summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-10-19 15:05:09 -0400
committerGitHub <noreply@github.com>2018-10-19 15:05:09 -0400
commitd36316738785c96dab2ee892762ed08c059fffde (patch)
tree168a7c0705b5bc8f0dee7ce4b511ccf71759d9b4
parent7f7fcbb998fb17f2954fd103349af67ea9b71a3f (diff)
parent83c5e805346d55ec7fb9f4ba8b6f6855d992273e (diff)
downloadsdl_core-hotfix/templates_updates.tar.gz
Release 5.0.0
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml53
-rw-r--r--CHANGELOG.md237
-rw-r--r--CMakeLists.txt75
-rw-r--r--Doxyfile2
-rw-r--r--README.md9
-rw-r--r--docs/FORD.OpenSDL.SDD.TPL.dox355
-rw-r--r--docs/SDL.SDD.Template.dox355
-rw-r--r--docs/mainpage.dox5
-rw-r--r--src/3rd_party/CMakeLists.txt69
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp4
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp4
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp10
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp10
-rw-r--r--src/appMain/CMakeLists.txt31
-rw-r--r--src/appMain/audio.8bit.wavbin88244 -> 44144 bytes
-rwxr-xr-xsrc/appMain/hmi_capabilities.json362
-rw-r--r--src/appMain/life_cycle.cc359
-rw-r--r--src/appMain/life_cycle.h112
-rw-r--r--src/appMain/life_cycle_impl.cc352
-rw-r--r--src/appMain/life_cycle_impl.h113
-rw-r--r--src/appMain/low_voltage_signals_handler.cc165
-rw-r--r--src/appMain/low_voltage_signals_handler.h132
-rw-r--r--src/appMain/main.cc39
-rw-r--r--src/appMain/sdl_preloaded_pt.json34
-rw-r--r--src/appMain/signal_handlers.cc4
-rw-r--r--src/appMain/smartDeviceLink.ini108
-rw-r--r--src/appMain/test/CMakeLists.txt46
-rw-r--r--src/appMain/test/low_voltage_signals_handler_test.cc138
-rw-r--r--src/appMain/test/mock_life_cycle.h54
-rw-r--r--src/components/CMakeLists.txt12
-rw-r--r--src/components/application_manager/CMakeLists.txt303
-rw-r--r--src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox76
-rw-r--r--src/components/application_manager/include/application_manager/app_extension.h25
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h3
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/apps_launcher.h3
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h34
-rw-r--r--src/components/application_manager/include/application_manager/application.h127
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h36
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h118
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h611
-rw-r--r--src/components/application_manager/include/application_manager/command_factory.h216
-rw-r--r--src/components/application_manager/include/application_manager/command_holder.h1
-rw-r--r--src/components/application_manager/include/application_manager/command_holder_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h3
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h22
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h8
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h11
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_response_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h83
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls.h92
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h91
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h79
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h85
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h91
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h64
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h60
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h83
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h79
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h70
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h90
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h97
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h63
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h110
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h70
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h93
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h90
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h165
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h93
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h106
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_request.h150
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h186
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h270
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h115
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h105
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h91
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/generic_response.h69
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h61
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h60
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h87
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h83
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h69
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h191
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h241
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h82
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h223
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h143
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h84
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h96
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h112
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h159
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h87
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h82
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h90
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_request.h99
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/slider_request.h92
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/slider_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/speak_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/speak_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h99
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h162
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h82
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h85
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h127
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h98
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/notification_from_hmi.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/notification_to_hmi.h63
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_from_hmi.h100
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_to_hmi.h92
-rw-r--r--src/components/application_manager/include/application_manager/commands/response_from_hmi.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/response_to_hmi.h66
-rw-r--r--src/components/application_manager/include/application_manager/core_service.h214
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager.h96
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager_impl.h197
-rw-r--r--src/components/application_manager/include/application_manager/helpers/application_helper.h10
-rw-r--r--src/components/application_manager/include/application_manager/hmi_command_factory.h64
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h151
-rw-r--r--src/components/application_manager/include/application_manager/message.h12
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h145
-rw-r--r--src/components/application_manager/include/application_manager/mobile_command_factory.h67
-rw-r--r--src/components/application_manager/include/application_manager/mobile_message_handler.h2
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h125
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h83
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h79
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h50
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h9
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h58
-rw-r--r--src/components/application_manager/include/application_manager/request_tracker.h2
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h35
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h112
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h22
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_db.h15
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_json.h18
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h7
-rw-r--r--src/components/application_manager/include/application_manager/rpc_handler_impl.h182
-rw-r--r--src/components/application_manager/include/application_manager/rpc_service_impl.h149
-rw-r--r--src/components/application_manager/include/application_manager/service.h183
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h47
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h79
-rw-r--r--src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h160
-rw-r--r--src/components/application_manager/include/application_manager/telemetry_observer.h10
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h8
-rw-r--r--src/components/application_manager/rpc_plugins/CMakeLists.txt34
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt80
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h68
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h68
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h70
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h72
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h68
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h69
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h96
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h61
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h102
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h67
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h137
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h172
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h86
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h86
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h122
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h94
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h88
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h96
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h279
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h113
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h178
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h224
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc58
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc57
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc71
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc138
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc55
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc290
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc404
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc108
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc787
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc268
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc192
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc158
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc250
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc118
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc141
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc507
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt77
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt62
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc326
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc593
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc152
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc248
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc234
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h54
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h55
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h74
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc160
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc668
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h94
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h114
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h97
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h94
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h169
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h97
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h110
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h154
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h191
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h278
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h119
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h109
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h92
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h91
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h189
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h251
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h224
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h149
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h90
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h88
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h100
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h116
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h158
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h94
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h102
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc58
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc230
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc192
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc193
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc182
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc142
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc88
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc102
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc113
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc101
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc108
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc294
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc121
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc627
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc186
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc291
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc453
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc684
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc483
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc235
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc132
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc168
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc203
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc100
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc143
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc116
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc191
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc199
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc229
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc453
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc1068
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc324
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc1428
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc131
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc336
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc163
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc108
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc284
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc301
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc173
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc568
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc166
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc292
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc413
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc207
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc184
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc147
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc123
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc700
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc48
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc126
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc117
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc243
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc847
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc442
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt37
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc123
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc112
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc540
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc138
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc88
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc334
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc1856
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc100
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc121
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc216
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc120
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc105
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc159
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc176
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc168
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc131
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc500
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc111
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc160
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc265
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc324
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc102
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc128
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc97
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc311
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc106
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc122
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc199
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc90
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc171
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc106
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc106
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc122
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc182
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc1154
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc158
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc256
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc809
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc559
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc923
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc272
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc250
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc296
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc375
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc187
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc315
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc120
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc282
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc145
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc337
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc137
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc119
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc284
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc166
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc167
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc273
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc138
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc148
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc834
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc261
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc406
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc536
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc575
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc285
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc164
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc421
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc173
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc249
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc1375
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc365
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc974
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc99
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc189
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc340
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc406
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc262
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc130
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc236
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc118
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc201
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc171
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc352
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt72
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h81
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h93
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h82
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h88
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h158
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h120
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h135
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h70
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h73
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h73
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h82
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc89
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc112
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc130
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc119
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc147
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc136
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc134
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc360
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc287
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc144
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc167
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc153
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc169
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc185
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc142
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc256
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc114
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc164
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc301
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc114
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc3
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_db.cc5
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_json.cc12
-rw-r--r--src/components/application_manager/src/app_launch/apps_launcher.cc4
-rw-r--r--src/components/application_manager/src/app_launch/device_apps_launcher.cc122
-rw-r--r--src/components/application_manager/src/application_data_impl.cc92
-rw-r--r--src/components/application_manager/src/application_impl.cc182
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc1839
-rw-r--r--src/components/application_manager/src/application_state.cc1
-rw-r--r--src/components/application_manager/src/command_holder_impl.cc8
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc38
-rw-r--r--src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc15
-rw-r--r--src/components/application_manager/src/commands/command_notification_impl.cc15
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc59
-rw-r--r--src/components/application_manager/src/commands/command_response_impl.cc15
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_request.cc69
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_response.cc64
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc73
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc68
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_response.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/dial_number_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/dial_number_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_response.cc84
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls.cc223
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc180
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc79
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc147
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc180
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc25
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_from_hmi.cc101
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_to_hmi.cc65
-rw-r--r--src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc175
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc67
-rw-r--r--src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_event_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_press_notification.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc115
-rw-r--r--src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc134
-rw-r--r--src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc114
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc113
-rw-r--r--src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_find_applications.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_policy_update.cc51
-rw-r--r--src/components/application_manager/src/commands/hmi/on_put_file_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ready_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_received_policy_update.cc69
-rw-r--r--src/components/application_manager/src/commands/hmi/on_record_start_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_status_update_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_context_notification.cc79
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_error_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_request_notification.cc117
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc93
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc29
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc92
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_update_device_list.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc66
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc104
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc91
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc99
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/request_from_hmi.cc108
-rw-r--r--src/components/application_manager/src/commands/hmi/request_to_hmi.cc87
-rw-r--r--src/components/application_manager/src/commands/hmi/response_from_hmi.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/response_to_hmi.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc288
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc87
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_response.cc71
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc112
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_response.cc72
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_request.cc94
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_response.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc80
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc103
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_response.cc72
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_request.cc616
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc161
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc267
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_request.cc426
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_request.cc661
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc442
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc66
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_request.cc224
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_request.cc121
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_response.cc66
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc159
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc75
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc192
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc121
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/dial_number_request.cc147
-rw-r--r--src/components/application_manager/src/commands/mobile/dial_number_response.cc53
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc91
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/generic_response.cc65
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_request.cc110
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/get_system_capability_request.cc95
-rw-r--r--src/components/application_manager/src/commands/mobile/get_system_capability_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc306
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/get_way_points_request.cc75
-rw-r--r--src/components/application_manager/src/commands/mobile/get_way_points_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_request.cc106
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc51
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_event_notification.cc174
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_press_notification.cc181
-rw-r--r--src/components/application_manager/src/commands/mobile/on_command_notification.cc78
-rw-r--r--src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc75
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc86
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc126
-rw-r--r--src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc87
-rw-r--r--src/components/application_manager/src/commands/mobile/on_language_change_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/on_system_request_notification.cc201
-rw-r--r--src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc70
-rw-r--r--src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc87
-rw-r--r--src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc112
-rw-r--r--src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc433
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_request.cc953
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_request.cc283
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_response.cc64
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_request.cc125
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc1287
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_response.cc99
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc327
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_request.cc154
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_response.cc63
-rw-r--r--src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc99
-rw-r--r--src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc53
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_request.cc276
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_request.cc286
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_request.cc114
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_response.cc55
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_request.cc560
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_request.cc140
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_response.cc55
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc157
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc285
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/show_request.cc403
-rw-r--r--src/components/application_manager/src/commands/mobile/show_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_request.cc198
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_request.cc160
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_request.cc123
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_response.cc64
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc479
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc82
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/system_request.cc659
-rw-r--r--src/components/application_manager/src/commands/mobile/system_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc64
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc47
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc103
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc65
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc407
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc76
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_request.cc234
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_response.cc56
-rw-r--r--src/components/application_manager/src/commands/notification_from_hmi.cc111
-rw-r--r--src/components/application_manager/src/commands/notification_to_hmi.cc74
-rw-r--r--src/components/application_manager/src/commands/request_from_hmi.cc115
-rw-r--r--src/components/application_manager/src/commands/request_to_hmi.cc97
-rw-r--r--src/components/application_manager/src/commands/response_from_hmi.cc114
-rw-r--r--src/components/application_manager/src/commands/response_to_hmi.cc71
-rw-r--r--src/components/application_manager/src/core_service.cc231
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher_impl.cc3
-rw-r--r--src/components/application_manager/src/help_prompt_manager_impl.cc388
-rw-r--r--src/components/application_manager/src/helpers/application_helper.cc29
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc38
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc2317
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc9
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc12
-rw-r--r--src/components/application_manager/src/hmi_state.cc172
-rw-r--r--src/components/application_manager/src/message.cc17
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc851
-rw-r--r--src/components/application_manager/src/mobile_command_factory.cc731
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc3
-rw-r--r--src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc111
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc9
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc200
-rw-r--r--src/components/application_manager/src/request_controller.cc61
-rw-r--r--src/components/application_manager/src/request_info.cc36
-rw-r--r--src/components/application_manager/src/request_tracker.cc15
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc473
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc15
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_db.cc119
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc69
-rw-r--r--src/components/application_manager/src/resumption/resumption_sql_queries.cc40
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc427
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc629
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc42
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc560
-rw-r--r--src/components/application_manager/src/system_time/system_time_handler_impl.cc174
-rw-r--r--src/components/application_manager/src/usage_statistics.cc7
-rwxr-xr-x[-rw-r--r--]src/components/application_manager/test/CMakeLists.txt14
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc14
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_db_test.cc10
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc44
-rw-r--r--src/components/application_manager/test/application_helper_test.cc28
-rw-r--r--src/components/application_manager/test/application_impl_test.cc62
-rw-r--r--src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc82
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc556
-rw-r--r--src/components/application_manager/test/application_state_test.cc80
-rw-r--r--src/components/application_manager/test/command_holder_test.cc35
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt20
-rw-r--r--src/components/application_manager/test/commands/command_impl_test.cc20
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc61
-rw-r--r--src/components/application_manager/test/commands/command_response_impl_test.cc27
-rw-r--r--src/components/application_manager/test/commands/hmi/activate_app_request_test.cc125
-rw-r--r--src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc90
-rw-r--r--src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc77
-rw-r--r--src/components/application_manager/test/commands/hmi/allow_app_response_test.cc95
-rw-r--r--src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc116
-rw-r--r--src/components/application_manager/test/commands/hmi/close_popup_response_test.cc73
-rw-r--r--src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc617
-rw-r--r--src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc100
-rw-r--r--src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc153
-rw-r--r--src/components/application_manager/test/commands/hmi/get_urls_response_test.cc91
-rw-r--r--src/components/application_manager/test/commands/hmi/get_urls_test.cc331
-rw-r--r--src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc1980
-rw-r--r--src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc92
-rw-r--r--src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc106
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc120
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc138
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc76
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc216
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc120
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc104
-rw-r--r--src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc161
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc181
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc174
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc137
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc503
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc88
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc116
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc82
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc169
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_notifications_test.cc77
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc99
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc285
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc373
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc107
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc136
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc109
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc134
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc99
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc346
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc113
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc128
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc204
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc92
-rw-r--r--src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc175
-rw-r--r--src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc91
-rw-r--r--src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc87
-rw-r--r--src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc156
-rw-r--r--src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc175
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc112
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc113
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc128
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc193
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/mobile/add_command_request_test.cc1084
-rw-r--r--src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc121
-rw-r--r--src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc265
-rw-r--r--src/components/application_manager/test/commands/mobile/alert_request_test.cc771
-rw-r--r--src/components/application_manager/test/commands/mobile/change_registration_test.cc565
-rw-r--r--src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc814
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_command_request_test.cc258
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_file_test.cc246
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc284
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc338
-rw-r--r--src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc185
-rw-r--r--src/components/application_manager/test/commands/mobile/dial_number_request_test.cc187
-rw-r--r--src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc342
-rw-r--r--src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc120
-rw-r--r--src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc142
-rw-r--r--src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc254
-rw-r--r--src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc284
-rw-r--r--src/components/application_manager/test/commands/mobile/list_files_request_test.cc145
-rw-r--r--src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc355
-rw-r--r--src/components/application_manager/test/commands/mobile/on_command_notification_test.cc137
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc117
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc282
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc206
-rw-r--r--src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc164
-rw-r--r--src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc206
-rw-r--r--src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc140
-rw-r--r--src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc149
-rw-r--r--src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc148
-rw-r--r--src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc116
-rw-r--r--src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc801
-rw-r--r--src/components/application_manager/test/commands/mobile/perform_interaction_test.cc262
-rw-r--r--src/components/application_manager/test/commands/mobile/put_file_test.cc351
-rw-r--r--src/components/application_manager/test/commands/mobile/read_did_request_test.cc166
-rw-r--r--src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc522
-rw-r--r--src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc565
-rw-r--r--src/components/application_manager/test/commands/mobile/scrollable_message_test.cc289
-rw-r--r--src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc163
-rw-r--r--src/components/application_manager/test/commands/mobile/send_location_request_test.cc396
-rw-r--r--src/components/application_manager/test/commands/mobile/set_app_icon_test.cc151
-rw-r--r--src/components/application_manager/test/commands/mobile/set_display_layout_test.cc254
-rw-r--r--src/components/application_manager/test/commands/mobile/set_global_properties_test.cc1229
-rw-r--r--src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc352
-rw-r--r--src/components/application_manager/test/commands/mobile/show_test.cc937
-rw-r--r--src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc99
-rw-r--r--src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc199
-rw-r--r--src/components/application_manager/test/commands/mobile/slider_test.cc341
-rw-r--r--src/components/application_manager/test/commands/mobile/speak_request_test.cc398
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc204
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc129
-rw-r--r--src/components/application_manager/test/commands/mobile/system_request_test.cc135
-rw-r--r--src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc118
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc156
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc287
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc111
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc172
-rw-r--r--src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc305
-rw-r--r--src/components/application_manager/test/event_engine_test.cc2
-rw-r--r--src/components/application_manager/test/help_prompt_manager_test.cc369
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json45
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc27
-rw-r--r--src/components/application_manager/test/hmi_language_handler_test.cc35
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/command_request_test.h11
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h57
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h47
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_command_factory.h61
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h61
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h60
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h30
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h11
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_test.h27
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt7
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc173
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc17
-rw-r--r--src/components/application_manager/test/mobile_message_handler_v1_test.cc7
-rw-r--r--src/components/application_manager/test/mock_hmi_command_factory.cc11
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc57
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc144
-rw-r--r--src/components/application_manager/test/rc_policy_handler_test.cc27
-rw-r--r--src/components/application_manager/test/request_controller/request_controller_test.cc48
-rw-r--r--src/components/application_manager/test/request_info_test.cc127
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc774
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc40
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc35
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc26
-rw-r--r--src/components/application_manager/test/resumption_sql_queries_test.cc239
-rw-r--r--src/components/application_manager/test/sdl_preloaded_pt.json19
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json21
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc467
-rw-r--r--src/components/application_manager/test/usage_statistics_test.cc19
-rw-r--r--src/components/application_manager/test/zero_request_amount_test.cc2
-rw-r--r--src/components/config_profile/include/config_profile/profile.h155
-rw-r--r--src/components/config_profile/src/profile.cc369
-rw-r--r--src/components/config_profile/test/profile_test.cc26
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h59
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h148
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h4
-rw-r--r--src/components/connection_handler/src/connection.cc146
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc580
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc21
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc299
-rw-r--r--src/components/connection_handler/test/connection_test.cc178
-rw-r--r--src/components/connection_handler/test/heart_beat_monitor_test.cc226
-rw-r--r--src/components/dbus/CMakeLists.txt82
-rw-r--r--src/components/dbus/codegen/code_formatter.py58
-rw-r--r--src/components/dbus/codegen/ford_xml_parser.py231
-rw-r--r--src/components/dbus/codegen/introspection_xml.cc327
-rwxr-xr-xsrc/components/dbus/codegen/make_hmi_requests.py343
-rwxr-xr-xsrc/components/dbus/codegen/make_introspection_c.py126
-rwxr-xr-xsrc/components/dbus/codegen/make_message_descriptions.py273
-rwxr-xr-xsrc/components/dbus/codegen/make_notifications_qml.py387
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_cpp.py736
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_qml.py217
-rw-r--r--src/components/dbus/codegen/make_qml_requests_cpp.py253
-rwxr-xr-xsrc/components/dbus/codegen/make_request_to_sdl.py335
-rw-r--r--src/components/dbus/include/dbus/dbus_adapter.h375
-rw-r--r--src/components/dbus/include/dbus/dbus_message.h179
-rw-r--r--src/components/dbus/include/dbus/dbus_message_controller.h97
-rw-r--r--src/components/dbus/include/dbus/dbus_message_inl.h214
-rw-r--r--src/components/dbus/include/dbus/message_descriptions.h73
-rw-r--r--src/components/dbus/include/dbus/schema.h98
-rw-r--r--src/components/dbus/src/dbus_adapter.cc935
-rw-r--r--src/components/dbus/src/dbus_message.cc217
-rw-r--r--src/components/dbus/src/dbus_message_controller.cc90
-rw-r--r--src/components/dbus/src/introspection_xml.cc327
-rw-r--r--src/components/dbus/src/message_descriptions.cc10424
-rw-r--r--src/components/dbus/src/schema.cc145
-rw-r--r--src/components/dbus/test/CMakeLists.txt53
-rw-r--r--src/components/dbus/test/dbus_adapter_test.cc59
-rw-r--r--src/components/dbus/test/dbus_message_controller_test.cc116
-rw-r--r--src/components/dbus/test/include/dbus/mock_dbus_message_controller.h75
-rw-r--r--src/components/dbus/test/include/dbus/mock_subscriber.h62
-rw-r--r--src/components/dbus/test/mock_subscriber.cc71
-rw-r--r--src/components/dbus/test/schema_test.cc118
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonBase.h12
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h30
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h44
-rw-r--r--src/components/formatters/include/formatters/CSmartFactory.h62
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h46
-rw-r--r--src/components/formatters/include/formatters/generic_json_formatter.h16
-rw-r--r--src/components/formatters/include/formatters/meta_formatter.h18
-rw-r--r--src/components/formatters/src/CFormatterJsonBase.cc34
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv1.cc10
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv2.cc10
-rw-r--r--src/components/formatters/src/CSmartFactory.cc34
-rw-r--r--src/components/formatters/src/formatter_json_rpc.cc57
-rw-r--r--src/components/formatters/src/generic_json_formatter.cc16
-rw-r--r--src/components/formatters/src/meta_formatter.cc10
-rw-r--r--src/components/formatters/test/CFormatterJsonBase_test.cc4
-rw-r--r--src/components/formatters/test/CSmartFactory_test.cc42
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc10
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc12
-rw-r--r--src/components/formatters/test/formatter_json_rpc_test.cc8
-rw-r--r--src/components/formatters/test/generic_json_formatter_test.cc8
-rw-r--r--src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h14
-rw-r--r--src/components/formatters/test/include/formatters/create_smartSchema.h6
-rw-r--r--src/components/formatters/test/include/formatters/meta_formatter_test_helper.h14
-rw-r--r--src/components/formatters/test/src/SmartFactoryTestHelper.cc31
-rw-r--r--src/components/formatters/test/src/create_smartSchema.cc6
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc4
-rw-r--r--src/components/functional_module/CMakeLists.txt58
-rw-r--r--src/components/functional_module/include/functional_module/function_ids.h63
-rw-r--r--src/components/functional_module/include/functional_module/generic_module.h180
-rw-r--r--src/components/functional_module/include/functional_module/module_observer.h54
-rw-r--r--src/components/functional_module/include/functional_module/plugin_manager.h159
-rw-r--r--src/components/functional_module/include/functional_module/timer/module_timer.h246
-rw-r--r--src/components/functional_module/include/functional_module/timer/timer_director.h92
-rw-r--r--src/components/functional_module/src/generic_module.cc54
-rw-r--r--src/components/functional_module/src/plugin_manager.cc396
-rw-r--r--src/components/functional_module/src/timer/timer_director.cc156
-rw-r--r--src/components/functional_module/test/CMakeLists.txt53
-rw-r--r--src/components/functional_module/test/include/driver_generic_module_test.h80
-rw-r--r--src/components/functional_module/test/include/mock_application.h250
-rw-r--r--src/components/functional_module/test/include/mock_module_observer.h50
-rw-r--r--src/components/functional_module/test/include/mock_service.h76
-rw-r--r--src/components/functional_module/test/include/module_timer_test.h56
-rw-r--r--src/components/functional_module/test/plugins/CMakeLists.txt17
-rw-r--r--src/components/functional_module/test/plugins/mock_generic_module.cc23
-rw-r--r--src/components/functional_module/test/plugins/mock_generic_module.h71
-rw-r--r--src/components/functional_module/test/src/generic_module_test.cc106
-rw-r--r--src/components/functional_module/test/src/module_timer_test.cc123
-rw-r--r--src/components/functional_module/test/src/plugin_manager_test.cc148
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt10
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h98
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h4
-rw-r--r--src/components/hmi_message_handler/mock_hmi_message_handler.h4
-rw-r--r--src/components/hmi_message_handler/src/dbus_message_adapter.cc223
-rw-r--r--src/components/hmi_message_handler/src/mb_controller.cc2
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc2
-rw-r--r--src/components/hmi_message_handler/src/websocket_session.cc2
-rw-r--r--src/components/hmi_message_handler/test/CMakeLists.txt2
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_adapter_test.cc8
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc6
-rw-r--r--src/components/include/application_manager/application_manager.h163
-rw-r--r--src/components/include/application_manager/application_manager_settings.h12
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h42
-rw-r--r--src/components/include/application_manager/rpc_handler.h60
-rw-r--r--src/components/include/application_manager/rpc_service.h90
-rw-r--r--src/components/include/application_manager/state_controller.h17
-rw-r--r--src/components/include/connection_handler/connection_handler.h84
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h30
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_observer.h6
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_sender.h2
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h10
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h34
-rw-r--r--src/components/include/policy/policy_external/policy/policy_settings.h2
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_listener.h3
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h34
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_settings.h2
-rw-r--r--src/components/include/protocol/bson_object_keys.h6
-rw-r--r--src/components/include/protocol/common.h16
-rw-r--r--src/components/include/protocol/raw_message.h4
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h37
-rw-r--r--src/components/include/protocol_handler/protocol_handler_settings.h28
-rw-r--r--src/components/include/protocol_handler/session_observer.h89
-rw-r--r--src/components/include/protocol_handler/telemetry_observer.h10
-rw-r--r--src/components/include/security_manager/crypto_manager.h13
-rw-r--r--src/components/include/security_manager/security_manager.h51
-rw-r--r--src/components/include/security_manager/security_manager_listener.h7
-rw-r--r--src/components/include/security_manager/security_manager_settings.h14
-rw-r--r--src/components/include/security_manager/security_query.h4
-rw-r--r--src/components/include/security_manager/ssl_context.h14
-rw-r--r--src/components/include/test/application_manager/mock_app_extension.h62
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h89
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h10
-rw-r--r--src/components/include/test/application_manager/mock_rpc_plugin.h30
-rw-r--r--src/components/include/test/application_manager/mock_rpc_plugin_manager.h24
-rw-r--r--src/components/include/test/application_manager/mock_rpc_service.h34
-rw-r--r--src/components/include/test/application_manager/mock_state_controller.h17
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h16
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler.h29
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h10
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h4
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h11
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_listener.h2
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h13
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_settings.h1
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h12
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h2
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h13
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h1
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler.h13
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler_settings.h11
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h18
-rw-r--r--src/components/include/test/protocol_handler/mock_telemetry_observer.h5
-rw-r--r--src/components/include/test/security_manager/mock_crypto_manager.h4
-rw-r--r--src/components/include/test/security_manager/mock_security_manager.h11
-rw-r--r--src/components/include/test/security_manager/mock_security_manager_listener.h1
-rw-r--r--src/components/include/test/security_manager/mock_security_manager_settings.h4
-rw-r--r--src/components/include/test/security_manager/mock_ssl_context.h2
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_listener.h2
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h2
-rw-r--r--src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h2
-rw-r--r--src/components/include/test/utils/mock_system_time_handler.h69
-rw-r--r--src/components/include/transport_manager/error.h4
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h5
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h27
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter_event.h27
-rw-r--r--src/components/include/transport_manager/transport_manager_listener.h9
-rw-r--r--src/components/include/transport_manager/transport_manager_listener_empty.h8
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h6
-rw-r--r--src/components/include/utils/atomic_object.h112
-rw-r--r--src/components/include/utils/conditional_variable.h19
-rw-r--r--src/components/include/utils/data_accessor.h19
-rw-r--r--src/components/include/utils/date_time.h95
-rw-r--r--src/components/include/utils/lock.h153
-rw-r--r--src/components/include/utils/make_shared.h191
-rw-r--r--src/components/include/utils/messagemeter.h35
-rw-r--r--src/components/include/utils/semantic_version.h125
-rw-r--r--src/components/include/utils/shared_ptr.h390
-rw-r--r--src/components/include/utils/threads/message_loop_thread.h2
-rw-r--r--src/components/include/utils/typed_enum_print.h52
-rw-r--r--src/components/interfaces/CMakeLists.txt29
-rw-r--r--src/components/interfaces/HMI_API.xml1034
-rw-r--r--src/components/interfaces/Json_HMI_message_specification.txt7
-rw-r--r--src/components/interfaces/MOBILE_API.xml2153
-rw-r--r--src/components/interfaces/QT_HMI_API.xml5517
-rw-r--r--src/components/media_manager/CMakeLists.txt2
-rw-r--r--src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h18
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter_impl.h4
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h4
-rw-r--r--src/components/media_manager/include/media_manager/streamer_adapter.h7
-rw-r--r--src/components/media_manager/src/audio/a2dp_source_player_adapter.cc12
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc65
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc30
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc39
-rw-r--r--src/components/media_manager/src/streamer_adapter.cc2
-rw-r--r--src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h5
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc39
-rw-r--r--src/components/policy/policy_external/.gitignore2
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt5
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt34
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt12
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt10
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt8
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt60
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt8
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote_impl.h6
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h45
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h46
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h55
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h47
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table.h7
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h381
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h12
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml10
-rw-r--r--src/components/policy/policy_external/include/policy/policy_types.h13
-rw-r--r--src/components/policy/policy_external/include/policy/pt_representation.h2
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_queries.h3
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h10
-rw-r--r--src/components/policy/policy_external/include/policy/update_status_manager.h22
-rw-r--r--src/components/policy/policy_external/include/policy/usage_statistics/counter.h20
-rw-r--r--src/components/policy/policy_external/src/access_remote_impl.cc2
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc145
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc145
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc255
-rw-r--r--src/components/policy/policy_external/src/policy_table.cc2
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc448
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc43
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc34
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_representation.cc59
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc23
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc147
-rw-r--r--src/components/policy/policy_external/src/status.cc23
-rw-r--r--src/components/policy/policy_external/src/update_status_manager.cc27
-rw-r--r--src/components/policy/policy_external/src/usage_statistics/counter.cc15
-rw-r--r--src/components/policy/policy_external/test/CMakeLists.txt6
-rw-r--r--src/components/policy/policy_external/test/counter_test.cc19
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h3
-rw-r--r--src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h6
-rw-r--r--src/components/policy/policy_external/test/json/PTU.json18
-rw-r--r--src/components/policy/policy_external/test/json/PTU2.json18
-rw-r--r--src/components/policy/policy_external/test/json/PTU3.json18
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json20
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json20
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json20
-rw-r--r--src/components/policy/policy_external/test/json/PTU_without_requestType_field.json20
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json18
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json18
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json18
-rw-r--r--src/components/policy/policy_external/test/json/ptu2_requestType.json22
-rw-r--r--src/components/policy/policy_external/test/json/ptu_requestType.json22
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt.json19
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_first_update.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_second_update.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_update.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/valid_sdl_pt_update.json20
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc61
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc12
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test.cc38
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc24
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc8
-rw-r--r--src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc8
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc12
-rw-r--r--src/components/policy/policy_external/test/update_status_manager_test.cc42
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt7
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt6
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote_impl.h6
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h44
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h46
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_helper.h14
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h55
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table.h8
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h380
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h14
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_types.h13
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_ext_representation.h336
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_representation.h4
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h97
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h206
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_queries.h3
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h10
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager.h14
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager_interface.h11
-rw-r--r--src/components/policy/policy_regular/include/policy/usage_statistics/counter.h20
-rw-r--r--src/components/policy/policy_regular/policy_table_interface_ext.xml279
-rw-r--r--src/components/policy/policy_regular/src/access_remote_impl.cc2
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc108
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc69
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc282
-rw-r--r--src/components/policy/policy_regular/src/policy_table.cc2
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc738
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc42
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc47
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_ext_queries.cc268
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_ext_representation.cc1807
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc26
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc161
-rw-r--r--src/components/policy/policy_regular/src/status.cc25
-rw-r--r--src/components/policy/policy_regular/src/update_status_manager.cc24
-rw-r--r--src/components/policy/policy_regular/src/usage_statistics/counter.cc15
-rw-r--r--src/components/policy/policy_regular/test/CMakeLists.txt5
-rw-r--r--src/components/policy/policy_regular/test/PTU.json18
-rw-r--r--src/components/policy/policy_regular/test/PTU2.json18
-rw-r--r--src/components/policy/policy_regular/test/PTU3.json18
-rw-r--r--src/components/policy/policy_regular/test/PTU4.json18
-rw-r--r--src/components/policy/policy_regular/test/access_remote_impl_test.cc4
-rw-r--r--src/components/policy/policy_regular/test/counter_test.cc18
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h139
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h2
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc86
-rw-r--r--src/components/policy/policy_regular/test/ptu2_requestType.json22
-rw-r--r--src/components/policy/policy_regular/test/ptu_requestType.json22
-rw-r--r--src/components/policy/policy_regular/test/sdl_preloaded_pt.json19
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_first_update.json20
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_second_update.json20
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_update.json20
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc19
-rw-r--r--src/components/policy/policy_regular/test/update_status_manager_test.cc23
-rw-r--r--src/components/policy/policy_regular/test/valid_sdl_pt_update.json20
-rw-r--r--src/components/protocol/src/bson_object_keys.cc6
-rw-r--r--src/components/protocol_handler/CMakeLists.txt1
-rw-r--r--src/components/protocol_handler/include/protocol_handler/handshake_handler.h29
-rw-r--r--src/components/protocol_handler/include/protocol_handler/multiframe_builder.h2
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h152
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h65
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc67
-rw-r--r--src/components/protocol_handler/src/multiframe_builder.cc10
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc1048
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc79
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h5
-rw-r--r--src/components/protocol_handler/test/incoming_data_handler_test.cc445
-rw-r--r--src/components/protocol_handler/test/multiframe_builder_test.cc12
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc1608
-rw-r--r--src/components/protocol_handler/test/protocol_header_validator_test.cc8
-rw-r--r--src/components/remote_control/CMakeLists.txt83
-rw-r--r--src/components/remote_control/include/remote_control/commands/base_command_notification.h110
-rw-r--r--src/components/remote_control/include/remote_control/commands/base_command_request.h293
-rw-r--r--src/components/remote_control/include/remote_control/commands/button_press_request.h104
-rw-r--r--src/components/remote_control/include/remote_control/commands/command.h84
-rw-r--r--src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h101
-rw-r--r--src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h75
-rw-r--r--src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h79
-rw-r--r--src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h127
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event.h127
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h203
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event_observer.h96
-rw-r--r--src/components/remote_control/include/remote_control/message_helper.h122
-rw-r--r--src/components/remote_control/include/remote_control/module_helper.h0
-rw-r--r--src/components/remote_control/include/remote_control/rc_app_extension.h82
-rw-r--r--src/components/remote_control/include/remote_control/rc_command_factory.h66
-rw-r--r--src/components/remote_control/include/remote_control/rc_module_constants.h233
-rw-r--r--src/components/remote_control/include/remote_control/rc_module_timer.h70
-rw-r--r--src/components/remote_control/include/remote_control/remote_control_event.h82
-rw-r--r--src/components/remote_control/include/remote_control/remote_control_plugin.h164
-rw-r--r--src/components/remote_control/include/remote_control/remote_plugin_interface.h118
-rw-r--r--src/components/remote_control/include/remote_control/request_controller.h110
-rw-r--r--src/components/remote_control/include/remote_control/resource_allocation_manager.h115
-rw-r--r--src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h137
-rw-r--r--src/components/remote_control/src/commands/base_command_notification.cc154
-rw-r--r--src/components/remote_control/src/commands/base_command_request.cc564
-rw-r--r--src/components/remote_control/src/commands/button_press_request.cc264
-rw-r--r--src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc224
-rw-r--r--src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc103
-rw-r--r--src/components/remote_control/src/commands/on_remote_control_settings_notification.cc122
-rw-r--r--src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc350
-rw-r--r--src/components/remote_control/src/message_helper.cc154
-rw-r--r--src/components/remote_control/src/module_helper.cc0
-rw-r--r--src/components/remote_control/src/rc_app_extension.cc62
-rw-r--r--src/components/remote_control/src/rc_command_factory.cc86
-rw-r--r--src/components/remote_control/src/remote_control_event.cc56
-rw-r--r--src/components/remote_control/src/remote_control_plugin.cc341
-rw-r--r--src/components/remote_control/src/request_controller.cc96
-rw-r--r--src/components/remote_control/src/resource_allocation_manager_impl.cc377
-rw-r--r--src/components/remote_control/test/CMakeLists.txt67
-rw-r--r--src/components/remote_control/test/commands/CMakeLists.txt62
-rw-r--r--src/components/remote_control/test/commands/button_press_request_test.cc344
-rw-r--r--src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc291
-rw-r--r--src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc182
-rw-r--r--src/components/remote_control/test/commands/on_remote_control_settings_test.cc326
-rw-r--r--src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc433
-rw-r--r--src/components/remote_control/test/include/mock_application.h344
-rw-r--r--src/components/remote_control/test/include/mock_remote_control_plugin.h54
-rw-r--r--src/components/remote_control/test/include/mock_resource_allocation_manager.h40
-rw-r--r--src/components/remote_control/test/src/rc_app_extension_test.cc43
-rw-r--r--src/components/remote_control/test/src/rc_library_test.cc92
-rw-r--r--src/components/remote_control/test/src/rc_module_test.cc263
-rw-r--r--src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc481
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base.h24
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h501
-rw-r--r--src/components/rpc_base/test/CMakeLists.txt13
-rw-r--r--src/components/rpc_base/test/rpc_base_dbus_test.cc682
-rw-r--r--src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox241
-rw-r--r--src/components/security_manager/docs/SDL.SDD.Security.dox241
-rw-r--r--src/components/security_manager/docs/assets/sm_class_diagram.png (renamed from src/components/security_manager/docs/assets/sm_class_digram.png)bin368935 -> 368935 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png)bin28014 -> 28014 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png)bin22326 -> 22326 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_init.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_init.png)bin119018 -> 119018 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_verify.png)bin39820 -> 39820 bytes
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_impl.h77
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h29
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h89
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc306
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc197
-rw-r--r--src/components/security_manager/src/ssl_context_impl.cc136
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc58
-rw-r--r--src/components/security_manager/test/security_manager_test.cc259
-rw-r--r--src/components/security_manager/test/ssl_certificate_handshake_test.cc353
-rw-r--r--src/components/security_manager/test/ssl_context_test.cc271
-rw-r--r--src/components/smart_objects/include/smart_objects/always_false_schema_item.h28
-rw-r--r--src/components/smart_objects/include/smart_objects/always_true_schema_item.h28
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h40
-rw-r--r--src/components/smart_objects/include/smart_objects/bool_schema_item.h12
-rw-r--r--src/components/smart_objects/include/smart_objects/default_shema_item.h41
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h185
-rw-r--r--src/components/smart_objects/include/smart_objects/errors.h12
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h70
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h66
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h45
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item_parameter.h8
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h28
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h34
-rw-r--r--src/components/smart_objects/include/smart_objects/string_schema_item.h29
-rw-r--r--src/components/smart_objects/src/always_false_schema_item.cc26
-rw-r--r--src/components/smart_objects/src/always_true_schema_item.cc24
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc49
-rw-r--r--src/components/smart_objects/src/bool_schema_item.cc12
-rw-r--r--src/components/smart_objects/src/number_schema_item.cc10
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc146
-rw-r--r--src/components/smart_objects/src/schema_item.cc23
-rw-r--r--src/components/smart_objects/src/smart_object.cc23
-rw-r--r--src/components/smart_objects/src/smart_schema.cc26
-rw-r--r--src/components/smart_objects/src/string_schema_item.cc32
-rw-r--r--src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc20
-rw-r--r--src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc20
-rw-r--r--src/components/smart_objects/test/ArraySchemaItem_test.cc96
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc62
-rw-r--r--src/components/smart_objects/test/CObjectSchemaItem_test.cc135
-rw-r--r--src/components/smart_objects/test/EnumSchemaItem_test.cc36
-rw-r--r--src/components/smart_objects/test/NumberSchemaItem_test.cc222
-rw-r--r--src/components/smart_objects/test/SmartObjectConvertionTime_test.cc57
-rw-r--r--src/components/smart_objects/test/SmartObjectDraft_test.cc8
-rw-r--r--src/components/smart_objects/test/SmartObjectInvalid_test.cc4
-rw-r--r--src/components/smart_objects/test/SmartObjectStress_test.cc14
-rw-r--r--src/components/smart_objects/test/SmartObjectUnit_test.cc2
-rw-r--r--src/components/smart_objects/test/StringSchemaItem_test.cc78
-rw-r--r--src/components/smart_objects/test/smart_object_performance_test.cc2
-rw-r--r--src/components/telemetry_monitor/CMakeLists.txt2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h4
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h6
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h16
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h3
-rw-r--r--src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc7
-rw-r--r--src/components/telemetry_monitor/src/application_manager_observer.cc6
-rw-r--r--src/components/telemetry_monitor/src/metric_wrapper.cc1
-rw-r--r--src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc5
-rw-r--r--src/components/telemetry_monitor/src/protocol_handler_observer.cc10
-rw-r--r--src/components/telemetry_monitor/src/telemetry_monitor.cc80
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc5
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_observer.cc14
-rw-r--r--src/components/telemetry_monitor/test/application_manager_metric_test.cc49
-rw-r--r--src/components/telemetry_monitor/test/application_manager_observer_test.cc4
-rw-r--r--src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h3
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_metric_test.cc34
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_observer_test.cc14
-rw-r--r--src/components/telemetry_monitor/test/telemetry_monitor_test.cc10
-rw-r--r--src/components/telemetry_monitor/test/transport_manager_metric_test.cc32
-rw-r--r--src/components/test_main.cc4
-rw-r--r--src/components/transport_manager/CMakeLists.txt21
-rw-r--r--src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h18
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h41
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h63
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h201
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h70
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h48
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h25
-rw-r--r--src/components/transport_manager/include/transport_manager/telemetry_observer.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/connection.h3
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h7
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h15
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h9
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h9
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h16
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/common.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device.h2
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc5
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device.cc4
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc4
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc4
-rw-r--r--src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc12
-rw-r--r--src/components/transport_manager/src/tcp/network_interface_listener_impl.cc42
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc673
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc38
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc551
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc5
-rw-r--r--src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc2
-rw-r--r--src/components/transport_manager/src/tcp/tcp_transport_adapter.cc35
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc38
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc21
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc19
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc4
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_connection.cc4
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc21
-rw-r--r--src/components/transport_manager/test/CMakeLists.txt7
-rw-r--r--src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h4
-rw-r--r--src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h34
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h2
-rw-r--r--src/components/transport_manager/test/network_interface_listener_test.cc57
-rw-r--r--src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc567
-rw-r--r--src/components/transport_manager/test/tcp_client_listener_test.cc499
-rw-r--r--src/components/transport_manager/test/tcp_transport_adapter_test.cc71
-rw-r--r--src/components/transport_manager/test/transport_adapter_listener_test.cc13
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc97
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc12
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc42
-rw-r--r--src/components/utils/CMakeLists.txt15
-rw-r--r--src/components/utils/include/utils/file_system.h224
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h10
-rw-r--r--src/components/utils/include/utils/optional.h83
-rw-r--r--src/components/utils/include/utils/signals.h54
-rw-r--r--src/components/utils/include/utils/system_time_handler.h151
-rw-r--r--src/components/utils/include/utils/timer.h2
-rw-r--r--src/components/utils/src/conditional_variable_boost.cc135
-rw-r--r--src/components/utils/src/conditional_variable_posix.cc149
-rw-r--r--src/components/utils/src/date_time.cc123
-rw-r--r--src/components/utils/src/file_system.cc317
-rw-r--r--src/components/utils/src/lock_boost.cc127
-rw-r--r--src/components/utils/src/lock_posix.cc146
-rw-r--r--src/components/utils/src/log_message_loop_thread.cc7
-rw-r--r--src/components/utils/src/logger.cc3
-rw-r--r--src/components/utils/src/semantic_version.cc39
-rw-r--r--src/components/utils/src/signals_posix.cc44
-rw-r--r--src/components/utils/src/system_time_handler.cc62
-rw-r--r--src/components/utils/test/async_runner_test.cc10
-rw-r--r--src/components/utils/test/atomic_object_test.cc57
-rw-r--r--src/components/utils/test/conditional_variable_test.cc9
-rw-r--r--src/components/utils/test/data_accessor_test.cc36
-rw-r--r--src/components/utils/test/date_time_test.cc331
-rw-r--r--src/components/utils/test/file_system_test.cc11
-rw-r--r--src/components/utils/test/include/utils/mock_signals_posix.h59
-rw-r--r--src/components/utils/test/lock_boost_test.cc103
-rw-r--r--src/components/utils/test/lock_posix_test.cc123
-rw-r--r--src/components/utils/test/log_message_loop_thread_test.cc2
-rw-r--r--src/components/utils/test/message_queue_test.cc3
-rw-r--r--src/components/utils/test/messagemeter_test.cc42
-rw-r--r--src/components/utils/test/mock_signals_posix.cc76
-rw-r--r--src/components/utils/test/shared_ptr_test.cc542
-rw-r--r--third_party.md104
-rw-r--r--tools/CMakeLists.txt3
-rw-r--r--tools/InterfaceGenerator/MsgVersionGenerate.py34
-rwxr-xr-xtools/InterfaceGenerator/generator/Model.py58
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactoryBase.py334
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py30
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py10
-rwxr-xr-xtools/InterfaceGenerator/generator/parsers/RPCBase.py152
-rwxr-xr-xtools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py48
-rwxr-xr-xtools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py10
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc78
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h22
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc58
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h22
-rw-r--r--tools/cmake/modules/FindDBus.cmake59
-rw-r--r--tools/cmake/modules/FindQt5DBus.cmake10
-rwxr-xr-xtools/infrastructure/check_style.sh15
-rw-r--r--tools/intergen/GenerateInterfaceLibrary.cmake10
-rw-r--r--tools/intergen/cppgen/CMakeLists.txt2
-rw-r--r--tools/intergen/cppgen/include/cppgen/generator_preferences.h5
-rw-r--r--tools/intergen/cppgen/include/cppgen/message_factory_function.h3
-rw-r--r--tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h88
-rw-r--r--tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc3
-rw-r--r--tools/intergen/cppgen/src/cppgen/declaration_generator.cc38
-rw-r--r--tools/intergen/cppgen/src/cppgen/definition_generator.cc29
-rw-r--r--tools/intergen/cppgen/src/cppgen/generator_preferences.cc9
-rw-r--r--tools/intergen/cppgen/src/cppgen/handler_interface.cc4
-rw-r--r--tools/intergen/cppgen/src/cppgen/message_factory_function.cc6
-rw-r--r--tools/intergen/cppgen/src/cppgen/module_manager.cc6
-rw-r--r--tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc177
-rw-r--r--tools/intergen/model/src/model/composite_type.cc1
-rw-r--r--tools/intergen/test/CMakeLists.txt23
-rw-r--r--tools/intergen/test/generated_interface_dbus_tests.cc127
-rw-r--r--tools/intergen/test/test_hmi_interface.xml1096
-rw-r--r--tools/intergen/tool/intergen.cc7
2515 files changed, 140219 insertions, 146101 deletions
diff --git a/.gitignore b/.gitignore
index c552e22d6c..ec291473fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ CMakeCache.txt
CMakeFiles/
*.pyc
.idea
+src/appMain/build_config.txt
diff --git a/.travis.yml b/.travis.yml
index 69db195531..7f7df359b4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,53 +13,20 @@ addons:
apt:
sources:
- ubuntu-toolchain-r-test
- packages:
- - gcc-4.9
- - g++-4.9
- - libssl-dev
- - libbluetooth3
- - libbluetooth-dev
- - libudev-dev
- - libusb-1.0
- - cmake
- - html2text
- - clang-format-3.6
- - binutils
+
before_install:
- - sudo apt-get -qq update
- - sudo apt-get -q -y install bluez-tools sqlite3 libsqlite3-dev automake1.11
- - wget http://archive.ubuntu.com/ubuntu/pool/main/l/lcov/lcov_1.11-3_all.deb
- - sudo dpkg -i lcov_1.11-3_all.deb
+ - sudo apt-get update
+ - sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck
+ - sudo apt-get install -f clang-format-3.6
+
script:
- - sudo ln -sf /usr/bin/gcov-4.9 /usr/bin/gcov
- - bash -e tools/infrastructure/check_style.sh
- - echo "Number of processing units available ${PROCESSING_UNITS_COUNT}"
- - mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON -DENABLE_GCOV=ON && make install -j${PROCESSING_UNITS_COUNT}
- - sudo ldconfig
- - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/bin/lib ; make test
- - bash ../tools/infrastructure/show_disabled.sh
- - bash -ex ../tools/infrastructure/collect_coverage.sh ./
+ - cppcheck --force -isrc/3rd_party -isrc/3rd_party-static --quiet --error-exitcode=1 src
+ - ./tools/infrastructure/check_style.sh
+ - mkdir build && cd build
+ - cmake ../ -DBUILD_TESTS=ON
+ - make install-3rd_party && make -j `nproc` install && sudo ldconfig && make test
env:
global:
- LC_CTYPE=en_US.UTF-8
- CTEST_OUTPUT_ON_FAILURE=TRUE
- - CMAKE_CXX_COMPILER=g++-4.9
- - CMAKE_C_COMPILER=gcc-4.9
- LD_LIBRARY_PATH=.
- - PROCESSING_UNITS_COUNT=$("nproc")
-after_success:
- - pwd ; bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage.info || echo "Codecov did not collect coverage reports"
-deploy:
- provider: releases
- api-key: "uw8e4USTAS6c9LFhRMYOvw"
- file:
- - "coverage_report.tar.gz"
- skip_cleanup: true
- on:
- tags: true
-notifications:
- email:
- - AKutsan@luxoft.com
- - NSnitsar@luxoft.com
- - MGhiumiusliu@luxoft.com
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 481f63a805..1c693f2b22 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,61 +1,196 @@
-# Release 4.5.0
+# Release 5.0.0
## Supported Specifications
-- SDL Mobile RPC Spec: [Version 4.5.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/4.5.0)
-- SDL Protocol Spec: [Version 5.0.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.0.0)
+- [SDL Mobile RPC Spec: Version 5.0.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/5.0.0)
+- [SDL Protocol Spec: Version 5.1.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.1.0)
-## Implemented Proposals
+## Implemented Proposals / New Features
-[Connectivity via iAP-BT and Transport Switch](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0053-Connectivity-via-iAP-BT-and-Transport-Switch.md) - Implementation of a mechanism to change a registered app connected over one transport to another seamlessly.
+- [[SDL 0043] Move to the new C++11 standard](https://github.com/smartdevicelink/sdl_core/issues/1493) - C++11 unique_ptr, shared_ptr, atomic utils implemented
-[Mark public deprecated methods](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0092-Deprecated-interfaces-markup.md) - Implemented a DEPRECATED macro for marking deprecated methods in the project. Using methods marked with this macro will result in a warning being generated.
+- [[SDL 0044] Use Boost library in SDL](https://github.com/smartdevicelink/sdl_core/issues/1523) - Boost Locks, Date/Time, and Filesystem utils implemented
-[Remove QT HMI from SDL Core (Partially Complete)](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0110-remove-qt-hmi-from-sdl-core.md) - The `qt_hmi` component was removed from SDL Core, the QT_HMI_API interface and dbus adapter will be removed in the next major release, due to this aspect of the proposal requiring breaking changes.
+- [[SDL 0122] Handling VR help requests when application does not send VR help prompt](https://github.com/smartdevicelink/sdl_core/issues/2154)
-[Use Boost Library (Partially Complete)](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0044-use-Boost-library.md) - The `boost` library is now installed as a 3rd party library, this library is currently only used in the refactored message broker component.
+- [[SDL 0160] Remote Control Radio Parameter Update](https://github.com/smartdevicelink/sdl_core/issues/2162)
-## Enhancements
-- `DBus` and `libusb` are now dynamically linked, instead of being installed as 3rd-party libraries during the SDL Core build - #2004
+- [[SDL 0181] SDL shall not put RC applications to HMI level NONE when user disables RC in HMI](https://github.com/smartdevicelink/sdl_core/issues/2377)
+
+- [[SDL 0182] Audio Source AM/FM/XM/DAB](https://github.com/smartdevicelink/sdl_core/issues/2338)
+
+- [[SDL 0165] Remote Control Lights More Names and Status Values](https://github.com/smartdevicelink/sdl_core/issues/2172)
+
+- [[SDL 0099] New remote control modules (LIGHT, AUDIO, HMI_SETTINGS) and parameters (SIS Data)](https://github.com/smartdevicelink/sdl_core/issues/1798)
+
+- [[SDL 0178] Interior Vehicle Data Subscription Management and Data Caching in SDL](https://github.com/smartdevicelink/sdl_core/issues/2318)
+
+- [[SDL 0153] Support for Short and Full UUID App ID](https://github.com/smartdevicelink/sdl_core/issues/2159)
+
+- [[SDL 0170] SDL behavior in case of LOW_VOLTAGE event](https://github.com/smartdevicelink/sdl_core/issues/2233)
+
+- [[SDL 0064] Choice-VR optional](https://github.com/smartdevicelink/sdl_core/issues/2160)
+
+- [[SDL 0175] Updating DOP value range for GPS notification](https://github.com/smartdevicelink/sdl_core/issues/2317)
+
+- [[SDL 0089] Mobile API versioning](https://github.com/smartdevicelink/sdl_core/issues/2248)
+
+- [[SDL 0150] Enhancing onHMIStatus with a New Parameter for Video Streaming State](https://github.com/smartdevicelink/sdl_core/issues/2129)
+
+- [[SDL 0109] SetAudioStreamingIndicator RPC](https://github.com/smartdevicelink/sdl_core/issues/2059)
+
+- [[SDL 0041] Provide AppIcon resumption across app registration requests](https://github.com/smartdevicelink/sdl_core/issues/1456)
+
+- [[SDL 0139] Clarification of audio format details of AudioPassThru](https://github.com/smartdevicelink/sdl_core/issues/2014)
+
+- [[SDL 0105] Remote Control - Seat](https://github.com/smartdevicelink/sdl_core/issues/1860)
+
+- [[SDL 0172] Remote Control - Update OnRCStatus with a new allowed parameter](https://github.com/smartdevicelink/sdl_core/issues/2244)
+
+- [[SDL 0106] Remote Control - OnRCStatus notification](https://github.com/smartdevicelink/sdl_core/issues/1930)
+
+- [[SDL 0145] Driver Distraction Notification Upon Registration](https://github.com/smartdevicelink/sdl_core/issues/2054)
+
+- [[SDL 0102] New vehicle data - ElectronicParkBrakeStatus ](https://github.com/smartdevicelink/sdl_core/issues/1815)
+
+- [[SDL 0110] Remove QT HMI from SDL Core](https://github.com/smartdevicelink/sdl_core/issues/1857) - Fully removed from project
+
+- [[SDL 0141] Supporting simultaneous multiple transports](https://github.com/smartdevicelink/sdl_core/issues/2065)
+
+- [[SDL 0149] Add capability to disable resumption based on app type and transport type](https://github.com/smartdevicelink/sdl_core/issues/2130)
+
+- [[SDL 0107] New vehicle data - TurnSignal](https://github.com/smartdevicelink/sdl_core/issues/1859)
+
+- [[SDL 0085] SubMenu Icon](https://github.com/smartdevicelink/sdl_core/issues/1747)
+
+- [[SDL 0168] RPC design refactoring](https://github.com/smartdevicelink/sdl_core/issues/2189)
+
+- [[SDL 0120] GetSystemTime RPC](https://github.com/smartdevicelink/sdl_core/issues/1963)
+
+- [[SDL 0040] DTLS encryption](https://github.com/smartdevicelink/sdl_core/issues/1479)
+
+- [[SDL 0014] Adding Audio File Playback to TTSChunk](https://github.com/smartdevicelink/sdl_core/issues/1277)
+
+- [[SDL 0063] Display name parameter](https://github.com/smartdevicelink/sdl_core/issues/1589)
+
+- [[SDL 0083] Expandable Design for Proprietary Data Exchange](https://github.com/smartdevicelink/sdl_core/issues/1734)
+
+- [[SDL 0042] SDL must transfer RPCs with invalid image reference parameters to the HMI](https://github.com/smartdevicelink/sdl_core/issues/1428)
+
+- [[SDL 0097] Tire pressure additions](https://github.com/smartdevicelink/sdl_core/issues/1766)
+
+- [[SDL 0062] Template images](https://github.com/smartdevicelink/sdl_core/issues/1588)
+
+- [[SDL 0037] Expand Mobile putfile RPC](https://github.com/smartdevicelink/sdl_core/issues/1455)
+
+- [[SDL 0164] Modernize Ubuntu Support](https://github.com/smartdevicelink/sdl_core/issues/2170)
+
+- [[SDL 0162] Define Handling of Duplicate Correlation IDs](https://github.com/smartdevicelink/sdl_core/issues/2169)
+
+- [[SDL 0151] ImageFieldName for SecondaryImage](https://github.com/smartdevicelink/sdl_core/issues/2099)
+
+- [[SDL 0082] New vehicle data - EngineOilLife](https://github.com/smartdevicelink/sdl_core/issues/1733)
+
+- [[SDL 0147] Template Improvements: Color Scheme](https://github.com/smartdevicelink/sdl_core/issues/2082)
+
+- [[SDL 0096] Deliver build configuration](https://github.com/smartdevicelink/sdl_core/issues/1765)
+
+- [[SDL 0072] New vehicle data - FuelRange](https://github.com/smartdevicelink/sdl_core/issues/1656)
+
+- [Inclusion of PLAY_PAUSE as a subscribable button](https://github.com/smartdevicelink/sdl_core/pull/930)
## Bug Fixes
-- [Remove OEM Specific references in SDL policy table preload file](https://github.com/smartdevicelink/sdl_core/issues/1252)
-- ["resultCode" should be more descriptive than "INVALID_DATA"](https://github.com/smartdevicelink/sdl_core/issues/31)
-- [SDL doesn't apply sequence SUSPEND -> OnSDLAwake -> SUSPEND -> IGN_OFF for saving resumption data](https://github.com/smartdevicelink/sdl_core/issues/1395)
-- [SDL responds "resultCode: SUCCESS" while dataType:VEHICLEDATA_EXTERNTEMP is VEHICLE_DATA_NOT_AVAILABLE and not in subscribed list store](https://github.com/smartdevicelink/sdl_core/issues/982)
-- [Policies SDL should be case-insensetive to "AppID" against listed in policies manager](https://github.com/smartdevicelink/sdl_core/issues/992)
-- [App is disconnected due to PROTOCOL_VIOLATION when start audio streaming after rejected 2 times then accepted](https://github.com/smartdevicelink/sdl_core/issues/1004)
-- [SDL doesn't set unsuccessful "message" value to "info" param in case HMI responds via single UI.RPC when Interface.IsReady missing](https://github.com/smartdevicelink/sdl_core/issues/997)
-- [Navigation SDL does not respond info message in case GENERIC_ERROR watchdog timeout from HMI](https://github.com/smartdevicelink/sdl_core/issues/990)
-- [SDL does not respond info message in case GENERIC_ERROR watchdog timeout from HM](https://github.com/smartdevicelink/sdl_core/issues/1012)
-- [SDL doesn't send info parameter when result of ResetGlobalProperties is GENERIC_ERROR](https://github.com/smartdevicelink/sdl_core/issues/1016)
-- [SDL does not send StopAudioStream() if exit app while Video service and Audio service are starting.](https://github.com/smartdevicelink/sdl_core/issues/1002)
-- [APIs AlertManeuver: SDL responds GENERIC_ERROR instead of INVALID_DATA when soft button has Type is Image or Both and Text is whitespace or \t or \n or empty](https://github.com/smartdevicelink/sdl_core/issues/980)
-- [IVSU SDL doesn't reject SystemRequest with filenam=IVSU but w/o binary data.](https://github.com/smartdevicelink/sdl_core/issues/976)
-- [Memory leaks: SDL does not release memory after sending AddCommand limit exhausted](https://github.com/smartdevicelink/sdl_core/issues/1029)
-- [Negative result code send instead of IGNORED for UnsubscribedVehicleData when VehicleInfo IsReady Missing](https://github.com/smartdevicelink/sdl_core/issues/996)
-- [API SDL responds "UNSUPPORTED_RESOURCE", success= false in case only have "UNSUPPORTED_RESOURCE" to Navigation.AlertManeuver](https://github.com/smartdevicelink/sdl_core/issues/989)
-- [Default app policies are never updated after a PTU](https://github.com/smartdevicelink/sdl_core/issues/1772)
-- [Build fails with GCC6+](https://github.com/smartdevicelink/sdl_core/issues/1975)
-- [Remote Control test suite fails](https://github.com/smartdevicelink/sdl_core/issues/1993)
-- [PoliciesManager allows all requested params in case "parameters" field is empty](https://github.com/smartdevicelink/sdl_core/issues/1873)
-- [OnDriverDistraction SDL does not send notification to app right after this app changes level from NONE to any other](https://github.com/smartdevicelink/sdl_core/issues/1881)
-- [Protect access to Resumption data during LastState::SaveStateToFileSystem](https://github.com/smartdevicelink/sdl_core/issues/1953)
-- [Need to protect cache manager "pt_" from concurrent access](https://github.com/smartdevicelink/sdl_core/issues/1961)
-- [Prevent deadlock in EventDispatcherIimpl::raise_event](https://github.com/smartdevicelink/sdl_core/issues/1949)
-- [Bluetooth StartService fail after Core restarted](https://github.com/smartdevicelink/sdl_core/issues/1932)
-- [Silent error caused by implicit conversion of SmartPointer to integer](https://github.com/smartdevicelink/sdl_core/issues/1834)
-- [AOA USB transport buffer size too small](https://github.com/smartdevicelink/sdl_core/issues/1863)
-- [Lock screen icon URL should be updated](https://github.com/smartdevicelink/sdl_core/issues/1646)
-- [Broken link in README.md for Software Architecture Documentation](https://github.com/smartdevicelink/sdl_core/issues/2091)
-- [SDL doesn't send OnPermissionsChange in case of external user consent](https://github.com/smartdevicelink/sdl_core/issues/2072)
-- [Build fails when ENABLE_SECURITY=OFF](https://github.com/smartdevicelink/sdl_core/issues/2073)
-
-### Security Related Fixes
-- [SDL must start PTU for navi app right after app successfully registration](https://github.com/smartdevicelink/sdl_core/issues/1925)
-- [SDL must start PTU for any app except navi right after app successfully request to start first secure service](https://github.com/smartdevicelink/sdl_core/issues/1924)
-- [PolicyTableUpdate is failed by any reason and "ForceProtectedService"=ON at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1923)
-- [PolicyTableUpdate has NO "certificate" and "ForceProtectedService"=ON at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1922)
-- [SDL must respond NACK in case navigation app connected over protocol v2 sends StartService for audio service](https://github.com/smartdevicelink/sdl_core/issues/1912)
-- [PolicyTableUpdate has NO "certificate" and "ForceProtectedService"=OFF at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1894)
-- [PolicyTableUpdate is failed by any reason and "ForceProtectedService"=OFF at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1891)
-- [PolicyTableUpdate is valid and brings "certificate"](https://github.com/smartdevicelink/sdl_core/issues/1888)
+
+- [SDL process RC requests with resultCode DISALLOWED after IGN_OFF and IGN_ON](https://github.com/smartdevicelink/sdl_core/issues/2670)
+
+- [SDL stop sending OnInteriorVehicleData notifications after the app sent a GetInteriorVehicleData without optional parameter subscribe](https://github.com/smartdevicelink/sdl_core/issues/2657)
+
+- [Make Size() function thread safe to avoid core dump](https://github.com/smartdevicelink/sdl_core/issues/2603)
+
+- [SDL does not cut parameters not related to defined module type from RC.SetInteriorVD](https://github.com/smartdevicelink/sdl_core/issues/2664)
+
+- [Add missing PRNDL enum value to the HMI API ](https://github.com/smartdevicelink/sdl_core/issues/2431)
+
+- [EXTERNAL_PROPRIETARY user consent is broken when permissions are in default object](https://github.com/smartdevicelink/sdl_core/issues/2146)
+
+- [Processing invalid PT after cutting off unknown_parameter or unknown_RPC](https://github.com/smartdevicelink/sdl_core/issues/1921)
+
+- [SDL does not check for non-mandatory parameters](https://github.com/smartdevicelink/sdl_core/issues/2443)
+
+- [SDL must close only session in case mobile app does not answer on Heartbeat_request](https://github.com/smartdevicelink/sdl_core/issues/1893)
+
+- [App does not activate when policies are disabled](https://github.com/smartdevicelink/sdl_core/issues/842)
+
+- [Pure virtual method called during SDL shutdown](https://github.com/smartdevicelink/sdl_core/issues/2433)
+
+- [SDL build is failing when ENABLE_LOG=OFF](https://github.com/smartdevicelink/sdl_core/issues/2341)
+
+- [Wrong policy permissions calculation in EXTERNAL_PROPRIETARY flow](https://github.com/smartdevicelink/sdl_core/issues/2405)
+
+- [Functional groupings parameters has max size of 24](https://github.com/smartdevicelink/sdl_core/issues/2470)
+
+- [AudioPassThru does not send audio data in raw PCM data](https://github.com/smartdevicelink/sdl_core/issues/1928)
+
+- [Deprecated GetDataOnSessionKey() cannot be overloaded in cross-compiling](https://github.com/smartdevicelink/sdl_core/issues/2137)
+
+- [V5 Protocol Messages do not encrypt payload of Control Frame Message Types](https://github.com/smartdevicelink/sdl_core/issues/2142)
+
+- [Remove TLS Handshake App Name String Compare](https://github.com/smartdevicelink/sdl_core/issues/1617)
+
+- [The reference of wild pointer cause to memory leak](https://github.com/smartdevicelink/sdl_core/issues/860)
+
+- [Build failing on Fedora 25](https://github.com/smartdevicelink/sdl_core/issues/1495)
+
+- [Add missing RPC changes: SpaceAvailable & CurrentTemperatureAvailable](https://github.com/smartdevicelink/sdl_core/pull/2588)
+
+- [Invalid memory accesses detected by valgrind](https://github.com/smartdevicelink/sdl_core/issues/2177)
+
+- [Memory leaks in media_manager_test unit tests](https://github.com/smartdevicelink/sdl_core/issues/2274)
+
+- [Empty moduleType disallows all RPC requests after ignition cycle](https://github.com/smartdevicelink/sdl_core/issues/2547)
+
+- [Feature/boost datetime implementation](https://github.com/smartdevicelink/sdl_core/pull/2278)
+
+- [Flush logger before deleting message loop thread](https://github.com/smartdevicelink/sdl_core/pull/2532)
+
+- [SDL Proxy crash happens when receiving SDLOnAppInterfaceUnregistered notification with reason -1 (INVALID_ENUM)](https://github.com/smartdevicelink/sdl_core/issues/2300)
+
+- [OnHMIStatus returns null hmiLevel if RPC has invalid/incomplete parameters](https://github.com/smartdevicelink/sdl_core/issues/2285)
+
+- [Invalid memory access in CacheManager::CheckPermissions()](https://github.com/smartdevicelink/sdl_core/issues/2298)
+
+- [Cert processing invalid, module certificate should be updated when a policy table update occurs](https://github.com/smartdevicelink/sdl_core/issues/2191)
+
+- [Cert processing invalid, CertificatePath and CACertificatePath keywords are nonfunctional](https://github.com/smartdevicelink/sdl_core/issues/2190)
+
+- [RegisterAppInterface Display Capabilities Segfault](https://github.com/smartdevicelink/sdl_core/issues/2220)
+
+- [Duplicate "PendingRequestsAmount" entries in smartDeviceLink.ini](https://github.com/smartdevicelink/sdl_core/issues/1790)
+
+## Enhancements
+
+- [PrintSmartObject function can not print to log file](https://github.com/smartdevicelink/sdl_core/issues/2574)
+
+## Best Practice
+
+- [AllowDeviceToConnect is never used](https://github.com/smartdevicelink/sdl_core/issues/494)
+
+- [Fix UnsubscribeWayPoints typo](https://github.com/smartdevicelink/sdl_core/pull/2504)
+
+- [Namespace capitalization](https://github.com/smartdevicelink/sdl_core/issues/33)
+
+- [Remove "SetIcon" Files](https://github.com/smartdevicelink/sdl_core/issues/1594)
+
+- [Initialization (et al) method return values](https://github.com/smartdevicelink/sdl_core/issues/34)
+
+- [Fix misspellings of "subscription"](https://github.com/smartdevicelink/sdl_core/issues/736)
+
+
+## Documentation
+
+- [Add FAQ link to README.md](https://github.com/smartdevicelink/sdl_core/pull/1366)
+
+- [Broken Links in SDD Documentation](https://github.com/smartdevicelink/sdl_core/issues/2107)
+
+- [Alter build instructions for slight clarity improvements](https://github.com/smartdevicelink/sdl_core/pull/218)
+
+- [Add third_party file](https://github.com/smartdevicelink/sdl_core/issues/2610)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 450a9192f3..1a180b6cf9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,6 @@ option(ENABLE_GCOV "gcov code coverage feature" OFF)
option(ENABLE_SANITIZE "Sanitize tool" OFF)
option(ENABLE_SECURITY "Security Ford protocol protection" ON)
option(ENABLE_HMI_PTU_DECRYPTION "Policy table update parsed by hmi" ON)
-option(REMOTE_CONTROL "Enable Reverse functionality" ON)
option(USE_COTIRE "Use Cotire to speed up build (currently only for commands tests)" ON)
option(USE_GOLD_LD "Use gold linker intead of GNU linker" ON)
option(USE_CCACHE "Turn on ccache usage" ON)
@@ -113,9 +112,6 @@ if (HMI_ADAPTER_OPTION)
if (${HMI_ADAPTER_OPTION} STREQUAL "MESSAGEBROKER")
message(STATUS "Jenkins integration: selected HMI adapter MESSAGEBROKER")
set (HMIADAPTER "messagebroker")
- elseif (${HMI_ADAPTER_OPTION} STREQUAL "DBUS")
- message(STATUS "Jenkins integration: selected HMI adapter DBUS")
- set (HMIADAPTER "dbus")
endif()
endif()
@@ -156,13 +152,61 @@ if (OS_TYPE_OPTION)
endif()
endif()
-if (REMOTE_CONTROL)
- add_definitions(-DSDL_REMOTE_CONTROL)
- message(STATUS "Remote control support is enabled (aka Reverse SDL or SDL-RC)")
-endif()
-
#Jenkins integration section end
+#Deliver Build Configuration
+
+set(build_config_path "src/appMain/build_config.txt")
+FILE(WRITE "${build_config_path}" "")
+
+get_property(cHelpString CACHE EXTENDED_POLICY PROPERTY HELPSTRING)
+get_property(cType CACHE EXTENDED_POLICY PROPERTY TYPE)
+get_property(cValue CACHE EXTENDED_POLICY PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "EXTENDED_POLICY:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE BUILD_BT_SUPPORT PROPERTY HELPSTRING)
+get_property(cType CACHE BUILD_BT_SUPPORT PROPERTY TYPE)
+get_property(cValue CACHE BUILD_BT_SUPPORT PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "BUILD_BT_SUPPORT:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE BUILD_USB_SUPPORT PROPERTY HELPSTRING)
+get_property(cType CACHE BUILD_USB_SUPPORT PROPERTY TYPE)
+get_property(cValue CACHE BUILD_USB_SUPPORT PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "BUILD_USB_SUPPORT:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE ENABLE_SECURITY PROPERTY HELPSTRING)
+get_property(cType CACHE ENABLE_SECURITY PROPERTY TYPE)
+get_property(cValue CACHE ENABLE_SECURITY PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "ENABLE_SECURITY:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE EXTENDED_MEDIA_MODE PROPERTY HELPSTRING)
+get_property(cType CACHE EXTENDED_MEDIA_MODE PROPERTY TYPE)
+get_property(cValue CACHE EXTENDED_MEDIA_MODE PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "EXTENDED_MEDIA_MODE:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE TELEMETRY_MONITOR PROPERTY HELPSTRING)
+get_property(cType CACHE TELEMETRY_MONITOR PROPERTY TYPE)
+get_property(cValue CACHE TELEMETRY_MONITOR PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "TELEMETRY_MONITOR:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE HMI PROPERTY HELPSTRING)
+get_property(cType CACHE HMI PROPERTY TYPE)
+get_property(cValue CACHE HMI PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "HMI:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY HELPSTRING)
+get_property(cType CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY TYPE)
+get_property(cValue CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "ENABLE_HMI_PTU_DECRYPTION:${cType}=${cValue}\n")
+
add_custom_target(pasa-tarball
COMMAND ${CMAKE_SOURCE_DIR}/tools/Utils/export-customer-specific.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} pasa
COMMAND tar -cz -C /tmp/PASA -f ${CMAKE_BINARY_DIR}/pasa.tar.gz .
@@ -180,7 +224,6 @@ add_custom_target(genivi-tarball
COMMAND tar -cz -C /tmp/GENIVI -f ${CMAKE_BINARY_DIR}/genivi.tar.gz .
)
-
project (${PROJECT})
#ADD_DEPENDENCIES(${PROJECT} Policy)
@@ -192,7 +235,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
-set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wno-deprecated-declarations -Wuninitialized -Wvla")
+set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wuninitialized -Wvla")
if (USE_GOLD_LD)
execute_process(COMMAND ld -v OUTPUT_VARIABLE result)
@@ -335,15 +378,6 @@ if (HMI STREQUAL "web" AND NOT DEFINED HMIADAPTER)
set(HMIADAPTER "messagebroker")
endif()
-if (HMIADAPTER STREQUAL "dbus")
- set(HMI_DBUS_API ON)
- add_definitions(-DDBUS_HMIADAPTER)
- add_definitions(-DHMI_DBUS_API)
-
- find_package(DBus REQUIRED)
- set(DBUS_LIBS_DIRECTORY ${DBUS_LIBRARY_DIRS} PARENT_SCOPE)
- message(${DBUS_INCLUDE_DIRS})
-endif()
if (HMIADAPTER STREQUAL "messagebroker")
set(HMI_JSON_API ON)
add_definitions(-DMESSAGEBROKER_HMIADAPTER)
@@ -446,4 +480,3 @@ find_package(Doxygen)
message(STATUS "To enable processing of MscGen comments please install mscgen")
message(STATUS "sudo apt-get install mscgen")
endif()
-
diff --git a/Doxyfile b/Doxyfile
index 0b46c939b6..36155e37a7 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -838,7 +838,7 @@ RECURSIVE = YES
# run.
EXCLUDE = **/CMakeLists.txt \
- docs/FORD.OpenSDL.SDD.TPL.dox
+ docs/SDL.SDD.Template.dox
src/components/test_main.cc
src/thirdPartyLibs \
tools/FlexeLint \
diff --git a/README.md b/README.md
index e4d9952aea..86d07c3d83 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
[![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com)
-
[![codecov.io](https://codecov.io/github/smartdevicelink/sdl_core/coverage.svg?branch=develop)](https://codecov.io/github/smartdevicelink/sdl_core?branch=develop)
+[![Build Status](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/badge/icon)](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/)
# SmartDeviceLink (SDL)
@@ -31,7 +31,7 @@ We're ramping up our efforts to get SmartDeviceLink developed and maintained dir
A quick guide to installing, configuring, and running an instance of the SDL Core on a linux OS.
1. Clone this repository
- 2. Create a folder for your build and run `cmake ../sdl_core`
+ 2. Create a folder for your build outside of the source folder and run `cmake {path_to_sdl_core_source_folder}` from the build folder you created
3. If there are any dependency issues, install missing dependencies
4. Run the following commands to compile and install smartdevicelink
@@ -65,7 +65,6 @@ The dependencies for SDL Core vary based on the configuration. You can change SD
| Flag | Description | Dependencies |
|------|-------------|--------------|
|Web HMI|Use HTML5 HMI|chromium-browser|
-|DBus|Use DBus HMI Adapter|dbus-1-dev|
|EXTENDED_MEDIA_MODE|Support Video and Audio Streaming|Opengl es2, gstreamer1.0*|
|Bluetooth|Enable bluetooth transport adapter|libbluetooth3, libbluetooth-dev, bluez-tools|
|USB|Enable USB transport adapter|libusb-dev|
@@ -120,6 +119,10 @@ There are several RPCs that are "required" to be implemented in order for SDL to
* OnSystemRequest
* Speak
+## Frequently Asked Questions
+
+If you have any questions regarding the setup of SDL Core or regarding the integration of SDL into an infotainment system, first visit our [SDL Core FAQ](https://smartdevicelink.com/en/guides/core/faq/). If you still have questions, you can post a question in the `core-help` channel of our Slack group (sign up [here](http://slack.smartdevicelink.com/))
+
## Test Coverage
### Used technologies
* GCOV - test coverage program.
diff --git a/docs/FORD.OpenSDL.SDD.TPL.dox b/docs/FORD.OpenSDL.SDD.TPL.dox
deleted file mode 100644
index c0106df5d4..0000000000
--- a/docs/FORD.OpenSDL.SDD.TPL.dox
+++ /dev/null
@@ -1,355 +0,0 @@
-/**
-\cond FALSE
------- Design document template explanation -------
-This is a SW Detailed Design template for each SDl component update.
-The original QCA template with more detail description is available at Luxoft portal
-https://adc.luxoft.com/confluence/display/PORTAL/Software+Detailed+Design+Template
-
----------------------- HOWTO -----------------------
-For adding new component documentation please follow this steps:
-1. Copy this document to the 'doc' subdirectory in the Component working directory with a new name
- - Example:
- + src/components/transport_manager/docs/FORD.OpenSDL.SDD.TM.dox
- + src/components/utils/docs/FORD.OpenSDL.SDD.Utils.dox
- - https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentNaming
-2. Replace <!Component Name> with a correct naming according to SAD naming
- - Name examples:
- Application Manager, Connection Handler
- - Replace examples:
- ~ sed -i 's/<!Component Name>/Utils/g' FORD.OpenSDL.SDD.Utils.dox
-3. Replace <!Component_Id> with a shot unique name
- - Something like app_manage, connection_handler, policy
- - It shall be one word without spaces and special symbols except '_'
- - Replace examples:
- ~ sed -i 's/<!Component_Id>/connection_handler/g' FORD.OpenSDL.SDD.Utils.dox
- Note: After that step all Doxygen tags becomes working well and IDE could be used
-4. Add reference in mainpage.dox Table of Content using <!Component_Id> used in p.3
-5. Replace blocks marked as following with a content according to instructions in these blocks
- - Each block starts as <!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
- - Each block ends as <!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
- - If chapter content is not applicable for a Component update it with "Not applicable, since/because of <Reason>."
-6. Update source code doxygen comments for mentioning entities in the following SDD chapter:
- - Public and private interfaces from chapter 3
- - Data types from chapter 4.2
-7. Update project Doxygen file with path to new images
- * IMAGE_PATH parameter
-8. Remove this template explanation from cond to endcond tags
-
-General notes/reminders:
-- Commit both: images and them source to the git repository
-- SDD file extension shall be 'dox'
-- the preferable path for SDD is src/components/COMPONENT/docs
-- the preferable path for SDD images is src/components/COMPONENT/docs/assets
-
-For more information, please follow:
-- Doxygen documentation
- http://www.stack.nl/~dimitri/doxygen/manual/index.html
-- Markdown support by doxygen
- http://www.stack.nl/~dimitri/doxygen/manual/markdown.html
-- Text-base UML tool
- http://plantuml.com/
-- Article "Providing design documentation with code changes"
- https://github.com/smartdevicelink/sdl_core/wiki/Providing-design-documentation-with-code-changes
-
----------------------------------------------
-\endcond
-\page <!Component_Id> <!Component Name> Detailed Design
-## Table of contents
-- \subpage <!Component_Id>_intoduction
- + \ref <!Component_Id>_rationale "1.1 Rationale"
- + \ref <!Component_Id>_scope "1.2 Scope"
- + \ref <!Component_Id>_abbreviations "1.3 Abbreviations"
-- \subpage <!Component_Id>_detail_design
- + \ref <!Component_Id>_design_solutions "2.1 Design solutions"
- + \ref <!Component_Id>_class_structure "2.2 Class Structure"
- + \ref <!Component_Id>_sequence_diagram "2.3 Sequence diagram"
- + \ref <!Component_Id>_state_chart "2.4 State chart diagram"
-- \subpage <!Component_Id>_interfaces
- + \ref <!Component_Id>_public_interfaces "3.1 Public interfaces description"
- + \ref <!Component_Id>_internal_interfaces "3.2 Internal interfaces description"
- + \ref <!Component_Id>_derived_interfaces "3.3 Derived interfaces and dependencies"
-- \subpage <!Component_Id>_data_structure_resources
- + \ref <!Component_Id>_data_structure "4.1 Element Data Structure"
- + \ref <!Component_Id>_resources "4.2 Resource usage"
-- \subpage <!Component_Id>_references_and_history
- + \ref <!Component_Id>_references "5.1 References"
- + \ref <!Component_Id>_history "5.2 Document history change and approve"
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_intoduction 1. Introduction
-The document is intended to support software developers,
-maintenance and integration engineers with sufficient,
-detailed information concerning the design, development and
-deployment concepts, to accomplish their respective tasks without reliance on the authors.
-
-\anchor <!Component_Id>_rationale
-## 1.1 Rationale
-<!Component Name> implements SDL Architectural Solution according to:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be a link SAD Components View and Requirements if applicable)
-Example:
- https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#hmi-message-handler
-<!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_scope
-## 1.2 Scope
-<!Component Name> extracted as a separate component for
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a reason and short description of the components functionality
-Example:
- Security Manager component extracted as a separate module for
- Ford channel data protection.
- This components is used to :
- - Provide security communications
- - Protect income and outcome business layer data from interception
- - Verify the relation between a mobile application certificate and its owner
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_abbreviations
-## 1.3 Abbreviations
-Abbreviations used in this document please find in the table below.
-| Abbreviation | Expansion |
-|------------------|----------------------------------|
-| | |
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added all component-specific terms, as
-| TA | Transport Adapter |
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-Definitions used in this document are in the table below.
-
-| Definition | Description |
-|------------------|-----------------------------------|
-| | |
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added all component-specific terms, as
-| WebSocket | a protocol providing full-duplex communication channels over a single TCP connection |
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_detail_design 2. Component detail design
-\anchor <!Component_Id>_design_solutions
-### 2.1 Design solutions
-The following design approaches and pattern was used for <!Component Name>:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added GoF (or other) SW design patterns,
-technologies and approaches with short description
-Example:
- - Command design pattern is used to treat requests as an object that provides
- possibility to add new request without existing code modification
- - Factory method pattern design used for SSLContext objects creation
- + It also guaranty correctness of SSLContext destruction by the
- same Compiled SecurityManger object
- - All database reading are cached by CacheManager class, which
- guaranty meeting timing contrariness
- - SQLite database was chosen as a lightweight, embedded, transactional SQL database engine
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_class_structure
-### 2.2 Class Structure
-The following UML class digram shows the component classes structure.
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added class diagram
-Example:
- ![Security Manager class diagram](sm_class_digram.png)
-For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
-https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
-OR plantuml diagram
-http://plantuml.com/classes.html
-Note: Source files of diagram and output images need to be also committed to git.
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more information about class digram follow:
-- http://www.uml-diagrams.org/class-diagrams-overview.html
-- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
-
-\anchor <!Component_Id>_sequence_diagram
-### 2.3 Sequence diagram
-The following UML sequence digram shows how objects operate with one another and in what order.
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added sequence diagram
-Example:
- Short description
- ![Connection](connection.png)
- ![job](job.png)
- ![disconnection](disconnection.png)
-For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
-https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
-OR plantuml diagram
-http://plantuml.com/sequence.html
-Note: Source files of diagram and output images need to be also committed to git.
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more information about sequence digram follow:
-- http://www.uml-diagrams.org/sequence-diagrams.html
-- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
-
-\anchor <!Component_Id>_state_chart
-### 2.4 State chart diagram
-The following UML state digram shows the component life cycle states.
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added state diagram
-Example:
- ![StateControllerImpl state](state_contoroller_states.png)
-For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
-https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
-OR plantuml diagram
-http://plantuml.com/state.html
-Note: Source files of diagram and output images need to be also committed to git.
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more information about class digram follow:
-- http://www.uml-diagrams.org/state-machine-diagrams.html
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_interfaces 3. Component Interfaces
-\anchor <!Component_Id>_public_interfaces
-### 3.1 Public interfaces description
-<!Component Name> provides functionality with following interfaces:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of external interfaces
-Example:
- - security_manager::SecurityManager
- - security_manager::SecurityManagerListener
- - security_manager::SSLContext
-(!) All link will be auto-added by doxygen
-For more auto-linking follow - https://www.stack.nl/~dimitri/doxygen/manual/autolink.html#linkclass
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_internal_interfaces
-### 3.2 Internal interfaces description
-The following interfaces are provided by component for internal usage only:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of internal interfaces
-Example:
- - security_manager::CryptoManager
- - security_manager::CryptoManagerSettings
- - security_manager::SecurityQuery
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_derived_interfaces
-### 3.3 Derived interfaces and dependencies
-<!Component Name> required following 3d-party libraries:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of libraries
-Example:
- - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-The following interfaces are required by component:
-- \ref src/components/include/utils Utils
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of external interfaces
-Example:
- - protocol_handler::ProtocolObserver for getting Protocol notifications
- - implements protocol_handler::SessionObserver for providing SSLContext object managing
- - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) :
- + SSL_library_init() - registers the available SSL/TLS ciphers and digests.
-All link will be auto-added by doxygen
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_data_structure_resources 4. Component data and resources
-\anchor <!Component_Id>_data_structure
-### 4.1 Element Data Structure
-The following data types are used by the Component:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of component data types
-Example:
- - security_manager::SecurityQuery
- - protocol_handler::ProtocolPacket
-All link will be auto-added by doxygen
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-The format of processing/saving/loading data is:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of formats
-Example:
- - Json data according to APPLINK-19421
- - Binary data array according to Ford Protocol Specification
- + https://github.com/smartdevicelink/protocol_spec
- - PEM certificates according to APPLINK-21512
-All link will be auto-added by doxygen
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_resources
-### 4.2 Resource usage
-The following system resources are used by the Component:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added all resource-related information
-All file, database or network reading
-An amount of processing by component data
-Example:
- Resumption uses QBD/JSON database with configurable limitation 10 Mb
- Request Controller Handle a configured amount of RPCs:
- - A XXX count of messages from application in NONE level
- + <LINK_TO_REQURMENT_XXX>
- - A YYY count of messages per second for each application
- + <LINK_TO_REQURMENT_YYY>
- (!) In case of no such restrict it need to be clarified (!)
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_references_and_history 5. References and history
-\anchor <!Component_Id>_references
-### 5.1 References
-- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of all related to component functionality
-references, including 3d-party libraries, documentation, requirements
-Example:
- - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
- - [SQLite Documents](https://www.sqlite.org/docs.html)
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_history
-### 5.2 Document history
-Document change history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|-----------------------------|---------------------|
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Example:
-| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
-For more details follow
-https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentVersion
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-Document approve history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|-----------------------------|---------------------|
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Example:
-| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more precise document change history follow github history -
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Example for this template:
-- https://github.com/smartdevicelink/sdl_core/commits/master/docs/software_detailed_design_template.dox
-- https://github.com/smartdevicelink/sdl_core/commits/develop/docs/software_detailed_design_template.dox
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/ \ No newline at end of file
diff --git a/docs/SDL.SDD.Template.dox b/docs/SDL.SDD.Template.dox
new file mode 100644
index 0000000000..435da665db
--- /dev/null
+++ b/docs/SDL.SDD.Template.dox
@@ -0,0 +1,355 @@
+/**
+\cond FALSE
+------ Design document template explanation -------
+This is a SW Detailed Design template for each SDl component update.
+The original QCA template with more detail description is available at Luxoft portal
+https://adc.luxoft.com/confluence/display/PORTAL/Software+Detailed+Design+Template
+
+---------------------- HOWTO -----------------------
+For adding new component documentation please follow this steps:
+1. Copy this document to the 'doc' subdirectory in the Component working directory with a new name
+ - Example:
+ + src/components/transport_manager/docs/SDL.SDD.TM.dox
+ + src/components/utils/docs/SDL.SDD.Utils.dox
+ - https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentNaming
+2. Replace <!Component Name> with a correct naming according to SAD naming
+ - Name examples:
+ Application Manager, Connection Handler
+ - Replace examples:
+ ~ sed -i 's/<!Component Name>/Utils/g' SDL.SDD.Utils.dox
+3. Replace <!Component_Id> with a shot unique name
+ - Something like app_manage, connection_handler, policy
+ - It shall be one word without spaces and special symbols except '_'
+ - Replace examples:
+ ~ sed -i 's/<!Component_Id>/connection_handler/g' SDL.SDD.Utils.dox
+ Note: After that step all Doxygen tags becomes working well and IDE could be used
+4. Add reference in mainpage.dox Table of Content using <!Component_Id> used in p.3
+5. Replace blocks marked as following with a content according to instructions in these blocks
+ - Each block starts as <!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+ - Each block ends as <!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
+ - If chapter content is not applicable for a Component update it with "Not applicable, since/because of <Reason>."
+6. Update source code doxygen comments for mentioning entities in the following SDD chapter:
+ - Public and private interfaces from chapter 3
+ - Data types from chapter 4.2
+7. Update project Doxygen file with path to new images
+ * IMAGE_PATH parameter
+8. Remove this template explanation from cond to endcond tags
+
+General notes/reminders:
+- Commit both: images and them source to the git repository
+- SDD file extension shall be 'dox'
+- the preferable path for SDD is src/components/COMPONENT/docs
+- the preferable path for SDD images is src/components/COMPONENT/docs/assets
+
+For more information, please follow:
+- Doxygen documentation
+ http://www.stack.nl/~dimitri/doxygen/manual/index.html
+- Markdown support by doxygen
+ http://www.stack.nl/~dimitri/doxygen/manual/markdown.html
+- Text-base UML tool
+ http://plantuml.com/
+- Article "Providing design documentation with code changes"
+ https://github.com/smartdevicelink/sdl_core/wiki/Providing-design-documentation-with-code-changes
+
+---------------------------------------------
+\endcond
+\page <!Component_Id> <!Component Name> Detailed Design
+## Table of contents
+- \subpage <!Component_Id>_intoduction
+ + \ref <!Component_Id>_rationale "1.1 Rationale"
+ + \ref <!Component_Id>_scope "1.2 Scope"
+ + \ref <!Component_Id>_abbreviations "1.3 Abbreviations"
+- \subpage <!Component_Id>_detail_design
+ + \ref <!Component_Id>_design_solutions "2.1 Design solutions"
+ + \ref <!Component_Id>_class_structure "2.2 Class Structure"
+ + \ref <!Component_Id>_sequence_diagram "2.3 Sequence diagram"
+ + \ref <!Component_Id>_state_chart "2.4 State chart diagram"
+- \subpage <!Component_Id>_interfaces
+ + \ref <!Component_Id>_public_interfaces "3.1 Public interfaces description"
+ + \ref <!Component_Id>_internal_interfaces "3.2 Internal interfaces description"
+ + \ref <!Component_Id>_derived_interfaces "3.3 Derived interfaces and dependencies"
+- \subpage <!Component_Id>_data_structure_resources
+ + \ref <!Component_Id>_data_structure "4.1 Element Data Structure"
+ + \ref <!Component_Id>_resources "4.2 Resource usage"
+- \subpage <!Component_Id>_references_and_history
+ + \ref <!Component_Id>_references "5.1 References"
+ + \ref <!Component_Id>_history "5.2 Document history change and approve"
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_intoduction 1. Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+
+\anchor <!Component_Id>_rationale
+## 1.1 Rationale
+<!Component Name> implements SDL Architectural Solution according to:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be a link SAD Components View and Requirements if applicable)
+Example:
+ https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#hmi-message-handler
+<!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_scope
+## 1.2 Scope
+<!Component Name> extracted as a separate component for
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a reason and short description of the components functionality
+Example:
+ Security Manager component extracted as a separate module for
+ SDL channel data protection.
+ This components is used to :
+ - Provide security communications
+ - Protect income and outcome business layer data from interception
+ - Verify the relation between a mobile application certificate and its owner
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_abbreviations
+## 1.3 Abbreviations
+Abbreviations used in this document please find in the table below.
+| Abbreviation | Expansion |
+|------------------|----------------------------------|
+| | |
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all component-specific terms, as
+| TA | Transport Adapter |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+Definitions used in this document are in the table below.
+
+| Definition | Description |
+|------------------|-----------------------------------|
+| | |
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all component-specific terms, as
+| WebSocket | a protocol providing full-duplex communication channels over a single TCP connection |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_detail_design 2. Component detail design
+\anchor <!Component_Id>_design_solutions
+### 2.1 Design solutions
+The following design approaches and pattern was used for <!Component Name>:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added GoF (or other) SW design patterns,
+technologies and approaches with short description
+Example:
+ - Command design pattern is used to treat requests as an object that provides
+ possibility to add new request without existing code modification
+ - Factory method pattern design used for SSLContext objects creation
+ + It also guaranty correctness of SSLContext destruction by the
+ same Compiled SecurityManger object
+ - All database reading are cached by CacheManager class, which
+ guaranty meeting timing contrariness
+ - SQLite database was chosen as a lightweight, embedded, transactional SQL database engine
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_class_structure
+### 2.2 Class Structure
+The following UML class diagram shows the component classes structure.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added class diagram
+Example:
+ ![Security Manager class diagram](sm_class_diagram.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy diagram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/classes.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about class diagram follow:
+- http://www.uml-diagrams.org/class-diagrams-overview.html
+- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
+
+\anchor <!Component_Id>_sequence_diagram
+### 2.3 Sequence diagram
+The following UML sequence diagram shows how objects operate with one another and in what order.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added sequence diagram
+Example:
+ Short description
+ ![Connection](connection.png)
+ ![job](job.png)
+ ![disconnection](disconnection.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy diagram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/sequence.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about sequence diagram follow:
+- http://www.uml-diagrams.org/sequence-diagrams.html
+- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
+
+\anchor <!Component_Id>_state_chart
+### 2.4 State chart diagram
+The following UML state diagram shows the component life cycle states.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added state diagram
+Example:
+ ![StateControllerImpl state](state_contoroller_states.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy diagram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/state.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about class diagram follow:
+- http://www.uml-diagrams.org/state-machine-diagrams.html
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_interfaces 3. Component Interfaces
+\anchor <!Component_Id>_public_interfaces
+### 3.1 Public interfaces description
+<!Component Name> provides functionality with following interfaces:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of external interfaces
+Example:
+ - security_manager::SecurityManager
+ - security_manager::SecurityManagerListener
+ - security_manager::SSLContext
+(!) All link will be auto-added by doxygen
+For more auto-linking follow - https://www.stack.nl/~dimitri/doxygen/manual/autolink.html#linkclass
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_internal_interfaces
+### 3.2 Internal interfaces description
+The following interfaces are provided by component for internal usage only:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of internal interfaces
+Example:
+ - security_manager::CryptoManager
+ - security_manager::CryptoManagerSettings
+ - security_manager::SecurityQuery
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_derived_interfaces
+### 3.3 Derived interfaces and dependencies
+<!Component Name> required following 3d-party libraries:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of libraries
+Example:
+ - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+The following interfaces are required by component:
+- \ref src/components/include/utils Utils
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of external interfaces
+Example:
+ - protocol_handler::ProtocolObserver for getting Protocol notifications
+ - implements protocol_handler::SessionObserver for providing SSLContext object managing
+ - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) :
+ + SSL_library_init() - registers the available SSL/TLS ciphers and digests.
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_data_structure_resources 4. Component data and resources
+\anchor <!Component_Id>_data_structure
+### 4.1 Element Data Structure
+The following data types are used by the Component:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of component data types
+Example:
+ - security_manager::SecurityQuery
+ - protocol_handler::ProtocolPacket
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+The format of processing/saving/loading data is:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of formats
+Example:
+ - Json data according to APPLINK-19421
+ - Binary data array according to SDL Protocol Specification
+ + https://github.com/smartdevicelink/protocol_spec
+ - PEM certificates according to APPLINK-21512
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_resources
+### 4.2 Resource usage
+The following system resources are used by the Component:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all resource-related information
+All file, database or network reading
+An amount of processing by component data
+Example:
+ Resumption uses QBD/JSON database with configurable limitation 10 Mb
+ Request Controller Handle a configured amount of RPCs:
+ - A XXX count of messages from application in NONE level
+ + <LINK_TO_REQURMENT_XXX>
+ - A YYY count of messages per second for each application
+ + <LINK_TO_REQURMENT_YYY>
+ (!) In case of no such restrict it need to be clarified (!)
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_references_and_history 5. References and history
+\anchor <!Component_Id>_references
+### 5.1 References
+- [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of all related to component functionality
+references, including 3d-party libraries, documentation, requirements
+Example:
+ - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+ - [SQLite Documents](https://www.sqlite.org/docs.html)
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_history
+### 5.2 Document history
+Document change history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example:
+| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
+For more details follow
+https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentVersion
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+Document approve history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example:
+| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more precise document change history follow github history -
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example for this template:
+- https://github.com/smartdevicelink/sdl_core/commits/master/docs/SDL.SDD.Template.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/docs/SDL.SDD.Template.dox
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/ \ No newline at end of file
diff --git a/docs/mainpage.dox b/docs/mainpage.dox
index 91ee95fc26..01b9034151 100644
--- a/docs/mainpage.dox
+++ b/docs/mainpage.dox
@@ -1,11 +1,12 @@
/**
* \mainpage Software Detail Design Documentation
*
- * This documents contain SW detailed design information fro each [SmartDeviceLink component](https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/).
+ * This documents contain SW detailed design information fro each [SmartDeviceLink component](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/components-view/).
*
- * For getting SmartDeviceLink overview, please, refer to [Software Architecture Document](https://smartdevicelink.com/en/docs/core/master/software-architecture-document/table-of-contents/)
+ * For getting SmartDeviceLink overview, please, refer to [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
*
* ##Table of contents
* - \ref security_manager
+ * - \ref application_manager
*/
//-----------------------------------------------------------
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index b97c05f7f9..bdb96de417 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -30,8 +30,8 @@
include("./set_3rd_party_paths.cmake")
-set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set (install-3rd_party_logger_var "")
@@ -44,17 +44,14 @@ if(FORCE_3RD_PARTY)
message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.")
else()
set(FORCE_3RD_PARTY_LOGGER ON)
- set(FORCE_3RD_PARTY_DBUS ON)
endif()
endif()
-if(ENABLE_LOG OR HMI_DBUS_API)
+if(ENABLE_LOG)
# --- libexpat
add_subdirectory(expat-2.1.0)
set(EXPAT_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
-endif()
-if(ENABLE_LOG)
if(NO_REBUILD_3RD_PARTY_LOGGER)
message(STATUS "Not rebuilding logger.")
else()
@@ -205,36 +202,41 @@ else()
get_filename_component(EMHASHMAP_LIBS_DIRECTORY ${EMHASHMAP_LIB} DIRECTORY)
set(BSON_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of bson libraries" FORCE)
set(EMHASHMAP_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of emashmap libraries" FORCE)
+ add_custom_target(
+ libbson
+ DEPENDS ${BSON_LIBS_DIRECTORY}
+ DEPENDS ${EMHASHMAP_LIBS_DIRECTORY}
+ )
endif()
-if (HMIADAPTER STREQUAL "messagebroker")
- find_package(Boost 1.66.0 COMPONENTS system)
- set(BOOST_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost_src)
- set(BOOST_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib)
- SET_PROPERTY(GLOBAL PROPERTY GLOBAL_BOOST_LIBS ${BOOST_LIBS_DIRECTORY})
- set(BOOST_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include )
- if (NOT ${Boost_FOUND})
- message(STATUS "Did not find boost. Downloading and installing boost 1.66")
- set(BOOST_INSTALL_COMMAND ./b2 install)
- if (${3RD_PARTY_INSTALL_PREFIX} MATCHES "/usr/local")
- set(BOOST_INSTALL_COMMAND sudo ./b2 install)
- endif()
- include(ExternalProject)
- ExternalProject_Add(
- Boost
- URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
- DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
- SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
- CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system --prefix=${3RD_PARTY_INSTALL_PREFIX}
- BUILD_COMMAND ./b2
- INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --with-system --prefix=${3RD_PARTY_INSTALL_PREFIX}
- INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
- BUILD_IN_SOURCE true
- )
-
- set(BOOST_INCLUDE_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost)
- set(BOOST_LIB_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost/stage/lib/)
+find_package(Boost 1.66.0 COMPONENTS system thread date_time filesystem)
+set(BOOST_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost_src)
+set(BOOST_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib)
+SET_PROPERTY(GLOBAL PROPERTY GLOBAL_BOOST_LIBS ${BOOST_LIBS_DIRECTORY})
+set(BOOST_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include )
+if (NOT ${Boost_FOUND})
+ message(STATUS "Did not find boost. Downloading and installing boost 1.66")
+ set(BOOST_INSTALL_COMMAND ./b2 install)
+ if (${3RD_PARTY_INSTALL_PREFIX} MATCHES "/usr/local")
+ set(BOOST_INSTALL_COMMAND sudo ./b2 install)
endif()
+ include(ExternalProject)
+ ExternalProject_Add(
+ Boost
+ URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
+ DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
+ SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
+ CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time,filesystem --prefix=${3RD_PARTY_INSTALL_PREFIX}
+ BUILD_COMMAND ./b2
+ INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --with-system --with-thread --with-date_time --with-filesystem --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
+ INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
+ BUILD_IN_SOURCE true
+ )
+
+ set(BOOST_INCLUDE_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost)
+ set(BOOST_LIB_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost/stage/lib/)
+else()
+add_custom_target(Boost) # empty target, Boost is already installed
endif()
add_custom_target(install-3rd_party
@@ -243,4 +245,3 @@ add_custom_target(install-3rd_party
DEPENDS Boost
WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
)
-
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
index db058d27bd..654f9b0eb8 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
@@ -150,7 +150,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
if (lineNumber == -1 && fileName == NA && methodName == NA_METHOD) {
os.writeNull(p);
} else {
- char prolog[] = {
+ unsigned char prolog[] = {
0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E,
0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C,
0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69,
@@ -163,7 +163,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67,
0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B,
0x78, 0x70 };
- os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);
+ os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, reinterpret_cast<char *>(prolog), sizeof(prolog), p);
char* line = p.itoa(lineNumber);
//
// construct Java-like fullInfo (replace "::" with ".")
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
index 58b2004216..f9730792cf 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
@@ -256,7 +256,7 @@ void LoggingEvent::setProperty(const LogString& key, const LogString& value)
void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
- char classDesc[] = {
+ unsigned char classDesc[] = {
0x72, 0x00, 0x21,
0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63,
0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A,
@@ -312,7 +312,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
0x3B, 0x78, 0x70 };
os.writeProlog("org.apache.log4j.spi.LoggingEvent",
- 8, classDesc, sizeof(classDesc), p);
+ 8, reinterpret_cast<char *>(classDesc), sizeof(classDesc), p);
}
void LoggingEvent::write(helpers::ObjectOutputStream& os, Pool& p) const {
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
index 7cd696b842..29412c1a67 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#if defined(_MSC_VER)
#pragma warning ( disable: 4231 4251 4275 4786 )
@@ -36,8 +38,8 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
objectHandle(0x7E0000),
classDescriptions(new ClassDescriptionMap())
{
- char start[] = { 0xAC, 0xED, 0x00, 0x05 };
- ByteBuffer buf(start, sizeof(start));
+ unsigned char start[] = { 0xAC, 0xED, 0x00, 0x05 };
+ ByteBuffer buf(reinterpret_cast<char *>(start), sizeof(start));
os->write(buf, p);
}
@@ -81,7 +83,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
//
// TC_OBJECT and the classDesc for java.util.Hashtable
//
- char prolog[] = {
+ unsigned char prolog[] = {
0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
@@ -90,7 +92,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
0x6F, 0x6C, 0x64, 0x78, 0x70 };
- writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);
+ writeProlog("java.util.Hashtable", 1, reinterpret_cast<char *>(prolog), sizeof(prolog), p);
//
// loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7
char data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
index a500628180..903646048f 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
@@ -190,9 +192,9 @@ public:
DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml"));
LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3");
#if LOG4CXX_LOGCHAR_IS_UTF8
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 };
#else
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };
#endif
File file;
file.setPath(fname);
@@ -209,9 +211,9 @@ public:
DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml"));
LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4");
#if LOG4CXX_LOGCHAR_IS_UTF8
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 };
#else
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };
#endif
File file;
file.setPath(fname);
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index 514867624a..fe9a6af3f7 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -44,7 +44,6 @@ endif()
include_directories(
${COMPONENTS_DIR}/protocol_handler/include
${COMPONENTS_DIR}/application_manager/include
- ${COMPONENTS_DIR}/remote_control/include
${COMPONENTS_DIR}/formatters/include
${COMPONENTS_DIR}/transport_manager/include
${COMPONENTS_DIR}/security_manager/include
@@ -63,7 +62,6 @@ include_directories(
${POLICY_GLOBAL_INCLUDE_PATH}/
${COMPONENTS_DIR}/rpc_base/include
${COMPONENTS_DIR}/resumption/include
- ${COMPONENTS_DIR}/dbus/include
${CMAKE_BINARY_DIR}/src/components
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
@@ -72,9 +70,19 @@ include_directories(
${default_media_inc}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${BOOST_INCLUDE_DIR}
+ ${CMAKE_SOURCE_DIR}/src
)
-collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+# Create object library
+add_library("LowVoltageHandlerObjLibrary" OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/low_voltage_signals_handler.cc
+)
+
+set (SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/life_cycle_impl.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/signal_handlers.cc
+ $<TARGET_OBJECTS:LowVoltageHandlerObjLibrary>
+)
cmake_policy(PUSH)
# make link_directories() treat paths relative to the source dir
@@ -109,13 +117,8 @@ set(LIBRARIES
jsoncpp
ConfigProfile
Resumption
+ SystemTimeLibrary
)
-if(REMOTE_CONTROL)
- SET (LIBRARIES
- ${LIBRARIES}
- FunctionalModule
- )
-endif(REMOTE_CONTROL)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBRARIES pthread)
@@ -148,13 +151,14 @@ add_executable(${PROJECT} ${SOURCES})
if (HMIADAPTER STREQUAL "messagebroker")
add_dependencies(${PROJECT} Boost)
- list(APPEND LIBRARIES libboost_system.so)
+ GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+ list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
endif()
target_link_libraries(${PROJECT} ${LIBRARIES})
add_dependencies(${PROJECT} Policy)
-
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/build_config.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/audio.8bit.wav DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
@@ -212,7 +216,7 @@ endif ()
# Install rules
install(TARGETS ${PROJECT} DESTINATION bin)
install(
- FILES log4cxx.properties audio.8bit.wav test.txt smartDeviceLink.ini
+ FILES build_config.txt log4cxx.properties audio.8bit.wav test.txt smartDeviceLink.ini
hmi_capabilities.json sdl_preloaded_pt.json sample_policy_manager.py
${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem
DESTINATION bin
@@ -249,3 +253,6 @@ else()
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/appMain/audio.8bit.wav b/src/appMain/audio.8bit.wav
index cebf6cc0e2..7a3f970a21 100644
--- a/src/appMain/audio.8bit.wav
+++ b/src/appMain/audio.8bit.wav
Binary files differ
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index bef4d1e896..93292d1023 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -7,6 +7,7 @@
],
"displayCapabilities": {
"displayType": "GEN2_8_DMA",
+ "displayName": "GENERIC_DISPLAY",
"textFields": [{
"name": "mainField1",
"characterSet": "TYPE2SET",
@@ -178,7 +179,6 @@
],
"imageFields": [{
"name": "softButtonImage",
- "imageTypeSupported": [],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -186,7 +186,6 @@
},
{
"name": "choiceImage",
- "imageTypeSupported": [],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -194,7 +193,6 @@
},
{
"name": "choiceSecondaryImage",
- "imageTypeSupported": [],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -202,7 +200,6 @@
},
{
"name": "menuIcon",
- "imageTypeSupported": [],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -210,7 +207,6 @@
},
{
"name": "cmdIcon",
- "imageTypeSupported": [],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -218,7 +214,6 @@
},
{
"name": "appIcon",
- "imageTypeSupported": [],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -226,9 +221,13 @@
},
{
"name": "graphic",
- "imageTypeSupported": [
-
- ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "secondaryGraphic",
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -251,7 +250,6 @@
],
"graphicSupported": true,
"templatesAvailable": [
-
"DEFAULT", "MEDIA", "NON-MEDIA", "ONSCREEN_PRESETS", "NAV_FULLSCREEN_MAP", "NAV_KEYBOARD",
"GRAPHIC_WITH_TEXT", "TEXT_WITH_GRAPHIC", "TILES_ONLY", "TEXTBUTTONS_ONLY",
"GRAPHIC_WITH_TILES", "TILES_WITH_GRAPHIC", "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
@@ -440,6 +438,10 @@
"defrostZoneAvailable": true,
"desiredTemperatureAvailable": true,
"dualModeEnableAvailable": true,
+ "heatedMirrorsAvailable":true,
+ "heatedRearWindowAvailable":true,
+ "heatedSteeringWheelAvailable":true,
+ "heatedWindshieldAvailable":true,
"fanSpeedAvailable": true,
"moduleName": "primary_climate",
"ventilationMode": [
@@ -462,9 +464,341 @@
"rdsDataAvailable": true,
"signalChangeThresholdAvailable": true,
"signalStrengthAvailable": true,
+ "hdRadioEnableAvailable" : true,
+ "siriusxmRadioAvailable" : true,
+ "sisDataAvailable":true,
"stateAvailable": true
}
- ]
+ ],
+ "audioControlCapabilities": [
+ {
+ "moduleName": "audio",
+ "sourceAvailable": true,
+ "volumeAvailable": true,
+ "equalizerAvailable": true,
+ "keepContextAvailable" : true,
+ "equalizerMaxChannelId": 10
+ }
+ ],
+ "seatControlCapabilities": [
+ {
+ "moduleName": "driver_seat",
+ "heatingEnabledAvailable" : true,
+ "coolingEnabledAvailable": true,
+ "heatingLevelAvailable": true,
+ "coolingLevelAvailable": true,
+ "horizontalPositionAvailable": true,
+ "verticalPositionAvailable" : true,
+ "frontVerticalPositionAvailable": true,
+ "backVerticalPositionAvailable": true,
+ "backTiltAngleAvailable": true,
+ "headSupportHorizontalPositionAvailable": true,
+ "headSupportVerticalPositionAvailable" : true,
+ "massageEnabledAvailable": true,
+ "massageModeAvailable": true,
+ "massageCushionFirmnessAvailable": true,
+ "memoryAvailable": true
+ }
+ ],
+ "lightControlCapabilities": {
+ "moduleName": "light",
+ "supportedLights":[
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_BRAKE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_BRAKE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_REGISTRATION_PLATE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"HIGH_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"LOW_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FOG_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"RUNNING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"PARKING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"BRAKE_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_REVERSING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"SIDE_MARKER_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"LEFT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"RIGHT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"HAZARD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"AMBIENT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"OVERHEAD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"READING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"TRUNK_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_FRONT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_REAR_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_LEFT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_RIGHT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_CARGO_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_TRUCK_BED_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_TRAILER_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"LEFT_SPOT_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"RIGHT_SPOT_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"LEFT_PUDDLE_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"RIGHT_PUDDLE_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":false,
+ "name":"EXTERIOR_ALL_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ }
+ ]
+ },
+ "hmiSettingsControlCapabilities": {
+ "moduleName": "hmiSettings",
+ "distanceUnitAvailable": true,
+ "temperatureUnitAvailable": true,
+ "displayModeUnitAvailable": true
+ }
}
}
},
@@ -552,6 +886,12 @@
"upDownAvailable": true
},
{
+ "name":"PLAY_PAUSE",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
"name": "SEEKLEFT",
"shortPressAvailable": true,
"longPressAvailable": true,
diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle.cc
deleted file mode 100644
index fc8441f28c..0000000000
--- a/src/appMain/life_cycle.cc
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
-* Copyright (c) 2017, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "life_cycle.h"
-#include "utils/signals.h"
-#include "utils/make_shared.h"
-#include "config_profile/profile.h"
-#include "resumption/last_state_impl.h"
-
-#ifdef ENABLE_SECURITY
-#include "security_manager/security_manager_impl.h"
-#include "security_manager/crypto_manager_impl.h"
-#include "security_manager/crypto_manager_settings_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#endif // ENABLE_SECURITY
-
-#ifdef ENABLE_LOG
-#include "utils/log_message_loop_thread.h"
-#endif // ENABLE_LOG
-
-using threads::Thread;
-
-namespace main_namespace {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
-
-LifeCycle::LifeCycle(const profile::Profile& profile)
- : transport_manager_(NULL)
- , protocol_handler_(NULL)
- , connection_handler_(NULL)
- , app_manager_(NULL)
-#ifdef ENABLE_SECURITY
- , crypto_manager_(NULL)
- , security_manager_(NULL)
-#endif // ENABLE_SECURITY
- , hmi_handler_(NULL)
- , hmi_message_adapter_(NULL)
- , media_manager_(NULL)
- , last_state_(NULL)
-#ifdef TELEMETRY_MONITOR
- , telemetry_monitor_(NULL)
-#endif // TELEMETRY_MONITOR
-#ifdef DBUS_HMIADAPTER
- , dbus_adapter_(NULL)
- , dbus_adapter_thread_(NULL)
-#endif // DBUS_HMIADAPTER
-#ifdef MESSAGEBROKER_HMIADAPTER
- , mb_adapter_(NULL)
- , mb_adapter_thread_(NULL)
-#endif // MESSAGEBROKER_HMIADAPTER
- , profile_(profile) {
-}
-
-bool LifeCycle::StartComponents() {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(!last_state_);
- last_state_ = new resumption::LastStateImpl(profile_.app_storage_folder(),
- profile_.app_info_storage());
-
- DCHECK(!transport_manager_);
- transport_manager_ = new transport_manager::TransportManagerDefault(profile_);
-
- DCHECK(!connection_handler_);
- connection_handler_ = new connection_handler::ConnectionHandlerImpl(
- profile_, *transport_manager_);
-
- DCHECK(!protocol_handler_);
- protocol_handler_ =
- new protocol_handler::ProtocolHandlerImpl(profile_,
- *connection_handler_,
- *connection_handler_,
- *transport_manager_);
- DCHECK(protocol_handler_);
-
- DCHECK(!app_manager_);
- app_manager_ =
- new application_manager::ApplicationManagerImpl(profile_, profile_);
-
- DCHECK(!hmi_handler_);
- hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(profile_);
-
- hmi_handler_->set_message_observer(app_manager_);
- app_manager_->set_hmi_message_handler(hmi_handler_);
-
- media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
- app_manager_->set_connection_handler(connection_handler_);
- if (!app_manager_->Init(*last_state_, media_manager_)) {
- LOG4CXX_ERROR(logger_, "Application manager init failed.");
- return false;
- }
-
-#ifdef ENABLE_SECURITY
- security_manager_ = new security_manager::SecurityManagerImpl();
- crypto_manager_ = new security_manager::CryptoManagerImpl(
- utils::MakeShared<security_manager::CryptoManagerSettingsImpl>(
- profile_, app_manager_->GetPolicyHandler().RetrieveCertificate()));
- protocol_handler_->AddProtocolObserver(security_manager_);
- protocol_handler_->set_security_manager(security_manager_);
-
- security_manager_->set_session_observer(connection_handler_);
- security_manager_->set_protocol_handler(protocol_handler_);
- security_manager_->set_crypto_manager(crypto_manager_);
- security_manager_->AddListener(app_manager_);
-
- app_manager_->AddPolicyObserver(crypto_manager_);
- app_manager_->AddPolicyObserver(protocol_handler_);
- if (!crypto_manager_->Init()) {
- LOG4CXX_ERROR(logger_, "CryptoManager initialization fail.");
- return false;
- }
-#endif // ENABLE_SECURITY
-
- transport_manager_->AddEventListener(protocol_handler_);
- transport_manager_->AddEventListener(connection_handler_);
-
- protocol_handler_->AddProtocolObserver(media_manager_);
- protocol_handler_->AddProtocolObserver(app_manager_);
-
- media_manager_->SetProtocolHandler(protocol_handler_);
-
- connection_handler_->set_protocol_handler(protocol_handler_);
- connection_handler_->set_connection_handler_observer(app_manager_);
-
-// it is important to initialise TelemetryMonitor before TM to listen TM
-// Adapters
-#ifdef TELEMETRY_MONITOR
- telemetry_monitor_ = new telemetry_monitor::TelemetryMonitor(
- profile_.server_address(), profile_.time_testing_port());
- telemetry_monitor_->Start();
- telemetry_monitor_->Init(protocol_handler_, app_manager_, transport_manager_);
-#endif // TELEMETRY_MONITOR
- // It's important to initialise TM after setting up listener chain
- // [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
- app_manager_->set_protocol_handler(protocol_handler_);
-
- transport_manager_->Init(*last_state_);
- // start transport manager
- transport_manager_->Visibility(true);
-
- return true;
-}
-
-#ifdef MESSAGEBROKER_HMIADAPTER
-bool LifeCycle::InitMessageSystem() {
- mb_adapter_ = new hmi_message_handler::MessageBrokerAdapter(
- hmi_handler_, profile_.server_address(), profile_.server_port());
-
- if (!mb_adapter_->StartListener()) {
- return false;
- }
-
- hmi_handler_->AddHMIMessageAdapter(mb_adapter_);
- mb_adapter_thread_ = new std::thread(
- &hmi_message_handler::MessageBrokerAdapter::Run, mb_adapter_);
- return true;
-}
-#endif // MESSAGEBROKER_HMIADAPTER
-
-#ifdef DBUS_HMIADAPTER
-/**
- * Initialize DBus component
- * @return true if success otherwise false.
- */
-bool LifeCycle::InitMessageSystem() {
- dbus_adapter_ = new hmi_message_handler::DBusMessageAdapter(hmi_handler_);
-
- hmi_handler_->AddHMIMessageAdapter(dbus_adapter_);
- if (!dbus_adapter_->Init()) {
- LOG4CXX_FATAL(logger_, "Cannot init DBus service!");
- return false;
- }
-
- dbus_adapter_->SubscribeTo();
-
- LOG4CXX_INFO(logger_, "Start DBusMessageAdapter thread!");
- dbus_adapter_thread_ = new std::thread(
- &hmi_message_handler::DBusMessageAdapter::Run, dbus_adapter_);
-
- return true;
-}
-#endif // DBUS_HMIADAPTER
-
-namespace {
-void sig_handler(int sig) {
- switch (sig) {
- case SIGINT:
- LOG4CXX_DEBUG(logger_, "SIGINT signal has been caught");
- break;
- case SIGTERM:
- LOG4CXX_DEBUG(logger_, "SIGTERM signal has been caught");
- break;
- case SIGSEGV:
- LOG4CXX_DEBUG(logger_, "SIGSEGV signal has been caught");
- FLUSH_LOGGER();
- // exit need to prevent endless sending SIGSEGV
- // http://stackoverflow.com/questions/2663456/how-to-write-a-signal-handler-to-catch-sigsegv
- abort();
- default:
- LOG4CXX_DEBUG(logger_, "Unexpected signal has been caught");
- exit(EXIT_FAILURE);
- }
-}
-} // namespace
-
-void LifeCycle::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- // Register signal handlers and wait sys signals
- // from OS
- if (!utils::WaitTerminationSignals(&sig_handler)) {
- LOG4CXX_FATAL(logger_, "Fail to catch system signal!");
- }
-}
-
-void LifeCycle::StopComponents() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- hmi_handler_->set_message_observer(NULL);
-
- DCHECK_OR_RETURN_VOID(connection_handler_);
- connection_handler_->set_connection_handler_observer(NULL);
-
- DCHECK_OR_RETURN_VOID(protocol_handler_);
- protocol_handler_->RemoveProtocolObserver(app_manager_);
-
- DCHECK_OR_RETURN_VOID(app_manager_);
- app_manager_->Stop();
-
- LOG4CXX_INFO(logger_, "Stopping Protocol Handler");
- DCHECK_OR_RETURN_VOID(protocol_handler_);
- protocol_handler_->RemoveProtocolObserver(media_manager_);
-
-#ifdef ENABLE_SECURITY
- protocol_handler_->RemoveProtocolObserver(security_manager_);
- if (security_manager_) {
- security_manager_->RemoveListener(app_manager_);
- LOG4CXX_INFO(logger_, "Destroying Crypto Manager");
- delete crypto_manager_;
- crypto_manager_ = NULL;
- LOG4CXX_INFO(logger_, "Destroying Security Manager");
- delete security_manager_;
- security_manager_ = NULL;
- }
-#endif // ENABLE_SECURITY
- protocol_handler_->Stop();
-
- LOG4CXX_INFO(logger_, "Destroying Media Manager");
- DCHECK_OR_RETURN_VOID(media_manager_);
- media_manager_->SetProtocolHandler(NULL);
- delete media_manager_;
- media_manager_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Transport Manager.");
- DCHECK_OR_RETURN_VOID(transport_manager_);
- transport_manager_->Visibility(false);
- transport_manager_->Stop();
- delete transport_manager_;
- transport_manager_ = NULL;
-
- LOG4CXX_INFO(logger_, "Stopping Connection Handler.");
- DCHECK_OR_RETURN_VOID(connection_handler_);
- connection_handler_->Stop();
-
- LOG4CXX_INFO(logger_, "Destroying Protocol Handler");
- DCHECK(protocol_handler_);
- delete protocol_handler_;
- protocol_handler_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Connection Handler.");
- delete connection_handler_;
- connection_handler_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Last State");
- DCHECK(last_state_);
- delete last_state_;
- last_state_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Application Manager.");
- DCHECK(app_manager_);
- delete app_manager_;
- app_manager_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
-
-#ifdef DBUS_HMIADAPTER
- if (dbus_adapter_) {
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- hmi_handler_->RemoveHMIMessageAdapter(dbus_adapter_);
- dbus_adapter_->Shutdown();
- if (dbus_adapter_thread_ != NULL) {
- dbus_adapter_thread_->join();
- }
- delete dbus_adapter_;
- dbus_adapter_ = NULL;
- delete dbus_adapter_thread_;
- dbus_adapter_thread_ = NULL;
- }
-#endif // DBUS_HMIADAPTER
-
-#ifdef MESSAGEBROKER_HMIADAPTER
- if (mb_adapter_) {
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- hmi_handler_->RemoveHMIMessageAdapter(mb_adapter_);
- mb_adapter_->unregisterController();
- mb_adapter_->exitReceivingThread();
- if (mb_adapter_thread_ != NULL) {
- mb_adapter_thread_->join();
- }
- delete mb_adapter_;
- mb_adapter_ = NULL;
- delete mb_adapter_thread_;
- mb_adapter_thread_ = NULL;
- }
- LOG4CXX_INFO(logger_, "Destroying Message Broker");
-#endif // MESSAGEBROKER_HMIADAPTER
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- delete hmi_handler_;
- hmi_handler_ = NULL;
-
-#ifdef TELEMETRY_MONITOR
- // It's important to delete tester Obcervers after TM adapters destruction
- if (telemetry_monitor_) {
- telemetry_monitor_->Stop();
- delete telemetry_monitor_;
- telemetry_monitor_ = NULL;
- }
-#endif // TELEMETRY_MONITOR
-}
-
-} // namespace main_namespace
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index db18892cd3..ff8fa2cc40 100644
--- a/src/appMain/life_cycle.h
+++ b/src/appMain/life_cycle.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, Ford Motor Company
+* Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,84 +32,60 @@
#ifndef SRC_APPMAIN_LIFE_CYCLE_H_
#define SRC_APPMAIN_LIFE_CYCLE_H_
-#include <thread>
-#include "utils/macro.h"
-#include "unistd.h"
-#include "config_profile/profile.h"
-#include "hmi_message_handler/hmi_message_handler_impl.h"
-#ifdef DBUS_HMIADAPTER
-#include "hmi_message_handler/dbus_message_adapter.h"
-#endif // DBUS_HMIADAPTER
-#if (defined(MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI))
-#include "hmi_message_handler/messagebroker_adapter.h"
-#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
-#include "application_manager/application_manager_impl.h"
-#ifdef SDL_REMOTE_CONTROL
-#include "application_manager/core_service.h"
-#include "functional_module/plugin_manager.h"
-#endif // SDL_REMOTE_CONTROL
-#include "connection_handler/connection_handler_impl.h"
-#include "protocol_handler/protocol_handler_impl.h"
-#include "transport_manager/transport_manager.h"
-#include "transport_manager/transport_manager_default.h"
-#include "media_manager/media_manager_impl.h"
-#ifdef TELEMETRY_MONITOR
-#include "telemetry_monitor/telemetry_monitor.h"
-#endif
+namespace main_namespace {
-#ifdef ENABLE_SECURITY
-namespace security_manager {
-class CryptoManager;
-class SecurityManagerImpl;
-} // namespace security_manager
-#endif // ENABLE_SECURITY
+/**
+ * Class responsible for all system components creation,
+ * start, stop, suspend and restore
+ */
-namespace main_namespace {
class LifeCycle {
public:
- LifeCycle(const profile::Profile& profile);
- bool StartComponents();
+ virtual ~LifeCycle() {}
/**
- * Initialize MessageBroker component
- * @return true if success otherwise false.
- */
- bool InitMessageSystem();
+ * Creates and starts all system components
+ * @return true if all components started successfully
+ * otherwise false.
+ */
+ virtual bool StartComponents() = 0;
+
/**
- * \brief Main loop
- */
- void Run();
- void StopComponents();
+ * Initializes MessageBroker component
+ * @return true if success otherwise false.
+ */
+ virtual bool InitMessageSystem() = 0;
+
+ /**
+ * @brief Main loop
+ */
+ virtual void Run() = 0;
+
+ /**
+ * Stops all system components
+ */
+ virtual void StopComponents() = 0;
- private:
- transport_manager::TransportManagerImpl* transport_manager_;
- protocol_handler::ProtocolHandlerImpl* protocol_handler_;
- connection_handler::ConnectionHandlerImpl* connection_handler_;
- application_manager::ApplicationManagerImpl* app_manager_;
-#ifdef ENABLE_SECURITY
- security_manager::CryptoManager* crypto_manager_;
- security_manager::SecurityManager* security_manager_;
-#endif // ENABLE_SECURITY
- hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
- hmi_message_handler::HMIMessageAdapter* hmi_message_adapter_;
- media_manager::MediaManagerImpl* media_manager_;
- resumption::LastState* last_state_;
-#ifdef TELEMETRY_MONITOR
- telemetry_monitor::TelemetryMonitor* telemetry_monitor_;
-#endif // TELEMETRY_MONITOR
-#ifdef DBUS_HMIADAPTER
- hmi_message_handler::DBusMessageAdapter* dbus_adapter_;
- std::thread* dbus_adapter_thread_;
-#endif // DBUS_HMIADAPTER
+ /**
+ * Makes appropriate actions when Low Voltage signal received:
+ * Stops all SDL activities except of waiting of UNIX signals
+ * from HMI
+ */
+ virtual void LowVoltage() = 0;
-#ifdef MESSAGEBROKER_HMIADAPTER
- hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
- std::thread* mb_adapter_thread_;
-#endif // MESSAGEBROKER_HMIADAPTER
+ /**
+ * Makes appropriate actions when Wake Up signal received:
+ * Restores all SDL activities stopped due to LOW VOLTAGE
+ * from HMI
+ */
+ virtual void WakeUp() = 0;
- const profile::Profile& profile_;
- DISALLOW_COPY_AND_ASSIGN(LifeCycle);
+ /**
+ * Makes appropriate actions when Ignition Off signal received:
+ * Triggers all SDL components stop and deletion
+ */
+ virtual void IgnitionOff() = 0;
};
} // namespace main_namespace
diff --git a/src/appMain/life_cycle_impl.cc b/src/appMain/life_cycle_impl.cc
new file mode 100644
index 0000000000..b87191d937
--- /dev/null
+++ b/src/appMain/life_cycle_impl.cc
@@ -0,0 +1,352 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "appMain/life_cycle_impl.h"
+#include "utils/signals.h"
+#include "config_profile/profile.h"
+#include "application_manager/system_time/system_time_handler_impl.h"
+#include "resumption/last_state_impl.h"
+
+#ifdef ENABLE_SECURITY
+#include "security_manager/security_manager_impl.h"
+#include "security_manager/crypto_manager_impl.h"
+#include "security_manager/crypto_manager_settings_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#endif // ENABLE_SECURITY
+
+#ifdef ENABLE_LOG
+#include "utils/log_message_loop_thread.h"
+#endif // ENABLE_LOG
+
+#include "appMain/low_voltage_signals_handler.h"
+
+using threads::Thread;
+
+namespace main_namespace {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
+
+LifeCycleImpl::LifeCycleImpl(const profile::Profile& profile)
+ : transport_manager_(NULL)
+ , protocol_handler_(NULL)
+ , connection_handler_(NULL)
+ , app_manager_(NULL)
+#ifdef ENABLE_SECURITY
+ , crypto_manager_(NULL)
+ , security_manager_(NULL)
+#endif // ENABLE_SECURITY
+ , hmi_handler_(NULL)
+ , hmi_message_adapter_(NULL)
+ , media_manager_(NULL)
+ , last_state_(NULL)
+#ifdef TELEMETRY_MONITOR
+ , telemetry_monitor_(NULL)
+#endif // TELEMETRY_MONITOR
+#ifdef MESSAGEBROKER_HMIADAPTER
+ , mb_adapter_(NULL)
+ , mb_adapter_thread_(NULL)
+#endif // MESSAGEBROKER_HMIADAPTER
+ , profile_(profile) {
+}
+
+bool LifeCycleImpl::StartComponents() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(!last_state_);
+ last_state_ = new resumption::LastStateImpl(profile_.app_storage_folder(),
+ profile_.app_info_storage());
+
+ DCHECK(!transport_manager_);
+ transport_manager_ = new transport_manager::TransportManagerDefault(profile_);
+
+ DCHECK(!connection_handler_);
+ connection_handler_ = new connection_handler::ConnectionHandlerImpl(
+ profile_, *transport_manager_);
+
+ DCHECK(!protocol_handler_);
+ protocol_handler_ =
+ new protocol_handler::ProtocolHandlerImpl(profile_,
+ *connection_handler_,
+ *connection_handler_,
+ *transport_manager_);
+ DCHECK(protocol_handler_);
+
+ DCHECK(!app_manager_);
+ app_manager_ =
+ new application_manager::ApplicationManagerImpl(profile_, profile_);
+
+ DCHECK(!hmi_handler_);
+ hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(profile_);
+
+ hmi_handler_->set_message_observer(&(app_manager_->GetRPCHandler()));
+ app_manager_->set_hmi_message_handler(hmi_handler_);
+
+ media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
+ app_manager_->set_connection_handler(connection_handler_);
+ if (!app_manager_->Init(*last_state_, media_manager_)) {
+ LOG4CXX_ERROR(logger_, "Application manager init failed.");
+ return false;
+ }
+
+#ifdef ENABLE_SECURITY
+ auto system_time_handler =
+ std::unique_ptr<application_manager::SystemTimeHandlerImpl>(
+ new application_manager::SystemTimeHandlerImpl(*app_manager_));
+ security_manager_ =
+ new security_manager::SecurityManagerImpl(std::move(system_time_handler));
+ crypto_manager_ = new security_manager::CryptoManagerImpl(
+ std::make_shared<security_manager::CryptoManagerSettingsImpl>(
+ profile_, app_manager_->GetPolicyHandler().RetrieveCertificate()));
+ protocol_handler_->AddProtocolObserver(security_manager_);
+ protocol_handler_->set_security_manager(security_manager_);
+
+ security_manager_->set_session_observer(connection_handler_);
+ security_manager_->set_protocol_handler(protocol_handler_);
+ security_manager_->set_crypto_manager(crypto_manager_);
+ security_manager_->AddListener(app_manager_);
+
+ app_manager_->AddPolicyObserver(security_manager_);
+ app_manager_->AddPolicyObserver(protocol_handler_);
+ if (!crypto_manager_->Init()) {
+ LOG4CXX_ERROR(logger_, "CryptoManager initialization fail.");
+ return false;
+ }
+#endif // ENABLE_SECURITY
+
+ transport_manager_->AddEventListener(protocol_handler_);
+ transport_manager_->AddEventListener(connection_handler_);
+
+ protocol_handler_->AddProtocolObserver(media_manager_);
+ protocol_handler_->AddProtocolObserver(&(app_manager_->GetRPCHandler()));
+
+ media_manager_->SetProtocolHandler(protocol_handler_);
+
+ connection_handler_->set_protocol_handler(protocol_handler_);
+ connection_handler_->set_connection_handler_observer(app_manager_);
+
+// it is important to initialise TelemetryMonitor before TM to listen TM
+// Adapters
+#ifdef TELEMETRY_MONITOR
+ telemetry_monitor_ = new telemetry_monitor::TelemetryMonitor(
+ profile_.server_address(), profile_.time_testing_port());
+ telemetry_monitor_->Start();
+ telemetry_monitor_->Init(protocol_handler_, app_manager_, transport_manager_);
+#endif // TELEMETRY_MONITOR
+ // It's important to initialise TM after setting up listener chain
+ // [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
+ app_manager_->set_protocol_handler(protocol_handler_);
+ if (transport_manager::E_SUCCESS != transport_manager_->Init(*last_state_)) {
+ LOG4CXX_ERROR(logger_, "Transport manager init failed.");
+ return false;
+ }
+ // start transport manager
+ transport_manager_->Visibility(true);
+
+ LowVoltageSignalsOffset signals_offset{profile_.low_voltage_signal_offset(),
+ profile_.wake_up_signal_offset(),
+ profile_.ignition_off_signal_offset()};
+
+ low_voltage_signals_handler_.reset(
+ new LowVoltageSignalsHandler(*this, signals_offset));
+
+ return true;
+}
+
+void LifeCycleImpl::LowVoltage() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ transport_manager_->Visibility(false);
+ app_manager_->OnLowVoltage();
+}
+
+void LifeCycleImpl::IgnitionOff() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ kill(getpid(), SIGINT);
+}
+
+void LifeCycleImpl::WakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_manager_->OnWakeUp();
+ transport_manager_->Reinit();
+ transport_manager_->Visibility(true);
+}
+
+#ifdef MESSAGEBROKER_HMIADAPTER
+bool LifeCycleImpl::InitMessageSystem() {
+ mb_adapter_ = new hmi_message_handler::MessageBrokerAdapter(
+ hmi_handler_, profile_.server_address(), profile_.server_port());
+
+ if (!mb_adapter_->StartListener()) {
+ return false;
+ }
+
+ hmi_handler_->AddHMIMessageAdapter(mb_adapter_);
+ mb_adapter_thread_ = new std::thread(
+ &hmi_message_handler::MessageBrokerAdapter::Run, mb_adapter_);
+ return true;
+}
+#endif // MESSAGEBROKER_HMIADAPTER
+
+namespace {
+void sig_handler(int sig) {
+ switch (sig) {
+ case SIGINT:
+ LOG4CXX_DEBUG(logger_, "SIGINT signal has been caught");
+ break;
+ case SIGTERM:
+ LOG4CXX_DEBUG(logger_, "SIGTERM signal has been caught");
+ break;
+ case SIGSEGV:
+ LOG4CXX_DEBUG(logger_, "SIGSEGV signal has been caught");
+ FLUSH_LOGGER();
+ // exit need to prevent endless sending SIGSEGV
+ // http://stackoverflow.com/questions/2663456/how-to-write-a-signal-handler-to-catch-sigsegv
+ abort();
+ default:
+ LOG4CXX_DEBUG(logger_, "Unexpected signal has been caught");
+ exit(EXIT_FAILURE);
+ }
+}
+} // namespace
+
+void LifeCycleImpl::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // Register signal handlers and wait sys signals
+ // from OS
+ if (!utils::Signals::WaitTerminationSignals(&sig_handler)) {
+ LOG4CXX_FATAL(logger_, "Fail to catch system signal!");
+ }
+}
+
+void LifeCycleImpl::StopComponents() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ DCHECK_OR_RETURN_VOID(hmi_handler_);
+ hmi_handler_->set_message_observer(NULL);
+
+ DCHECK_OR_RETURN_VOID(connection_handler_);
+ connection_handler_->set_connection_handler_observer(NULL);
+
+ DCHECK_OR_RETURN_VOID(protocol_handler_);
+ protocol_handler_->RemoveProtocolObserver(&(app_manager_->GetRPCHandler()));
+
+ DCHECK_OR_RETURN_VOID(app_manager_);
+ app_manager_->Stop();
+
+ LOG4CXX_INFO(logger_, "Stopping Protocol Handler");
+ DCHECK_OR_RETURN_VOID(protocol_handler_);
+ protocol_handler_->RemoveProtocolObserver(media_manager_);
+
+#ifdef ENABLE_SECURITY
+ protocol_handler_->RemoveProtocolObserver(security_manager_);
+ if (security_manager_) {
+ security_manager_->RemoveListener(app_manager_);
+ LOG4CXX_INFO(logger_, "Destroying Crypto Manager");
+ delete crypto_manager_;
+ crypto_manager_ = NULL;
+ LOG4CXX_INFO(logger_, "Destroying Security Manager");
+ delete security_manager_;
+ security_manager_ = NULL;
+ }
+#endif // ENABLE_SECURITY
+ protocol_handler_->Stop();
+
+ LOG4CXX_INFO(logger_, "Destroying Media Manager");
+ DCHECK_OR_RETURN_VOID(media_manager_);
+ media_manager_->SetProtocolHandler(NULL);
+ delete media_manager_;
+ media_manager_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Transport Manager.");
+ DCHECK_OR_RETURN_VOID(transport_manager_);
+ transport_manager_->Visibility(false);
+ transport_manager_->Stop();
+ delete transport_manager_;
+ transport_manager_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Stopping Connection Handler.");
+ DCHECK_OR_RETURN_VOID(connection_handler_);
+ connection_handler_->Stop();
+
+ LOG4CXX_INFO(logger_, "Destroying Protocol Handler");
+ DCHECK(protocol_handler_);
+ delete protocol_handler_;
+ protocol_handler_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Connection Handler.");
+ delete connection_handler_;
+ connection_handler_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Last State");
+ DCHECK(last_state_);
+ delete last_state_;
+ last_state_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Application Manager.");
+ DCHECK(app_manager_);
+ delete app_manager_;
+ app_manager_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Low Voltage Signals Handler.");
+ low_voltage_signals_handler_.reset();
+
+ LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
+
+#ifdef MESSAGEBROKER_HMIADAPTER
+ if (mb_adapter_) {
+ DCHECK_OR_RETURN_VOID(hmi_handler_);
+ hmi_handler_->RemoveHMIMessageAdapter(mb_adapter_);
+ mb_adapter_->unregisterController();
+ mb_adapter_->exitReceivingThread();
+ if (mb_adapter_thread_ != NULL) {
+ mb_adapter_thread_->join();
+ }
+ delete mb_adapter_;
+ mb_adapter_ = NULL;
+ delete mb_adapter_thread_;
+ mb_adapter_thread_ = NULL;
+ }
+ LOG4CXX_INFO(logger_, "Destroying Message Broker");
+#endif // MESSAGEBROKER_HMIADAPTER
+ DCHECK_OR_RETURN_VOID(hmi_handler_);
+ delete hmi_handler_;
+ hmi_handler_ = NULL;
+
+#ifdef TELEMETRY_MONITOR
+ // It's important to delete tester Obcervers after TM adapters destruction
+ if (telemetry_monitor_) {
+ telemetry_monitor_->Stop();
+ delete telemetry_monitor_;
+ telemetry_monitor_ = NULL;
+ }
+#endif // TELEMETRY_MONITOR
+}
+
+} // namespace main_namespace
diff --git a/src/appMain/life_cycle_impl.h b/src/appMain/life_cycle_impl.h
new file mode 100644
index 0000000000..5dfc4641ab
--- /dev/null
+++ b/src/appMain/life_cycle_impl.h
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
+#define SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
+
+#include "appMain/life_cycle.h"
+
+#include <unistd.h>
+#include <thread>
+#include <memory>
+#include "utils/macro.h"
+
+#include "config_profile/profile.h"
+#include "hmi_message_handler/hmi_message_handler_impl.h"
+#if (defined(MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI))
+#include "hmi_message_handler/messagebroker_adapter.h"
+#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
+#include "application_manager/application_manager_impl.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "protocol_handler/protocol_handler_impl.h"
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_default.h"
+#include "media_manager/media_manager_impl.h"
+#ifdef TELEMETRY_MONITOR
+#include "telemetry_monitor/telemetry_monitor.h"
+#endif
+
+#ifdef ENABLE_SECURITY
+namespace security_manager {
+class CryptoManager;
+class SecurityManagerImpl;
+} // namespace security_manager
+#endif // ENABLE_SECURITY
+
+namespace utils {
+class SystemTimeHandler;
+} // namespace utils
+
+namespace main_namespace {
+
+class LowVoltageSignalsHandler;
+
+class LifeCycleImpl : public LifeCycle {
+ public:
+ explicit LifeCycleImpl(const profile::Profile& profile);
+
+ bool StartComponents() OVERRIDE;
+ bool InitMessageSystem() OVERRIDE;
+ void Run() OVERRIDE;
+ void StopComponents() OVERRIDE;
+ void LowVoltage() OVERRIDE;
+ void WakeUp() OVERRIDE;
+ void IgnitionOff() OVERRIDE;
+
+ private:
+ transport_manager::TransportManagerImpl* transport_manager_;
+ protocol_handler::ProtocolHandlerImpl* protocol_handler_;
+ connection_handler::ConnectionHandlerImpl* connection_handler_;
+ application_manager::ApplicationManagerImpl* app_manager_;
+ std::unique_ptr<LowVoltageSignalsHandler> low_voltage_signals_handler_;
+#ifdef ENABLE_SECURITY
+ security_manager::CryptoManager* crypto_manager_;
+ security_manager::SecurityManager* security_manager_;
+#endif // ENABLE_SECURITY
+ hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
+ hmi_message_handler::HMIMessageAdapter* hmi_message_adapter_;
+ media_manager::MediaManagerImpl* media_manager_;
+ resumption::LastState* last_state_;
+#ifdef TELEMETRY_MONITOR
+ telemetry_monitor::TelemetryMonitor* telemetry_monitor_;
+#endif // TELEMETRY_MONITOR
+
+#ifdef MESSAGEBROKER_HMIADAPTER
+ hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
+ std::thread* mb_adapter_thread_;
+#endif // MESSAGEBROKER_HMIADAPTER
+
+ const profile::Profile& profile_;
+ DISALLOW_COPY_AND_ASSIGN(LifeCycleImpl);
+};
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
diff --git a/src/appMain/low_voltage_signals_handler.cc b/src/appMain/low_voltage_signals_handler.cc
new file mode 100644
index 0000000000..936d91ba18
--- /dev/null
+++ b/src/appMain/low_voltage_signals_handler.cc
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "appMain/low_voltage_signals_handler.h"
+
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <iostream>
+#include "appMain/life_cycle.h"
+#include "utils/signals.h"
+#include "utils/logger.h"
+#include "utils/typed_enum_print.h"
+#include "config_profile/profile.h"
+
+namespace main_namespace {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "LowVoltageSignalsHandler")
+
+LowVoltageSignalsHandler::LowVoltageSignalsHandler(
+ LifeCycle& life_cycle, const LowVoltageSignalsOffset& offset_data)
+ : notifications_delegate_(new NotificationThreadDelegate(*this))
+ , signals_handler_thread_(threads::CreateThread(
+ "LV_SIGNALS_HANDLER_THREAD", notifications_delegate_.get()))
+ , life_cycle_(life_cycle)
+ , SIGLOWVOLTAGE_(offset_data.low_voltage_signal_offset + SIGRTMIN)
+ , SIGWAKEUP_(offset_data.wake_up_signal_offset + SIGRTMIN)
+ , SIGIGNOFF_(offset_data.ignition_off_signal_offset + SIGRTMIN)
+ , cpid_(-1) {
+ sigemptyset(&lv_mask_);
+ sigaddset(&lv_mask_, SIGLOWVOLTAGE_);
+ signals_handler_thread_->start();
+}
+
+sigset_t LowVoltageSignalsHandler::LowVoltageSignalsMask() const {
+ return lv_mask_;
+}
+
+int LowVoltageSignalsHandler::low_voltage_signo() const {
+ return SIGLOWVOLTAGE_;
+}
+
+int LowVoltageSignalsHandler::wake_up_signo() const {
+ return SIGWAKEUP_;
+}
+
+int LowVoltageSignalsHandler::ignition_off_signo() const {
+ return SIGIGNOFF_;
+}
+
+void LowVoltageSignalsHandler::Destroy() {
+ if (signals_handler_thread_) {
+ signals_handler_thread_->join();
+ }
+ notifications_delegate_.reset();
+ threads::DeleteThread(signals_handler_thread_);
+}
+
+LowVoltageSignalsHandler::~LowVoltageSignalsHandler() {
+ Destroy();
+}
+
+void LowVoltageSignalsHandler::HandleSignal(const int signo) {
+ if (SIGLOWVOLTAGE_ == signo) {
+ LOG4CXX_DEBUG(logger_, "Received LOW_VOLTAGE signal");
+
+ life_cycle_.LowVoltage();
+ cpid_ = utils::Signals::Fork();
+
+ if (0 > cpid_) {
+ LOG4CXX_FATAL(logger_,
+ "Error due fork() call. Error: " << strerror(errno));
+ utils::Signals::ExitProcess(EXIT_FAILURE);
+ }
+
+ if (0 != cpid_) {
+ // In Parent process
+ LOG4CXX_DEBUG(logger_, "Child PID: " << cpid_);
+ utils::Signals::WaitPid(cpid_, nullptr, 0);
+ LOG4CXX_DEBUG(logger_, "Child process: " << cpid_ << " is stopped");
+ life_cycle_.WakeUp();
+ } else {
+ // In Child process
+ sigset_t signal_set;
+ sigfillset(&signal_set);
+ pthread_sigmask(SIG_BLOCK, &signal_set, nullptr);
+ sigemptyset(&lv_mask_);
+ sigaddset(&lv_mask_, SIGWAKEUP_);
+ sigaddset(&lv_mask_, SIGIGNOFF_);
+ std::cout << "Stopping parent process: " << getppid() << std::endl;
+ utils::Signals::SendSignal(SIGSTOP, getppid());
+ std::cout << "SIGSTOP signal sent to " << getppid() << std::endl;
+ }
+ return;
+ }
+
+ if (SIGWAKEUP_ == signo) {
+ std::cout << "Received WAKE UP signal" << std::endl;
+ std::cout << "Waking Up parent process: " << getppid() << std::endl;
+ utils::Signals::SendSignal(SIGCONT, getppid());
+ std::cout << "Stopping child process: " << getpid() << std::endl;
+ utils::Signals::ExitProcess(0);
+ }
+
+ if (SIGIGNOFF_ == signo) {
+ std::cout << "Received IGNITION_OFF signal" << std::endl;
+ std::cout << "Stopping all SDL processes..." << std::endl;
+ utils::Signals::SendSignal(SIGKILL, getppid());
+ utils::Signals::ExitProcess(0);
+ }
+}
+
+void NotificationThreadDelegate::threadMain() {
+ while (true) {
+ int signo = 0;
+ const sigset_t lv_mask =
+ low_voltage_signals_handler_.LowVoltageSignalsMask();
+ const int err = sigwait(&lv_mask, &signo);
+ if (0 != err) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Sigwait() error! Signals set contains an invalid signal number!");
+ continue;
+ }
+ low_voltage_signals_handler_.HandleSignal(signo);
+ }
+}
+
+void NotificationThreadDelegate::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ThreadDelegate::exitThreadMain();
+}
+
+} // namespace main_namespace
diff --git a/src/appMain/low_voltage_signals_handler.h b/src/appMain/low_voltage_signals_handler.h
new file mode 100644
index 0000000000..8c139c6836
--- /dev/null
+++ b/src/appMain/low_voltage_signals_handler.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
+#define SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
+
+#include <unistd.h>
+#include <memory>
+#include "utils/threads/thread_delegate.h"
+#include "utils/threads/thread.h"
+
+namespace main_namespace {
+
+typedef struct LowVoltageSignalsOffset {
+ int low_voltage_signal_offset;
+ int wake_up_signal_offset;
+ int ignition_off_signal_offset;
+} LowVoltageSignalsOffset;
+
+class LifeCycle;
+class NotificationThreadDelegate;
+
+/**
+ * @brief Class which handles real-time POSIX signals
+ * dedicated for LOW VOLTAGE functionality
+ */
+class LowVoltageSignalsHandler {
+ public:
+ /**
+ * @brief Constructor
+ * @param life_cycle - life_cycle object to interact with other system
+ * components
+ * @param offset_data offset data needed to calculate correct SIGNAL numbers
+ * used for LOW VOLTAGE functionality (as offset from SIGRTMIN)
+ */
+ LowVoltageSignalsHandler(LifeCycle& life_cycle,
+ const LowVoltageSignalsOffset& offset_data);
+ /**
+ * @brief Handles RT signals related to Low Voltage functionality
+ * @param signal number to handle
+ */
+ void HandleSignal(const int signo);
+
+ /**
+ * @brief Returns signals mask required for handling
+ * LOW VOLTAGE functionality
+ */
+ sigset_t LowVoltageSignalsMask() const;
+
+ /**
+ * @brief Returns LOW VOLTAGE signal number
+ */
+ int low_voltage_signo() const;
+
+ /**
+ * @brief Returns WAKE UP signal number
+ */
+ int wake_up_signo() const;
+
+ /**
+ * @brief Returns IGNITION OFF signal number
+ */
+ int ignition_off_signo() const;
+
+ /**
+ * @brief Destructor
+ */
+ ~LowVoltageSignalsHandler();
+
+ private:
+ /**
+ * @brief Destroys all parts of Low Voltage signals handler
+ * Invoked from destructor
+ */
+ void Destroy();
+ std::unique_ptr<NotificationThreadDelegate> notifications_delegate_;
+ threads::Thread* signals_handler_thread_;
+ LifeCycle& life_cycle_;
+ int SIGLOWVOLTAGE_;
+ int SIGWAKEUP_;
+ int SIGIGNOFF_;
+ pid_t cpid_;
+ sigset_t lv_mask_;
+};
+
+class NotificationThreadDelegate : public threads::ThreadDelegate {
+ public:
+ NotificationThreadDelegate(
+ LowVoltageSignalsHandler& low_voltage_signals_handler)
+ : low_voltage_signals_handler_(low_voltage_signals_handler) {}
+
+ ~NotificationThreadDelegate() {}
+
+ void threadMain() OVERRIDE;
+ void exitThreadMain() OVERRIDE;
+
+ private:
+ LowVoltageSignalsHandler& low_voltage_signals_handler_;
+};
+
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
diff --git a/src/appMain/main.cc b/src/appMain/main.cc
index feb5b5830e..752cfb7bb9 100644
--- a/src/appMain/main.cc
+++ b/src/appMain/main.cc
@@ -35,6 +35,7 @@
#include <signal.h>
#include <cstdio>
#include <cstdlib>
+#include <memory>
#include <vector>
#include <string>
#include <iostream> // cpplint: Streams are highly discouraged.
@@ -45,7 +46,7 @@
#include "utils/log_message_loop_thread.h"
#include "utils/logger.h"
-#include "./life_cycle.h"
+#include "appMain/life_cycle_impl.h"
#include "signal_handlers.h"
#include "utils/signals.h"
@@ -94,8 +95,8 @@ bool InitHmi(std::string hmi_link) {
* \return EXIT_SUCCESS or EXIT_FAILURE
*/
int32_t main(int32_t argc, char** argv) {
- // Unsibscribe once for all threads
- if (!utils::UnsibscribeFromTermination()) {
+ // Unsubscribe once for all threads
+ if (!utils::Signals::UnsubscribeFromTermination()) {
// Can't use internal logger here
exit(EXIT_FAILURE);
}
@@ -103,13 +104,31 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Components initialization
profile::Profile profile_instance;
- main_namespace::LifeCycle life_cycle(profile_instance);
+ std::unique_ptr<main_namespace::LifeCycle> life_cycle(
+ new main_namespace::LifeCycleImpl(profile_instance));
+
if ((argc > 1) && (0 != argv)) {
profile_instance.set_config_file_name(argv[1]);
} else {
profile_instance.set_config_file_name("smartDeviceLink.ini");
}
+ // Reading profile offsets for real-time signals dedicated
+ // for Low Voltage functionality handling
+ main_namespace::LowVoltageSignalsOffset signals_offset{
+ profile_instance.low_voltage_signal_offset(),
+ profile_instance.wake_up_signal_offset(),
+ profile_instance.ignition_off_signal_offset()};
+
+ // Unsubscribe once for all threads
+ // except specific thread dedicated for
+ // Low Voltage signals handling
+ // Thread will be created later
+ if (!utils::Signals::UnsubscribeFromLowVoltageSignals(signals_offset)) {
+ // Can't use internal logger here
+ exit(EXIT_FAILURE);
+ }
+
// --------------------------------------------------------------------------
// Logger initialization
INIT_LOGGER("log4cxx.properties", profile_instance.logs_enabled());
@@ -134,9 +153,9 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Components initialization
- if (!life_cycle.StartComponents()) {
+ if (!life_cycle->StartComponents()) {
LOG4CXX_FATAL(logger_, "Failed to start components");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
DEINIT_LOGGER();
exit(EXIT_FAILURE);
}
@@ -145,9 +164,9 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Third-Party components initialization.
- if (!life_cycle.InitMessageSystem()) {
+ if (!life_cycle->InitMessageSystem()) {
LOG4CXX_FATAL(logger_, "Failed to init message system");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
DEINIT_LOGGER();
_exit(EXIT_FAILURE);
}
@@ -167,10 +186,10 @@ int32_t main(int32_t argc, char** argv) {
}
// --------------------------------------------------------------------------
- life_cycle.Run();
+ life_cycle->Run();
LOG4CXX_INFO(logger_, "Stop SDL due to caught signal");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
LOG4CXX_INFO(logger_, "Application has been stopped successfuly");
DEINIT_LOGGER();
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index e5c82418ee..d503ae34e5 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -28,6 +28,7 @@
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"VOICECOM": 20,
"COMMUNICATION": 6,
"NORMAL": 4,
@@ -140,7 +141,8 @@
"OnDriverDistraction": {
"hmi_levels": ["BACKGROUND",
"FULL",
- "LIMITED"]
+ "LIMITED",
+ "NONE"]
},
"OnEncodedSyncPData": {
"hmi_levels": ["BACKGROUND",
@@ -344,6 +346,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -356,6 +359,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -368,6 +372,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -380,6 +385,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -397,12 +403,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -414,12 +423,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -431,12 +443,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -447,12 +462,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -538,6 +556,12 @@
"FULL",
"LIMITED",
"NONE"]
+ },
+ "OnRCStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
}
}
},
@@ -696,7 +720,8 @@
"OnDriverDistraction": {
"hmi_levels": ["BACKGROUND",
"FULL",
- "LIMITED"]
+ "LIMITED",
+ "NONE"]
},
"OnEncodedSyncPData": {
"hmi_levels": ["BACKGROUND",
@@ -2344,7 +2369,9 @@
"steal_focus": false,
"priority": "NONE",
"default_hmi": "NONE",
- "groups": ["Base-4"]
+ "groups": ["Base-4"],
+ "RequestType": [],
+ "RequestSubType": []
},
"device": {
"keep_context": false,
@@ -2363,4 +2390,3 @@
}
}
}
-
diff --git a/src/appMain/signal_handlers.cc b/src/appMain/signal_handlers.cc
index c695467ae2..649f162ec6 100644
--- a/src/appMain/signal_handlers.cc
+++ b/src/appMain/signal_handlers.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "signal_handlers.h"
-#include "life_cycle.h"
+#include "appMain/signal_handlers.h"
+#include "appMain/life_cycle.h"
#include "utils/logger.h"
namespace main_namespace {
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index 7a7b901979..b0513c076f 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -27,7 +27,7 @@ VideoStreamingPort = 5050
AudioStreamingPort = 5080
[MAIN]
-; SDL source version
+; SDL source version
; represents as a git commit hash value
SDLVersion = {GIT_COMMIT}
; All logging event could be dropped by setting $LogsEnabled to false
@@ -69,7 +69,6 @@ AppTimeScaleMaxRequests = 1000
AppRequestsTimeScale = 10
; Allowed pending requests amount. If value is 0 check will be skipped
PendingRequestsAmount = 5000
-PendingRequestsAmount = 0
; Heart beat timeout used for protocol v3.
; Timeout must be specified in milliseconds. If timeout is 0 heart beat will be disabled.
HeartBeatTimeout = 7000
@@ -87,7 +86,9 @@ TimeTestingPort = 8090
ReadDIDRequest = 5, 1
; Limitation for a number of GetVehicleData requests (the 1st value) per (the 2nd value) seconds
GetVehicleDataRequest = 5, 1
-PluginFolder = plugins
+; Limitation for a number of GetInteriorVehicleDataRequest requests (the 1st value) per (the 2nd value) seconds
+GetInteriorVehicleDataRequest = 5, 1
+PluginFolder = ./
; The time used during switch transport procedure
AppTransportChangeTimer = 500
@@ -95,6 +96,12 @@ AppTransportChangeTimer = 500
; The time used as addition for AppTransportChangeTimer
AppTransportChangeTimerAddition = 0
+; Signal offsets used by SDL for setting up real time signals
+; used by LOW VOLTAGE functionality
+LowVoltageSignal = 1 ; Offset from SIGRTMIN
+WakeUpSignal = 2 ; Offset from SIGRTMIN
+IgnitionOffSignal = 3 ; Offset from SIGRTMIN
+
[MEDIA MANAGER]
; where 3 is a number of retries and 1000 is a timeout in milliseconds for request frequency
StartStreamRetry = 3, 1000
@@ -145,7 +152,7 @@ DeleteFileRequest = 5
ListFilesRequest = 5
[VR COMMANDS]
-; TODO(EZamakhov): delete with APPLINK-15220
+; TODO(EZamakhov): delete with APPLINK-15220
HelpCommand = Help
[AppInfo]
@@ -153,7 +160,8 @@ HelpCommand = Help
AppInfoStorage = app_info.dat
[Security Manager]
-Protocol = TLSv1.2
+;Protocol = TLSv1.2
+Protocol = DTLSv1.0
; Certificate and key path to pem file
CertificatePath = mycert.pem
KeyPath = mykey.pem
@@ -169,7 +177,7 @@ CACertificatePath = .
; Services which can not be started unprotected (could be id's from 0x01 to 0xFF)
;ForceProtectedService = 0x0A, 0x0B
ForceProtectedService = Non
-; Services which can not be started protected or delayed protected
+; Services which can not be started protected or delayed protected
;ForceUnprotectedService = 0x07
ForceUnprotectedService = Non
; The PTU will be triggered in case expiration date of certificate
@@ -184,10 +192,15 @@ PathToSnapshot = sdl_snapshot.json
AttemptsToOpenPolicyDB = 5
; Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMs = 500
+; Whether to use the fullAppID over the short-form appID in policy lookups
+UseFullAppID = true
[TransportManager]
; Listening port form incoming TCP mobile connection
TCPAdapterPort = 12345
+; Name of the network interface that Core will listen on for incoming TCP connection, e.g. eth0.
+; If the name is omitted, Core will listen on all network interfaces by binding to INADDR_ANY.
+TCPAdapterNetworkInterface =
[ProtocolHandler]
; SDL supported protocol version
@@ -232,16 +245,16 @@ AppIconsAmountToRemove = 1
[SDL5]
; Section for features added in protocol version 5
-; Control service packet with payload bigger than this value will be marked as a malformed,
+; Control service packet with payload bigger than this value will be marked as a malformed,
; if not specified, this value will default to MaxPayloadSize
;MaximumControlPayloadSize = 131072
-; RPC service packet with payload bigger than this value will be marked as a malformed,
+; RPC service packet with payload bigger than this value will be marked as a malformed,
; if not specified, this value will default to MaxPayloadSize
;MaximumRpcPayloadSize = 131072
-; Audio service packet with payload bigger than this value will be marked as a malformed,
+; Audio service packet with payload bigger than this value will be marked as a malformed,
; if not specified, this value will default to MaxPayloadSize
;MaximumAudioPayloadSize = 131072
-; Video service packet with payloadbigger than this value will be marked as a malformed,
+; Video service packet with payloadbigger than this value will be marked as a malformed,
; if not specified, this value will default to MaxPayloadSize
;MaximumVideoPayloadSize = 131072
@@ -262,6 +275,57 @@ AttemptsToOpenResumptionDB = 5
; Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMsResumptionDB = 500
+[TransportRequiredForResumption]
+; This section specifies transport types that are required to trigger resumption for each
+; AppHMIType. App has to be connected through at least one of the transports listed (either as
+; the primary transport or secondary transport) to trigger resumption. If the app is not
+; connected with any of the transports listed, its HMIlevel will be kept in NONE and the state
+; stays in NOT_AUDIBLE.
+; In case an app has multiple AppHMIType, requirements of all of the AppHMITypes are applied.
+;
+; Possible AppHMITypes: Default, Communication, Media, Messaging, Navigation, Information,
+; Social, BackgroundProcess, Testing, System, Projection, RemoteControl,
+; EmptyApp
+; Possible transport types: TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE,
+; IAP_USB, AOA_USB, IAP_BLUETOOTH, SPP_BLUETOOTH
+;
+; The default behavior is to always enable resumption. If an AppHMIType is not listed in this
+; section, resumption is enabled for an app with the AppHMIType.
+; On the other hand, if you want to disable resumption and always keep an app in NONE and
+; NOT_AUDIBLE state after registration, specify an empty value for the AppHMIType.
+;
+; NAVIGATION apps, PROJECTION apps and apps that declare themselves as media apps have a
+; special exception. When these apps do not have any of the transports listed here, they will
+; be still resumed into particular HMIlevel defined in LowBandwidthTransportResumptionLevel
+; section.
+
+;DefaultTransportRequiredForResumption =
+;CommunicationTransportRequiredForResumption =
+;MediaTransportRequiredForResumption =
+;MessagingTransportRequiredForResumption =
+;NavigationTransportRequiredForResumption =
+;InformationTransportRequiredForResumption =
+;SocialTransportRequiredForResumption =
+;BackgroundProcessTransportRequiredForResumption =
+;TestingTransportRequiredForResumption =
+;SystemTransportRequiredForResumption =
+;ProjectionTransportRequiredForResumption =
+;RemoteControlTransportRequiredForResumption =
+; "EmptyAppTransportRequiredForResumption" applies to apps that don't specify any AppHMIType
+;EmptyAppTransportRequiredForResumption =
+
+[LowBandwidthTransportResumptionLevel]
+; The HMI Level that an app will resume to if no high bandwidth connection is active.
+; High bandwidth connections for each app type are defined under TransportRequiredForResumption
+; section.
+; Possible values: NONE, BACKGROUND, LIMITED and FULL
+; this is for NAVIGATION apps
+;NavigationLowBandwidthResumptionLevel =
+; this is for PROJECTION apps
+;ProjectionLowBandwidthResumptionLevel =
+; this is for apps who declare themselves as media apps. (Don't be confused with AppHMIType=MEDIA.)
+;MediaLowBandwidthResumptionLevel =
+
[AppLaunch]
; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
AppLaunchWaitTime = 5000
@@ -275,5 +339,27 @@ RemoveBundleIDattempts = 3
MaxNumberOfiOSDevice = 10
; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
WaitTimeBetweenApps = 4000
-; App Launch on iOS devices SDL feature enabler/disabler
+; App Launch on iOS devices SDL feature enabler/disabler
EnableAppLaunchIOS = true
+
+[MultipleTransports]
+; Whether multiple-transports feature is enabled
+;MultipleTransportsEnabled = true
+
+; Comma-separated list of transports that can be used as Secondary Transport for each Primary Transport.
+; Possible values are: WiFi, USB and Bluetooth.
+; Core will not suggest Secondary Transport if the value is empty.
+;SecondaryTransportForBluetooth = WiFi
+;SecondaryTransportForUSB =
+;SecondaryTransportForWiFi =
+
+[ServicesMap]
+; A matrix to specify which service is allowed on which transports. The transports are listed
+; in preferred order. If a transport is not listed, then the service is not allowed
+; to run on the transport.
+; Only video and audio services are configurable.
+; If the entry of a service is completely omitted, the service will be allowed on all transports.
+; Possible values are: IAP_BLUETOOTH, IAP_USB, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_CARPLAY, SPP_BLUETOOTH, AOA_USB and TCP_WIFI.
+; 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
diff --git a/src/appMain/test/CMakeLists.txt b/src/appMain/test/CMakeLists.txt
new file mode 100644
index 0000000000..057e1e9869
--- /dev/null
+++ b/src/appMain/test/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/utils/test/include
+)
+
+set(testSources
+ $<TARGET_OBJECTS:LowVoltageHandlerObjLibrary>
+ ${CMAKE_SOURCE_DIR}/src/appMain/test/low_voltage_signals_handler_test.cc
+ ${COMPONENTS_DIR}/utils/test/mock_signals_posix.cc
+)
+
+set(LIBRARIES
+ gmock
+)
+
+create_test(low_voltage_signals_handler_test "${testSources}" "${LIBRARIES}")
diff --git a/src/appMain/test/low_voltage_signals_handler_test.cc b/src/appMain/test/low_voltage_signals_handler_test.cc
new file mode 100644
index 0000000000..14210df71d
--- /dev/null
+++ b/src/appMain/test/low_voltage_signals_handler_test.cc
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "appMain/low_voltage_signals_handler.h"
+
+#include <memory>
+#include "gtest/gtest.h"
+#include "appMain/test/mock_life_cycle.h"
+#include "utils/mock_signals_posix.h"
+#include "config_profile/profile.h"
+#include "utils/macro.h"
+
+namespace test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+
+class LowVoltageSignalsHandlerTest : public ::testing::Test {
+ protected:
+ LowVoltageSignalsHandlerTest()
+ : mock_life_cycle_(std::make_shared<main_namespace::MockLifeCycle>())
+ , mock_signals_posix_(*utils::MockSignalsPosix::signals_posix_mock()) {}
+
+ void SetUp() OVERRIDE {
+ profile_.set_config_file_name("smartDeviceLink.ini");
+ signals_offset_ = {profile_.low_voltage_signal_offset(),
+ profile_.wake_up_signal_offset(),
+ profile_.ignition_off_signal_offset()};
+
+ low_voltage_signals_handler_ =
+ std::unique_ptr<main_namespace::LowVoltageSignalsHandler>(
+ new main_namespace::LowVoltageSignalsHandler(
+ *mock_life_cycle_.get(), signals_offset_));
+ }
+
+ profile::Profile profile_;
+ main_namespace::LowVoltageSignalsOffset signals_offset_;
+ std::unique_ptr<main_namespace::LowVoltageSignalsHandler>
+ low_voltage_signals_handler_;
+ std::shared_ptr<main_namespace::MockLifeCycle> mock_life_cycle_;
+ utils::MockSignalsPosix& mock_signals_posix_;
+};
+
+TEST_F(
+ LowVoltageSignalsHandlerTest,
+ LowVoltageSignalReceived_CheckParentProcessBehavior_ExpectChildCreationAndtLowVoltageCall) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Set expectation after LOW VOLTAGE signal
+ EXPECT_CALL(*mock_life_cycle_, LowVoltage());
+ // Expect child process creation
+ const pid_t cpid = 111;
+ EXPECT_CALL(mock_signals_posix_, Fork()).WillOnce(Return(cpid));
+ // Expect parent process sleep
+ EXPECT_CALL(mock_signals_posix_, WaitPid(_, nullptr, 0));
+ // Expect parent process wakes up
+ EXPECT_CALL(*mock_life_cycle_, WakeUp());
+ const int low_voltage_signo =
+ low_voltage_signals_handler_->low_voltage_signo();
+ // Emulate LOW VOLTAGE signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(low_voltage_signo);
+}
+
+TEST_F(
+ LowVoltageSignalsHandlerTest,
+ LowVoltageSignalReceived_CheckChildProcessBehavior_ExpectChildSendsStopToParentProcess) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Set expectation after LOW VOLTAGE signal
+ EXPECT_CALL(*mock_life_cycle_, LowVoltage());
+ // Expect child process creation
+ const pid_t cpid = 0;
+ EXPECT_CALL(mock_signals_posix_, Fork()).WillOnce(Return(cpid));
+ // Expect SIGCONT signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGSTOP, _));
+ const int low_voltage_signo =
+ low_voltage_signals_handler_->low_voltage_signo();
+ // Emulate LOW VOLTAGE signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(low_voltage_signo);
+}
+
+TEST_F(LowVoltageSignalsHandlerTest,
+ WakeUpSignalReceived_ExpectParentProcessWakeUpAndChildProcessExit) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Expect SIGCONT signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGCONT, _));
+ // Expect child process exit
+ EXPECT_CALL(mock_signals_posix_, ExitProcess(0));
+ const int wake_up_signo = low_voltage_signals_handler_->wake_up_signo();
+ // Emulate WAKE UP signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(wake_up_signo);
+}
+
+TEST_F(LowVoltageSignalsHandlerTest,
+ IgnitionOffSignalReceived_ExpectAllProcessesStopped) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Expect SIGKILL signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGKILL, _));
+ // Expect child process exit
+ EXPECT_CALL(mock_signals_posix_, ExitProcess(0));
+ const int ign_off_signo = low_voltage_signals_handler_->ignition_off_signo();
+ // Emulate IGN OFF signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(ign_off_signo);
+}
+
+} // namespace test
diff --git a/src/appMain/test/mock_life_cycle.h b/src/appMain/test/mock_life_cycle.h
new file mode 100644
index 0000000000..fc24b26080
--- /dev/null
+++ b/src/appMain/test/mock_life_cycle.h
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
+#define SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
+
+#include "appMain/life_cycle.h"
+#include "gmock/gmock.h"
+
+namespace main_namespace {
+
+class MockLifeCycle : public LifeCycle {
+ public:
+ MOCK_METHOD0(StartComponents, bool());
+ MOCK_METHOD0(InitMessageSystem, bool());
+ MOCK_METHOD0(Run, void());
+ MOCK_METHOD0(StopComponents, void());
+ MOCK_METHOD0(LowVoltage, void());
+ MOCK_METHOD0(WakeUp, void());
+ MOCK_METHOD0(IgnitionOff, void());
+};
+
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
index e1071e826f..f262f201c2 100644
--- a/src/components/CMakeLists.txt
+++ b/src/components/CMakeLists.txt
@@ -86,18 +86,8 @@ add_subdirectory(./config_profile)
# --- Media Manager
add_subdirectory(./media_manager)
-if(REMOTE_CONTROL)
- # --- CAN Module
- add_subdirectory(./remote_control)
- # --- Functional module
- add_subdirectory(./functional_module)
-endif()
+
# --- Telemetry Monitor
if(TELEMETRY_MONITOR)
add_subdirectory(./telemetry_monitor)
endif()
-
-# --- DBus
-if(HMI_DBUS_API)
- add_subdirectory(./dbus)
-endif()
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index e9f2f8ec7b..67a7136a62 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -41,7 +41,6 @@ set (AM_MOCK_DIR ${AM_TEST_DIR}/mock)
include_directories (
include/
${COMPONENTS_DIR}
- ${COMPONENTS_DIR}/functional_module/include/
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/protocol_handler/include/
@@ -52,6 +51,7 @@ include_directories (
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/request_watchdog/include
${COMPONENTS_DIR}/resumption/include
+ ${COMPONENTS_DIR}/system_time/
${COMPONENTS_DIR}/rpc_base/include
${COMPONENTS_DIR}/interfaces
${POLICY_PATH}/include/
@@ -85,6 +85,9 @@ set (MESSAGE_HELPER_PATHS
)
collect_sources(MESSAGE_HELPER_SOURCES "${MESSAGE_HELPER_PATHS}")
+set (SYSTEM_TIME_SOURCES
+ ${AM_SOURCE_DIR}/src/system_time/system_time_handler_impl.cc
+)
set (POLICIES_SOURCE_DIR
${AM_SOURCE_DIR}/src/policies
@@ -112,283 +115,10 @@ set (EVENT_ENGINE_PATHS
)
collect_sources(EVENT_ENGINE_SOURCES "${EVENT_ENGINE_PATHS}")
-set (COMMANDS_SOURCE_DIR
- ${AM_SOURCE_DIR}/src/commands
-)
-collect_sources(POLICIES_SOURCES "${POLICIES_PATHS}")
-
-set(MOBILE_COMMANDS_EXCLUDE_PATHS
- ${COMMANDS_SOURCE_DIR}/hmi
-)
-
-set (MOBILE_COMMANDS_PATHS
- ${CMAKE_CURRENT_SOURCE_DIR}/include/application_manager/commands
- ${CMAKE_CURRENT_SOURCE_DIR}/include/application_manager/commands/mobile
- ${COMMANDS_SOURCE_DIR}
- ${COMMANDS_SOURCE_DIR}/mobile
-)
-collect_sources(MOBILE_COMMANDS_SOURCES "${MOBILE_COMMANDS_PATHS}" "${MOBILE_COMMANDS_EXCLUDE_PATHS}")
-set (HMI_COMMANDS_SOURCES
- ${COMMANDS_SOURCE_DIR}/hmi/request_to_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/response_from_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/request_from_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/response_to_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/notification_to_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/notification_from_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_all_apps_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_all_apps_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_app_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_app_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_sdl_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_sdl_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/activate_app_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/activate_app_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/get_system_info_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/get_system_info_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_list_of_permissions_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_list_of_permissions_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_user_friendly_message_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_user_friendly_message_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_status_update_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_status_update_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_status_update_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_activate_app_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_activate_app_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/mixing_audio_supported_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/mixing_audio_supported_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_app_list_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_app_list_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_update_device_list.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_device_list_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_device_list_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_audio_data_streaming_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_video_data_streaming_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_consent_needed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_persistence_complete_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_exit_all_applications_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_exit_application_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_navi_way_point_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_start_device_discovery.cc
- ${COMMANDS_SOURCE_DIR}/hmi/close_popup_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/close_popup_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_activated_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/button_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/button_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_add_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_add_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_delete_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_delete_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_change_registration_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_change_registration_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_supported_languages_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_supported_languages_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_language_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_language_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_change_registration_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_change_registration_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_language_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_language_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_supported_languages_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_supported_languages_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_stop_speaking_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_stop_speaking_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_speak_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_speak_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_set_global_properties_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_set_global_properties_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_perform_interaction_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_perform_interaction_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_submenu_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_submenu_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_submenu_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_submenu_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_supported_languages_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_supported_languages_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_language_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_language_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_change_registration_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_change_registration_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_alert_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_alert_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_slider_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_scrollable_message_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_scrollable_message_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_global_properties_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_global_properties_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_slider_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_audio_pass_thru_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_audio_pass_thru_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_end_audio_pass_thru_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_end_audio_pass_thru_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_interaction_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_interaction_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_app_icon_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_app_icon_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_media_clock_timer_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_media_clock_timer_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_read_did_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_read_did_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_dtcs_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_dtcs_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_diagnostic_message_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_diagnostic_message_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_type_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_type_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_alert_maneuver_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_alert_maneuver_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_update_turn_list_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_update_turn_list_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_show_constant_tbt_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_show_constant_tbt_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_send_location_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_send_location_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_subscribe_way_points_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_subscribe_way_points_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_unsubscribe_way_points_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_unsubscribe_way_points_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ready_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_system_context_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_device_chosen_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_allow_sdl_functionality_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_permission_consent_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_registered_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_permission_changed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_unregistered_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_driver_distraction_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ignition_cycle_over_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_system_info_changed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_file_removed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_tts_started_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_tts_stopped_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_started_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_stopped_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_command_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_command_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_navi_tbt_client_state_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_deactivated_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_tts_language_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_language_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_language_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_button_event_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_button_press_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_button_subscription_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_find_applications.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_keyboard_input_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_touch_event_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_reset_timeout_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_start_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_start_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_stop_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_stop_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_start_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_start_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_set_video_config_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_set_video_config_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_system_request_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_put_file_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_resume_audio_source_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_close_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_display_layout_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_display_layout_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_record_start_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/add_statistics_info_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_system_error_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/basic_communication_system_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/basic_communication_system_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/basic_communication_on_awake_sdl.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_policy_update.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_policy_update_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_received_policy_update.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_policy_update.cc
- ${COMMANDS_SOURCE_DIR}/hmi/get_urls.cc
- ${COMMANDS_SOURCE_DIR}/hmi/get_urls_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_device_state_changed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_tts_reset_timeout_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/dial_number_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/dial_number_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_event_changed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_icon_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/rc_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/rc_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_subscribe_vehicle_data_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_subscribe_vehicle_data_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_unsubscribe_vehicle_data_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_unsubscribe_vehicle_data_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vehicle_data_notification.cc
-)
-
-set (HMI_COMMANDS_SOURCES_JSON
-)
-
-set (HMI_COMMANDS_SOURCES_DBUS
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_gps_data_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_speed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_rpm_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_state_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_instant_fuel_consumption_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_external_temperature_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vin_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_prndl_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_tire_pressure_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_odometer_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_belt_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_body_information_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_device_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_driver_braking_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_wiper_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_head_lamp_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_engine_torque_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_acc_pedal_position_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_steering_wheel_angle_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_my_key_notification.cc
-)
-
-if (${HMI_JSON_API})
- set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON})
-endif (${HMI_JSON_API})
-
-set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_DBUS})
+collect_sources(POLICIES_SOURCES "${POLICIES_PATHS}")
set(EXCLUDE_PATHS
- ${COMMANDS_SOURCE_DIR}
${EVENT_ENGINE_SOURCE_DIR}
${MESSAGE_HELPER_SOURCE_DIR}
${POLICIES_SOURCE_DIR}
@@ -400,11 +130,6 @@ set(PATHS
)
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
-if (NOT REMOTE_CONTROL)
- list(REMOVE_ITEM SOURCES
- ${COMPONENTS_DIR}/application_manager/src/core_service.cc)
-endif()
-
set(LIBRARIES
HMI_API
MOBILE_API
@@ -420,12 +145,6 @@ set(LIBRARIES
emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
-if(REMOTE_CONTROL)
- SET (LIBRARIES
- ${LIBRARIES}
- FunctionalModule
- )
-endif(REMOTE_CONTROL)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBRARIES sqlite3)
@@ -441,31 +160,27 @@ target_link_libraries("AMEventEngine" ${LIBRARIES})
add_library("AMPolicyLibrary" ${POLICIES_MANAGER_SOURCES} )
target_link_libraries("AMPolicyLibrary" ${LIBRARIES} AMEventEngine)
-add_library("AMHMICommandsLibrary" ${HMI_COMMANDS_SOURCES})
-target_link_libraries("AMHMICommandsLibrary" ${LIBRARIES} AMEventEngine)
+add_library("SystemTimeLibrary" ${SYSTEM_TIME_SOURCES})
+target_link_libraries("SystemTimeLibrary" ${LIBRARIES} AMEventEngine)
add_library("MessageHelper" ${MESSAGE_HELPER_SOURCES})
target_link_libraries("MessageHelper" ${LIBRARIES})
-add_library("AMMobileCommandsLibrary" ${MOBILE_COMMANDS_SOURCES} )
-target_link_libraries("AMMobileCommandsLibrary" ${LIBRARIES} AMEventEngine)
-
add_library("ApplicationManager" ${SOURCES})
list(APPEND LIBRARIES
AMEventEngine
AMPolicyLibrary
- AMHMICommandsLibrary
- AMMobileCommandsLibrary
)
if(ENABLE_LOG)
list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-add_dependencies("ApplicationManager" libbson)
target_link_libraries("ApplicationManager" ${LIBRARIES})
if(BUILD_TESTS)
add_subdirectory(test)
endif()
+
+add_subdirectory(rpc_plugins)
diff --git a/src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox b/src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox
new file mode 100644
index 0000000000..447da51c55
--- /dev/null
+++ b/src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox
@@ -0,0 +1,76 @@
+/**
+\page application_manager Application Manager Detailed Design
+## Table of contents
+- \subpage application_manager_intoduction
+- \subpage application_manager_detail_design
+ + \ref application_manager_state_controller "2.1 State Controller"
+*/
+//-----------------------------------------------------------
+/**
+\page application_manager_intoduction 1 Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+*/
+//-----------------------------------------------------------
+/**
+\page application_manager_detail_design 2 Component Detail Design
+\anchor application_manager_state_controller
+### 2.1 State Controller
+While application activating by HMI service new HMI level assigned to its state.
+The only one application can exist in the same time with HMI level 'FULL'.
+Therefore states of other application with their HMI level should be changed respectively.
+State Controller handles properly states of other applications while one of them changing it state.
+
+The main logic of application HMI Level conflict resolver
+If applied HMI state is FULL:
+ - all NOT audio/video applications becomes BACKGROUND
+ - all audio/video applications with other application type (navi, vc, media, projection) in FULL becomes LIMMITED
+ - all applications with same application type becomes BACKGROUND
+
+If applied HMI state is LIMITED:
+ - all NOT audio/video applications saves their's HMI states
+ - all applications with other application types saves their's HMI states
+ - all applications with same application type becomes BACKGROUND
+
+If applied HMI state is BACKGROUND:
+ - all applications will save their's HMI states
+
+Resolve tables to figure out audio/video streaming state for FULL/LIMITED HMI level.
+For example if applied is 'NAVIGATION' and resolve application is 'PROJECTION' then to resolve becomes 'NOT_STREAMABLE'.
+According to video resolve table the only one application may be 'STREAMABLE' in the same time.
+
+Video app resolve table(S --> STREAMABLE, NS --> NOT_STREAMABLE)
+
+| resolve/applied | NAVIGATION | PROJECTION | Other |
+|-----------------|------------|------------|-------|
+|NAVIGATION | NS | NS | S |
+|PROJECTION | NS | NS | S |
+|Other | NS | NS | NS |
+
+Audio application resolve table(A --> AUDIBLE, NS --> NOT_AUDIBLE)
+
+| resolve/applied | NAVIGATION | COMMUNICATION | IsMediaApp | Other |
+|-----------------|------------|---------------|------------|-------|
+|NAVIGATION | NA | A | A | A |
+|COMMUNICATION | A | NA | A | A |
+|IsMediaApp | A | A | NA | A |
+|Other | NA | NA | NA | NA |
+
+\note
+For instance if applied application is 'PROJECTION' & isMedia=true with applied HMI level 'FULL' (STREAMABLE & AUDIBLE)
+and application to resolve is 'NAVIGATION' with HMI level 'FULL' or 'LIMITED' STREAMABLE & AUDIBLE)
+then to resolve becomes 'LIMITED' (NOT_STREAMABLE & AUDIBLE).
+So, the only one application may stream video in the same time. But audio application such types as 'NAVIGATION', 'COMMUNICATION'
+may stream audio/video in 'LIMITED' level with application of other types.
+
+\note
+If applied application is 'NAVIGATION' (STREAMABLE & AUDIBLE) and application to resolve is same type
+'NAVIGATION' (STREAMABLE & AUDIBLE) then to resolve application becomes BACKGROUND (NOT_STREAMABLE & NOT_AUDIBLE).
+
+\note
+When a 'NAVIGATION' application does not start audio streaming service, media application is AUDIBLE,
+When the 'NAVIGATION' application starts streaming service, media application is ATTENUATED if system supports mixing,
+otherwise media application is NOT_AUDIBLE
+*/ \ No newline at end of file
diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h
index 221601a307..e3231de347 100644
--- a/src/components/application_manager/include/application_manager/app_extension.h
+++ b/src/components/application_manager/include/application_manager/app_extension.h
@@ -33,7 +33,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
-#include "utils/shared_ptr.h"
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+class SmartObject;
+}
+}
namespace application_manager {
@@ -47,11 +51,28 @@ class AppExtension {
return kUid_;
}
+ /**
+ * @brief SaveResumptionData method called by SDL when it saves resumption
+ * data.
+ * @param resumption_data data reference to data, that will be appended by
+ * plugin
+ */
+ virtual void SaveResumptionData(
+ ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) = 0;
+
+ /**
+ * @brief ProcessResumption Method called by SDL during resumption.
+ * @param resumption_data list of resumption data
+ */
+ virtual void ProcessResumption(
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) = 0;
+
private:
const AppExtensionUID kUid_;
};
-typedef utils::SharedPtr<AppExtension> AppExtensionPtr;
+typedef std::shared_ptr<AppExtension> AppExtensionPtr;
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
index 9fc85db38c..a10963ad82 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
@@ -33,11 +33,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace application_manager {
class Application;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
} // namespace application_manager
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
index 1f508eebe5..61f3480f77 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
@@ -49,7 +49,7 @@ class ResumeCtrl;
namespace app_launch {
// TODO(AK) Use unique pointer
-typedef utils::SharedPtr<timer::Timer> TimerPtr;
+typedef std::shared_ptr<timer::Timer> TimerPtr;
class MultipleAppsLauncherFactoryImpl;
class AppLaunchCtrlImpl : public AppLaunchCtrl {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
index 0d52384018..73e9623b62 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
@@ -36,7 +36,7 @@
#include <stdint.h>
#include <vector>
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace app_launch {
@@ -59,7 +59,7 @@ struct ApplicationData {
bundle_id_ == app_data.bundle_id_ && device_mac_ == device_mac_;
}
};
-typedef utils::SharedPtr<ApplicationData> ApplicationDataPtr;
+typedef std::shared_ptr<ApplicationData> ApplicationDataPtr;
/**
* @brief class contains interfaces to AppLaunchDataDB and AppLaunchDataJson
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
index 92d6bbd9ef..ccbf4c7c01 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
@@ -153,7 +153,7 @@ class AppLaunchDataDB : public AppLaunchDataImpl {
/**
* @brief returns pointer to data base
*/
- std::auto_ptr<utils::dbms::SQLDatabase> db_;
+ std::unique_ptr<utils::dbms::SQLDatabase> db_;
/**
* @brief indicate initializing status of DB
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
index 111ff25ab2..a2b8630bcc 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
@@ -35,6 +35,8 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch_settings.h"
+#include "utils/macro.h"
+#include <memory>
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
index 61117e552b..a292b84fc0 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
@@ -38,6 +38,7 @@
#include "resumption/last_state.h"
#include "utils/lock.h"
#include "utils/macro.h"
+#include <memory>
namespace app_launch {
@@ -141,7 +142,7 @@ class AppLaunchDataJson : public AppLaunchDataImpl {
/**
* @brief lock to protected common data
*/
- mutable sync_primitives::Lock app_launch_json_lock_;
+ mutable sync_primitives::RecursiveLock app_launch_json_lock_;
/**
* @brief ponter to Last State object
diff --git a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
index 751e04bada..6285514be9 100644
--- a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
@@ -3,6 +3,7 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "connection_handler/connection_handler.h"
#include "utils/timer.h"
+#include <memory>
namespace app_launch {
class AppLaunchCtrlImpl;
@@ -69,7 +70,7 @@ class AppsLauncher {
connection_handler::ConnectionHandler& connection_handler_;
AppsLauncher& parent_;
};
- typedef utils::SharedPtr<Launcher> LauncherPtr;
+ typedef std::shared_ptr<Launcher> LauncherPtr;
typedef std::vector<LauncherPtr> AppLaunchers;
private:
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
index f1f29471e6..f156654215 100644
--- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -10,9 +10,39 @@
namespace app_launch {
class AppLaunchCtrlImpl;
-class DeviceAppsLauncherImpl;
+class DeviceAppsLauncher;
class AppsLauncher;
class AppLaunchSettings;
+class Launcher;
+class LauncherGenerator;
+
+// impl class must be defined for unique_ptr in DeviceAppsLauncher
+class DeviceAppsLauncherImpl {
+ public:
+ DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher);
+
+ bool LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch);
+
+ struct LauncherFinder {
+ LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+
+ bool operator()(const std::shared_ptr<Launcher>& launcher) const;
+
+ std::string device_mac_;
+ };
+
+ bool StopLaunchingAppsOnDevice(const std::string& device_mac);
+
+ private:
+ sync_primitives::Lock launchers_lock_;
+ std::vector<std::shared_ptr<Launcher> > free_launchers_;
+ std::vector<std::shared_ptr<Launcher> > works_launchers_;
+ DeviceAppsLauncher& interface_;
+};
+
/**
* @brief The MultipleAppsLauncher struct
* should manage launching applications and gaps between launching application
@@ -36,7 +66,7 @@ class DeviceAppsLauncher {
private:
application_manager::ApplicationManager& app_mngr_;
const AppLaunchSettings& settings_;
- std::auto_ptr<DeviceAppsLauncherImpl> impl_;
+ std::unique_ptr<DeviceAppsLauncherImpl> impl_;
friend class DeviceAppsLauncherImpl;
DISALLOW_COPY_AND_ASSIGN(DeviceAppsLauncher);
};
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 0c93f7447b..ad7570955e 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -38,7 +38,8 @@
#include <set>
#include <list>
#include <vector>
-#include "utils/shared_ptr.h"
+#include <memory>
+
#include "utils/data_accessor.h"
#include "interfaces/MOBILE_API.h"
#include "connection_handler/device.h"
@@ -46,9 +47,11 @@
#include "application_manager/message.h"
#include "application_manager/hmi_state.h"
#include "application_manager/application_state.h"
+#include "application_manager/help_prompt_manager.h"
#include "protocol_handler/protocol_handler.h"
#include "smart_objects/smart_object.h"
#include "utils/macro.h"
+#include "utils/semantic_version.h"
namespace application_manager {
@@ -113,6 +116,7 @@ class InitialApplicationData {
virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0;
virtual const mobile_api::Language::eType& language() const = 0;
virtual const mobile_api::Language::eType& ui_language() const = 0;
+ virtual const utils::SemanticVersion& msg_version() const = 0;
virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0;
virtual void set_vr_synonyms(
const smart_objects::SmartObject& vr_synonyms) = 0;
@@ -123,6 +127,7 @@ class InitialApplicationData {
virtual void set_language(const mobile_api::Language::eType& language) = 0;
virtual void set_ui_language(
const mobile_api::Language::eType& ui_language) = 0;
+ virtual void set_msg_version(const utils::SemanticVersion& version) = 0;
};
/*
@@ -160,11 +165,6 @@ typedef std::map<uint32_t, PerformChoice> PerformChoiceSetMap;
typedef std::set<uint32_t> SoftButtonID;
/**
- * @brief Defines set of vehicle info types
- */
-typedef std::set<mobile_apis::VehicleDataType::eType> VehicleInfoSubscriptions;
-
-/**
* @brief Defines set of buttons subscription
*/
typedef std::set<mobile_apis::ButtonName::eType> ButtonSubscriptions;
@@ -185,10 +185,12 @@ class DynamicApplicationData {
virtual const smart_objects::SmartObject* show_command() const = 0;
virtual const smart_objects::SmartObject* tbt_show_command() const = 0;
virtual DataAccessor<ButtonSubscriptions> SubscribedButtons() const = 0;
- virtual DataAccessor<VehicleInfoSubscriptions> SubscribedIVI() const = 0;
virtual const smart_objects::SmartObject* keyboard_props() const = 0;
virtual const smart_objects::SmartObject* menu_title() const = 0;
virtual const smart_objects::SmartObject* menu_icon() const = 0;
+ virtual const smart_objects::SmartObject* day_color_scheme() const = 0;
+ virtual const smart_objects::SmartObject* night_color_scheme() const = 0;
+ virtual const std::string& display_layout() const = 0;
virtual void load_global_properties(const smart_objects::SmartObject& so) = 0;
virtual void set_help_prompt(
@@ -220,6 +222,12 @@ class DynamicApplicationData {
virtual void set_video_stream_retry_number(
const uint32_t& video_stream_retry_number) = 0;
+ virtual void set_day_color_scheme(
+ const smart_objects::SmartObject& color_scheme) = 0;
+ virtual void set_night_color_scheme(
+ const smart_objects::SmartObject& color_scheme) = 0;
+
+ virtual void set_display_layout(const std::string& layout) = 0;
/**
* @brief Checks if application is media, voice communication or navigation
* @return true if application is media, voice communication or navigation,
@@ -448,6 +456,20 @@ class Application : public virtual InitialApplicationData,
virtual bool is_navi() const = 0;
virtual void set_is_navi(bool allow) = 0;
+ /**
+ * @brief Returns is_remote_control_supported_
+ * @return true if app supports remote control, else false
+ */
+ virtual bool is_remote_control_supported() const = 0;
+
+ /**
+ * @brief Sets remote control supported,
+ * which is used to determine app with remote control
+ * @param allow, if true - remote control is supported,
+ * else remote control is disable
+ */
+ virtual void set_remote_control_supported(const bool allow) = 0;
+
virtual void set_mobile_projection_enabled(bool option) = 0;
virtual bool mobile_projection_enabled() const = 0;
@@ -530,8 +552,16 @@ class Application : public virtual InitialApplicationData,
virtual const mobile_api::SystemContext::eType system_context() const = 0;
virtual const mobile_api::AudioStreamingState::eType audio_streaming_state()
const = 0;
+ virtual const mobile_api::VideoStreamingState::eType video_streaming_state()
+ const = 0;
virtual const std::string& app_icon_path() const = 0;
virtual connection_handler::DeviceHandle device() const = 0;
+ /**
+ * @brief Returns handle of the device on which secondary transport of this
+ * app is running
+ * @return handle of the device on which secondary transport is running
+ */
+ virtual connection_handler::DeviceHandle secondary_device() const = 0;
/**
* @brief sets true if application has sent TTS GlobalProperties
@@ -559,6 +589,18 @@ class Application : public virtual InitialApplicationData,
* @return flag tts_properties_in_full
*/
virtual bool tts_properties_in_full() = 0;
+ /**
+ * @brief sets true if application should keep it's HMI Level after an audio
+ * source change
+ * @param value of keep context
+ */
+ virtual void set_keep_context(bool keep_context) = 0;
+ /**
+ * @brief returns true if application should keep keep it's HMI Level after
+ * an audio source change, otherwise return false
+ * @return value of keep_context flag
+ */
+ virtual bool keep_context() = 0;
virtual void set_version(const Version& version) = 0;
virtual void set_name(const custom_str::CustomString& name) = 0;
virtual void set_is_media_application(bool is_media) = 0;
@@ -567,8 +609,13 @@ class Application : public virtual InitialApplicationData,
virtual void increment_list_files_in_none_count() = 0;
virtual bool set_app_icon_path(const std::string& file_name) = 0;
virtual void set_app_allowed(const bool allowed) = 0;
- DEPRECATED virtual void set_device(
- connection_handler::DeviceHandle device) = 0;
+ /**
+ * @brief Sets the handle of the device on which secondary transport of this
+ * app is running
+ * @param handle of the device on which secondary transport is running
+ */
+ virtual void set_secondary_device(
+ connection_handler::DeviceHandle secondary_device) = 0;
virtual uint32_t get_grammar_id() const = 0;
virtual void set_grammar_id(uint32_t value) = 0;
@@ -579,6 +626,24 @@ class Application : public virtual InitialApplicationData,
virtual void set_is_resuming(bool is_resuming) = 0;
virtual bool is_resuming() const = 0;
+ /**
+ * @brief Remembers the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ * @param level The HMI level which the app would resume into. Specify
+ * INVALID_ENUM to clear the state.
+ */
+ virtual void set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) = 0;
+ /**
+ * @brief Returns the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ *
+ * A value of INVALID_ENUM indicates that the app does not have deferred
+ * HMI level.
+ * @return HMI level which the app would resume into
+ */
+ virtual mobile_api::HMILevel::eType deferred_resumption_hmi_level() const = 0;
+
virtual bool AddFile(const AppFile& file) = 0;
virtual const AppFilesMap& getAppFiles() const = 0;
@@ -600,10 +665,6 @@ class Application : public virtual InitialApplicationData,
virtual bool UnsubscribeFromButton(
mobile_apis::ButtonName::eType btn_name) = 0;
- virtual bool SubscribeToIVI(uint32_t vehicle_info_type) = 0;
- virtual bool IsSubscribedToIVI(uint32_t vehicle_info_type) const = 0;
- virtual bool UnsubscribeFromIVI(uint32_t vehicle_info_type) = 0;
-
/**
* @brief ResetDataInNone reset data counters in NONE
*/
@@ -625,6 +686,12 @@ class Application : public virtual InitialApplicationData,
virtual UsageStatistics& usage_report() = 0;
/**
+ * @brief Access to HelpPromptManager interface
+ * @return object for Handling VR help
+ */
+ virtual HelpPromptManager& help_prompt_manager() = 0;
+
+ /**
* @brief SetInitialState sets initial HMI state for application on
* registration
* @param state Hmi state value
@@ -681,6 +748,12 @@ class Application : public virtual InitialApplicationData,
virtual const HmiStatePtr RegularHmiState() const = 0;
/**
+ * @brief Checks if app is allowed to change audio source
+ * @return True - if allowed, otherwise - False
+ */
+ virtual bool IsAllowedToChangeAudioSource() const = 0;
+
+ /**
* @brief PostponedHmiState returns postponed hmi state of application
* if it's present
*
@@ -721,14 +794,11 @@ class Application : public virtual InitialApplicationData,
virtual bool IsAudioApplication() const = 0;
/**
- * DEPRECATED
- * @brief GetDeviceId allows to obtain device id which posseses
- * by this application.
- * @return device the device id.
+ * @brief Check's if it is projection or navigation application
+ *
+ * @return true if application is projection or navigation
*/
- std::string GetDeviceId() const {
- return device_id_;
- }
+ virtual bool IsVideoApplication() const = 0;
/**
* @brief IsRegistered allows to distinguish if this
@@ -829,7 +899,6 @@ class Application : public virtual InitialApplicationData,
*/
virtual void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) = 0;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief set_system_context Set system context for application
* @param system_context Current context
@@ -872,16 +941,10 @@ class Application : public virtual InitialApplicationData,
virtual bool RemoveExtension(AppExtensionUID uid) = 0;
/**
- * @brief Removes all extensions
- */
- virtual void RemoveExtensions() = 0;
-
- /**
- * @brief Get list of subscriptions to vehicle info notifications
- * @return list of subscriptions to vehicle info notifications
+ * @brief Get list of available application extensions
+ * @return application extensions
*/
- virtual const VehicleInfoSubscriptions& SubscribesIVI() const = 0;
-#endif // SDL_REMOTE_CONTROL
+ virtual const std::list<AppExtensionPtr>& Extensions() const = 0;
protected:
mutable sync_primitives::Lock hmi_states_lock_;
@@ -895,8 +958,8 @@ class Application : public virtual InitialApplicationData,
bool is_greyed_out_;
};
-typedef utils::SharedPtr<Application> ApplicationSharedPtr;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<Application> ApplicationSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
typedef uint32_t ApplicationId;
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h
index 64b5f8780b..8f24f124f9 100644
--- a/src/components/application_manager/include/application_manager/application_data_impl.h
+++ b/src/components/application_manager/include/application_manager/application_data_impl.h
@@ -35,6 +35,7 @@
#include <string>
#include "utils/lock.h"
+#include "utils/semantic_version.h"
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "interfaces/MOBILE_API.h"
@@ -55,6 +56,8 @@ class InitialApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* ngn_media_screen_name() const;
const mobile_api::Language::eType& language() const;
const mobile_api::Language::eType& ui_language() const;
+ const utils::SemanticVersion& msg_version() const;
+
void set_app_types(const smart_objects::SmartObject& app_types);
void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms);
void set_mobile_app_id(const std::string& policy_app_id);
@@ -62,6 +65,7 @@ class InitialApplicationDataImpl : public virtual Application {
void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name);
void set_language(const mobile_api::Language::eType& language);
void set_ui_language(const mobile_api::Language::eType& ui_language);
+ void set_msg_version(const utils::SemanticVersion& version);
void set_perform_interaction_layout(
mobile_api::LayoutMode::eType layout) OVERRIDE;
@@ -76,6 +80,7 @@ class InitialApplicationDataImpl : public virtual Application {
mobile_api::Language::eType language_;
mobile_api::Language::eType ui_language_;
mobile_apis::LayoutMode::eType perform_interaction_layout_;
+ utils::SemanticVersion msg_version_;
private:
DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl);
@@ -95,6 +100,9 @@ class DynamicApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* keyboard_props() const;
const smart_objects::SmartObject* menu_title() const;
const smart_objects::SmartObject* menu_icon() const;
+ const smart_objects::SmartObject* day_color_scheme() const;
+ const smart_objects::SmartObject* night_color_scheme() const;
+ const std::string& display_layout() const;
void load_global_properties(const smart_objects::SmartObject& properties_so);
void set_help_prompt(const smart_objects::SmartObject& help_prompt);
@@ -109,6 +117,9 @@ class DynamicApplicationDataImpl : public virtual Application {
void set_keyboard_props(const smart_objects::SmartObject& keyboard_props);
void set_menu_title(const smart_objects::SmartObject& menu_title);
void set_menu_icon(const smart_objects::SmartObject& menu_icon);
+ void set_day_color_scheme(const smart_objects::SmartObject& color_scheme);
+ void set_night_color_scheme(const smart_objects::SmartObject& color_scheme);
+ void set_display_layout(const std::string& layout);
/*
* @brief Adds a command to the in application menu
*/
@@ -263,15 +274,19 @@ class DynamicApplicationDataImpl : public virtual Application {
smart_objects::SmartObject* menu_title_;
smart_objects::SmartObject* menu_icon_;
smart_objects::SmartObject* tbt_show_command_;
+ smart_objects::SmartObject* day_color_scheme_;
+ smart_objects::SmartObject* night_color_scheme_;
+ std::string display_layout_;
CommandsMap commands_;
- mutable sync_primitives::Lock commands_lock_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock> commands_lock_ptr_;
SubMenuMap sub_menu_;
- mutable sync_primitives::Lock sub_menu_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> sub_menu_lock_ptr_;
ChoiceSetMap choice_set_map_;
- mutable sync_primitives::Lock choice_set_map_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> choice_set_map_lock_ptr_;
PerformChoiceSetMap performinteraction_choice_set_map_;
- mutable sync_primitives::Lock performinteraction_choice_set_lock_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ performinteraction_choice_set_lock_ptr_;
uint32_t is_perform_interaction_active_;
bool is_reset_global_properties_active_;
int32_t perform_interaction_mode_;
@@ -280,26 +295,27 @@ class DynamicApplicationDataImpl : public virtual Application {
void SetGlobalProperties(
const smart_objects::SmartObject& param,
void (DynamicApplicationData::*callback)(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&));
+ const ns_smart_device_link::ns_smart_objects::SmartObject&));
DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl);
};
DataAccessor<CommandsMap> DynamicApplicationDataImpl::commands_map() const {
- return DataAccessor<CommandsMap>(commands_, commands_lock_);
+ return DataAccessor<CommandsMap>(commands_, commands_lock_ptr_);
}
DataAccessor<SubMenuMap> DynamicApplicationDataImpl::sub_menu_map() const {
- return DataAccessor<SubMenuMap>(sub_menu_, sub_menu_lock_);
+ return DataAccessor<SubMenuMap>(sub_menu_, sub_menu_lock_ptr_);
}
DataAccessor<ChoiceSetMap> DynamicApplicationDataImpl::choice_set_map() const {
- return DataAccessor<ChoiceSetMap>(choice_set_map_, choice_set_map_lock_);
+ return DataAccessor<ChoiceSetMap>(choice_set_map_, choice_set_map_lock_ptr_);
}
DataAccessor<PerformChoiceSetMap>
DynamicApplicationDataImpl::performinteraction_choice_set_map() const {
- return DataAccessor<PerformChoiceSetMap>(performinteraction_choice_set_map_,
- performinteraction_choice_set_lock_);
+ return DataAccessor<PerformChoiceSetMap>(
+ performinteraction_choice_set_map_,
+ performinteraction_choice_set_lock_ptr_);
}
uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const {
diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h
index 50e0a209cf..8dc3b2da20 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -41,18 +41,20 @@
#include <forward_list>
#include <stdint.h>
-#include "utils/date_time.h"
+#include "application_manager/application.h"
#include "application_manager/application_data_impl.h"
#include "application_manager/usage_statistics.h"
+#include "application_manager/help_prompt_manager_impl.h"
#include "application_manager/hmi_state.h"
#include "protocol_handler/protocol_handler.h"
#include "connection_handler/device.h"
#include "utils/lock.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/custom_string.h"
#include "utils/timer.h"
#include "utils/macro.h"
+#include "utils/date_time.h"
namespace usage_statistics {
@@ -89,15 +91,7 @@ class ApplicationImpl : public virtual Application,
const std::string& mac_address,
const connection_handler::DeviceHandle device_id,
const custom_str::CustomString& app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
- ApplicationManager& application_manager);
-
- DEPRECATED ApplicationImpl(
- uint32_t application_id,
- const std::string& policy_app_id,
- const std::string& mac_address,
- const custom_str::CustomString& app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager);
~ApplicationImpl();
@@ -121,6 +115,10 @@ class ApplicationImpl : public virtual Application,
}
void set_is_navi(bool allow);
+ virtual bool is_remote_control_supported() const;
+
+ void set_remote_control_supported(const bool allow);
+
void set_mobile_projection_enabled(bool option);
bool mobile_projection_enabled() const;
@@ -167,8 +165,11 @@ class ApplicationImpl : public virtual Application,
const mobile_api::SystemContext::eType system_context() const;
inline const mobile_apis::AudioStreamingState::eType audio_streaming_state()
const;
+ inline const mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const;
const std::string& app_icon_path() const;
connection_handler::DeviceHandle device() const;
+ connection_handler::DeviceHandle secondary_device() const;
const std::string& mac_address() const OVERRIDE;
const std::string& bundle_id() const OVERRIDE;
void set_bundle_id(const std::string& bundle_id) OVERRIDE;
@@ -176,6 +177,8 @@ class ApplicationImpl : public virtual Application,
bool tts_properties_in_none();
void set_tts_properties_in_full(bool active);
bool tts_properties_in_full();
+ void set_keep_context(bool keep_context);
+ bool keep_context();
void set_version(const Version& ver);
void set_name(const custom_str::CustomString& name);
void set_is_media_application(bool is_media);
@@ -185,6 +188,7 @@ class ApplicationImpl : public virtual Application,
bool set_app_icon_path(const std::string& path);
void set_app_allowed(const bool allowed);
void set_device(connection_handler::DeviceHandle device);
+ void set_secondary_device(connection_handler::DeviceHandle secondary_device);
virtual uint32_t get_grammar_id() const;
virtual void set_grammar_id(uint32_t value);
bool is_audio() const OVERRIDE;
@@ -196,6 +200,24 @@ class ApplicationImpl : public virtual Application,
virtual void set_is_resuming(bool is_resuming);
virtual bool is_resuming() const;
+ /**
+ * @brief Remembers the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ * @param level The HMI level which the app would resume into. Specify
+ * INVALID_ENUM to clear the state.
+ */
+ void set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) OVERRIDE;
+ /**
+ * @brief Returns the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ *
+ * A value of INVALID_ENUM indicates that the app does not have deferred
+ * HMI level.
+ * @return HMI level which the app would resume into
+ */
+ mobile_api::HMILevel::eType deferred_resumption_hmi_level() const OVERRIDE;
+
bool AddFile(const AppFile& file);
bool UpdateFile(const AppFile& file);
bool DeleteFile(const std::string& file_name);
@@ -207,10 +229,6 @@ class ApplicationImpl : public virtual Application,
bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name);
bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name);
- bool SubscribeToIVI(uint32_t vehicle_info_type) OVERRIDE;
- bool IsSubscribedToIVI(uint32_t vehicle_info_type) const OVERRIDE;
- bool UnsubscribeFromIVI(uint32_t vehicle_info_type) OVERRIDE;
- DataAccessor<VehicleInfoSubscriptions> SubscribedIVI() const OVERRIDE;
inline bool IsRegistered() const OVERRIDE;
/**
@@ -245,6 +263,12 @@ class ApplicationImpl : public virtual Application,
UsageStatistics& usage_report();
+ /**
+ * @brief Access to HelpPromptManager interface
+ * @return object for Handling VR help
+ */
+ HelpPromptManager& help_prompt_manager() OVERRIDE;
+
bool AreCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
TLimitSource source);
virtual void SubscribeToSoftButtons(int32_t cmd_id,
@@ -263,7 +287,14 @@ class ApplicationImpl : public virtual Application,
*
* @return true if application is media, voice communication or navigation
*/
- virtual bool IsAudioApplication() const;
+ bool IsAudioApplication() const OVERRIDE;
+
+ /**
+ * @brief Checks whether the application is navigation or projection
+ *
+ * @return true if application is navigation or projection
+ */
+ bool IsVideoApplication() const OVERRIDE;
/**
* @brief SetInitialState sets initial HMI state for application on
@@ -316,6 +347,12 @@ class ApplicationImpl : public virtual Application,
virtual const HmiStatePtr CurrentHmiState() const;
/**
+ * @brief Checks if app is allowed to change audio source
+ * @return True - if allowed, otherwise - False
+ */
+ virtual bool IsAllowedToChangeAudioSource() const;
+
+ /**
* @brief RegularHmiState of application without active events VR, TTS etc ...
* @return HmiState of application
*/
@@ -349,7 +386,6 @@ class ApplicationImpl : public virtual Application,
*/
uint32_t GetAvailableDiskSpace() OVERRIDE;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Sets current system context
* @param system_context new system context
@@ -368,20 +404,6 @@ class ApplicationImpl : public virtual Application,
*/
void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) OVERRIDE;
- /**
- * @brief Get list of subscriptions to vehicle info notifications
- * @return list of subscriptions to vehicle info notifications
- */
- const VehicleInfoSubscriptions& SubscribesIVI() const OVERRIDE;
-
- /**
- * @brief Return pointer to extension by uid
- * @param uid uid of extension
- * @return Pointer to extension, if extension was initialized, otherwise NULL
- */
- AppExtensionPtr QueryInterface(AppExtensionUID uid) OVERRIDE;
-#endif
-
void PushMobileMessage(
smart_objects::SmartObjectSPtr mobile_message) OVERRIDE;
@@ -416,7 +438,8 @@ class ApplicationImpl : public virtual Application,
*/
void OnAudioStreamSuspend();
-#ifdef SDL_REMOTE_CONTROL
+ AppExtensionPtr QueryInterface(AppExtensionUID uid) OVERRIDE;
+
/**
* @brief Add extension to application
* @param extension pointer to extension
@@ -431,11 +454,7 @@ class ApplicationImpl : public virtual Application,
*/
bool RemoveExtension(AppExtensionUID uid) OVERRIDE;
- /**
- * @brief Removes all extensions
- */
- void RemoveExtensions() OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
+ const std::list<AppExtensionPtr>& Extensions() const OVERRIDE;
std::string hash_val_;
uint32_t grammar_id_;
@@ -447,6 +466,7 @@ class ApplicationImpl : public virtual Application,
smart_objects::SmartObject* active_message_;
bool is_media_;
bool is_navi_;
+ bool is_remote_control_supported_;
bool mobile_projection_enabled_;
bool video_streaming_approved_;
@@ -457,11 +477,13 @@ class ApplicationImpl : public virtual Application,
bool audio_streaming_suspended_;
sync_primitives::Lock video_streaming_suspended_lock_;
sync_primitives::Lock audio_streaming_suspended_lock_;
+ sync_primitives::Lock streaming_stop_lock_;
bool is_app_allowed_;
bool has_been_activated_;
bool tts_properties_in_none_;
bool tts_properties_in_full_;
+ bool keep_context_;
bool is_foreground_;
bool is_application_data_changed_;
uint32_t put_file_in_none_count_;
@@ -470,14 +492,16 @@ class ApplicationImpl : public virtual Application,
std::string app_icon_path_;
std::string mac_address_;
connection_handler::DeviceHandle device_id_;
+ connection_handler::DeviceHandle secondary_device_id_;
std::string bundle_id_;
AppFilesMap app_files_;
std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
- VehicleInfoSubscriptions subscribed_vehicle_info_;
UsageStatistics usage_report_;
+ HelpPromptManagerImpl help_prompt_manager_impl_;
protocol_handler::MajorProtocolVersion protocol_version_;
bool is_voice_communication_application_;
- sync_primitives::atomic_bool is_resuming_;
+ std::atomic_bool is_resuming_;
+ mobile_api::HMILevel::eType deferred_resumption_hmi_level_;
bool is_hash_changed_during_suspend_;
uint32_t video_stream_retry_number_;
@@ -487,14 +511,12 @@ class ApplicationImpl : public virtual Application,
Timer video_stream_suspend_timer_;
Timer audio_stream_suspend_timer_;
-#ifdef SDL_REMOTE_CONTROL
std::list<AppExtensionPtr> extensions_;
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Defines number per time in seconds limits
*/
- typedef std::pair<TimevalStruct, uint32_t> TimeToNumberLimit;
+ typedef std::pair<date_time::TimeDuration, uint32_t> TimeToNumberLimit;
/**
* @brief Defines specific command number per time in seconds limits
@@ -510,8 +532,8 @@ class ApplicationImpl : public virtual Application,
CommandSoftButtonID cmd_softbuttonid_;
// Lock for command soft button id
sync_primitives::Lock cmd_softbuttonid_lock_;
- mutable sync_primitives::Lock vi_lock_;
- sync_primitives::Lock button_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> vi_lock_ptr_;
+ mutable std::shared_ptr<sync_primitives::Lock> button_lock_ptr_;
std::string folder_name_;
ApplicationManager& application_manager_;
@@ -542,6 +564,14 @@ ApplicationImpl::audio_streaming_state() const {
: AudioStreamingState::INVALID_ENUM;
}
+const mobile_api::VideoStreamingState::eType
+ApplicationImpl::video_streaming_state() const {
+ using namespace mobile_apis;
+ const HmiStatePtr hmi_state = CurrentHmiState();
+ return hmi_state ? hmi_state->video_streaming_state()
+ : VideoStreamingState::INVALID_ENUM;
+}
+
bool ApplicationImpl::app_allowed() const {
return is_app_allowed_;
}
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 286ad87018..6c111dbbb3 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
@@ -41,7 +41,6 @@
#include <algorithm>
#include <memory>
-#include "application_manager/hmi_command_factory.h"
#include "application_manager/application_manager.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/message.h"
@@ -54,6 +53,9 @@
#include "application_manager/event_engine/event_dispatcher_impl.h"
#include "application_manager/hmi_interfaces_impl.h"
#include "application_manager/command_holder.h"
+#include "application_manager/command_factory.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/rpc_handler.h"
#include "protocol_handler/protocol_observer.h"
#include "protocol_handler/protocol_handler.h"
@@ -84,7 +86,7 @@
#endif // TELEMETRY_MONITOR
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "utils/message_queue.h"
#include "utils/prioritized_queue.h"
#include "utils/threads/thread.h"
@@ -115,97 +117,17 @@ struct CommandParametersPermissions;
typedef std::map<std::string, hmi_apis::Common_TransportType::eType>
DeviceTypes;
-namespace impl {
-using namespace threads;
-
-/*
- * These dummy classes are here to locally impose strong typing on different
- * kinds of messages
- * Currently there is no type difference between incoming and outgoing messages
- * And due to ApplicationManagerImpl works as message router it has to
- * distinguish
- * messages passed from it's different connection points
- * TODO(ik): replace these with globally defined message types
- * when we have them.
- */
-struct MessageFromMobile : public utils::SharedPtr<Message> {
- MessageFromMobile() {}
- explicit MessageFromMobile(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-struct MessageToMobile : public utils::SharedPtr<Message> {
- MessageToMobile() : is_final(false) {}
- explicit MessageToMobile(const utils::SharedPtr<Message>& message,
- bool final_message)
- : utils::SharedPtr<Message>(message), is_final(final_message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
- // Signals if connection to mobile must be closed after sending this message
- bool is_final;
-};
-
-struct MessageFromHmi : public utils::SharedPtr<Message> {
- MessageFromHmi() {}
- explicit MessageFromHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-struct MessageToHmi : public utils::SharedPtr<Message> {
- MessageToHmi() {}
- explicit MessageToHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-// Short type names for prioritized message queues
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> >
- FromMobileQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> >
- ToMobileQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> >
- FromHmiQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> >
- ToHmiQueue;
-
-// AudioPassThru
-typedef struct {
- std::vector<uint8_t> binary_data;
- int32_t session_key;
-} AudioData;
-typedef std::queue<AudioData> RawAudioDataQueue;
-typedef threads::MessageLoopThread<RawAudioDataQueue> AudioPassThruQueue;
-}
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
-typedef utils::SharedPtr<timer::Timer> TimerSPtr;
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
class ApplicationManagerImpl
: public ApplicationManager,
- public hmi_message_handler::HMIMessageObserver,
- public protocol_handler::ProtocolObserver,
public connection_handler::ConnectionHandlerObserver,
- public policy::PolicyHandlerObserver,
+ public policy::PolicyHandlerObserver
#ifdef ENABLE_SECURITY
- public security_manager::SecurityManagerListener,
+ ,
+ public security_manager::SecurityManagerListener
#endif // ENABLE_SECURITY
- public impl::FromMobileQueue::Handler,
- public impl::ToMobileQueue::Handler,
- public impl::FromHmiQueue::Handler,
- public impl::ToHmiQueue::Handler,
- public impl::AudioPassThruQueue::Handler
#ifdef TELEMETRY_MONITOR
,
public telemetry_monitor::TelemetryObservable<AMTelemetryObserver>
@@ -259,14 +181,19 @@ class ApplicationManagerImpl
void set_application_id(const int32_t correlation_id,
const uint32_t app_id) OVERRIDE;
+ uint32_t get_current_audio_source() const OVERRIDE;
+
+ void set_current_audio_source(const uint32_t source) OVERRIDE;
+
void OnHMILevelChanged(uint32_t app_id,
mobile_apis::HMILevel::eType from,
mobile_apis::HMILevel::eType to) OVERRIDE;
void SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) OVERRIDE;
+ const std::shared_ptr<Application> app) OVERRIDE;
+
+ void SendDriverDistractionState(ApplicationSharedPtr application);
-#ifdef SDL_REMOTE_CONTROL
ApplicationSharedPtr application(
const std::string& device_id,
const std::string& policy_app_id) const OVERRIDE;
@@ -281,24 +208,14 @@ class ApplicationManagerImpl
*/
void ChangeAppsHMILevel(uint32_t app_id, mobile_apis::HMILevel::eType level);
- void Erase(ApplicationSharedPtr app_to_remove) {
- DCHECK(app_to_remove);
- app_to_remove->RemoveExtensions();
- applications_.erase(app_to_remove);
- }
-
- virtual functional_modules::PluginManager& GetPluginManager() OVERRIDE {
- return plugin_manager_;
+ virtual plugin_manager::RPCPluginManager& GetPluginManager() OVERRIDE {
+ DCHECK(plugin_manager_);
+ return *plugin_manager_;
}
std::vector<std::string> devices(
const std::string& policy_app_id) const OVERRIDE;
- virtual void SendPostMessageToMobile(const MessagePtr& message) OVERRIDE;
-
- virtual void SendPostMessageToHMI(const MessagePtr& message) OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
-
/**
* @brief Checks if application with the same HMI type
* (media, voice communication or navi) exists
@@ -311,29 +228,6 @@ class ApplicationManagerImpl
bool IsAppTypeExistsInFullOrLimited(ApplicationConstSharedPtr app) const;
/**
- * DEPRECATED
- * @brief Checks if Application is subscribed for way points
- * @param Application AppID
- * @return true if Application is subscribed for way points
- * otherwise false
- */
- bool IsAppSubscribedForWayPoints(const uint32_t app_id) const OVERRIDE;
-
- /**
- * DEPRECATED
- * @brief Subscribe Application for way points
- * @param Application AppID
- */
- void SubscribeAppForWayPoints(const uint32_t app_id) OVERRIDE;
-
- /**
- * DEPRECATED
- * @brief Unsubscribe Application for way points
- * @param Application AppID
- */
- void UnsubscribeAppFromWayPoints(const uint32_t app_id) OVERRIDE;
-
- /**
* @brief Checks if Application is subscribed for way points
* @param Application pointer
* @return true if Application is subscribed for way points
@@ -363,7 +257,7 @@ class ApplicationManagerImpl
* @brief Get subscribed for way points
* @return reference to set of subscribed apps for way points
*/
- const std::set<int32_t> GetAppsSubscribedForWayPoints() const OVERRIDE;
+ const std::set<uint32_t> GetAppsSubscribedForWayPoints() const OVERRIDE;
/**
* @brief Notifies all components interested in Vehicle Data update
@@ -372,8 +266,8 @@ class ApplicationManagerImpl
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- std::vector<ApplicationSharedPtr> IviInfoUpdated(
- mobile_apis::VehicleDataType::eType vehicle_info, int value) OVERRIDE;
+ void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info,
+ int value) OVERRIDE;
void OnApplicationRegistered(ApplicationSharedPtr app) OVERRIDE;
@@ -408,7 +302,7 @@ class ApplicationManagerImpl
void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE;
#endif // TELEMETRY_MONITOR
- ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
+ ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration) OVERRIDE;
/*
* @brief Closes application by id
@@ -452,10 +346,6 @@ class ApplicationManagerImpl
* @brief Closes all registered applications
*/
void UnregisterAllApplications();
-
- DEPRECATED bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
-
- DEPRECATED bool LoadAppDataToHMI(ApplicationSharedPtr app);
bool ActivateApplication(ApplicationSharedPtr app) OVERRIDE;
/**
@@ -477,13 +367,6 @@ class ApplicationManagerImpl
*/
uint32_t GetNextHMICorrelationID() OVERRIDE;
- /* @brief Starts audio passthru process
- * @deprecated Use BeginAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is already in process
- */
- bool BeginAudioPassThrough() OVERRIDE;
-
/**
* @brief Starts AudioPassThru process by given application
* @param app_id ID of the application which starts the process
@@ -491,14 +374,6 @@ class ApplicationManagerImpl
*/
bool BeginAudioPassThru(uint32_t app_id) OVERRIDE;
- /*
- * @brief Finishes already started audio passthru process
- * @deprecated Use EndAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is not active
- */
- bool EndAudioPassThrough() OVERRIDE;
-
/**
* @brief Finishes already started AudioPassThru process by given application
* @param app_id ID of the application which started the process
@@ -524,22 +399,6 @@ class ApplicationManagerImpl
const hmi_apis::Common_DriverDistractionState::eType state) OVERRIDE;
/*
- * DEPRECATED
- * @brief Retrieves if VR session has started
- *
- * @return Current VR session state (started, stopped)
- */
- inline bool vr_session_started() const;
-
- /*
- * DEPRECATED
- * @brief Sets VR session state
- *
- * @param state Current HMI VR session state
- */
- void set_vr_session_started(const bool state);
-
- /*
* @brief Retrieves SDL access to all mobile apps
*
* @return Currently active state of the access
@@ -562,60 +421,13 @@ class ApplicationManagerImpl
* @return new regular HMI state
*/
HmiStatePtr CreateRegularState(
- utils::SharedPtr<Application> app,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context) const OVERRIDE;
/**
- * DEPRECATED
- * @brief CreateRegularState create regular HMI state for application
- * @param app_id Application id
- * @param hmi_level of returned state
- * @param audio_state of returned state
- * @param system_context of returned state
- * @return new regular HMI state
- */
- DEPRECATED HmiStatePtr CreateRegularState(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) const OVERRIDE;
-
- /**
- * @brief SetState set regular audio state
- * @param app_id applicatio id
- * @param audio_state aaudio streaming state
- */
- void SetState(uint32_t app_id,
- mobile_apis::AudioStreamingState::eType audio_state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, audio_state);
- }
-
- /**
- * @brief SetState setup regular hmi state, that will appear if no
- * specific events are active
- * @param app appication to setup regular State
- * @param state state of new regular state
- */
- template <bool SendActivateApp>
- void SetState(uint32_t app_id, HmiStatePtr new_state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, new_state, SendActivateApp);
- }
-
- /**
* @brief Checks, if given RPC is allowed at current HMI level for specific
* application in policy table
* @param app Application
@@ -677,117 +489,6 @@ class ApplicationManagerImpl
ApplicationConstSharedPtr waiting_app(const uint32_t hmi_id) const;
/**
- * @brief SetState Change regular audio state
- * @param app appication to setup regular State
- * @param audio_state of new regular state
- */
- template <bool SendActivateApp>
- void SetState(uint32_t app_id, mobile_apis::HMILevel::eType hmi_level) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, hmi_level, SendActivateApp);
- }
-
- /**
- * @brief SetState Change regular hmi level and audio state
- * @param app appication to setup regular State
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI
- */
- template <bool SendActivateApp>
- void SetState(uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, hmi_level, audio_state, SendActivateApp);
- }
-
- /**
- * @brief SetState Change regular hmi level and audio state
- * @param app appication to setup regular State
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI
- */
- template <bool SendActivateApp>
- void SetState(uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(
- app, hmi_level, audio_state, system_context, SendActivateApp);
- }
-
- /**
- * @brief SetState Change regular system context
- * @param app appication to setup regular State
- * @param system_context of new regular state
- */
- void SetState(uint32_t app_id,
- mobile_apis::SystemContext::eType system_context) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, system_context);
- }
-
- /**
- * @brief SetState Change regular hmi level
- * @param app appication to setup regular State
- * @param hmi_level hmi level of new regular state
- */
- void SetHmiState(uint32_t app_id, mobile_apis::HMILevel::eType hmi_level) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, hmi_level);
- }
-
- /**
- * @brief SetState Change regular hmi state
- * @param app appication to setup regular State
- * @param state new regular hmi state
- */
- void SetState(uint32_t app_id, HmiStatePtr state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, state);
- }
-
- /**
- * @brief Checks, if particular state is active
- * @param state_id State
- * @return True, if state is active, otherwise - false
- */
- bool IsStateActive(HmiState::StateID state_id) const;
-
- /**
* @brief Notification from PolicyHandler about PTU.
* Compares AppHMIType between saved in app and received from PTU. If they are
* different method sends:
@@ -832,18 +533,6 @@ class ApplicationManagerImpl
*/
void StopAudioPassThru(int32_t application_key) OVERRIDE;
- /*
- * @brief Creates AudioPassThru data chunk and inserts it
- * to audio_pass_thru_messages_
- *
- * @param session_key Id of application for which
- * audio pass thru should be sent
- *
- * @param binary_data AudioPassThru data chunk
- */
- void SendAudioPassThroughNotification(
- uint32_t session_key, std::vector<uint8_t>& binary_data) OVERRIDE;
-
std::string GetDeviceName(connection_handler::DeviceHandle handle);
/*
@@ -863,20 +552,9 @@ class ApplicationManagerImpl
void StartDevicesDiscovery();
- // Put message to the queue to be sent to mobile.
- // if |final_message| parameter is set connection to mobile will be closed
- // after processing this message
- void SendMessageToMobile(const commands::MessageSharedPtr message,
- bool final_message = false) OVERRIDE;
-
- void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE;
-
void RemoveHMIFakeParameters(
- application_manager::MessagePtr& message) OVERRIDE;
-
- bool ManageMobileCommand(const commands::MessageSharedPtr message,
- commands::Command::CommandOrigin origin) OVERRIDE;
- bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE;
+ application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id) OVERRIDE;
/**
* @brief TerminateRequest forces termination of request
@@ -887,17 +565,6 @@ class ApplicationManagerImpl
void TerminateRequest(const uint32_t connection_key,
const uint32_t corr_id,
const int32_t function_id) OVERRIDE;
- // Overriden ProtocolObserver method
- void OnMessageReceived(
- const ::protocol_handler::RawMessagePtr message) OVERRIDE;
- void OnMobileMessageSent(
- const ::protocol_handler::RawMessagePtr message) OVERRIDE;
-
- // Overriden HMIMessageObserver method
- void OnMessageReceived(
- hmi_message_handler::MessageSharedPointer message) OVERRIDE;
- void OnErrorSending(
- hmi_message_handler::MessageSharedPointer message) OVERRIDE;
// Overriden ConnectionHandlerObserver method
void OnDeviceListUpdated(
@@ -925,10 +592,6 @@ class ApplicationManagerImpl
*/
void OnDeviceSwitchingFinish(const std::string& device_uid) FINAL;
- DEPRECATED bool OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type) OVERRIDE;
void OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
@@ -938,6 +601,10 @@ class ApplicationManagerImpl
const int32_t& session_key,
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason) OVERRIDE;
+ void OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) OVERRIDE;
+ void OnSecondaryTransportEndedCallback(const int32_t session_key) OVERRIDE;
/**
* @brief Check if application with specified app_id has NAVIGATION HMI type
@@ -958,6 +625,12 @@ class ApplicationManagerImpl
security_manager::SSLContext::HandshakeResult result) OVERRIDE;
/**
+ * @brief Notification about handshake failure
+ * @return true on success notification handling or false otherwise
+ */
+ bool OnHandshakeFailed() OVERRIDE;
+
+ /**
* @brief Notification that certificate update is required.
*/
void OnCertificateUpdateRequired() OVERRIDE;
@@ -1079,6 +752,18 @@ class ApplicationManagerImpl
ApplicationConstSharedPtr application) const;
/**
+ * @brief Checks if required transport for resumption is available
+ *
+ * The required transport can be configured through smartDeviceLink.ini file.
+ *
+ * @param application an instance of the app to check
+ * @return true if the app is connected through one of the required
+ * transports, false otherwise
+ */
+ bool CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const;
+
+ /**
* Getter for resume_controller
* @return Resume Controller
*/
@@ -1104,20 +789,6 @@ class ApplicationManagerImpl
*/
uint32_t GenerateNewHMIAppID() OVERRIDE;
- /**
- * DERPECATED
- * @brief Parse smartObject and replace mobile app Id by HMI app ID
- * @param message Smartobject to be parsed
- */
- void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
-
- /**
- * DEPRECATED
- * @brief Parse smartObject and replace HMI app ID by mobile app Id
- * @param message Smartobject to be parsed
- */
- void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
-
/*
* @brief Save binary data to specified directory
*
@@ -1133,7 +804,7 @@ class ApplicationManagerImpl
mobile_apis::Result::eType SaveBinary(const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset) OVERRIDE;
+ const uint64_t offset) OVERRIDE;
/**
* @brief Get available app space
@@ -1169,35 +840,33 @@ class ApplicationManagerImpl
*/
void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) OVERRIDE;
- /**
- * DEPRECATED
- * @brief method adds application in FULL and LIMITED state
- * to on_phone_call_app_list_.
- * Also OnHMIStateNotification with BACKGROUND state sent for these apps
- */
- void CreatePhoneCallAppList();
-
- /**
- * DEPRECATED
- * @brief method removes application from on_phone_call_app_list_.
- *
- * Also OnHMIStateNotification with previous HMI state sent for these apps
- */
- void ResetPhoneCallAppList();
-
// TODO(AOleynik): Temporary added, to fix build. Should be reworked.
connection_handler::ConnectionHandler& connection_handler() const OVERRIDE;
protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE;
- virtual policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE {
+ policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE {
return *policy_handler_;
}
- virtual const policy::PolicyHandlerInterface& GetPolicyHandler()
- const OVERRIDE {
+ const policy::PolicyHandlerInterface& GetPolicyHandler() const OVERRIDE {
return *policy_handler_;
}
+ rpc_service::RPCService& GetRPCService() const OVERRIDE {
+ return *rpc_service_;
+ }
+
+ rpc_handler::RPCHandler& GetRPCHandler() const OVERRIDE {
+ return *rpc_handler_;
+ }
+
+ void SetRPCService(std::unique_ptr<rpc_service::RPCService>& rpc_service) {
+ rpc_service_ = std::move(rpc_service);
+ }
+
+ bool is_stopping() const OVERRIDE;
+
+ bool is_audio_pass_thru_active() const OVERRIDE;
/*
* @brief Function Should be called when Low Voltage is occured
*/
@@ -1353,10 +1022,21 @@ class ApplicationManagerImpl
StateController& state_controller() OVERRIDE;
const ApplicationManagerSettings& get_settings() const OVERRIDE;
+ std::string GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const OVERRIDE;
virtual event_engine::EventDispatcher& event_dispatcher() OVERRIDE;
app_launch::AppLaunchCtrl& app_launch_ctrl() OVERRIDE;
+ bool IsSOStructValid(const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities);
+
+ /**
+ * @brief Function returns supported SDL Protocol Version
+ * @return protocol version depends on parameters from smartDeviceLink.ini.
+ */
+ protocol_handler::MajorProtocolVersion SupportedSDLVersion() const OVERRIDE;
+
private:
/**
* @brief PullLanguagesInfo allows to pull information about languages.
@@ -1378,6 +1058,14 @@ class ApplicationManagerImpl
mobile_apis::AppHMIType::eType StringToAppHMIType(std::string str);
/**
+ * @brief Returns a string representation of AppHMIType
+ * @param type an enum value of AppHMIType
+ * @return string representation of the enum value
+ */
+ const std::string AppHMITypeToString(
+ mobile_apis::AppHMIType::eType type) const;
+
+ /**
* @brief Method compares arrays of app HMI type
* @param from_policy contains app HMI type from policy
* @param from_application contains app HMI type from application
@@ -1389,40 +1077,9 @@ class ApplicationManagerImpl
hmi_apis::HMI_API& hmi_so_factory();
mobile_apis::MOBILE_API& mobile_so_factory();
- bool ConvertMessageToSO(const Message& message,
- smart_objects::SmartObject& output);
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
Message& output);
- MessageValidationResult ValidateMessageBySchema(
- const Message& message) OVERRIDE;
-
- utils::SharedPtr<Message> ConvertRawMsgToMessage(
- const ::protocol_handler::RawMessagePtr message);
-
- void ProcessMessageFromMobile(const utils::SharedPtr<Message> message);
- void ProcessMessageFromHMI(const utils::SharedPtr<Message> message);
-
- // threads::MessageLoopThread<*>::Handler implementations
- /*
- * @brief Handles for threads pumping different types
- * of messages. Beware, each is called on different thread!
- */
- // CALLED ON messages_from_mobile_ thread!
- void Handle(const impl::MessageFromMobile message) OVERRIDE;
-
- // CALLED ON messages_to_mobile_ thread!
- void Handle(const impl::MessageToMobile message) OVERRIDE;
-
- // CALLED ON messages_from_hmi_ thread!
- void Handle(const impl::MessageFromHmi message) OVERRIDE;
-
- // CALLED ON messages_to_hmi_ thread!
- void Handle(const impl::MessageToHmi message) OVERRIDE;
-
- // CALLED ON audio_pass_thru_messages_ thread!
- void Handle(const impl::AudioData message) OVERRIDE;
-
template <typename ApplicationList>
void PrepareApplicationListSO(ApplicationList app_list,
smart_objects::SmartObject& applications,
@@ -1433,7 +1090,7 @@ class ApplicationManagerImpl
uint32_t app_count = NULL == app_array ? 0 : app_array->size();
typename ApplicationList::const_iterator it;
for (it = app_list.begin(); it != app_list.end(); ++it) {
- if (!it->valid()) {
+ if (it->use_count() == 0) {
LOG4CXX_ERROR(logger_, "Application not found ");
continue;
}
@@ -1477,10 +1134,10 @@ class ApplicationManagerImpl
*/
void SendOnSDLClose();
- /*
+ /**
* @brief returns true if low voltage state is active
*/
- bool IsLowVoltage();
+ bool IsLowVoltage() const OVERRIDE;
/**
* @brief Allows to process postponed commands for application
@@ -1554,15 +1211,6 @@ class ApplicationManagerImpl
* @brief Starts specified navi service for application
* @param app_id Application to proceed
* @param service_type Type of service to start
- * @return True on success, false on fail
- */
- DEPRECATED bool StartNaviService(uint32_t app_id,
- protocol_handler::ServiceType service_type);
-
- /**
- * @brief Starts specified navi service for application
- * @param app_id Application to proceed
- * @param service_type Type of service to start
* @param params configuration parameters specified by mobile
* @return True if service is immediately started or configuration
* parameters are sent to HMI, false on other cases
@@ -1594,20 +1242,6 @@ class ApplicationManagerImpl
void DisallowStreaming(uint32_t app_id);
/**
- * @brief Function returns supported SDL Protocol Version
- * @return protocol version depends on parameters from smartDeviceLink.ini.
- */
- protocol_handler::MajorProtocolVersion SupportedSDLVersion() const;
-
- /**
- * @brief Checks if driver distraction state is valid, creates message
- * and puts it to postponed message.
- * @param application contains registered application.
- */
- void PutDriverDistractionMessageToPostponed(
- ApplicationSharedPtr application) const;
-
- /**
* @brief Types of directories used by Application Manager
*/
enum DirectoryType { TYPE_STORAGE, TYPE_SYSTEM, TYPE_ICONS };
@@ -1671,6 +1305,15 @@ class ApplicationManagerImpl
const std::string& mac_address);
/**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ const std::string GetTransportTypeProfileString(
+ connection_handler::DeviceHandle device_handle) const;
+
+ /**
* @brief Converts BSON object containing video parameters to
* smart object's map object
* @param output the smart object to add video parameters
@@ -1698,8 +1341,10 @@ class ApplicationManagerImpl
ForbiddenApps forbidden_applications;
// Lock for applications list
- mutable sync_primitives::Lock applications_list_lock_;
- mutable sync_primitives::Lock apps_to_register_list_lock_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ applications_list_lock_ptr_;
+ mutable std::shared_ptr<sync_primitives::Lock>
+ apps_to_register_list_lock_ptr_;
mutable sync_primitives::Lock subscribed_way_points_apps_lock_;
/**
@@ -1710,13 +1355,13 @@ class ApplicationManagerImpl
/**
* @brief Set AppIDs of subscribed apps for way points
*/
- std::set<int32_t> subscribed_way_points_apps_list_;
+ std::set<uint32_t> subscribed_way_points_apps_list_;
/**
* @brief Map contains applications which
* will send TTS global properties to HMI after timeout
*/
- std::map<uint32_t, TimevalStruct> tts_global_properties_app_list_;
+ std::map<uint32_t, date_time::TimeDuration> tts_global_properties_app_list_;
bool audio_pass_thru_active_;
uint32_t audio_pass_thru_app_id_;
@@ -1726,18 +1371,17 @@ class ApplicationManagerImpl
bool is_vr_session_strated_;
bool hmi_cooperating_;
bool is_all_apps_allowed_;
+ uint32_t current_audio_source_;
event_engine::EventDispatcherImpl event_dispatcher_;
media_manager::MediaManager* media_manager_;
hmi_message_handler::HMIMessageHandler* hmi_handler_;
connection_handler::ConnectionHandler* connection_handler_;
- std::auto_ptr<policy::PolicyHandlerInterface> policy_handler_;
+ std::unique_ptr<policy::PolicyHandlerInterface> policy_handler_;
protocol_handler::ProtocolHandler* protocol_handler_;
request_controller::RequestController request_ctrl_;
-
-#ifdef SDL_REMOTE_CONTROL
- functional_modules::PluginManager plugin_manager_;
+ std::unique_ptr<plugin_manager::RPCPluginManager> plugin_manager_;
/**
* @brief Map contains apps with HMI state before incoming call
@@ -1756,7 +1400,6 @@ class ApplicationManagerImpl
mobile_apis::AudioStreamingState::eType audio_streaming_state;
mobile_apis::SystemContext::eType system_context;
};
-#endif // SDL_REMOTE_CONTROL
hmi_apis::HMI_API* hmi_so_factory_;
mobile_apis::MOBILE_API* mobile_so_factory_;
@@ -1764,20 +1407,7 @@ class ApplicationManagerImpl
static uint32_t corelation_id_;
static const uint32_t max_corelation_id_;
- // Construct message threads when everything is already created
-
- // Thread that pumps messages coming from mobile side.
- impl::FromMobileQueue messages_from_mobile_;
- // Thread that pumps messages being passed to mobile side.
- impl::ToMobileQueue messages_to_mobile_;
- // Thread that pumps messages coming from HMI.
- impl::FromHmiQueue messages_from_hmi_;
- // Thread that pumps messages being passed to HMI.
- impl::ToHmiQueue messages_to_hmi_;
- // Thread that pumps messages audio pass thru to mobile.
- impl::AudioPassThruQueue audio_pass_thru_messages_;
-
- std::auto_ptr<HMICapabilities> hmi_capabilities_;
+ std::unique_ptr<HMICapabilities> hmi_capabilities_;
// The reason of HU shutdown
mobile_api::AppInterfaceUnregisteredReason::eType unregister_reason_;
@@ -1786,7 +1416,7 @@ class ApplicationManagerImpl
* about persistent application data on disk, and save session ID for resuming
* application in case INGITION_OFF or MASTER_RESSET
*/
- std::auto_ptr<resumption::ResumeCtrl> resume_ctrl_;
+ std::unique_ptr<resumption::ResumeCtrl> resume_ctrl_;
HmiInterfacesImpl hmi_interfaces_;
@@ -1799,10 +1429,10 @@ class ApplicationManagerImpl
std::vector<TimerSPtr> timer_pool_;
sync_primitives::Lock timer_pool_lock_;
- sync_primitives::Lock stopping_application_mng_lock_;
+ mutable sync_primitives::RecursiveLock stopping_application_mng_lock_;
StateControllerImpl state_ctrl_;
- std::auto_ptr<app_launch::AppLaunchData> app_launch_dto_;
- std::auto_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchData> app_launch_dto_;
+ std::unique_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
/**
* @brief ReregisterWaitList is list of applications expected to be
@@ -1813,6 +1443,12 @@ class ApplicationManagerImpl
mutable sync_primitives::Lock reregister_wait_list_lock_;
+ // This is a cache to remember DeviceHandle of secondary transports. Only used
+ // during RegisterApplication().
+ typedef std::map<int32_t, connection_handler::DeviceHandle> DeviceMap;
+
+ DeviceMap secondary_transport_devices_cache_;
+
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
@@ -1829,6 +1465,9 @@ class ApplicationManagerImpl
std::unique_ptr<CommandHolder> commands_holder_;
+ std::unique_ptr<rpc_service::RPCService> rpc_service_;
+ std::unique_ptr<rpc_handler::RPCHandler> rpc_handler_;
+
#ifdef BUILD_TESTS
public:
/**
@@ -1845,16 +1484,18 @@ class ApplicationManagerImpl
*/
void SetMockMediaManager(media_manager::MediaManager* mock_media_manager);
+ virtual void SetPluginManager(
+ std::unique_ptr<plugin_manager::RPCPluginManager>& plugin_manager)
+ OVERRIDE {
+ plugin_manager_.reset(plugin_manager.release());
+ }
+
private:
#endif
DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
};
-DEPRECATED bool ApplicationManagerImpl::vr_session_started() const {
- return is_vr_session_strated_;
-}
-
inline bool ApplicationManagerImpl::all_apps_allowed() const {
return is_all_apps_allowed_;
}
diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h
new file mode 100644
index 0000000000..7dc8a0cfc1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/command_factory.h
@@ -0,0 +1,216 @@
+/*
+ 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_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H
+
+#include "application_manager/commands/command.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+using policy::PolicyHandlerInterface;
+typedef std::shared_ptr<commands::Command> CommandSharedPtr;
+
+/**
+ * @brief Factory class for command creation
+ **/
+class CommandFactory {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~CommandFactory() {}
+
+ /**
+ * @brief Create command object and return pointer to it
+ *
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ virtual CommandSharedPtr CreateCommand(
+ const commands::MessageSharedPtr& message,
+ commands::Command::CommandSource source) = 0;
+ /**
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
+ virtual bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource source)
+ const = 0;
+};
+
+/**
+ * @brief Command creator interface for create commands
+ **/
+class CommandCreator {
+ public:
+ /**
+ * @brief ~CommandCreator destructor
+ **/
+ virtual ~CommandCreator() {}
+ /**
+ * @return return true if command can be create, else return false
+ **/
+ virtual bool CanBeCreated() const = 0;
+ /**
+ * @brief Create command object and return pointer to it
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ virtual CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const = 0;
+};
+
+/**
+ * @brief DefaultCommandCreator concrete command creator
+ **/
+template <typename CommandType>
+class DefaultCommandCreator : public CommandCreator {
+ public:
+ /**
+ * @brief DefaultCommandCreator constructor
+ * @param application_manager ApplicationManager.
+ * @param rpc_service RPCService.
+ * @param hmi_capabilities HMICapabilities.
+ * @param policy_handler PolicyHandlerInterface.
+ */
+ DefaultCommandCreator(ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+ private:
+ /**
+ * @return return true
+ **/
+ bool CanBeCreated() const override {
+ return true;
+ }
+
+ /**
+ * @brief Create command object and return pointer to it
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ CommandSharedPtr command(new CommandType(message,
+ application_manager_,
+ rpc_service_,
+ hmi_capabilities_,
+ policy_handler_));
+ return command;
+ }
+
+ ApplicationManager& application_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ PolicyHandlerInterface& policy_handler_;
+};
+
+struct InvalidCommand {};
+
+/**
+ * @brief DefaultCommandCreator<InvalidCommand> creator for invalid commands
+ **/
+template <>
+class DefaultCommandCreator<InvalidCommand> : public CommandCreator {
+ public:
+ /**
+ * @brief DefaultCommandCreator constructor
+ * @param application_manager ApplicationManager.
+ * @param rpc_service RPCService.
+ * @param hmi_capabilities HMICapabilities.
+ * @param policy_handler PolicyHandlerInterface.
+ */
+ DefaultCommandCreator(ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ PolicyHandlerInterface& policy_handler) {
+ UNUSED(application_manager);
+ UNUSED(rpc_service);
+ UNUSED(hmi_capabilities);
+ UNUSED(policy_handler);
+ }
+
+ private:
+ /**
+ * @return return false
+ **/
+ bool CanBeCreated() const override {
+ return false;
+ }
+ /**
+ * @brief Create command object and return pointer to it
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created empty command object.
+ **/
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ UNUSED(message);
+ return CommandSharedPtr();
+ }
+};
+
+struct CommandCreatorFactory {
+ CommandCreatorFactory(ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+ template <typename CommandType>
+ CommandCreator& GetCreator() {
+ static DefaultCommandCreator<CommandType> res(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+ return res;
+ }
+ ApplicationManager& application_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ PolicyHandlerInterface& policy_handler_;
+};
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/include/application_manager/command_holder.h b/src/components/application_manager/include/application_manager/command_holder.h
index d3171aedbb..8cfe5f0889 100644
--- a/src/components/application_manager/include/application_manager/command_holder.h
+++ b/src/components/application_manager/include/application_manager/command_holder.h
@@ -36,7 +36,6 @@
#include <string>
#include "application_manager/application.h"
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
namespace application_manager {
/**
diff --git a/src/components/application_manager/include/application_manager/command_holder_impl.h b/src/components/application_manager/include/application_manager/command_holder_impl.h
index ed5f6baa62..18a1de7526 100644
--- a/src/components/application_manager/include/application_manager/command_holder_impl.h
+++ b/src/components/application_manager/include/application_manager/command_holder_impl.h
@@ -39,9 +39,10 @@
#include <vector>
#include <map>
#include "application_manager/application.h"
+#include "application_manager/rpc_service.h"
#include "smart_objects/smart_object.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/macro.h"
namespace application_manager {
@@ -98,7 +99,7 @@ class CommandHolderImpl : public CommandHolder {
using AppCommands =
std::map<ApplicationSharedPtr,
- std::vector<utils::SharedPtr<smart_objects::SmartObject> > >;
+ std::vector<std::shared_ptr<smart_objects::SmartObject> > >;
ApplicationManager& app_manager_;
sync_primitives::Lock commands_lock_;
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 cc090defa0..f8ea7db24d 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -34,7 +34,6 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
#include <stdint.h>
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
namespace application_manager {
@@ -113,7 +112,7 @@ class Command {
*/
virtual void SetAllowedToTerminate(const bool allowed) = 0;
- enum CommandOrigin { ORIGIN_SDL, ORIGIN_MOBILE };
+ enum CommandSource { SOURCE_SDL, SOURCE_MOBILE, SOURCE_HMI };
};
typedef smart_objects::SmartObjectSPtr MessageSharedPtr;
diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h
index 5fee7500ce..4859f73a55 100644
--- a/src/components/application_manager/include/application_manager/commands/command_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_impl.h
@@ -63,7 +63,10 @@ class CommandImpl : public Command {
* @param message Incoming SmartObject message
**/
CommandImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
/**
* @brief CommandImpl class destructor
@@ -149,30 +152,19 @@ class CommandImpl : public Command {
bool ReplaceMobileWithHMIAppId(smart_objects::SmartObject& message);
/**
- * DEPRECATED
- * @brief Parses mobile message and replaces mobile app id with HMI app id
- * @param message Message to replace its ids
- */
- void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
-
- /**
* @brief Parses message from HMI and replaces HMI app id with mobile app id
* @param message Message to replace its ids
* @return True if replacement succeeded, otherwise - false
*/
bool ReplaceHMIWithMobileAppId(smart_objects::SmartObject& message);
- /**
- * DEPRECATED
- * @brief Parses message from HMI and replaces HMI app id with mobile app id
- * @param message Message to replace its ids
- */
- void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
-
MessageSharedPtr message_;
uint32_t default_timeout_;
bool allowed_to_terminate_;
ApplicationManager& application_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
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 e8a0399c9d..8741dae540 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
@@ -42,8 +42,12 @@ namespace commands {
class CommandNotificationFromMobileImpl : public CommandImpl {
public:
- CommandNotificationFromMobileImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ CommandNotificationFromMobileImpl(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
virtual ~CommandNotificationFromMobileImpl();
virtual bool Init();
virtual bool CleanUp();
diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
index dabbe4fe31..2274bc5f3b 100644
--- a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
@@ -43,7 +43,10 @@ namespace commands {
class CommandNotificationImpl : public CommandImpl {
public:
CommandNotificationImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
virtual ~CommandNotificationImpl();
virtual bool Init();
virtual bool CleanUp();
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 74a884a223..27aa93d1d8 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
@@ -43,8 +43,6 @@ namespace application_manager {
namespace commands {
struct ResponseInfo {
- DEPRECATED ResponseInfo(hmi_apis::Common_Result::eType result,
- HmiInterfaces::InterfaceID interface);
ResponseInfo();
ResponseInfo(const hmi_apis::Common_Result::eType result,
const HmiInterfaces::InterfaceID hmi_interface,
@@ -57,7 +55,7 @@ struct ResponseInfo {
bool is_not_used;
};
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
/**
* @brief MergeInfos merge 2 infos in one string
@@ -110,7 +108,10 @@ class CommandRequestImpl : public CommandImpl,
enum HashUpdateMode { kSkipHashUpdate, kDoHashUpdate };
CommandRequestImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
~CommandRequestImpl();
@@ -188,7 +189,7 @@ class CommandRequestImpl : public CommandImpl,
* @param msg_params HMI request msg params
*/
void CreateHMINotification(const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const;
+ const ns_smart::SmartObject& msg_params) const;
/**
* @brief Converts HMI result code to Mobile result code
diff --git a/src/components/application_manager/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
index 44c58a8102..06e73db191 100644
--- a/src/components/application_manager/include/application_manager/commands/command_response_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
@@ -44,7 +44,10 @@ namespace commands {
class CommandResponseImpl : public CommandImpl {
public:
CommandResponseImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
virtual ~CommandResponseImpl();
virtual bool Init();
virtual bool CleanUp();
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h
deleted file mode 100644
index fd4cc12468..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ActivateAppRequest command class
- **/
-class ActivateAppRequest : public RequestToHMI {
- public:
- /**
- * @brief ActivateAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ActivateAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ActivateAppRequest class destructor
- **/
- virtual ~ActivateAppRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h
deleted file mode 100644
index 1470bf8651..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ActivateAppResponse command class
- **/
-class ActivateAppResponse : public ResponseFromHMI {
- public:
- /**
- * @brief ActivateAppResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ActivateAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ActivateAppResponse class destructor
- **/
- virtual ~ActivateAppResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h
deleted file mode 100644
index 3e0f81f167..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddStatisticsInfoNotification command class
- **/
-class AddStatisticsInfoNotification : public NotificationFromHMI {
- public:
- /**
- * @brief AddStatisticsInfoNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddStatisticsInfoNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddStatisticsInfoNotification class destructor
- **/
- virtual ~AddStatisticsInfoNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AddStatisticsInfoNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h
deleted file mode 100644
index c1c5b36e5b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAllAppsRequest command class
- **/
-class AllowAllAppsRequest : public RequestToHMI {
- public:
- /**
- * @brief AllowAllAppsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAllAppsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAllAppsRequest class destructor
- **/
- virtual ~AllowAllAppsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAllAppsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h
deleted file mode 100644
index 711825cfab..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAllAppsResponse command class
- **/
-class AllowAllAppsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AllowAllAppsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAllAppsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAllAppsResponse class destructor
- **/
- virtual ~AllowAllAppsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAllAppsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h
deleted file mode 100644
index 10424a2661..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAppRequest command class
- **/
-class AllowAppRequest : public RequestToHMI {
- public:
- /**
- * @brief AllowAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAppRequest class destructor
- **/
- virtual ~AllowAppRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAppRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h
deleted file mode 100644
index 4f2642f550..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAppResponse command class
- **/
-class AllowAppResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AllowAppResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAppResponse class destructor
- **/
- virtual ~AllowAppResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAppResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
deleted file mode 100644
index daa71e68b5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAwakeSDLNotification command class
- **/
-class OnAwakeSDLNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAwakeSDLNotification class constructor
- * @param message Incoming SmartObject message
- * @param application_manager reference to ApplicationManager instance
- **/
- OnAwakeSDLNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAwakeSDLNotification class destructor
- **/
- virtual ~OnAwakeSDLNotification();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAwakeSDLNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h
deleted file mode 100644
index bdfdfffd66..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief BasicCommunicationSystemRequest command class
- **/
-class BasicCommunicationSystemRequest : public RequestToHMI {
- public:
- /**
- * @brief BasicCommunicationSystemRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- BasicCommunicationSystemRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief BasicCommunicationSystemRequest class destructor
- **/
- virtual ~BasicCommunicationSystemRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h
deleted file mode 100644
index de433568b1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief BasicCommunicationSystemResponse command class
- **/
-class BasicCommunicationSystemResponse : public ResponseFromHMI {
- public:
- /**
- * @brief BasicCommunicationSystemResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- BasicCommunicationSystemResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief BasicCommunicationSystemResponse class destructor
- **/
- virtual ~BasicCommunicationSystemResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h
deleted file mode 100644
index 45dc690c6c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ButtonGetCapabilitiesRequest command class
- **/
-class ButtonGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief ButtonGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ButtonGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ButtonGetCapabilitiesRequest class destructor
- **/
- virtual ~ButtonGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h
deleted file mode 100644
index 4efa576079..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ButtonGetCapabilitiesResponse command class
- **/
-class ButtonGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief ButtonGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ButtonGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ButtonGetCapabilitiesResponse class destructor
- **/
- virtual ~ButtonGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h
deleted file mode 100644
index d7d4d18d97..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ClosePopupRequest command class
- **/
-class ClosePopupRequest : public RequestToHMI {
- public:
- /**
- * @brief ClosePopupRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ClosePopupRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ClosePopupRequest class destructor
- **/
- virtual ~ClosePopupRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ClosePopupRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h
deleted file mode 100644
index fdba83d3b6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ClosePopupResponse command class
- **/
-class ClosePopupResponse : public ResponseFromHMI {
- public:
- /**
- * @brief ClosePopupResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ClosePopupResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ClosePopupResponse class destructor
- **/
- virtual ~ClosePopupResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ClosePopupResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h
deleted file mode 100644
index 8688698883..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DecryptCertificateRequest command class
- **/
-class DecryptCertificateRequest : public RequestToHMI {
- public:
- /**
- * @brief DecryptCertificateRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DecryptCertificateRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DecryptCertificateRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h
deleted file mode 100644
index 45c2258489..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DecryptCertificateResponse command class
- **/
-class DecryptCertificateResponse : public ResponseFromHMI {
- public:
- /**
- * @brief DecryptCertificateResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DecryptCertificateResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DecryptCertificateResponse class destructor
- **/
- virtual ~DecryptCertificateResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DecryptCertificateResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h
deleted file mode 100644
index 2b002c31dd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-/**
- * @brief DialNumberRequest command class
- **/
-class DialNumberRequest : public RequestToHMI {
- public:
- /**
- * @brief DialNumberRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DialNumberRequest class destructor
- **/
- virtual ~DialNumberRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h
deleted file mode 100644
index 1fbef15307..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief DialNumberResponse command class
- **/
-class DialNumberResponse : public ResponseFromHMI {
- public:
- /**
- * @brief DialNumberResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DialNumberResponse class destructor
- **/
- virtual ~DialNumberResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h
deleted file mode 100644
index 0e0c271eef..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetSystemInfoRequest command class
- **/
-class GetSystemInfoRequest : public RequestToHMI {
- public:
- /**
- * @brief GetSystemInfoRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetSystemInfoRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetSystemInfoRequest class destructor
- **/
- virtual ~GetSystemInfoRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h
deleted file mode 100644
index 10e28a839e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-struct SystemInfo {
- std::string ccpu_version;
- std::string wers_country_code;
- std::string language;
-};
-
-/**
- * @brief GetSystemInfoResponse command class
- **/
-class GetSystemInfoResponse : public ResponseFromHMI {
- public:
- /**
- * @brief GetSystemInfoResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetSystemInfoResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetSystemInfoResponse class destructor
- **/
- virtual ~GetSystemInfoResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- const SystemInfo GetSystemInfo(
- const hmi_apis::Common_Result::eType code) const;
-
- DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
deleted file mode 100644
index 1fcc1e626a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "policy/policy_types.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief GetUrls command class
- **/
-class GetUrls : public RequestFromHMI {
- public:
- /**
- * @brief GetUrls class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetUrls(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetUrls class destructor
- **/
- virtual ~GetUrls();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
-#ifdef PROPRIETARY_MODE
- /**
- * @brief Processes URLs collecting for policy service
- * @param endpoints Endpoints section of policy table
- */
- void ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints);
-#endif // PROPRIETARY_MODE
-
- /**
- * @brief Process URLs collecting for service
- * @param endpoints Endpoints section of policy table
- */
- void ProcessServiceURLs(const policy::EndpointUrls& endpoints);
-
- /**
- * @brief Sends response to HMI
- * @param result Result code
- */
- void SendResponseToHMI(hmi_apis::Common_Result::eType result);
-
- DISALLOW_COPY_AND_ASSIGN(GetUrls);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h
deleted file mode 100644
index ba058a0ec9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-class GetUrlsResponse : public ResponseToHMI {
- public:
- /**
- * @brief GetUrlsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetUrlsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetUrlsResponse class destructor
- **/
- virtual ~GetUrlsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h
deleted file mode 100644
index 4989208f7a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief MixingAudioSupportedRequest command class
- **/
-class MixingAudioSupportedRequest : public RequestToHMI {
- public:
- /**
- * @brief MixingAudioSupportedRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- MixingAudioSupportedRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief MixingAudioSupportedRequest class destructor
- **/
- virtual ~MixingAudioSupportedRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h
deleted file mode 100644
index a0cf89f558..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief MixingAudioSupportedResponse command class
- **/
-class MixingAudioSupportedResponse : public ResponseFromHMI {
- public:
- /**
- * @brief MixingAudioSupportedResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- MixingAudioSupportedResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief MixingAudioSupportedResponse class destructor
- **/
- virtual ~MixingAudioSupportedResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
deleted file mode 100644
index 123c0ab0d6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviAlertManeuverRequest command class
- **/
-class NaviAlertManeuverRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviAlertManeuverRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviAlertManeuverRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviAlertManeuverRequest class destructor
- **/
- virtual ~NaviAlertManeuverRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
deleted file mode 100644
index d4a57e9e2f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviAlertManeuverResponse command class
- **/
-class NaviAlertManeuverResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviAlertManeuverResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviAlertManeuverResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviAlertManeuverResponse class destructor
- **/
- virtual ~NaviAlertManeuverResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
deleted file mode 100644
index d6f4fd36e2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AudioStartStreamRequest command class
- **/
-class AudioStartStreamRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief AudioStartStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStartStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStartStreamRequest class destructor
- **/
- virtual ~AudioStartStreamRequest();
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief On event callback
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief RetryStartSession resend HMI startSession request if needed.
- * If limit expired, set audio_stream_retry_number counter to 0
- */
- void RetryStartSession();
-
- private:
- uint32_t retry_number_;
- DISALLOW_COPY_AND_ASSIGN(AudioStartStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
deleted file mode 100644
index 485b510bf2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AudioStartStreamResponse command class
- **/
-class AudioStartStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AudioStartStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStartStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AudioStartStreamResponse class destructor
- **/
- virtual ~AudioStartStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AudioStartStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
deleted file mode 100644
index 3a21e3e827..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AudioStopStreamRequest command class
- **/
-class AudioStopStreamRequest : public RequestToHMI {
- public:
- /**
- * @brief AudioStopStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStopStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviStopStreamRequest class destructor
- **/
- virtual ~AudioStopStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AudioStopStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
deleted file mode 100644
index ce32d5b627..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStopStreamResponse command class
- **/
-class AudioStopStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AudioStopStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStopStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStopStreamResponse class destructor
- **/
- virtual ~AudioStopStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AudioStopStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h
deleted file mode 100644
index 33c5dfe2db..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviGetWayPointsRequest command class
- **/
-class NaviGetWayPointsRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviGetWayPointsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviGetWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- /**
- * @brief NaviGetWayPointsRequest class destructor
- **/
- virtual ~NaviGetWayPointsRequest();
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h
deleted file mode 100644
index 633d927715..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviGetWaypoints command class
- **/
-class NaviGetWayPointsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviGetWaypoints class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviGetWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviGetWaypoints class destructor
- **/
- virtual ~NaviGetWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h
deleted file mode 100644
index 08826743cc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviIsReadyRequest command class
- **/
-class NaviIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief NaviIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviIsReadyRequest class destructor
- **/
- virtual ~NaviIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h
deleted file mode 100644
index 72c001b863..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviIsReadyResponse command class
- **/
-class NaviIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviIsReadyResponse class destructor
- **/
- virtual ~NaviIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h
deleted file mode 100644
index 56a9594c0b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSendLocationRequest command class
- */
-class NaviSendLocationRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviSendLocationRequest class constructor
- *
- * @param message Incoming SmartObject message
- */
- NaviSendLocationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSendLocationRequest class destructor
- */
- virtual ~NaviSendLocationRequest();
-
- /**
- * @brief Execute command
- */
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSendLocationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h
deleted file mode 100644
index ec3392642a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSendLocationResponse command class
- */
-class NaviSendLocationResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviSendLocationResponse class constructor
- *
- * @param message Incoming SmartObject message
- */
- NaviSendLocationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSendLocationResponse class destructor
- */
- virtual ~NaviSendLocationResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSendLocationResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h
deleted file mode 100644
index 0788a5595e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the names of the copyright holders 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_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSetVideoConfigRequest command class
- **/
-class NaviSetVideoConfigRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief NaviSetVideoConfigRequest class constructor
- *
- * @param message Incoming SmartObject message
- * @param application_manager Reference of application manager
- **/
- NaviSetVideoConfigRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSetVideoConfigRequest class destructor
- **/
- virtual ~NaviSetVideoConfigRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut callback
- */
- void onTimeOut() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h
deleted file mode 100644
index 3c53687a93..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the names of the copyright holders 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_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSetVideoConfigResponse command class
- **/
-class NaviSetVideoConfigResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviSetVideoConfigResponse class constructor
- *
- * @param message Incoming SmartObject message
- * @param application_manager Reference of application manager
- **/
- NaviSetVideoConfigResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSetVideoConfigResponse class destructor
- **/
- virtual ~NaviSetVideoConfigResponse();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
deleted file mode 100644
index 4cb8ddd7f7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviShowConstantTBTRequest command class
- **/
-class NaviShowConstantTBTRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviShowConstantTBTRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviShowConstantTBTRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviShowConstantTBTRequest class destructor
- **/
- virtual ~NaviShowConstantTBTRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
deleted file mode 100644
index d9e7b1d234..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviShowConstantTBTResponse command class
- **/
-class NaviShowConstantTBTResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviShowConstantTBTResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviShowConstantTBTResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviShowConstantTBTResponse class destructor
- **/
- virtual ~NaviShowConstantTBTResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h
deleted file mode 100644
index 6fcb3f3267..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStartStreamRequest command class
- **/
-class NaviStartStreamRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief NaviStartStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStartStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStartStreamRequest class destructor
- **/
- virtual ~NaviStartStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief On event callback
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut();
-
- /**
- * @brief RetryStartSession resend HMI startSession request if needed.
- * If limit expired, set video_stream_retry_number counter to 0
- */
- void RetryStartSession();
-
- private:
- uint32_t retry_number_;
- DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h
deleted file mode 100644
index 3e18767194..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStartStreamResponse command class
- **/
-class NaviStartStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviStartStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStartStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviStartStreamResponse class destructor
- **/
- virtual ~NaviStartStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviStartStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h
deleted file mode 100644
index d6952d0305..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStopStreamRequest command class
- **/
-class NaviStopStreamRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviStopStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStopStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviStopStreamRequest class destructor
- **/
- virtual ~NaviStopStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviStopStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h
deleted file mode 100644
index b3107b5e61..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStopStreamResponse command class
- **/
-class NaviStopStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviStopStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStopStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStopStreamResponse class destructor
- **/
- virtual ~NaviStopStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviStopStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h
deleted file mode 100644
index 33a2077918..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSubscribeWayPointsRequest command class
- **/
-class NaviSubscribeWayPointsRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviSubscribeWayPointsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviSubscribeWayPointsRequest(const MessageSharedPtr& messag,
- ApplicationManager& application_manager);
- /**
- * @brief NaviSubscribeWayPointsRequest class destructor
- **/
- virtual ~NaviSubscribeWayPointsRequest();
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h
deleted file mode 100644
index eff2b281f2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSubscribeWaypoints command class
- **/
-class NaviSubscribeWayPointsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviSubscribeWaypoints class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviSubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSubscribeWaypoints class destructor
- **/
- virtual ~NaviSubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h
deleted file mode 100644
index 607bb1ef26..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSubscribeWayPointsRequest command class
- **/
-class NaviUnSubscribeWayPointsRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviUnSubscribeWayPointsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUnSubscribeWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- /**
- * @brief NaviUnSubscribeWayPointsRequest class destructor
- **/
- virtual ~NaviUnSubscribeWayPointsRequest();
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUnSubscribeWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h
deleted file mode 100644
index 936814f2fe..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviUnSubscribeWaypoints command class
- **/
-class NaviUnsubscribeWayPointsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviUnSubscribeWaypoints class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUnsubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviUnSubscribeWaypoints class destructor
- **/
- virtual ~NaviUnsubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h
deleted file mode 100644
index 830e9358ec..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviUpdateTurnListRequest command class
- **/
-class NaviUpdateTurnListRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviUpdateTurnListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUpdateTurnListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviUpdateTurnListRequest class destructor
- **/
- virtual ~NaviUpdateTurnListRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h
deleted file mode 100644
index 93c714b4f4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviUpdateTurnListResponse command class
- **/
-class NaviUpdateTurnListResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviUpdateTurnListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUpdateTurnListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviUpdateTurnListResponse class destructor
- **/
- virtual ~NaviUpdateTurnListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h
deleted file mode 100644
index ccf3e6d7f3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/HMI_API.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class NotificationFromHMI : public CommandImpl {
- public:
- NotificationFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~NotificationFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendNotificationToMobile(const MessageSharedPtr& message);
- void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h
deleted file mode 100644
index dd2db8804a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class NotificationToHMI : public CommandImpl {
- public:
- NotificationToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~NotificationToHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendNotification();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NotificationToHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
deleted file mode 100644
index 8d8d2d8eb0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAllowSDLFunctionalityNotification command class
- **/
-class OnAllowSDLFunctionalityNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAllowSDLFunctionalityNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAllowSDLFunctionalityNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAllowSDLFunctionalityNotification class destructor
- **/
- virtual ~OnAllowSDLFunctionalityNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h
deleted file mode 100644
index 6772d49781..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppActivatedNotification command class
- **/
-class OnAppActivatedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAppActivatedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppActivatedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppActivatedNotification class destructor
- **/
- virtual ~OnAppActivatedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h
deleted file mode 100644
index 687d492a01..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppDeactivatedNotification command class
- **/
-class OnAppDeactivatedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAppDeactivatedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppDeactivatedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppDeactivatedNotification class destructor
- **/
- virtual ~OnAppDeactivatedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppDeactivatedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
deleted file mode 100644
index 236e1b5071..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppPermissionChangedNotification command class
- **/
-class OnAppPermissionChangedNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAppPermissionChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppPermissionChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppPermissionChangedNotification class destructor
- **/
- virtual ~OnAppPermissionChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
deleted file mode 100644
index 21f96fc055..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppPermissionConsentNotification command class
- **/
-class OnAppPermissionConsentNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAppPermissionConsentNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppPermissionConsentNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppPermissionConsentNotification class destructor
- **/
- virtual ~OnAppPermissionConsentNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h
deleted file mode 100644
index 58e92a977a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppRegisteredNotification command class
- **/
-class OnAppRegisteredNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAppRegisteredNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppRegisteredNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppRegisteredNotification class destructor
- **/
- virtual ~OnAppRegisteredNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppRegisteredNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
deleted file mode 100644
index f49dac071f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppUnregisteredNotification command class
- **/
-class OnAppUnregisteredNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAppUnregisteredNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppUnregisteredNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppUnregisteredNotification class destructor
- **/
- ~OnAppUnregisteredNotification() FINAL;
-
- /**
- * @brief Init overrides and skips replacement of app id with hmi id since
- * 1) at the moment this notification is being sent there is no application
- * registered in application manager
- * 2) hmi id is already used whenever this message is being constructed, so
- * its already there
- * @return True in any case
- */
- bool Init() FINAL;
-
- /**
- * @brief Execute command
- **/
- virtual void Run() FINAL;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h
deleted file mode 100644
index 13fa41ac22..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAudioDataStreamingNotification command class
- **/
-class OnAudioDataStreamingNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAudioDataStreamingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAudioDataStreamingNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAudioDataStreamingNotification class destructor
- **/
- virtual ~OnAudioDataStreamingNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAudioDataStreamingNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h
deleted file mode 100644
index f294bce2c8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnButtonEventNotification command class
- **/
-class OnButtonEventNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnButtonEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h
deleted file mode 100644
index 8936ed8a0f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnButtonPressNotification command class
- **/
-class OnButtonPressNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnButtonPressNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonPressNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h
deleted file mode 100644
index d98ba3a90b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnButtonSubscriptionNotification command class
- **/
-class OnButtonSubscriptionNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnButtonSubscriptionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonSubscriptionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnButtonSubscriptionNotification class destructor
- **/
- virtual ~OnButtonSubscriptionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnButtonSubscriptionNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h
deleted file mode 100644
index 5345135583..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnDeviceChosenNotification command class
- **/
-class OnDeviceChosenNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnDeviceChosenNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDeviceChosenNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDeviceChosenNotification class destructor
- **/
- virtual ~OnDeviceChosenNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDeviceChosenNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h
deleted file mode 100644
index 62a87f4599..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnDeviceStateChangedNotification command class
- **/
-class OnDeviceStateChangedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnDeviceStateChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDeviceStateChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDeviceStateChangedNotification class destructor
- **/
- virtual ~OnDeviceStateChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h
deleted file mode 100644
index 69d1707bf7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnDriverDistractionNotification command class
- **/
-class OnDriverDistractionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnDriverDistractionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDriverDistractionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDriverDistractionNotification class destructor
- **/
- virtual ~OnDriverDistractionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h
deleted file mode 100644
index cbe301179d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnEventChangedNotification command class
- **/
-class OnEventChangedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnEventChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnEventChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnEventChangedNotification class destructor
- **/
- virtual ~OnEventChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnEventChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
deleted file mode 100644
index 92ef97a4aa..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnExitAllApplicationsNotification command class
- **/
-class OnExitAllApplicationsNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnExitAllApplicationsNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnExitAllApplicationsNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnExitAllApplicationsNotification class destructor
- **/
- virtual ~OnExitAllApplicationsNotification();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- private:
- /**
- * @brief Notify's HMI that SDL stored all data required for resumption
- **/
- void SendOnSDLPersistenceComplete();
-
- DISALLOW_COPY_AND_ASSIGN(OnExitAllApplicationsNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h
deleted file mode 100644
index bb96a4f14e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnExitApplicationNotification command class
- **/
-class OnExitApplicationNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnExitApplicationNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnExitApplicationNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnExitApplicationNotification class destructor
- **/
- virtual ~OnExitApplicationNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnExitApplicationNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h
deleted file mode 100644
index 3f1ac17fc4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnFileRemovedNotification command class
- **/
-class OnFileRemovedNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnFileRemovedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnFileRemovedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnFileRemovedNotification class destructor
- **/
- virtual ~OnFileRemovedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnFileRemovedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h
deleted file mode 100644
index 70347cc44f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnFindApplications command class
- **/
-class OnFindApplications : public NotificationFromHMI {
- public:
- /**
- * @brief OnFindApplications class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnFindApplications(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnFindApplications class destructor
- **/
- virtual ~OnFindApplications();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnFindApplications);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
deleted file mode 100644
index acb1ff31ac..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnIgnitionCycleOverNotification command class
- **/
-class OnIgnitionCycleOverNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnIgnitionCycleOverNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnIgnitionCycleOverNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnIgnitionCycleOverNotification class destructor
- **/
- virtual ~OnIgnitionCycleOverNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnIgnitionCycleOverNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
deleted file mode 100644
index 0150853546..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnNaviTBTClientStateNotification command class
- **/
-class OnNaviTBTClientStateNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnNaviTBTClientStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnNaviTBTClientStateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviTBTClientStateNotification class destructor
- **/
- virtual ~OnNaviTBTClientStateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnNaviTBTClientStateNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h
deleted file mode 100644
index d304685008..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnNaviWayPointChangeNotification command class
- **/
-class OnNaviWayPointChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnNaviWayPointChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnNaviWayPointChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& app_man);
-
- /**
- * @brief OnNaviWayPointChangeNotification class destructor
- **/
- virtual ~OnNaviWayPointChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnNaviWayPointChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h
deleted file mode 100644
index 5569131c2b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-class OnPolicyUpdate : public NotificationFromHMI {
- public:
- /**
- * @brief OnPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnPolicyUpdate class destructor
- **/
- virtual ~OnPolicyUpdate();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate);
-};
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h
deleted file mode 100644
index 809623fda0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnPutFileNotification command class
- **/
-class OnPutFileNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnPutFileNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnPutFileNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnPutFileNotification class destructor
- **/
- virtual ~OnPutFileNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPutFileNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h
deleted file mode 100644
index 7df1bf5ac0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnReadyNotification command class
- **/
-class OnReadyNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnReadyNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnReadyNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnReadyNotification class destructor
- **/
- virtual ~OnReadyNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnReadyNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h
deleted file mode 100644
index cec707b44f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class OnReceivedPolicyUpdate : public NotificationFromHMI {
- public:
- /**
- * @brief OnReceivedPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnReceivedPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnReceivedPolicyUpdate class destructor
- **/
- ~OnReceivedPolicyUpdate() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h
deleted file mode 100644
index fbb8a0522a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnRecordStartdNotification command class
- **/
-class OnRecordStartdNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnRecordStartdNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnRecordStartdNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnRecordStartdNotification class destructor
- **/
- virtual ~OnRecordStartdNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnRecordStartdNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
deleted file mode 100644
index 764ee6d180..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnResumeAudioSourceNotification command class
- **/
-class OnResumeAudioSourceNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnResumeAudioSourceNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnResumeAudioSourceNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnResumeAudioSourceNotification class destructor
- **/
- virtual ~OnResumeAudioSourceNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnResumeAudioSourceNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h
deleted file mode 100644
index ef1d289ca7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSDLCloseNotification command class
- **/
-class OnSDLCloseNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnSDLCloseNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSDLCloseNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSdlCloseNotification class destructor
- **/
- virtual ~OnSDLCloseNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSDLCloseNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
deleted file mode 100644
index 5b0f4a1667..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSDLConsentNeededNotification command class
- **/
-class OnSDLConsentNeededNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnSDLConsentNeededNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSDLConsentNeededNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSDLConsentNeededNotification class destructor
- **/
- virtual ~OnSDLConsentNeededNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
deleted file mode 100644
index 1d91faece6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSDLPersistenceCompleteNotification command class
- **/
-class OnSDLPersistenceCompleteNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnSDLPersistenceCompleteNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSDLPersistenceCompleteNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSDLPersistenceCompleteNotification class destructor
- **/
- virtual ~OnSDLPersistenceCompleteNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h
deleted file mode 100644
index 2e523924db..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnStartDeviceDiscovery command class
- **/
-class OnStartDeviceDiscovery : public NotificationFromHMI {
- public:
- /**
- * @brief OnStartDeviceDiscovery class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnStartDeviceDiscovery(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnStartDeviceDiscovery class destructor
- **/
- virtual ~OnStartDeviceDiscovery();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnStartDeviceDiscovery);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h
deleted file mode 100644
index 05cb5a4931..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnGetStatusUpdateNotification command class
- **/
-class OnStatusUpdateNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnGetStatusUpdateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnStatusUpdateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnGetStatusUpdateNotification class destructor
- **/
- virtual ~OnStatusUpdateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h
deleted file mode 100644
index 9008a20cc9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile_api = mobile_apis;
-/**
- * @brief OnSystemContextNotification command class
- **/
-class OnSystemContextNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemContextNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemContextNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemContextNotification class destructor
- **/
- virtual ~OnSystemContextNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemContextNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h
deleted file mode 100644
index 1e65b15c20..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSystemErrorNotification command class
- **/
-class OnSystemErrorNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemErrorNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemErrorNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemErrorNotification class destructor
- **/
- virtual ~OnSystemErrorNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemErrorNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h
deleted file mode 100644
index 1c2bf0266f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSystemInfoChangedNotification command class
- **/
-class OnSystemInfoChangedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemInfoChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemInfoChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemInfoChangedNotification class destructor
- **/
- virtual ~OnSystemInfoChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h
deleted file mode 100644
index 8e4db24822..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSystemRequestNotification command class
- **/
-class OnSystemRequestNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemRequestNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemRequestNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemRequestNotification class destructor
- **/
- virtual ~OnSystemRequestNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h
deleted file mode 100644
index 245dc32386..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTTSLanguageChangeNotification command class
- **/
-class OnTTSLanguageChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSLanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTTSLanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSLanguageChangeNotification class destructor
- **/
- virtual ~OnTTSLanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSLanguageChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
deleted file mode 100644
index be84a93215..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnTTSResetTimeoutNotification command class
- **/
-class OnTTSResetTimeoutNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSResetTimeoutNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTTSResetTimeoutNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSResetTimeoutNotification class destructor
- **/
- virtual ~OnTTSResetTimeoutNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h
deleted file mode 100644
index 234d8036eb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTTSStartedNotification command class
- **/
-class OnTTSStartedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSStartedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTTSStartedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSStartedNotification class destructor
- **/
- virtual ~OnTTSStartedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSStartedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h
deleted file mode 100644
index 4e058fde64..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTTSStoppedNotification command class
- **/
-class OnTTSStoppedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSStoppedNotification class constructor
- *
- * @param message Incoming SmartObject OnTTSStartedNotificationmessage
- **/
- OnTTSStoppedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSStoppedNotification class destructor
- **/
- virtual ~OnTTSStoppedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSStoppedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h
deleted file mode 100644
index 618bc13017..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnUICommandNotification command class
- **/
-class OnUICommandNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUICommandNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUICommandNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUICommandNotification class destructor
- **/
- virtual ~OnUICommandNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUICommandNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
deleted file mode 100644
index 6e881dc94a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnUIKeyBoardInputNotification command class
- **/
-class OnUIKeyBoardInputNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUIKeyBoardInputNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUIKeyBoardInputNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUIKeyBoardInputNotification class destructor
- **/
- virtual ~OnUIKeyBoardInputNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUIKeyBoardInputNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h
deleted file mode 100644
index cc8cd1eb0e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnUILanguageChangeNotification command class
- **/
-class OnUILanguageChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUILanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUILanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUILanguageChangeNotification class destructor
- **/
- virtual ~OnUILanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUILanguageChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
deleted file mode 100644
index f5dd173998..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnUIResetTimeoutNotification command class
- **/
-class OnUIResetTimeoutNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUIResetTimeoutNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUIResetTimeoutNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUIResetTimeoutNotification class destructor
- **/
- virtual ~OnUIResetTimeoutNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
deleted file mode 100644
index 9e9384fffe..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnUITouchEventNotification command class
- **/
-class OnUITouchEventNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUITouchEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUITouchEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUITouchEventNotification class destructor
- **/
- virtual ~OnUITouchEventNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUITouchEventNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h b/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h
deleted file mode 100644
index ee53445606..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnUpdateDeviceList command class
- **/
-class OnUpdateDeviceList : public NotificationFromHMI {
- public:
- /**
- * @brief OnUpdateDeviceList class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUpdateDeviceList(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUpdateDeviceList class destructor
- **/
- virtual ~OnUpdateDeviceList();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUpdateDeviceList);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
deleted file mode 100644
index 9c5a8cd955..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIAccPedalPositionNotification command class
- **/
-class OnVIAccPedalPositionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIAccPedalPositionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIAccPedalPositionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIAccPedalPositionNotification class destructor
- **/
- virtual ~OnVIAccPedalPositionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
deleted file mode 100644
index c4f92269bb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIBeltStatusNotification command class
- **/
-class OnVIBeltStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIBeltStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIBeltStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIBeltStatusNotification class destructor
- **/
- virtual ~OnVIBeltStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h
deleted file mode 100644
index 9d9854c50b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIBodyInformationNotification command class
- **/
-class OnVIBodyInformationNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIBodyInformationNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIBodyInformationNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIBodyInformationNotification class destructor
- **/
- virtual ~OnVIBodyInformationNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h
deleted file mode 100644
index c31ee1f209..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIDeviceStatusNotification command class
- **/
-class OnVIDeviceStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIDeviceStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIDeviceStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIDeviceStatusNotification class destructor
- **/
- virtual ~OnVIDeviceStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
deleted file mode 100644
index 108f02b5a4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIDriverBrakingNotification command class
- **/
-class OnVIDriverBrakingNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIDriverBrakingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIDriverBrakingNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIDriverBrakingNotification class destructor
- **/
- virtual ~OnVIDriverBrakingNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
deleted file mode 100644
index bbd13963aa..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIEngineTorqueNotification command class
- **/
-class OnVIEngineTorqueNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIEngineTorqueNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIEngineTorqueNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIEngineTorqueNotification class destructor
- **/
- virtual ~OnVIEngineTorqueNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
deleted file mode 100644
index b996febacf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIExternalTemperatureNotification command class
- **/
-class OnVIExternalTemperatureNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIExternalTemperatureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIExternalTemperatureNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIExternalTemperatureNotification class destructor
- **/
- virtual ~OnVIExternalTemperatureNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
deleted file mode 100644
index 9c30b6c32c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIFuelLevelNotification command class
- **/
-class OnVIFuelLevelNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIFuelLevelNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIFuelLevelNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIFuelLevelNotification class destructor
- **/
- virtual ~OnVIFuelLevelNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
deleted file mode 100644
index 53b6ea209f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIFuelLevelStateNotification command class
- **/
-class OnVIFuelLevelStateNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIFuelLevelStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIFuelLevelStateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIFuelLevelStateNotification class destructor
- **/
- virtual ~OnVIFuelLevelStateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
deleted file mode 100644
index 579344b538..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIGpsDataNotification command class
- **/
-class OnVIGpsDataNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIGpsDataNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIGpsDataNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIGpsDataNotification class destructor
- **/
- virtual ~OnVIGpsDataNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
deleted file mode 100644
index 5fd3be85a4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIHeadLampStatusNotification command class
- **/
-class OnVIHeadLampStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIHeadLampStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIHeadLampStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIHeadLampStatusNotification class destructor
- **/
- virtual ~OnVIHeadLampStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
deleted file mode 100644
index ee82b1397f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIInstantFuelConsumptionNotification command class
- **/
-class OnVIInstantFuelConsumptionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIInstantFuelConsumptionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIInstantFuelConsumptionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager);
-
- /**
- * @brief OnVIInstantFuelConsumptionNotification class destructor
- **/
- virtual ~OnVIInstantFuelConsumptionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h
deleted file mode 100644
index 364e42081c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIMyKeyNotification command class
- **/
-class OnVIMyKeyNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIMyKeyNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIMyKeyNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIMyKeyNotification class destructor
- **/
- virtual ~OnVIMyKeyNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h
deleted file mode 100644
index 7d93530f04..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIOdometerNotification command class
- **/
-class OnVIOdometerNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIOdometerNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIOdometerNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIOdometerNotification class destructor
- **/
- virtual ~OnVIOdometerNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h
deleted file mode 100644
index c09220d2a6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIPrndlNotification command class
- **/
-class OnVIPrndlNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIPrndlNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIPrndlNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIPrndlNotification class destructor
- **/
- virtual ~OnVIPrndlNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h
deleted file mode 100644
index d05e1221df..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIRpmNotification command class
- **/
-class OnVIRpmNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIRpmNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIRpmNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIRpmNotification class destructor
- **/
- virtual ~OnVIRpmNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h
deleted file mode 100644
index b1908cde28..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVISpeedNotification command class
- **/
-class OnVISpeedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVISpeedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVISpeedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVISpeedNotification class destructor
- **/
- virtual ~OnVISpeedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
deleted file mode 100644
index 28f78ac4d5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVISteeringWheelAngleNotification command class
- **/
-class OnVISteeringWheelAngleNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVISteeringWheelAngleNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVISteeringWheelAngleNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVISteeringWheelAngleNotification class destructor
- **/
- virtual ~OnVISteeringWheelAngleNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
deleted file mode 100644
index eef4f0e4a4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVITirePressureNotification command class
- **/
-class OnVITirePressureNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVITirePressureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVITirePressureNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVITirePressureNotification class destructor
- **/
- virtual ~OnVITirePressureNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
deleted file mode 100644
index 2422c47813..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIVehicleDataNotification command class
- * Sent by HMI for the periodic and non periodic vehicle data
- **/
-class OnVIVehicleDataNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIVehicleDataNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIVehicleDataNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIVehicleDataNotification class destructor
- **/
- virtual ~OnVIVehicleDataNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIVehicleDataNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h
deleted file mode 100644
index 4ea04fbb0d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIVinNotification command class
- **/
-class OnVIVinNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIVinNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIVinNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIVinNotification class destructor
- **/
- virtual ~OnVIVinNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
deleted file mode 100644
index 2b57ef1dd3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIWiperStatusNotification command class
- **/
-class OnVIWiperStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIWiperStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIWiperStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIWiperStatusNotification class destructor
- **/
- virtual ~OnVIWiperStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h
deleted file mode 100644
index 81493a0a33..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVideoDataStreamingNotification command class
- **/
-class OnVideoDataStreamingNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnVideoDataStreamingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVideoDataStreamingNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVideoDataStreamingNotification class destructor
- **/
- virtual ~OnVideoDataStreamingNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVideoDataStreamingNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h
deleted file mode 100644
index fa85ba8468..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRCommandNotification command class
- **/
-class OnVRCommandNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRCommandNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRCommandNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRCommandNotification class destructor
- **/
- virtual ~OnVRCommandNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRCommandNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h
deleted file mode 100644
index d0f86e5f83..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRLanguageChangeNotification command class
- **/
-class OnVRLanguageChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRLanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRLanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRLanguageChangeNotification class destructor
- **/
- virtual ~OnVRLanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRLanguageChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h
deleted file mode 100644
index f142fcc25c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRStartedNotification command class
- **/
-class OnVRStartedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRStartedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRStartedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRStartedNotification class destructor
- **/
- virtual ~OnVRStartedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRStartedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h
deleted file mode 100644
index d1dbcc91cd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRStoppedNotification command class
- **/
-class OnVRStoppedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRStoppedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRStoppedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRStoppedNotification class destructor
- **/
- virtual ~OnVRStoppedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRStoppedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h
deleted file mode 100644
index 58654d81d9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief RCGetCapabilitiesRequest command class
- **/
-class RCGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief RCGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- RCGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief RCGetCapabilitiesRequest class destructor
- **/
- virtual ~RCGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h
deleted file mode 100644
index 006f38cbb5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief RCGetCapabilitiesResponse command class
- **/
-class RCGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief RCGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- RCGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief RCGetCapabilitiesResponse class destructor
- **/
- virtual ~RCGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h
deleted file mode 100644
index 40e05c2b1f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief RCIsReadyRequest command class
- **/
-class RCIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief RCIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- RCIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief RCIsReadyRequest class destructor
- **/
- virtual ~RCIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RCIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h
deleted file mode 100644
index 547b89a30d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief RCIsReadyResponse command class
- **/
-class RCIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief RCIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- RCIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief RCIsReadyResponse class destructor
- **/
- virtual ~RCIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RCIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h
deleted file mode 100644
index 628d3257d9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/HMI_API.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
-class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
- public:
- RequestFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~RequestFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- virtual void on_event(const event_engine::Event& event);
- /**
- * @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);
-
- /**
- * @brief SendResponse allows to send error response to hmi
- * @param correlation_id the correlation id for the response.
- * @param function_id the function id for which response will be sent
- * @param result_code the result code.
- * @param error_message info message for error.
- */
- void SendErrorResponse(const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code,
- const std::string error_message);
-
- private:
- /**
- * @brief Fills common parameters for SO
- * @param message Contains SO for filling
- * @param correlation_id the correlation id for the response.
- * @param function_id the function id for which response will be sent
- */
- void FillCommonParametersOfSO(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message,
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
deleted file mode 100644
index b30044fd26..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Check if HMI's interface is available.
- * @param application_manager contains application manager component
- * @param interface contains name of HMI's interface
- * @return true if interface is available otherwise return fasle.
- */
-bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
- HmiInterfaces::InterfaceID interface);
-
-/**
- * @brief Change interface state
- * @param application_manager contains ApplicationManager instance
- * @param response_from_hmi contains response from HMI
- * @param interface contanins InterfaceID whose state is changed.
- * @return true if field available exist and contains true in response params
- * otherwise return false.
- */
-bool ChangeInterfaceState(ApplicationManager& application_manager,
- const smart_objects::SmartObject& response_from_hmi,
- HmiInterfaces::InterfaceID interface);
-
-class RequestToHMI : public CommandImpl {
- public:
- RequestToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~RequestToHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- 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(RequestToHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h
deleted file mode 100644
index 05fd23adf0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/application_manager.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class ResponseFromHMI : public CommandImpl {
- public:
- ResponseFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~ResponseFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendResponseToMobile(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /*
- * @brief Creates HMI request
- *
- * @param function_id HMI request ID
- * @param msg_params HMI request msg params
- */
- void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ResponseFromHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
deleted file mode 100644
index 1dd0657815..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
+++ /dev/null
@@ -1,63 +0,0 @@
-
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/HMI_API.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
-class ResponseToHMI : public CommandImpl {
- public:
- ResponseToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~ResponseToHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ResponseToHMI);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h
deleted file mode 100644
index 9ce15a0970..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLActivateAppRequest command class
- **/
-class SDLActivateAppRequest : public RequestFromHMI {
- public:
- /**
- * @brief Applications registered over protocol v4
- */
- typedef std::vector<application_manager::ApplicationSharedPtr> V4ProtoApps;
-
- /**
- * @brief SDLActivateAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLActivateAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLActivateAppRequest class destructor
- **/
- ~SDLActivateAppRequest() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief onTimeOut allows to process case when timeout has appeared
- * during request execution.
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief on_event allows to handle events
- *
- * @param event event type that current request subscribed on.
- */
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- private:
- uint32_t app_id() const;
- uint32_t hmi_app_id(const smart_objects::SmartObject& so) const;
-
- /**
- * @brief Retrieves all v4 protocol applications for particular device
- * @param handle Device handle
- * @return List of applications registered over v4 protocol
- */
- V4ProtoApps get_v4_proto_apps(
- const connection_handler::DeviceHandle handle) const;
-
- /**
- * @brief Get v4 protocol application reported as forgrounded on device
- * @param handle Device
- * @return Pointer to application or empty pointer
- */
- ApplicationSharedPtr get_foreground_app(
- const connection_handler::DeviceHandle handle) const;
-
- DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h
deleted file mode 100644
index 50bc319569..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLActivateAppResponse command class
- **/
-class SDLActivateAppResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLActivateAppResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLActivateAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLActivateAppResponse class destructor
- **/
- virtual ~SDLActivateAppResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
deleted file mode 100644
index 69e4ec227c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetListOfPermissionsRequest command class
- **/
-class SDLGetListOfPermissionsRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLGetListOfPermissionsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetListOfPermissionsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetListOfPermissionsRequest class destructor
- **/
- virtual ~SDLGetListOfPermissionsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
deleted file mode 100644
index b82f16e113..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetListOfPermissionsResponse command class
- **/
-class SDLGetListOfPermissionsResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLGetListOfPermissionsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetListOfPermissionsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetListOfPermissionsResponse class destructor
- **/
- virtual ~SDLGetListOfPermissionsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h
deleted file mode 100644
index 4f5ce887bd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetStatusUpdateRequest command class
- **/
-class SDLGetStatusUpdateRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLGetStatusUpdateRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetStatusUpdateRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetStatusUpdateRequest class destructor
- **/
- virtual ~SDLGetStatusUpdateRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h
deleted file mode 100644
index f8aeb6135f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetStatusUpdateResponse command class
- **/
-class SDLGetStatusUpdateResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLGetStatusUpdateResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetStatusUpdateResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetStatusUpdateResponse class destructor
- **/
- virtual ~SDLGetStatusUpdateResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
deleted file mode 100644
index 9837e6af09..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetUserFriendlyMessageRequest command class
- **/
-class SDLGetUserFriendlyMessageRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLGetUserFriendlyMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetUserFriendlyMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetUserFriendlyMessageRequest class destructor
- **/
- virtual ~SDLGetUserFriendlyMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
deleted file mode 100644
index bb2fba8433..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetUserFriendlyMessageResponse command class
- **/
-class SDLGetUserFriendlyMessageResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLGetUserFriendlyMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetUserFriendlyMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetUserFriendlyMessageResponse class destructor
- **/
- virtual ~SDLGetUserFriendlyMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h
deleted file mode 100644
index 99b627431c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class SDLPolicyUpdate : public RequestToHMI {
- public:
- /**
- * @brief SDLPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- ~SDLPolicyUpdate() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h
deleted file mode 100644
index 12850f4b8a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class SDLPolicyUpdateResponse : public ResponseFromHMI {
- public:
- /**
- * @brief SDLPolicyUpdateResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLPolicyUpdateResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLPolicyUpdateResponse class destructor
- **/
- virtual ~SDLPolicyUpdateResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h
deleted file mode 100644
index 0f36e82b44..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSChangeRegistrationRequest command class
- **/
-class TTSChangeRegistrationRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSChangeRegistrationRequest class destructor
- **/
- virtual ~TTSChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistrationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h
deleted file mode 100644
index ca9c114156..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSChangeRegistratioResponse command class
- **/
-class TTSChangeRegistratioResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSChangeRegistratioResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSChangeRegistratioResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSChangeRegistratioResponse class destructor
- **/
- virtual ~TTSChangeRegistratioResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistratioResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h
deleted file mode 100644
index bea41b7371..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetCapabilitiesRequest command class
- **/
-class TTSGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetCapabilitiesRequest class destructor
- **/
- virtual ~TTSGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h
deleted file mode 100644
index a70ee2b33b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetCapabilitiesResponse command class
- **/
-class TTSGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetCapabilitiesResponse class destructor
- **/
- virtual ~TTSGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h
deleted file mode 100644
index 627cf3da06..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetLanguageRequest command class
- **/
-class TTSGetLanguageRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSGetLanguageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetLanguageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetLanguageRequest class destructor
- **/
- virtual ~TTSGetLanguageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h
deleted file mode 100644
index f44492a6ed..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetLanguageResponse command class
- **/
-class TTSGetLanguageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSGetLanguageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetLanguageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetLanguageResponse class destructor
- **/
- virtual ~TTSGetLanguageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
deleted file mode 100644
index 9500d54eea..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetSupportedLanguagesRequest command class
- **/
-class TTSGetSupportedLanguagesRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSGetSupportedLanguagesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetSupportedLanguagesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetSupportedLanguagesRequest class destructor
- **/
- virtual ~TTSGetSupportedLanguagesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
deleted file mode 100644
index 1bc569ebb8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetSupportedLanguagesResponse command class
- **/
-class TTSGetSupportedLanguagesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSGetSupportedLanguagesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetSupportedLanguagesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetSupportedLanguagesResponse class destructor
- **/
- virtual ~TTSGetSupportedLanguagesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
deleted file mode 100644
index 340a00d294..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSIsReadyRequest command class
- **/
-class TTSIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief TTSIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSIsReadyRequest class destructor
- **/
- virtual ~TTSIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h
deleted file mode 100644
index 833d3d0a82..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSIsReadyResponse command class
- **/
-class TTSIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSIsReadyResponse class destructor
- **/
- virtual ~TTSIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h
deleted file mode 100644
index b18e372b3e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSetGlobalPropertiesRequest command class
- **/
-class TTSSetGlobalPropertiesRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSSetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSetGlobalPropertiesRequest class destructor
- **/
- virtual ~TTSSetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h
deleted file mode 100644
index aa7c85eece..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSetGlobalPropertiesResponse command class
- **/
-class TTSSetGlobalPropertiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSSetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSetGlobalPropertiesResponse class destructor
- **/
- virtual ~TTSSetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h
deleted file mode 100644
index 87384beedf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSpeakRequest command class
- **/
-class TTSSpeakRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSSpeakRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSpeakRequest class destructor
- **/
- virtual ~TTSSpeakRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSpeakRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h
deleted file mode 100644
index 9f15afb33b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSpeakResponse command class
- **/
-class TTSSpeakResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSSpeakResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSpeakResponse class destructor
- **/
- virtual ~TTSSpeakResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSpeakResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h
deleted file mode 100644
index c51daee84d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSStopSpeakingRequest command class
- **/
-class TTSStopSpeakingRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSStopSpeakingRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSStopSpeakingRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSStopSpeakingRequest class destructor
- **/
- virtual ~TTSStopSpeakingRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h
deleted file mode 100644
index a23889a733..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSStopSpeakingResponse command class
- **/
-class TTSStopSpeakingResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSStopSpeakingResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSStopSpeakingResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSStopSpeakingResponse class destructor
- **/
- virtual ~TTSStopSpeakingResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h
deleted file mode 100644
index 294fd11912..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddCommandRequest command class
- **/
-class UIAddCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief UIAddCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddCommandRequest class destructor
- **/
- virtual ~UIAddCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h
deleted file mode 100644
index ed48e13322..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddCommandResponse command class
- **/
-class UIAddCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIAddCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddCommandResponse class destructor
- **/
- virtual ~UIAddCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h
deleted file mode 100644
index 96fa0557ae..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddSubmenuRequest command class
- **/
-class UIAddSubmenuRequest : public RequestToHMI {
- public:
- /**
- * @brief UIAddSubmenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddSubmenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddSubmenuRequest class destructor
- **/
- virtual ~UIAddSubmenuRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h
deleted file mode 100644
index 62abf10b60..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddSubmenuResponse command class
- **/
-class UIAddSubmenuResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIAddSubmenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddSubmenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddSubmenuResponse class destructor
- **/
- virtual ~UIAddSubmenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h
deleted file mode 100644
index 123246e596..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAlertRequest command class
- **/
-class UIAlertRequest : public RequestToHMI {
- public:
- /**
- * @brief UIAlertRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAlertRequest class destructor
- **/
- virtual ~UIAlertRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAlertRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h
deleted file mode 100644
index db48699a23..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAlertResponse command class
- **/
-class UIAlertResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIAlertResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAlertResponse class destructor
- **/
- virtual ~UIAlertResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAlertResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h
deleted file mode 100644
index 744ed82cad..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIChangeRegistrationRequest command class
- **/
-class UIChangeRegistrationRequest : public RequestToHMI {
- public:
- /**
- * @brief UIChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIChangeRegistrationRequest class destructor
- **/
- virtual ~UIChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIChangeRegistrationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h
deleted file mode 100644
index 57814b9acf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIChangeRegistratioResponse command class
- **/
-class UIChangeRegistratioResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIChangeRegistratioResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIChangeRegistratioResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIChangeRegistratioResponse class destructor
- **/
- virtual ~UIChangeRegistratioResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIChangeRegistratioResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h
deleted file mode 100644
index 21a4c6dd42..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIDeleteCommandRequest command class
- **/
-class UIDeleteCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief UIDeleteCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteCommandRequest class destructor
- **/
- virtual ~UIDeleteCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h
deleted file mode 100644
index c9baba728f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIDeleteCommandResponse command class
- **/
-class UIDeleteCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIDeleteCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteCommandResponse class destructor
- **/
- virtual ~UIDeleteCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h
deleted file mode 100644
index d238e39a10..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddSubmenuRequest command class
- **/
-class UIDeleteSubmenuRequest : public RequestToHMI {
- public:
- /**
- * @brief UIDeleteSubmenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteSubmenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteSubmenuRequest class destructor
- **/
- virtual ~UIDeleteSubmenuRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h
deleted file mode 100644
index 36d7bee528..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIDeleteSubmenuResponse command class
- **/
-class UIDeleteSubmenuResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIDeleteSubmenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteSubmenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteSubmenuResponse class destructor
- **/
- virtual ~UIDeleteSubmenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
deleted file mode 100644
index d8bd10a9ca..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIEndAudioPassThruRequest command class
- * When this request is invoked, the audio capture stops
- **/
-class UIEndAudioPassThruRequest : public RequestToHMI {
- public:
- /**
- * @brief UIEndAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIEndAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIEndAudioPassThruRequest class destructor
- **/
- virtual ~UIEndAudioPassThruRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
deleted file mode 100644
index c2a373d8c0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIEndAudioPassThruResponse command class
- **/
-class UIEndAudioPassThruResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIEndAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIEndAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIEndAudioPassThruResponse class destructor
- **/
- virtual ~UIEndAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h
deleted file mode 100644
index cffba5ca42..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetCapabilitiesRequest command class
- **/
-class UIGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief UIGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetCapabilitiesRequest class destructor
- **/
- virtual ~UIGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h
deleted file mode 100644
index 525dd7ad9d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetCapabilitiesResponse command class
- **/
-class UIGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetCapabilitiesResponse class destructor
- **/
- virtual ~UIGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h
deleted file mode 100644
index 4bf8e11d7e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetLanguageRequest command class
- **/
-class UIGetLanguageRequest : public RequestToHMI {
- public:
- /**
- * @brief UIGetLanguageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetLanguageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetLanguageRequest class destructor
- **/
- virtual ~UIGetLanguageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetLanguageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h
deleted file mode 100644
index 29bbba85ff..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetLanguageResponse command class
- **/
-class UIGetLanguageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIGetLanguageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetLanguageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetLanguageResponse class destructor
- **/
- virtual ~UIGetLanguageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetLanguageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
deleted file mode 100644
index 94c197b7bc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetSupportedLanguagesRequest command class
- **/
-class UIGetSupportedLanguagesRequest : public RequestToHMI {
- public:
- /**
- * @brief UIGetSupportedLanguagesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetSupportedLanguagesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetSupportedLanguagesRequest class destructor
- **/
- virtual ~UIGetSupportedLanguagesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
deleted file mode 100644
index 8962b77833..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetSupportedLanguagesResponse command class
- **/
-class UIGetSupportedLanguagesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIGetSupportedLanguagesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetSupportedLanguagesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetSupportedLanguagesResponse class destructor
- **/
- virtual ~UIGetSupportedLanguagesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
deleted file mode 100644
index 49942d81a7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIIsReadyRequest command class
- **/
-class UIIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief UIIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIIsReadyRequest class destructor
- **/
- virtual ~UIIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h
deleted file mode 100644
index 93b2d9a569..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIIsReadyResponse command class
- **/
-class UIIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIIsReadyResponse class destructor
- **/
- virtual ~UIIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
deleted file mode 100644
index 4cec5a5600..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformAudioPassThruRequest command class
- **/
-class UIPerformAudioPassThruRequest : public RequestToHMI {
- public:
- /**
- * @brief UIPerformAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformAudioPassThruRequest class destructor
- **/
- virtual ~UIPerformAudioPassThruRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
deleted file mode 100644
index 9fb502233f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformAudioPassThruResponse command class
- **/
-class UIPerformAudioPassThruResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIPerformAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformAudioPassThruResponse class destructor
- **/
- virtual ~UIPerformAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h
deleted file mode 100644
index 8232043395..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformInteractionRequest command class
- **/
-class UIPerformInteractionRequest : public RequestToHMI {
- public:
- /**
- * @brief UIPerformInteractionRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformInteractionRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformInteractionRequest class destructor
- **/
- virtual ~UIPerformInteractionRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h
deleted file mode 100644
index 4db471bbae..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformInteractionResponse command class
- **/
-class UIPerformInteractionResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIPerformInteractionResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformInteractionResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformInteractionResponse class destructor
- **/
- virtual ~UIPerformInteractionResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h
deleted file mode 100644
index 8ba828a25e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIScrollableMessageRequest command class
- **/
-class UIScrollableMessageRequest : public RequestToHMI {
- public:
- /**
- * @brief UIScrollableMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIScrollableMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIScrollableMessageRequest class destructor
- **/
- virtual ~UIScrollableMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h
deleted file mode 100644
index 4ae432d658..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIScrollableMessageResponse command class
- **/
-class UIScrollableMessageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIScrollableMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIScrollableMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIScrollableMessageResponse class destructor
- **/
- virtual ~UIScrollableMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h
deleted file mode 100644
index b697176a36..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISendHapticDataRequest command class
- **/
-class UISendHapticDataRequest : public RequestToHMI {
- public:
- /**
- * @brief UISendHapticDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- * @param application_manager Reference of application manager
- **/
- UISendHapticDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISendHapticDataRequest class destructor
- **/
- ~UISendHapticDataRequest() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISendHapticDataRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h
deleted file mode 100644
index 96abe4665d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISendHapticDataResponse command class
- **/
-class UISendHapticDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISendHapticDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- * @param application_manager Reference of application manager
- **/
- UISendHapticDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISendHapticDataResponse class destructor
- **/
- ~UISendHapticDataResponse() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISendHapticDataResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h
deleted file mode 100644
index b1025035d6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconRequest command class
- **/
-class UISetAppIconRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetAppIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetIconRequest class destructor
- **/
- virtual ~UISetAppIconRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetAppIconRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h
deleted file mode 100644
index 6ad80bc9fe..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconResponse command class
- **/
-class UISetAppIconResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetAppIconResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetIconResponse class destructor
- **/
- virtual ~UISetAppIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetAppIconResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h
deleted file mode 100644
index 573e9351b1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UiSetDisplayLayoutRequest command class
- **/
-class UiSetDisplayLayoutRequest : public RequestToHMI {
- public:
- /**
- * @brief UiSetDisplayLayoutRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UiSetDisplayLayoutRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UiSetDisplayLayoutRequest class destructor
- **/
- virtual ~UiSetDisplayLayoutRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h
deleted file mode 100644
index 595ee93c30..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UiSetDisplayLayoutResponse command class
- **/
-class UiSetDisplayLayoutResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UiSetDisplayLayoutResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UiSetDisplayLayoutResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UiSetDisplayLayoutResponse class destructor
- **/
- virtual ~UiSetDisplayLayoutResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h
deleted file mode 100644
index 83bf11e2e1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetGlobalPropertiesRequest command class
- **/
-class UISetGlobalPropertiesRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIShowRequest class destructor
- **/
- virtual ~UISetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h
deleted file mode 100644
index 91de5e6df7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetGlobalPropertiesResponse command class
- **/
-class UISetGlobalPropertiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetGlobalPropertiesResponse class destructor
- **/
- virtual ~UISetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
deleted file mode 100644
index b7d759916e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconRequest command class
- **/
-class UISetIconRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetIconRequest class destructor
- **/
- virtual ~UISetIconRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetIconRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h
deleted file mode 100644
index a9739bc802..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconResponse command class
- **/
-class UISetIconResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetIconResponse(const MessageSharedPtr& message);
-
- /**
- * @brief UISetIconResponse class destructor
- **/
- virtual ~UISetIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetIconResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
deleted file mode 100644
index 92565e6f02..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetMediaClockTimerRequest command class
- **/
-class UISetMediaClockTimerRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetMediaClockTimerRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetMediaClockTimerRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetMediaClockTimerRequest class destructor
- **/
- virtual ~UISetMediaClockTimerRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
deleted file mode 100644
index 0d71ff00f0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetMediaClockTimerResponse command class
- **/
-class UISetMediaClockTimerResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetMediaClockTimerResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetMediaClockTimerResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetMediaClockTimerResponse class destructor
- **/
- virtual ~UISetMediaClockTimerResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h
deleted file mode 100644
index 80348de63b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIShowRequest command class
- **/
-class UIShowRequest : public RequestToHMI {
- public:
- /**
- * @brief UIShowRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIShowRequest class destructor
- **/
- virtual ~UIShowRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIShowRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h
deleted file mode 100644
index d696d2b9f8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIShowResponse command class
- **/
-class UIShowResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIShowResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIShowResponse class destructor
- **/
- virtual ~UIShowResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIShowResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h
deleted file mode 100644
index 583f52084d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ButtonGetCapabilitiesRequest command class
- **/
-class UISliderRequest : public RequestToHMI {
- public:
- /**
- * @brief UISliderRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISliderRequest class destructor
- **/
- virtual ~UISliderRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISliderRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h
deleted file mode 100644
index cabb54f6cb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISliderResponse command class
- **/
-class UISliderResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISliderResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISliderResponse class destructor
- **/
- virtual ~UISliderResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISliderResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h
deleted file mode 100644
index 61be04d04f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateAppListRequest command class
- **/
-class UpdateAppListRequest : public RequestToHMI {
- public:
- /**
- * @brief UpdateAppListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateAppListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateAppListRequest class destructor
- **/
- virtual ~UpdateAppListRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateAppListRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h
deleted file mode 100644
index 5ff8948393..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateAppListResponse command class
- **/
-class UpdateAppListResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UpdateAppListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateAppListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateAppListResponse class destructor
- **/
- virtual ~UpdateAppListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateAppListResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h
deleted file mode 100644
index f304f404a1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/event_engine/event_observer.h"
-#include "utils/lock.h"
-#include "utils/conditional_variable.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateDeviceListRequest command class
- **/
-class UpdateDeviceListRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief UpdateDeviceListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateDeviceListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateDeviceListRequest class destructor
- **/
- ~UpdateDeviceListRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- * Need to observe OnHMIReady event, to send UpdateDeviceListRequest
- * when HMI will be ready
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief Need to stop execution StopMethod if HMI did not started
- */
- virtual bool CleanUp();
-
- private:
- sync_primitives::Lock wait_hmi_lock;
- sync_primitives::ConditionalVariable termination_condition_;
-
- DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h
deleted file mode 100644
index 9320de1387..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateDeviceListResponse command class
- **/
-class UpdateDeviceListResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UpdateDeviceListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateDeviceListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateDeviceListResponse class destructor
- **/
- virtual ~UpdateDeviceListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h
deleted file mode 100644
index d8be10da2e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateSDLRequest command class
- **/
-class UpdateSDLRequest : public RequestToHMI {
- public:
- /**
- * @brief UpdateSDLRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateSDLRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateSDLRequest class destructor
- **/
- virtual ~UpdateSDLRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateSDLRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h
deleted file mode 100644
index bc0375d5fa..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateSDLResponse command class
- **/
-class UpdateSDLResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UpdateSDLResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateSDLResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateSDLResponse class destructor
- **/
- virtual ~UpdateSDLResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateSDLResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
deleted file mode 100644
index 099f27b734..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIDiagnosticMessageRequest command class
- **/
-class VIDiagnosticMessageRequest : public RequestToHMI {
- public:
- /**
- * @brief VIDiagnosticMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIDiagnosticMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIDiagnosticMessageRequest class destructor
- **/
- virtual ~VIDiagnosticMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
deleted file mode 100644
index f0ae76ccb7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIDiagnosticMessageResponse command class
- **/
-class VIDiagnosticMessageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIDiagnosticMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIDiagnosticMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIDiagnosticMessageResponse class destructor
- **/
- virtual ~VIDiagnosticMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h
deleted file mode 100644
index 3b7e502a57..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetDTCsRequest command class
- **/
-class VIGetDTCsRequest : public RequestToHMI {
- public:
- /**
- * @brief VIGetDTCsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetDTCsRequest class destructor
- **/
- virtual ~VIGetDTCsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetDTCsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h
deleted file mode 100644
index 7b7dab567b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetDTCsResponse command class
- **/
-class VIGetDTCsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetDTCsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetDTCsResponse class destructor
- **/
- virtual ~VIGetDTCsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetDTCsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
deleted file mode 100644
index 006f18e864..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataRequest command class
- **/
-class VIGetVehicleDataRequest : public RequestToHMI {
- public:
- /**
- * @brief VIGetVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleDataRequest class destructor
- **/
- virtual ~VIGetVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
deleted file mode 100644
index 6e90656600..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 subscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VIGetVehicleDataRequestTemplate : public RequestToHMI {
- public:
- /**
- * @brief VIGetVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataRequestTemplate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
deleted file mode 100644
index ef19072bb0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataResponse command class
- **/
-class VIGetVehicleDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleDataResponse class destructor
- **/
- virtual ~VIGetVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
deleted file mode 100644
index 557c33df13..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VIGetVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataResponseTemplate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
deleted file mode 100644
index cd70c3349b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleTypeRequest command class
- **/
-class VIGetVehicleTypeRequest : public RequestToHMI {
- public:
- /**
- * @brief VIGetVehicleTypeRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleTypeRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleTypeRequest class destructor
- **/
- virtual ~VIGetVehicleTypeRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
deleted file mode 100644
index 0ef35dd7fc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleTypeResponse command class
- **/
-class VIGetVehicleTypeResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleTypeResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleTypeResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleTypeResponse class destructor
- **/
- virtual ~VIGetVehicleTypeResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
deleted file mode 100644
index 07ab9df605..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIIsReadyRequest command class
- **/
-class VIIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief VIIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIIsReadyRequest class destructor
- **/
- virtual ~VIIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h
deleted file mode 100644
index a7866a1e73..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIIsReadyResponse command class
- **/
-class VIIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIIsReadyResponse class destructor
- **/
- virtual ~VIIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h
deleted file mode 100644
index cdbdb45a8b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIReadDIDRequest command class
- **/
-class VIReadDIDRequest : public RequestToHMI {
- public:
- /**
- * @brief VIReadDIDRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIReadDIDRequest class destructor
- **/
- virtual ~VIReadDIDRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIReadDIDRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h
deleted file mode 100644
index acb8760c5b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIReadDIDResponse command class
- **/
-class VIReadDIDResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIReadDIDResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIReadDIDResponse class destructor
- **/
- virtual ~VIReadDIDResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIReadDIDResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
deleted file mode 100644
index 58d4984f8d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VISubscribeVehicleDataRequest command class
- **/
-class VISubscribeVehicleDataRequest : public RequestToHMI {
- public:
- /**
- * @brief VISubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VISubscribeVehicleDataRequest class destructor
- **/
- virtual ~VISubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
deleted file mode 100644
index 76245af0f9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VISubscriveVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 subscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VISubscribeVehicleDataRequestTemplate : public RequestToHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataRequestTemplate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
deleted file mode 100644
index 8f038bf941..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VISubscribeVehicleDataResponse command class
- **/
-class VISubscribeVehicleDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VISubscribeVehicleDataResponse class destructor
- **/
- virtual ~VISubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
deleted file mode 100644
index e8272971e2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief VISubscriveVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataResponseTemplate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
deleted file mode 100644
index b99eee47e7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIUnsubscribeVehicleDataRequest command class
- **/
-class VIUnsubscribeVehicleDataRequest : public RequestToHMI {
- public:
- /**
- * @brief VIUnsubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIUnsubscribeVehicleDataRequest class destructor
- **/
- virtual ~VIUnsubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
deleted file mode 100644
index 2014896f11..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIUnsubscriveVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 unsubscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VIUnsubscribeVehicleDataRequestTemplate : public RequestToHMI {
- public:
- /**
- * @brief VIUnsubscriveVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataRequestTemplate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
deleted file mode 100644
index 3f930b5a5b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIUnsubscribeVehicleDataResponse command class
- **/
-class VIUnsubscribeVehicleDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIUnsubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIUnsubscribeVehicleDataResponse class destructor
- **/
- virtual ~VIUnsubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
deleted file mode 100644
index 0817ca90af..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIUnsubscriveVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataResponseTemplate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h
deleted file mode 100644
index 1ef4125c89..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRAddCommandRequest command class
- **/
-class VRAddCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief VRAddCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRAddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRAddCommandRequest class destructor
- **/
- virtual ~VRAddCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRAddCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h
deleted file mode 100644
index 1b419ed6ec..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRAddCommandResponse command class
- **/
-class VRAddCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRAddCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRAddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRAddCommandResponse class destructor
- **/
- virtual ~VRAddCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRAddCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h
deleted file mode 100644
index 642319e8d6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRChangeRegistrationRequest command class
- **/
-class VRChangeRegistrationRequest : public RequestToHMI {
- public:
- /**
- * @brief VRChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRChangeRegistrationRequest class destructor
- **/
- virtual ~VRChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h
deleted file mode 100644
index 8dc5e96729..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRChangeRegistrationResponse command class
- **/
-class VRChangeRegistrationResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRChangeRegistrationResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRChangeRegistrationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRChangeRegistrationResponse class destructor
- **/
- virtual ~VRChangeRegistrationResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h
deleted file mode 100644
index bc5c24a350..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRDeleteCommandRequest command class
- **/
-class VRDeleteCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief VRDeleteCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRDeleteCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRDeleteCommandRequest class destructor
- **/
- virtual ~VRDeleteCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h
deleted file mode 100644
index 526c296321..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRDeleteCommandResponse command class
- **/
-class VRDeleteCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRDeleteCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRDeleteCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRDeleteCommandResponse class destructor
- **/
- virtual ~VRDeleteCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
deleted file mode 100644
index 8dcc240e9b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetCapabilitiesRequest command class
- **/
-class VRGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief VRGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetCapabilitiesRequest class destructor
- **/
- virtual ~VRGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
deleted file mode 100644
index b6c8e081f5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetCapabilitiesResponse command class
- **/
-class VRGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetCapabilitiesResponse class destructor
- **/
- virtual ~VRGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h
deleted file mode 100644
index 05373784f3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetLanguageRequest command class
- **/
-class VRGetLanguageRequest : public RequestToHMI {
- public:
- /**
- * @brief VRGetLanguageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetLanguageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetLanguageRequest class destructor
- **/
- virtual ~VRGetLanguageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetLanguageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h
deleted file mode 100644
index fad2f219df..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetLanguageResponse command class
- **/
-class VRGetLanguageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRGetLanguageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetLanguageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetLanguageResponse class destructor
- **/
- virtual ~VRGetLanguageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetLanguageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
deleted file mode 100644
index 6ed56ebd32..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetSupportedLanguagesRequest command class
- **/
-class VRGetSupportedLanguagesRequest : public RequestToHMI {
- public:
- /**
- * @brief VRGetSupportedLanguagesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetSupportedLanguagesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetSupportedLanguagesRequest class destructor
- **/
- virtual ~VRGetSupportedLanguagesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
deleted file mode 100644
index c4e742ecd0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetSupportedLanguagesResponse command class
- **/
-class VRGetSupportedLanguagesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRGetSupportedLanguagesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetSupportedLanguagesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetSupportedLanguagesResponse class destructor
- **/
- virtual ~VRGetSupportedLanguagesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
deleted file mode 100644
index 55a2101e1a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRIsReadyRequest command class
- **/
-class VRIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief VRIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRIsReadyRequest class destructor
- **/
- virtual ~VRIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h
deleted file mode 100644
index 474b3373a3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRIsReadyResponse command class
- **/
-class VRIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRIsReadyResponse class destructor
- **/
- virtual ~VRIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h
deleted file mode 100644
index 1f54d29beb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRPerformInteractionRequest command class
- **/
-class VRPerformInteractionRequest : public RequestToHMI {
- public:
- /**
- * @brief VRPerformInteractionRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRPerformInteractionRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRPerformInteractionRequest class destructor
- **/
- virtual ~VRPerformInteractionRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h
deleted file mode 100644
index 7c445416ce..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSPerformInteractionResponse command class
- **/
-class VRPerformInteractionResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSPerformInteractionResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRPerformInteractionResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSPerformInteractionResponse class destructor
- **/
- virtual ~VRPerformInteractionResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
deleted file mode 100644
index 2aed94c448..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddCommandRequest command class
- **/
-class AddCommandRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AddCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddCommandRequest class destructor
- **/
- ~AddCommandRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- */
- void onTimeOut() FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /*
- * @brief Check if command name doesn't exist in application
- * Please see SDLAQ-CRS-407 for more information
- *
- * @param app Mobile application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckCommandName(ApplicationConstSharedPtr app);
-
- /*
- * @brief Check if command VR synonyms doesn't exist in application commands
- * Please see SDLAQ-CRS-407 for more information
- *
- * @param app Mobile application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckCommandVRSynonym(ApplicationConstSharedPtr app);
-
- /*
- * @brief Check if command parent ID exists in submenu map
- *
- * @param app Mobile application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckCommandParentId(ApplicationConstSharedPtr app);
-
- /**
- * @brief Removes command from list when HMI sends negative response or
- * HMI does not answer on addCommand request.
- */
- void RemoveCommand();
-
- DISALLOW_COPY_AND_ASSIGN(AddCommandRequest);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /**
- * @brief Checks add command param
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if add command contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- inline bool BothSend() const;
-
- /**
- * @brief GenerateMobileResponseInfo generated info for mobile response
- * depends from UI and VR responses
- * @return info for mobile response
- */
- const std::string GenerateMobileResponseInfo();
- bool send_ui_;
- bool send_vr_;
-
- bool is_ui_received_;
- bool is_vr_received_;
-
- std::string ui_info_;
- std::string vr_info_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType vr_result_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
deleted file mode 100644
index b385b3bc5c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddCommandResponse command class
- **/
-class AddCommandResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AddCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddCommandResponse class destructor
- **/
- virtual ~AddCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AddCommandResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
deleted file mode 100644
index 36b0b38464..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddSubMenuRequest command class
- **/
-class AddSubMenuRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AddSubMenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddSubMenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddSubMenuRequest class destructor
- **/
- ~AddSubMenuRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /*
- * @brief Check if submenu name is valid
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckSubMenuName();
-
- DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
deleted file mode 100644
index b09254369f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddSubMenuResponse command class
- **/
-class AddSubMenuResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AddSubMenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddSubMenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddSubMenuResponse class destructor
- **/
- virtual ~AddSubMenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AddSubMenuResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
deleted file mode 100644
index 17ad75b7a6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/pending.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertManeuverRequest command class
- **/
-class AlertManeuverRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AlertManeuverRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertManeuverRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertManeuverRequest class destructor
- **/
- virtual ~AlertManeuverRequest();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /**
- * @brief Prepare parameters for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param return_info contains resulting info for sending to mobile
- * application
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& return_info);
- /**
- * @brief Checks alert maneuver params(ttsChunks, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if alert maneuver contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- hmi_apis::Common_Result::eType tts_speak_result_code_;
- hmi_apis::Common_Result::eType navi_alert_maneuver_result_code_;
- std::string info_navi_;
- std::string info_tts_;
- Pending pending_requests_;
-
- DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
deleted file mode 100644
index 2d45435a8b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertManeuverResponse command class
- **/
-class AlertManeuverResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AlertManeuverResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertManeuverResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertManeuverResponse class destructor
- **/
- virtual ~AlertManeuverResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AlertManeuverResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
deleted file mode 100644
index 01b9782662..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertRequest command class
- **/
-class AlertRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AlertRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertRequest class destructor
- **/
- virtual ~AlertRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- protected:
- private:
- /*
- * @brief Checks if request parameters are valid
- * @param app_id Id of application requested this RPC
- * @returns true if request is valid and should be processed
- */
- bool Validate(uint32_t app_id);
- /*
- * @brief Sends UI Alert request
- *
- * @param app_id Id of application requested this RPC
- */
- void SendAlertRequest(int32_t app_id);
-
- /*
- * @brief Sends TTS Speak request
- *
- * @param app_id Id of application requested this RPC
- *
- * @param tts_chunks_exists if tts chunks exists in
- * message contains true, otherwise contains false
- *
- * @param length_tts_chunks contains length of array
- * tts chunks.
- */
- void SendSpeakRequest(int32_t app_id,
- bool tts_chunks_exists,
- size_t length_tts_chunks);
-
- /*
- * @brief Tells if there are sent requests without responses
- */
- bool HasHmiResponsesToWait();
-
- /*
- * @brief Check if all strings have valid syntax in request
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckStringsOfAlertRequest();
-
- /*
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param info contains info for mobile app.
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
-
- bool awaiting_ui_alert_response_;
- bool awaiting_tts_speak_response_;
- bool awaiting_tts_stop_speaking_response_;
- bool is_alert_succeeded_;
- bool is_ui_alert_sent_;
- hmi_apis::Common_Result::eType alert_result_;
- smart_objects::SmartObject alert_response_params_;
- hmi_apis::Common_Result::eType tts_speak_result_;
- std::string ui_response_info_;
- std::string tts_response_info_;
-
- DISALLOW_COPY_AND_ASSIGN(AlertRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
deleted file mode 100644
index e03dad7564..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertResponse command class
- **/
-class AlertResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AlertResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertResponse class destructor
- **/
- virtual ~AlertResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AlertResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h
deleted file mode 100644
index 2cd8e386e0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
-
-#include <strings.h>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/pending.h"
-#include "utils/macro.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-/**
- * @brief ChangeRegistrationRequest command class
- **/
-class ChangeRegistrationRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ChangeRegistrationRequest class destructor
- **/
- virtual ~ChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /*
- * @brief Search for requested language in HMI UI supported languages
- *
- * @return true if language supported by UI, otherwise false
- */
- bool IsLanguageSupportedByUI(const int32_t& hmi_display_lang);
-
- /*
- * @brief Search for requested language in HMI VR supported languages
- *
- * @return true if language supported by VR, otherwise false
- */
- bool IsLanguageSupportedByVR(const int32_t& hmi_display_lang);
-
- /*
- * @brief Search for requested language in HMI TTS supported languages
- *
- * @return true if language supported by TTS, otherwise false
- */
- bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /**
- * @brief Checks change_registration params(ttsName, appname,
- * ngnMediaScreenAppName, vrSynonyms) on invalid characters.
- *
- * @return true if command contains \t\n \\t \\n of whitespace otherwise
- * returns false.
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief Check parameters (name, vr) for
- * coincidence with already known parameters of registered applications
- *
- * @return SUCCESS if there is no coincidence of app.name/VR synonyms,
- * otherwise appropriate error code returns
- */
- mobile_apis::Result::eType CheckCoincidence();
-
- /**
- * @brief Checks if requested name is allowed by policy
- * @param app_name Application name
- * @return true, if allowed, otherwise - false
- */
- bool IsNicknameAllowed(const custom_str::CustomString& app_name) const;
-
- /**
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param response_info contains info for sending to mobile application
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& ResponseInfo);
-
- /**
- * @brief Predicate for using with CheckCoincidence method to compare with VR
- * synonym SO
- *
- * @return TRUE if there is coincidence of VR, otherwise FALSE
- */
- struct CoincidencePredicateVR {
- CoincidencePredicateVR(const custom_str::CustomString& newItem)
- : newItem_(newItem){};
-
- bool operator()(const smart_objects::SmartObject& obj) const {
- const custom_str::CustomString& vr_synonym = obj.asCustomString();
- return newItem_.CompareIgnoreCase(vr_synonym);
- };
-
- const custom_str::CustomString& newItem_;
- };
-
- Pending pending_requests_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType vr_result_;
- hmi_apis::Common_Result::eType tts_result_;
- std::string ui_response_info_;
- std::string vr_response_info_;
- std::string tts_response_info_;
-
- void SendVRRequest(ApplicationSharedPtr app,
- smart_objects::SmartObject& msg_params);
-
- void SendTTSRequest(ApplicationSharedPtr app,
- smart_objects::SmartObject& msg_params);
-
- void SendUIRequest(ApplicationSharedPtr app,
- smart_objects::SmartObject& msg_params,
- const int32_t hmi_language);
-
- DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
deleted file mode 100644
index 995764a15f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ChangeRegistrationResponse command class
- **/
-class ChangeRegistrationResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ChangeRegistrationResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ChangeRegistrationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ChangeRegistrationResponse class destructor
- **/
- virtual ~ChangeRegistrationResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
deleted file mode 100644
index c00d310e7d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
-#include <map>
-#include <string>
-
-#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/event_engine/event_observer.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-/**
- * @brief CreateInteractionChoiceSetRequest command class
- **/
-class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
- public:
- /**
- * @brief CreateInteractionChoiceSetRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- CreateInteractionChoiceSetRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief CreateInteractionChoiceSetRequest class destructor
- **/
- ~CreateInteractionChoiceSetRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- */
- void onTimeOut() FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /**
- * @brief DeleteChoices allows to walk through the sent commands collection
- * in order to sent appropriate DeleteCommand request.
- */
- void DeleteChoices();
-
- /**
- * @brief Calls after all responses from HMI were received.
- * Terminates request and sends successful response to mobile
- * if all responses were SUCCESS or calls DeleteChoices in other case.
- */
- void OnAllHMIResponsesReceived();
-
- /**
- * @brief The VRCommand struct
- * Collect minimum information about sent VR commands, for correctly
- * processing deleting sent commands if error from HMI received
- */
- struct VRCommandInfo {
- VRCommandInfo() : cmd_id_(0), succesful_response_received_(false) {}
- VRCommandInfo(uint32_t cmd_id)
- : cmd_id_(cmd_id), succesful_response_received_(false) {}
- uint32_t cmd_id_;
- bool succesful_response_received_;
- };
-
- typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap;
- SentCommandsMap sent_commands_map_;
-
- int32_t choice_set_id_;
- size_t expected_chs_count_;
- size_t received_chs_count_;
-
- /**
- * @brief Flag for stop sending VR commands to HMI, in case one of responses
- * failed
- */
- volatile bool error_from_hmi_;
- sync_primitives::Lock error_from_hmi_lock_;
-
- /**
- * @brief Flag shows if request already was expired by timeout
- */
- volatile bool is_timed_out_;
- sync_primitives::Lock is_timed_out_lock_;
-
- sync_primitives::Lock vr_commands_lock_;
- /*
- * @brief Sends VR AddCommand request to HMI
- *
- * @param app_id Application ID
- *
- */
- void SendVRAddCommandRequests(ApplicationSharedPtr const app);
-
- /*
- * @brief Checks incoming choiseSet params.
- * @param app Registred mobile application
- *
- * @return Mobile result code
- */
- mobile_apis::Result::eType CheckChoiceSet(ApplicationConstSharedPtr app);
-
- /*
- * @brief Predicate for using with CheckChoiceSet method to compare choice ID
- *param
- *
- * return TRUE if there is coincidence of choice ID, otherwise FALSE
- */
- struct CoincidencePredicateChoiceID {
- CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {}
-
- bool operator()(smart_objects::SmartObject obj) {
- return obj[strings::choice_id].asUInt() == newItem_;
- }
-
- const uint32_t newItem_;
- };
-
- /*
- * @brief Predicate for using with CheckChoiceSet method to compare menu name
- *param
- *
- * return TRUE if there is coincidence of menu name, otherwise FALSE
- */
- struct CoincidencePredicateMenuName {
- CoincidencePredicateMenuName(const std::string& newItem)
- : newItem_(newItem){};
-
- bool operator()(smart_objects::SmartObject obj) {
- return obj[strings::menu_name].asString() == newItem_;
- }
-
- const std::string& newItem_;
- };
-
- /*
- * @brief Predicate for using with CheckChoiceSet method to compare VR commands
- *param
- *
- * return TRUE if there is coincidence of VR commands, otherwise FALSE
- */
- struct CoincidencePredicateVRCommands {
- CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
- : newItem_(newItem) {}
-
- bool operator()(smart_objects::SmartObject obj) {
- return compareStr(obj, newItem_);
- }
-
- const smart_objects::SmartObject& newItem_;
- };
-
- /*
- * @brief Checks if incoming choice set doesn't has similar VR synonyms.
- *
- * @param choice1 Choice to compare
- * @param choice2 Choice to compare
- *
- * return Return TRUE if there are similar VR synonyms in choice set,
- * otherwise FALSE
- */
- bool compareSynonyms(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2);
-
- /*
- * @brief Checks VR synonyms ignoring differences in case.
- *
- * @param str1 VR synonym to compare
- * @param str2 VR synonym to compare
- *
- * return Return TRUE if there are similar VR synonyms in choice set,
- * otherwise FALSE
- */
- static bool compareStr(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2);
-
- /**
- * @brief Checks choice set params(menuName, tertiaryText, ...)
- * When type is String there is a check on the contents \t\n \\t \\n
- * @param choice_set which must check
- * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise
- */
- bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set);
-
- /**
- * @brief ProcessHmiError process received error from HMI.
- * This function id not thread safe. It should be protected with
- * vr_commands_lock_
- * @param vr_result ERROR type
- */
- void ProcessHmiError(const hmi_apis::Common_Result::eType vr_result);
-
- /**
- * @brief ProcessSuccesfulHMIResponse process succesful response from HMI\
- * This function id not thread safe. It should be protected with
- * vr_commands_lock_
- * @param corr_id correlation id of received response
- * @return true if resuest with corr_itd was sent on HMI, false otherwise
- */
- bool ProcessSuccesfulHMIResponse(const uint32_t corr_id);
-
- /**
- * @brief CountReceivedVRResponses counts received HMI responses. Updated
- * request timeout if not all responses received
- * Send response to mobile if all responses received.
- */
- void CountReceivedVRResponses();
-
- DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
deleted file mode 100644
index bb2083e0b5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief CreateInteractionChoiceSetResponse command class
- **/
-class CreateInteractionChoiceSetResponse : public CommandResponseImpl {
- public:
- /**
- * @brief CreateInteractionChoiceSetResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- CreateInteractionChoiceSetResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief CreateInteractionChoiceSetResponse class destructor
- **/
- virtual ~CreateInteractionChoiceSetResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
deleted file mode 100644
index afb2e226f6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteCommandRequest command class
- **/
-class DeleteCommandRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteCommandRequest class destructor
- **/
- ~DeleteCommandRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /*
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param info contains info for mobile app.
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
-
- bool is_ui_send_;
- bool is_vr_send_;
-
- bool is_ui_received_;
- bool is_vr_received_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType vr_result_;
- std::string ui_info_;
- std::string vr_info_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
deleted file mode 100644
index a6a25f9cd5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteCommandResponse command class
- **/
-class DeleteCommandResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteCommandResponse class destructor
- **/
- virtual ~DeleteCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteCommandResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
deleted file mode 100644
index beb8ae73cd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-struct AppFile;
-
-namespace commands {
-
-/**
- * @brief DeleteFileRequest command class
- **/
-class DeleteFileRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteFileRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteFileRequest class destructor
- **/
- virtual ~DeleteFileRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteFileRequest);
-
- void SendFileRemovedNotification(const AppFile* file) const;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
deleted file mode 100644
index 08f734ec13..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteFileResponse command class
- **/
-class DeleteFileResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteFileResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteFileResponse class destructor
- **/
- virtual ~DeleteFileResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteFileResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
deleted file mode 100644
index ead60be1af..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteInteractionChoiceSetRequest command class
- **/
-class DeleteInteractionChoiceSetRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteInteractionChoiceSetRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteInteractionChoiceSetRequest class destructor
- **/
- ~DeleteInteractionChoiceSetRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /*
- * @brief Check if requested choice set ID in use by perform interaction
- *
- * @param app mobile application
- */
- bool ChoiceSetInUse(ApplicationConstSharedPtr app);
-
- void SendVrDeleteCommand(ApplicationSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
deleted file mode 100644
index 7a926399ee..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteInteractionChoiceSetResponse command class
- **/
-class DeleteInteractionChoiceSetResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteInteractionChoiceSetResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteInteractionChoiceSetResponse class destructor
- **/
- virtual ~DeleteInteractionChoiceSetResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
deleted file mode 100644
index 37863598ac..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteSubMenuRequest command class
- **/
-class DeleteSubMenuRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteSubMenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteSubMenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteSubMenuRequest class destructor
- **/
- ~DeleteSubMenuRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /*
- * @brief Deletes VR commands from SDL for corresponding submenu ID
- *
- * @param app_id Application ID
- *
- * @return TRUE on success, otherwise FALSE
- */
- void DeleteSubMenuVRCommands(ApplicationConstSharedPtr app);
-
- /*
- * @brief Deletes UI commands from SDL for corresponding submenu ID
- *
- * @param app_id Application ID
- *
- * @return TRUE on success, otherwise FALSE
- */
- void DeleteSubMenuUICommands(ApplicationSharedPtr const app);
-
- DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
deleted file mode 100644
index 4319d88ea0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ResetGlobalPropertiesResponse command class
- **/
-class DeleteSubMenuResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteSubMenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteSubMenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteSubMenuResponse class destructor
- **/
- virtual ~DeleteSubMenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
deleted file mode 100644
index d55bce6613..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DiagnosticMessageRequest command class
- **/
-class DiagnosticMessageRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DiagnosticMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DiagnosticMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DiagnosticMessageRequest class destructor
- **/
- virtual ~DiagnosticMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
deleted file mode 100644
index 7ac810eabf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DiagnosticMessageResponse command class
- **/
-class DiagnosticMessageResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DiagnosticMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DiagnosticMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DiagnosticMessageResponse class destructor
- **/
- virtual ~DiagnosticMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
deleted file mode 100644
index c8ae2b2cd9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DialNumber request command class
- **/
-class DialNumberRequest : public CommandRequestImpl {
- public:
- /**
- * \brief DialNumberRequest class constructor
- **/
- DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief DialNumberRequest class destructor
- **/
- ~DialNumberRequest() OVERRIDE;
-
- /**
- * @brief Initialize request params
- **/
- bool Init() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Removes from number param all characters
- * except the + character and digits.
- *
- */
- void StripNumberParam(std::string& number);
-
- DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h
deleted file mode 100644
index 688c9a7207..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DialNumberResponse command class
- **/
-class DialNumberResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DialNumberResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DialNumberResponse class destructor
- **/
- virtual ~DialNumberResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
deleted file mode 100644
index 04f4fa53ab..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief EndAudioPassThruRequest command class
- **/
-class EndAudioPassThruRequest : public CommandRequestImpl {
- public:
- /**
- * @brief EndAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- EndAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief EndAudioPassThruRequest class destructor
- **/
- virtual ~EndAudioPassThruRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
deleted file mode 100644
index ca756cf5d7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief EndAudioPassThruResponse command class
- **/
-class EndAudioPassThruResponse : public CommandResponseImpl {
- public:
- /**
- * @brief EndAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- EndAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief EndAudioPassThruResponse class destructor
- **/
- virtual ~EndAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
deleted file mode 100644
index 6cfc6e5891..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class GenericResponse : public CommandResponseImpl {
- public:
- /**
- * \brief GenericResponse class constructor
- **/
- GenericResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
- /**
- * \brief GenericResponse class destructor
- **/
- virtual ~GenericResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GenericResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
deleted file mode 100644
index b70c04bcca..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetDTCsRequest command class
- **/
-class GetDTCsRequest : public CommandRequestImpl {
- public:
- /**
- * @brief GetDTCsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetDTCsRequest class destructor
- **/
- virtual ~GetDTCsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetDTCsRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
deleted file mode 100644
index 10d0d0f86d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetDTCsResponse command class
- **/
-class GetDTCsResponse : public CommandResponseImpl {
- public:
- /**
- * @brief GetDTCsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetDTCsResponse class destructor
- **/
- virtual ~GetDTCsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetDTCsResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h
deleted file mode 100644
index ba55a6b4cd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class GetSystemCapabilityRequest : public CommandRequestImpl {
- public:
- GetSystemCapabilityRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- virtual ~GetSystemCapabilityRequest();
-
- virtual void Run() OVERRIDE;
-
- virtual void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest);
-
-}; // GetSystemCapabilityRequest
-} // commands
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ \ No newline at end of file
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h
deleted file mode 100644
index 9fa6f9b5bb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class GetSystemCapabilityResponse : public CommandResponseImpl {
- public:
- GetSystemCapabilityResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- virtual ~GetSystemCapabilityResponse();
-
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse);
-
-}; // GetSystemCapabilityResponse
-} // commands
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ \ No newline at end of file
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
deleted file mode 100644
index 030a3afedc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class SmartObject;
-
-namespace commands {
-
-/**
- * @brief GetVehicleDataRequest command class
- **/
-class GetVehicleDataRequest : public CommandRequestImpl {
- public:
- /**
- * @brief GetVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetVehicleDataRequest class destructor
- **/
- virtual ~GetVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- protected:
- virtual void on_event(const event_engine::Event& event);
-
-#ifdef HMI_DBUS_API
- private:
- void SendRequestsToHmi(const int32_t app_id);
-
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
- DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
deleted file mode 100644
index 11691d1f84..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetVehicleDataResponse command class
- **/
-class GetVehicleDataResponse : public CommandResponseImpl {
- public:
- /**
- * @brief GetVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetVehicleDataResponse class destructor
- **/
- virtual ~GetVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetVehicleDataResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h
deleted file mode 100644
index bf23121177..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetWayPointsRequest command class
- **/
-class GetWayPointsRequest : public CommandRequestImpl {
- public:
- /**
- * \brief GetWayPointsRequest class constructor
- **/
- GetWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief GetWayPointsRequest class destructor
- **/
- virtual ~GetWayPointsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h
deleted file mode 100644
index cb4f840763..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetWayPointsResponse command class
- **/
-class GetWayPointsResponse : public CommandResponseImpl {
- public:
- /**
- * \brief GetWayPointsResponse class constructor
- **/
- GetWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief GetWayPointsResponse class destructor
- **/
- virtual ~GetWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
deleted file mode 100644
index f1e9204eea..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ListFilesRequest command class
- **/
-class ListFilesRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ListFilesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ListFilesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ListFilesRequest class destructor
- **/
- virtual ~ListFilesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ListFilesRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
deleted file mode 100644
index 81165c9bc4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ListFilesResponse command class
- **/
-class ListFilesResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ListFilesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ListFilesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ListFilesResponse class destructor
- **/
- virtual ~ListFilesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ListFilesResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
deleted file mode 100644
index 758fdaf760..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppInterfaceUnregisteredNotification class
- **/
-class OnAppInterfaceUnregisteredNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnAppInterfaceUnregisteredNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppInterfaceUnregisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager);
-
- /**
- * @brief OnAppInterfaceUnregisteredNotification class destructor
- **/
- virtual ~OnAppInterfaceUnregisteredNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppInterfaceUnregisteredNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
deleted file mode 100644
index 68e1d4f548..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAudioPassThruNotification class used to send notification with
- *binary data written from
- * microphone to mobile device while PerformAudioPassThru is active.
- **/
-class OnAudioPassThruNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnAudioPassThruNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAudioPassThruNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAudioPassThruNotification class destructor
- **/
- virtual ~OnAudioPassThruNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAudioPassThruNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
deleted file mode 100644
index d6a15caf4b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnButtonEventNotification class is used to send notification
- * to mobile device that some button was pressed on HMI.
- **/
-class OnButtonEventNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnButtonEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnButtonEventNotification class destructor
- **/
- virtual ~OnButtonEventNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /*
- * @brief Sends button event notification to mobile device
- *
- * @param app Application to receive notification
- */
- void SendButtonEvent(ApplicationConstSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
-};
-
-} // namespace mobile
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
deleted file mode 100644
index 9acd31f8da..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnButtonPressNotification class is used to send notification
- * to mobile device that some button was pressed on HMI.
- **/
-class OnButtonPressNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnButtonPressNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonPressNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnButtonEventCommand class destructor
- **/
- virtual ~OnButtonPressNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /*
- * @brief Sends button press notification to mobile device
- *
- * @param app Application to receive notification
- */
- void SendButtonPress(ApplicationConstSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
deleted file mode 100644
index e2faf9b05c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-/**
- * @brief OnCommandNotification class is used to send notification
- * to mobile device.
- **/
-class OnCommandNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnCommandNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnCommandNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnCommandNotification class destructor
- **/
- virtual ~OnCommandNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnCommandNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
deleted file mode 100644
index 1f9ee4ed8c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnDriverDistractionNotification class
- **/
-class OnDriverDistractionNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnDriverDistractionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDriverDistractionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDriverDistractionNotification class destructor
- **/
- virtual ~OnDriverDistractionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
-};
-
-} // namespace mobile
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
deleted file mode 100644
index 07544c573f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-namespace mobile {
-
-/**
- * @brief OnHashChangeNotification class
- **/
-class OnHashChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnHashChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnHashChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnHashChangeNotification class destructor
- **/
- virtual ~OnHashChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h
deleted file mode 100644
index 58659cbc4b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnHMIStatusNotification class
- **/
-class OnHMIStatusNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnHMIStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnHMIStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnHMIStatusNotification class destructor
- **/
- virtual ~OnHMIStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
deleted file mode 100644
index b2802e9fe9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
-
-#include "application_manager/commands/command_notification_from_mobile_impl.h"
-#include "application_manager/application_manager.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnHMIStatusNotificationFromMobile class
- **/
-class OnHMIStatusNotificationFromMobile
- : public CommandNotificationFromMobileImpl {
- public:
- /**
- * @brief OnHMIStatusNotificationFromMobile class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnHMIStatusNotificationFromMobile(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnHMIStatusNotificationFromMobile class destructor
- **/
- virtual ~OnHMIStatusNotificationFromMobile();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotificationFromMobile);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h
deleted file mode 100644
index 911ca70cdf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnKeyBoardInputNotification class
- **/
-class OnKeyBoardInputNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnKeyBoardInputNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnKeyBoardInputNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnKeyBoardInputNotification class destructor
- **/
- virtual ~OnKeyBoardInputNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnKeyBoardInputNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
deleted file mode 100644
index bbd7679a6b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnLanguageChangeNotification class
- **/
-class OnLanguageChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnLanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnLanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnLanguageChangeNotification class destructor
- **/
- virtual ~OnLanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnLanguageChangeNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
deleted file mode 100644
index 9fd2832218..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnPermissionsChangeNotification class
- **/
-class OnPermissionsChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnPermissionsChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnPermissionsChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnPermissionsChangeNotification class destructor
- **/
- virtual ~OnPermissionsChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPermissionsChangeNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
deleted file mode 100644
index d42e42649a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include <vector>
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnSystemRequestNotification class
- **/
-class OnSystemRequestNotification : public CommandNotificationImpl {
- public:
- typedef std::vector<uint8_t> BinaryMessage;
- /**
- * @brief OnSystemRequestNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemRequestNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemRequestNotification class destructor
- **/
- ~OnSystemRequestNotification() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
-#ifdef PROPRIETARY_MODE
- /**
- * @brief Adds HTTP header to message
- * @param message Message
- */
- void AddHeader(BinaryMessage& message) const;
- size_t ParsePTString(std::string& pt_string) const;
-#endif // PROPRIETARY_MODE
-
- DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
deleted file mode 100644
index 42a81043f9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTBTClientStateNotification class
- **/
-class OnTBTClientStateNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnTBTClientStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTBTClientStateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTBTClientStateNotification class destructor
- **/
- virtual ~OnTBTClientStateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTBTClientStateNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h
deleted file mode 100644
index abbf6787db..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnTouchEventNotification class
- **/
-class OnTouchEventNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnTouchEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTouchEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTouchEventNotification class destructor
- **/
- virtual ~OnTouchEventNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTouchEventNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
deleted file mode 100644
index efe2ce8c55..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVehicleDataNotification class is used to send notification
- * to mobile device that some button was pressed on HMI.
- **/
-class OnVehicleDataNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnVehicleDataNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVehicleDataNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVehicleDataNotification class destructor
- **/
- virtual ~OnVehicleDataNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /*
- * @brief Sends vehicle data notification to mobile device
- *
- * @param app Application to receive notification
- */
- void SendVehicleData(ApplicationConstSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(OnVehicleDataNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h
deleted file mode 100644
index e33de74fd8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class OnWayPointChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnWayPointChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnWayPointChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnWayPointChangeNotification class destructor
- **/
- virtual ~OnWayPointChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnWayPointChangeNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
deleted file mode 100644
index efe1f107f3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PerformAudioPassThruRequest command class
- **/
-class PerformAudioPassThruRequest : public CommandRequestImpl {
- public:
- /**
- * @brief PerformAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformAudioPassThruRequest class destructor
- **/
- virtual ~PerformAudioPassThruRequest();
-
- /**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- /**
- * @brief Init required by command resources
- **/
- bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Prepare result code, result and info for sending to mobile
- * @brief Response params
- * success for sending to mobile application
- * result code for sending to mobile application
- * info for sending to mobile application
- */
- struct ResponseParams {
- bool success;
- mobile_apis::Result::eType result_code;
- std::string info;
- ResponseParams()
- : success(false), result_code(mobile_apis::Result::INVALID_ENUM) {}
- };
-
- ResponseParams response_params_;
-
- /**
- * @brief Prepare result code, result and info for sending to mobile
- * application
- * @param result_code contains result code for sending to mobile application
- * @return result for sending to mobile application.
- * @deprecated
- */
- DEPRECATED bool PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info);
- /**
- * @brief Prepare result code, 'success' result and info for sending
- * to mobile application
- * @param result_code contains result code for sending to mobile application
- * @return result for sending to mobile application.
- */
- const ResponseParams& PrepareResponseParameters();
-
- /**
- * @brief Sends TTS Speak request
- */
- void SendSpeakRequest();
-
- /**
- * @brief Sends UI PerformAudioPassThru request
- */
- void SendPerformAudioPassThruRequest();
-
- /**
- * @brief Sends UI RecordStart notification after TTS Speak response received.
- * Indicates that capturing mic data should be started
- */
- void SendRecordStartNotification();
-
- /**
- * @brief Starts microphone recording
- */
- void StartMicrophoneRecording();
-
- /**
- * @brief Checks perform audio pass thru params(initialPrompt, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if perform audio pass thru contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request
- * TTS_StopSpeaking to HMI
- */
- void FinishTTSSpeak();
-
- /*
- * @brief Tells if there are sent requests without responses
- */
- bool IsWaitingHMIResponse();
-
- /**
- * @brief Pair of result_code and success for mobile app
- */
- typedef std::pair<mobile_apis::Result::eType, bool> AudioPassThruResults;
-
- /**
- * @brief Checks result code from HMI for splitted RPC
- * and returns parameter for sending to mobile app in
- * audioPassThru communication.
- * @param ui_response contains result_code from UI
- * @param tts_response contains result_code from TTS
- * @return pair of result code (UI error code has precedence than TTS's,
- * error_code from TTS is turned to WARNINGS) and
- * result for mobile app
- */
- AudioPassThruResults PrepareAudioPassThruResultCodeForResponse(
- const ResponseInfo& ui_response, const ResponseInfo& tts_response);
-
- hmi_apis::Common_Result::eType result_tts_speak_;
- hmi_apis::Common_Result::eType result_ui_;
- std::string ui_info_;
- std::string tts_info_;
-
- DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
deleted file mode 100644
index 29005d7b01..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PerformAudioPassThruResponse command class
- **/
-class PerformAudioPassThruResponse : public CommandResponseImpl {
- public:
- /**
- * @brief PerformAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformAudioPassThruResponse class destructor
- **/
- virtual ~PerformAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h
deleted file mode 100644
index c482e2d548..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-/**
- * @brief PerformInteractionRequest command class
- **/
-class PerformInteractionRequest : public CommandRequestImpl {
- public:
- /**
- * @brief PerformInteractionRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformInteractionRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformInteractionRequest class destructor
- **/
- virtual ~PerformInteractionRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @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 event_engine::Event& event);
-
- /*
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- private:
- /**
- * @brief Function will be called when VR_OnCommand event
- * comes
- * @param message which should send to mobile side
- * @return true if send response to mobile application otherwise
- * return false.
- */
- bool ProcessVRResponse(const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params);
-
- /**
- * @brief Sends PerformInteraction response to mobile side
- * @param message which should send to mobile side
- */
- void ProcessUIResponse(const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params);
-
- /*
- * @brief Sends UI PerformInteraction request to HMI
- *
- * @param app_id Application ID
- *
- */
- void SendUIPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Sends TTS PerformInteraction request to HMI
- *
- * @param app_id Application ID
- *
- */
- void SendVRPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Sends UI Show VR help request to HMI
- *
- * @param app_id Application ID
- */
- void SendUIShowVRHelpRequest(ApplicationSharedPtr const app);
-
- /*
- * @brief Checks if incoming choice set doesn't has similar menu names.
- *
- * @param app_id Application ID
- *
- * return Return TRUE if there are no similar menu names in choice set,
- * otherwise FALSE
- */
- bool CheckChoiceSetMenuNames(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Checks if incoming choice set doesn't has similar VR synonyms.
- *
- * @param app_id Application ID
- *
- * return Return TRUE if there are no similar VR synonyms in choice set,
- * otherwise FALSE
- */
- bool CheckChoiceSetVRSynonyms(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Checks if request with non-sequential positions of vrHelpItems
- * SDLAQ-CRS-466
- *
- * @param app_id Application ID
- *
- * @return TRUE if vrHelpItems positions are sequential,
- * otherwise FALSE
- */
- bool CheckVrHelpItemPositions(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Disable PerformInteraction state in application and
- * delete VR commands from HMI
- */
- void DisablePerformInteraction();
-
- /**
- * @brief Checks perform interaction params(initialText, initialPrompt, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if perform interaction contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief Send HMI close PopUp and call DisablePerformInteraction
- */
- void TerminatePerformInteraction();
-
- /**
- * @brief Checks parameter ChoiceID from response.
- * @param app contains pointer to application
- * @param choice_id contains ChoiceID from response.
- * @return if ChoiceID from response is correct method returns TRUE
- * otherwise returns FALSE.
- */
- bool CheckChoiceIDFromResponse(ApplicationSharedPtr app, int32_t choice_id);
-
- /**
- * @brief Checks for a match of choice ID, in
- * choice sets.
- * @param app contains pointer to application.
- * @param choice_set_id_list_length contains amount
- * of choice set ids.
- * @param choice_set_id_list array of choice set ids
- * @return If request contains several choice sets with
- * same choice id returns false, otherwise returns
- * true.
- */
- bool CheckChoiceIDFromRequest(
- ApplicationSharedPtr app,
- const size_t choice_set_id_list_length,
- const smart_objects::SmartObject& choice_set_id_list) const;
-
- /**
- * @brief Tells if there are sent requests without responses
- * @return If there is request without response method returns TRUE
- * otherwise returns FALSE
- */
- const bool HasHMIResponsesToWait() const;
-
- /**
- * @brief Check UI & VR result codes, send response to mobile
- * @param msg_param Message params to send
- */
- void SendBothModeResponse(const smart_objects::SmartObject& msg_param);
-
- mobile_apis::InteractionMode::eType interaction_mode_;
- bool ui_response_received_;
- bool vr_response_received_;
- bool app_pi_was_active_before_;
- static uint32_t pi_requests_count_;
- hmi_apis::Common_Result::eType vr_result_code_;
- hmi_apis::Common_Result::eType ui_result_code_;
- std::string ui_info_;
- std::string vr_info_;
-
- DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
deleted file mode 100644
index 209b469d0d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PerformInteractionResponse command class
- **/
-class PerformInteractionResponse : public CommandResponseImpl {
- public:
- /**
- * @brief PerformInteractionResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformInteractionResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformInteractionResponse class destructor
- **/
- virtual ~PerformInteractionResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PerformInteractionResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
deleted file mode 100644
index ad13f0ee52..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PutFileRequest command class
- **/
-class PutFileRequest : public CommandRequestImpl {
- public:
- /**
- * @brief PutFileRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PutFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PutFileRequest class destructor
- **/
- virtual ~PutFileRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- int64_t offset_;
- std::string sync_file_name_;
- int64_t length_;
- mobile_apis::FileType::eType file_type_;
- bool is_persistent_file_;
-
- void SendOnPutFileNotification();
- DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
deleted file mode 100644
index aa407c8d83..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PutFileResponse command class
- **/
-class PutFileResponse : public CommandResponseImpl {
- public:
- /**
- * @brief PutFileResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PutFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PutFileResponse class destructor
- **/
- virtual ~PutFileResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PutFileResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h
deleted file mode 100644
index c88f16dab0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ReadDIDRequest command class
- **/
-class ReadDIDRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ReadDIDRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ReadDIDRequest class destructor
- **/
- virtual ~ReadDIDRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ReadDIDRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h
deleted file mode 100644
index 2e493fa0ec..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ReadDIDResponse command class
- **/
-class ReadDIDResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ReadDIDResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ReadDIDResponse class destructor
- **/
- virtual ~ReadDIDResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ReadDIDResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
deleted file mode 100644
index 5713e2e814..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "utils/macro.h"
-#include "utils/custom_string.h"
-
-namespace policy {
-struct DeviceInfo;
-}
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-/**
- * @brief Register app interface request command class
- **/
-class RegisterAppInterfaceRequest : public CommandRequestImpl {
- public:
- /**
- * \brief RegisterAppInterfaceRequest class constructor
- **/
- RegisterAppInterfaceRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief RegisterAppInterfaceRequest class destructor
- **/
- virtual ~RegisterAppInterfaceRequest();
-
- /**
- * @brief Init required by command resources
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Prepares and sends RegisterAppInterface response to mobile
- * considering application type
- **/
- void SendRegisterAppInterfaceResponseToMobile();
-
- private:
- /**
- * @brief The AppicationType enum defines whether application is newly
- * registered or existing and being switched over another transport
- */
- enum class ApplicationType {
- kNewApplication,
- kSwitchedApplicationHashOk,
- kSwitchedApplicationWrongHashId
- };
-
- /**
- * @brief Prepares and sends RegisterAppInterface response to mobile
- * considering application type
- * @param app_type Type of application
- **/
- void SendRegisterAppInterfaceResponseToMobile(ApplicationType app_type);
-
- smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification(
- const uint32_t connection_key, ApplicationSharedPtr app);
-
- /**
- * @brief SendChangeRegistration send ChangeRegistration on HMI
- * @param function_id interface specific ChangeRegistration
- * @param language language of registration
- * @param app_id application to change registration
- */
- void SendChangeRegistration(const hmi_apis::FunctionID::eType function_id,
- const int32_t language,
- const uint32_t app_id);
-
- /**
- * @brief SendChangeRegistrationOnHMI send required SendChangeRegistration
- * HMI
- * @param app application to change registration
- */
- void SendChangeRegistrationOnHMI(ApplicationConstSharedPtr app);
-
- /**
- * @brief Sends OnAppRegistered notification to HMI
- *
- *@param application_impl application with changed HMI status
- *
- **/
- void SendOnAppRegisteredNotificationToHMI(const Application& application_impl,
- bool resumption = false,
- bool need_restore_vr = false);
- /*
- * @brief Check new ID along with known mobile application ID
- *
- * return TRUE if ID is known already, otherwise - FALSE
- */
- bool IsApplicationWithSameAppIdRegistered();
-
- /*
- * @brief Check new application parameters (name, tts, vr) for
- * coincidence with already known parameters of registered applications
- *
- * return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms,
- * otherwise appropriate error code returns
- */
- mobile_apis::Result::eType CheckCoincidence();
-
- /*
- * @brief Predicate for using with CheckCoincidence method to compare with VR
- * synonym SO
- *
- * return TRUE if there is coincidence of VR, otherwise FALSE
- */
- struct CoincidencePredicateVR {
- CoincidencePredicateVR(const custom_str::CustomString& newItem)
- : newItem_(newItem) {}
-
- bool operator()(const smart_objects::SmartObject& obj) {
- const custom_str::CustomString& vr_synonym = obj.asCustomString();
- return newItem_.CompareIgnoreCase(vr_synonym);
- }
- const custom_str::CustomString& newItem_;
- };
-
- /**
- * @brief Check request parameters against policy table data
- * @return SUCCESS if check ok, otherwise return appropriate error code
- */
- mobile_apis::Result::eType CheckWithPolicyData();
-
- /**
- * @brief Fill DeviceInfo struct with data from request, if any
- * @param device_info Struct for device params from request
- */
- void FillDeviceInfo(policy::DeviceInfo* device_info);
-
- /**
- * @brief Checks register app interface params(ttsName, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if register app interface contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief Checks vehicle type params (model, year etc.) and in case of absense
- * replaces with policy table backup values
- * @param vehicle_type VehicleType struct
- * @param param Vehicle param
- * @param backup_value Backup value
- */
- void CheckResponseVehicleTypeParam(smart_objects::SmartObject& vehicle_type,
- const std::string& param,
- const std::string& backup_value);
- /**
- * @brief Sends ButtonSubscription notification at start up
- * to notify HMI that app subscribed on the custom button by default.
- */
- void SendSubscribeCustomButtonNotification();
-
- /**
- * @brief IsApplicationSwitched checks whether application is switched from
- * another transport. If application id is found, but not in reconnection
- * list, returns 'already registered' code. Otherwise - proceed with
- * switching.
- * @return True if application is detected as switched, otherwise false.
- */
- bool IsApplicationSwitched();
-
- private:
- std::string response_info_;
- mobile_apis::Result::eType result_checking_app_hmi_type_;
-
- policy::PolicyHandlerInterface& GetPolicyHandler();
- DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h
deleted file mode 100644
index b125cc7c55..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief Register app interface request command class
- **/
-class RegisterAppInterfaceResponse : public CommandResponseImpl {
- public:
- /**
- * \brief RegisterAppInterfaceResponse class constructor
- **/
- RegisterAppInterfaceResponse(const MessageSharedPtr& response,
- ApplicationManager& application_manager)
- : CommandResponseImpl(response, application_manager) {}
-
- /**
- * \brief RegisterAppInterfaceResponse class destructor
- **/
- virtual ~RegisterAppInterfaceResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- void SetHeartBeatTimeout(uint32_t connection_key,
- const std::string& mobile_app_id);
-
- DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
deleted file mode 100644
index c16a014c9f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ResetGlobalPropertiesRequest command class
- **/
-class ResetGlobalPropertiesRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ResetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ResetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ResetGlobalPropertiesRequest class destructor
- **/
- ~ResetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /*
- * @brief Sets default value of the HELPPROMT global property
- * to the first vrCommand of each Command Menu registered in application
- *
- * @param app Registered application
- * @param is_timeout_promp Flag indicating that timeout prompt
- * should be reset
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool ResetHelpPromt(ApplicationSharedPtr app);
-
- /*
- * @brief Sets default value of the TIMEOUTPROMT global property
- * to the first vrCommand of each Command Menu registered in application
- *
- * @param app Registered application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool ResetTimeoutPromt(application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Sets default value of the VRHELPTITLE global property
- * to the application name and value of the VRHELPITEMS global property
- * to value equal to registered command -1(default command “Help / Cancel”.)
- *
- * @param app Registered application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool ResetVrHelpTitleItems(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Prepare result for sending to mobile application
- * @param out_result_code contains result code for sending to mobile
- * application
- * @param out_response_info contains info for sending to mobile applicaion
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& out_result_code,
- std::string& out_response_info);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType tts_result_;
- std::string ui_response_info_;
- std::string tts_response_info_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h
deleted file mode 100644
index 39e28486d4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ResetGlobalPropertiesResponse command class
- **/
-class ResetGlobalPropertiesResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ResetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ResetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ResetGlobalPropertiesResponse class destructor
- **/
- virtual ~ResetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h
deleted file mode 100644
index b3058c9a26..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief scrollable message request command class
- **/
-class ScrollableMessageRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ScrollableMessageRequest class constructor
- **/
- ScrollableMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SliderCommand class destructor
- **/
- virtual ~ScrollableMessageRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScrollableMessageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h
deleted file mode 100644
index aa0ac01e9d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class ScrollableMessageResponse : public CommandResponseImpl {
- public:
- /**
- * \brief ScrollableMessageResponse class constructor
- **/
- ScrollableMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakResponseCommand class destructor
- **/
- virtual ~ScrollableMessageResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScrollableMessageResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h
deleted file mode 100644
index 13ed06cce6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
-
-#include <string>
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SendHapticDataRequest command class
- **/
-class SendHapticDataRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SendHapticDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- * @param application_manager Reference of application manager
- **/
- SendHapticDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SendHapticDataRequest class destructor
- **/
- ~SendHapticDataRequest() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SendHapticDataRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h
deleted file mode 100644
index 2a60746c61..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SendHapticDataResponse command class
- **/
-class SendHapticDataResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SendHapticDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- * @param application_manager Reference of application manager
- **/
- SendHapticDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SendHapticDataResponse class destructor
- **/
- ~SendHapticDataResponse() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SendHapticDataResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h
deleted file mode 100644
index 570e70d007..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
-
-#include <list>
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief send location request command class
- */
-class SendLocationRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SendLocationRquest class constructor
- */
- SendLocationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SendLocationRquest class destructor
- */
- virtual ~SendLocationRequest();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /**
- * @brief CheckFieldsCompatibility checks if fields are compatible with each
- * other.
- * @return true if compatible, otherwise return false
- */
- bool CheckFieldsCompatibility();
-
- /**
- * @brief Checks sendlocation params(locationName, locationDescription, ...).
- * Checks string if it contains \t\n \\t \\n or whitespace
- * @return true if string contains invalid characters, otherwise returns false
- */
- bool IsWhiteSpaceExist();
-
- bool CheckHMICapabilities(
- std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names);
- DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h
deleted file mode 100644
index 0be0be8ca3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-
-namespace application_manager {
-namespace commands {
-
-class SendLocationResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SendLocationResponse class constructor
- */
- SendLocationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SendLocationResponse class destructor
- */
- virtual ~SendLocationResponse();
-
- /**
- * @brief Execute command
- */
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SendLocationResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h
deleted file mode 100644
index 4735d89fb0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconRequest command class
- **/
-class SetAppIconRequest : public CommandRequestImpl {
- public:
- /**
- * @brief Contains information about the type of image
- */
- typedef enum { STATIC = 0, DYNAMIC } ImageType;
-
- /**
- * @brief SetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetAppIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetIconRequest class destructor
- **/
- virtual ~SetAppIconRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /**
- * @brief Copies file to icon storage
- * @param path_to_file Path to icon
- */
- void CopyToIconStorage(const std::string& path_to_file) const;
-
- /**
- * @brief Remove oldest icons
- * @param storage Path to icons storage
- * @param icons_amount Amount of icons to be deleted
- */
- void RemoveOldestIcons(const std::string& storage,
- const uint32_t icons_amount) const;
-
- /**
- * @brief Checks, if there enough space in storage for icon copy
- * @param file_size File size
- * @return true, if enough, otherwise - false
- */
- bool IsEnoughSpaceForIcon(const uint64_t icon_size) const;
- DISALLOW_COPY_AND_ASSIGN(SetAppIconRequest);
-
- private:
- /**
- * @brief Checks, if icons saving to configured folder is enabled
- */
- bool is_icons_saving_enabled_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h
deleted file mode 100644
index 742332742b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconResponse command class
- **/
-class SetAppIconResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetAppIconResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetIconResponse class destructor
- **/
- virtual ~SetAppIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetAppIconResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h
deleted file mode 100644
index 06e8d70f79..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetDisplayLayoutRequest command class
- **/
-class SetDisplayLayoutRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SetDisplayLayoutRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetDisplayLayoutRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetDisplayLayoutRequest class destructor
- **/
- virtual ~SetDisplayLayoutRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h
deleted file mode 100644
index a2040307b0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetDisplayLayoutResponse command class
- **/
-class SetDisplayLayoutResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetDisplayLayoutResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetDisplayLayoutResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetDisplayLayoutResponse class destructor
- **/
- virtual ~SetDisplayLayoutResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
deleted file mode 100644
index da28d33de8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- Copyright (c) 2015, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#include <string>
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-#include "application_manager/application.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Register app interface request command class
- **/
-class SetGlobalPropertiesRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetGlobalPropertiesRequest class destructor
- **/
- ~SetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- // Verify correctness VrHelptitle value
- static bool ValidateVRHelpTitle(
- const smart_objects::SmartObject* const vr_help_so_ptr);
-
- // prepare UI sending data (VrHelps, Menus, Keyboard) to SmartObject
- static void PrepareUIRequestVRHelpData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params);
-
- static bool PrepareUIRequestDefaultVRHelpData(
- const ApplicationSharedPtr app, smart_objects::SmartObject& out_params);
-
- static void PrepareUIRequestMenuAndKeyboardData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params);
-
- // Send TTS request to HMI
- void SendTTSRequest(const smart_objects::SmartObject& params,
- bool use_events);
-
- // Send UI request to HMI
- void SendUIRequest(const smart_objects::SmartObject& params, bool use_events);
-
- // VRHelp shall contain sequential positions and start from 1
- static bool CheckVrHelpItemsOrder(const smart_objects::SmartObject& vr_help);
-
- /**
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /**
- * @brief Checks if request has at least one parameter
- *
- * @param params request parameters
- *
- * @returns true if at least one parameter is present in object
- */
- static bool ValidateConditionalMandatoryParameters(
- const smart_objects::SmartObject& params);
-
- /**
- * @brief Checks set global properties params(helpPrompt, timeoutPrompt, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if set global properties contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /*
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param info contains info for sending to mobile applicaion
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
-
- bool is_ui_send_;
- bool is_tts_send_;
-
- bool is_ui_received_;
- bool is_tts_received_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType tts_result_;
- std::string ui_response_info_;
- std::string tts_response_info_;
-
- DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h
deleted file mode 100644
index c5beda084d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Register app interface request command class
- **/
-class SetGlobalPropertiesResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetGlobalPropertiesResponse class destructor
- **/
- virtual ~SetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h
deleted file mode 100644
index 96d4ac6f1e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_manager.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconRequest command class
- **/
-class SetIconRequest : public CommandRequestImpl {
- public:
- /**
- * @brief Contains information about the type of image
- */
- typedef enum { STATIC = 0, DYNAMIC } ImageType;
-
- /**
- * @brief SetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetIconRequest class destructor
- **/
- virtual ~SetIconRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetIconRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h
deleted file mode 100644
index 83be0d4a4b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/application_manager.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconResponse command class
- **/
-class SetIconResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetIconResponse(const MessageSharedPtr& message, ApplicationManager& app_man);
-
- /**
- * @brief SetIconResponse class destructor
- **/
- virtual ~SetIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetIconResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h
deleted file mode 100644
index 283dd41622..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetMediaClockRequest request command class
- **/
-class SetMediaClockRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SetMediaClockRequest class constructor
- **/
- SetMediaClockRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief ShowCommand class destructor
- **/
- virtual ~SetMediaClockRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- bool isDataValid();
-
- DISALLOW_COPY_AND_ASSIGN(SetMediaClockRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h
deleted file mode 100644
index 3f41ae2dab..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class SetMediaClockTimerResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SetMediaClockTimerResponse class constructor
- **/
- SetMediaClockTimerResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SetMediaClockTimerResponse class destructor
- **/
- virtual ~SetMediaClockTimerResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetMediaClockTimerResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h
deleted file mode 100644
index f015d740df..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ShowConstantTBTRequest command class
- **/
-class ShowConstantTBTRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ShowConstantTBTRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ShowConstantTBTRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ShowConstantTBTRequest class destructor
- **/
- virtual ~ShowConstantTBTRequest();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /**
- * @brief Checks show constant TBT params(turnIcon, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if show constant TBT contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h
deleted file mode 100644
index 73aad5de89..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ShowConstantTBTResponse command class
- **/
-class ShowConstantTBTResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ShowConstantTBTResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ShowConstantTBTResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ShowConstantTBTResponse class destructor
- **/
- virtual ~ShowConstantTBTResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
deleted file mode 100644
index a10997bacd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief show request command class
- **/
-class ShowRequest : public CommandRequestImpl {
- public:
- /**
- * \brief ShowRequest class constructor
- **/
- ShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief ShowRequest class destructor
- **/
- virtual ~ShowRequest();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /*
- * @brief Check if all strings have valid syntax in request
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckStringsOfShowRequest();
-
- /**
- * @brief Handle the conversion of metadata information from the incoming
- * mobile json message format to the outgoing hmi json message format
- */
- void HandleMetadata(const char* field_id,
- int32_t field_index,
- smart_objects::SmartObject& msg_params);
-
- mobile_apis::Result::eType core_result_code_;
- std::string core_response_info_;
-
- DISALLOW_COPY_AND_ASSIGN(ShowRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h
deleted file mode 100644
index 0a54fb9cde..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class ShowResponse : public CommandResponseImpl {
- public:
- /**
- * \brief ShowResponse class constructor
- **/
- ShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief ShowResponse class destructor
- **/
- virtual ~ShowResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShowResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h
deleted file mode 100644
index 2446c9ff20..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief slider request command class
- **/
-class SliderRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SliderRequest class constructor
- **/
- SliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SliderRequest class destructor
- **/
- virtual ~SliderRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /**
- * @brief Checks slider params(sliderHeader, sliderFooter, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if slider contains \t\n \\t \\n return TRUE, FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(SliderRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h
deleted file mode 100644
index bc0efaadd0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class SliderResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SliderResponse class constructor
- **/
- SliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakResponseCommand class destructor
- **/
- virtual ~SliderResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SliderResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h
deleted file mode 100644
index dc22652b27..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief speak request command class
- **/
-class SpeakRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SpeakRequest class constructor
- **/
- SpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakRequest class destructor
- **/
- virtual ~SpeakRequest();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /*
- * @brief Sends Speak response to mobile side
- *
- * @param message which should send to mobile side
- *
- */
- void ProcessTTSSpeakResponse(const smart_objects::SmartObject& message);
-
- /**
- * @brief Checks speak param ttsChunks on the contents \t\n \\t \\n
- * @return if speak contains \t\n \\t \\n return TRUE, FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(SpeakRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h
deleted file mode 100644
index 2808526603..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class SpeakResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SpeakResponse class constructor
- **/
- SpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakResponse class destructor
- **/
- virtual ~SpeakResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SpeakResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h
deleted file mode 100644
index cf65e2a6a4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeButtonRequest command class
- **/
-class SubscribeButtonRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SubscribeButtonRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeButtonRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SubscribeButtonRequest class destructor
- **/
- ~SubscribeButtonRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /**
- * @brief Checks if button subscription allowed. In case non-media
- * application trying to subscribe on buttons(tune, seek) negative result will
- * be returned
- *
- * @param app Application requested subscription
- * @param btn_id Button to be subscribe
- *
- * @return TRUE on success, otherwise false
- **/
- bool IsSubscriptionAllowed(ApplicationSharedPtr app,
- const mobile_apis::ButtonName::eType btn_id);
-
- /**
- * @brief Sends ButtonSubscription notification
- * to notify HMI that app subscribed on the button.
- */
- void SendSubscribeButtonNotification();
-
- DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h
deleted file mode 100644
index 38e0dd2dc6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeButtonResponse command class
- **/
-class SubscribeButtonResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SubscribeButtonResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeButtonResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SubscribeButtonResponse class destructor
- **/
- virtual ~SubscribeButtonResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
deleted file mode 100644
index f556f81764..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeVehicleDataRequest command class
- **/
-class SubscribeVehicleDataRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SubscribeButtonCommandRequest class destructor
- **/
- ~SubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
-#ifdef HMI_DBUS_API
- private:
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
- private:
- /**
- * @brief Checks, if any app is subscribed for particular VI parameter
- * @param param_id VI parameter id
- * @return true, if there are registered apps subscribed for VI parameter,
- * otherwise - false
- */
- bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
-
- /**
- * @brief Adds VI parameters being subscribed by another or the same app to
- * response with appropriate results
- * @param msg_params 'message_params' response section reference
- */
- void AddAlreadySubscribedVI(smart_objects::SmartObject& msg_params) const;
-
- /**
- * @brief Removes subscription for VI parameters which subsription attempt
- * returned an error
- * @param app Pointer to application sent subscribe request
- * @param msg_params 'message_parameters' response section reference
- */
- void UnsubscribeFailedSubscriptions(
- ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params) const;
-
- /**
- * @brief Checks if current application and other applications
- * were subscribed to VI, prepare data that need to send to mobile app
- * or HMI.
- * @param app contains application
- * @param out_info contains resulting info for sending to mobile app
- * @param out_result_code contains result code for sending to mobile app
- * @param out_response_params contains parameters that SDL sends to
- * mobile application
- * @param out_request_params contains parameters that SDL sends to
- * HMI
- * @param result contains result that SDL sends to mobile app.
- */
- void CheckVISubscribtions(ApplicationSharedPtr app,
- std::string& out_info,
- mobile_apis::Result::eType& out_result_code,
- smart_objects::SmartObject& out_response_params,
- smart_objects::SmartObject& out_request_params,
- bool& out_result);
-
- /**
- * @brief VI parameters which had been already subscribed by another apps
- * befor particular app subscribed for these parameters
- */
- VehicleInfoSubscriptions vi_already_subscribed_by_another_apps_;
-
- /**
- * @brief VI parameters which had been subscribed already by particular app
- */
- VehicleInfoSubscriptions vi_already_subscribed_by_this_app_;
-
- /**
- * @brief VI parameters which wait for subscribe after HMI respond
- */
- VehicleInfoSubscriptions vi_waiting_for_subscribe_;
-
- DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
deleted file mode 100644
index 7e3cffc387..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeVehicleDataResponse command class
- **/
-class SubscribeVehicleDataResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeVehicleDataCommandRequest class destructor
- **/
- virtual ~SubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h
deleted file mode 100644
index f392dd6dd1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubsribeWayPointsRequest command class
- **/
-class SubscribeWayPointsRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SubscribeWayPointsRequest class constructor
- **/
- SubscribeWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SubscribeWayPointsRequest class destructor
- **/
- ~SubscribeWayPointsRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h
deleted file mode 100644
index cfdc0eede7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeWayPointsResponse command class
- **/
-class SubscribeWayPointsResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SubscribeWayPointsResponse class constructor
- **/
- SubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SubscribeWayPointsResponse class destructor
- **/
- virtual ~SubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h
deleted file mode 100644
index 1d163b6cd8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
-
-#include <string>
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SystemRequest command class
- **/
-class SystemRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SystemRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SystemRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SystemRequest class destructor
- **/
- virtual ~SystemRequest();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /**
- * @brief Validates data coming within QueryApps response
- * @param data Data
- * @return true, if data is valid, otherwise - false
- */
- bool ValidateQueryAppData(smart_objects::SmartObject& data) const;
-
- private:
- static uint32_t index;
- std::string processing_file_;
- DISALLOW_COPY_AND_ASSIGN(SystemRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
deleted file mode 100644
index efee210b7b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SystemResponse command class
- **/
-class SystemResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SystemResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SystemResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SystemResponse class destructor
- **/
- virtual ~SystemResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SystemResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h
deleted file mode 100644
index acc7374e18..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Unregister app interface request command class
- **/
-class UnregisterAppInterfaceRequest : public CommandRequestImpl {
- public:
- /**
- * \brief UnregisterAppInterfaceRequest class constructor
- **/
- UnregisterAppInterfaceRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
- /**
- * \brief UnregisterAppInterfaceRequest class destructor
- **/
- virtual ~UnregisterAppInterfaceRequest() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
- // virtual void cleanUp() = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h
deleted file mode 100644
index 1a459e109c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief Unregister app interface request command class
- **/
-class UnregisterAppInterfaceResponse : public CommandResponseImpl {
- public:
- /**
- * \brief UnregisterAppInterfaceResponse class constructor
- **/
- UnregisterAppInterfaceResponse(const MessageSharedPtr& response,
- ApplicationManager& application_manager)
- : CommandResponseImpl(response, application_manager) {}
-
- /**
- * \brief UnregisterAppInterfaceResponse class destructor
- **/
- virtual ~UnregisterAppInterfaceResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h
deleted file mode 100644
index b0206c4407..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeButtonRequest command class
- **/
-class UnsubscribeButtonRequest : public CommandRequestImpl {
- public:
- /**
- * @brief UnsubscribeButtonRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeButtonRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeButtonRequest class destructor
- **/
- ~UnsubscribeButtonRequest() FINAL;
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- /**
- * @brief Sends ButtonSubscription notification
- * to notify HMI that app unsubscribed from the button.
- */
- void SendUnsubscribeButtonNotification();
-
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h
deleted file mode 100644
index 06dbe84578..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeButtonResponse command class
- **/
-class UnsubscribeButtonResponse : public CommandResponseImpl {
- public:
- /**
- * @brief UnsubscribeButtonResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeButtonResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeButtonResponse class destructor
- **/
- virtual ~UnsubscribeButtonResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
deleted file mode 100644
index 1c7d80797d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeVehicleDataRequest command class
- **/
-class UnsubscribeVehicleDataRequest : public CommandRequestImpl {
- public:
- /**
- * @brief UnsubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeVehicleDataRequest class destructor
- **/
- ~UnsubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
-#ifdef HMI_DBUS_API
- private:
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
- private:
- /**
- * @brief Checks, if any app is subscribed for particular VI parameter
- * @param param_id VI parameter id
- * @return true, if there are registered apps subscribed for VI parameter,
- * otherwise - false
- */
- bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
-
- /**
- * @brief Adds VI parameters being unsubscribed by another or the same app to
- * response with appropriate results
- * @param msg_params 'message_params' response section reference
- */
- void AddAlreadyUnsubscribedVI(smart_objects::SmartObject& response) const;
-
- /**
- * @brief VI parameters which still being subscribed by another apps after
- * particular app had been unsubscribed from these parameters
- */
- VehicleInfoSubscriptions vi_still_subscribed_by_another_apps_;
-
- /**
- * @brief VI parameters which had been unsubscribed already by particular app
- */
- VehicleInfoSubscriptions vi_already_unsubscribed_by_this_app_;
-
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
deleted file mode 100644
index a34a36688c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeVehicleDataResponse command class
- **/
-class UnsubscribeVehicleDataResponse : public CommandResponseImpl {
- public:
- /**
- * @brief UnsubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeVehicleDataResponse class destructor
- **/
- virtual ~UnsubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h
deleted file mode 100644
index 0b5462b7b5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class UnSubscribeWayPointsRequest : public CommandRequestImpl {
- public:
- /**
- * \brief UnSubscribeWayPointsRequest class constructor
- **/
- UnSubscribeWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief UnSubscribeWayPointsRequest class destructor
- **/
- ~UnSubscribeWayPointsRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event) FINAL;
-
- /**
- * @brief Init sets hash update mode for request
- */
- bool Init() FINAL;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h
deleted file mode 100644
index 70211330a9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeWayPointsResponse command class
- **/
-class UnsubscribeWayPointsResponse : public CommandResponseImpl {
- public:
- /**
- * \brief UnsubscribeWayPointsResponse class constructor
- **/
- UnsubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief UnsubscribeWayPointsResponse class destructor
- **/
- virtual ~UnsubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h
deleted file mode 100644
index e15e81caf5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateTurnListRequest command class
- **/
-class UpdateTurnListRequest : public CommandRequestImpl {
- public:
- /**
- * @brief UpdateTurnListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateTurnListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateTurnListRequest class destructor
- **/
- virtual ~UpdateTurnListRequest();
-
- /**
- * @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 event_engine::Event& event);
-
- private:
- /**
- * @brief check correct parameter turnList
- *
- * @return TRUE if turnList is correct,
- * otherwise FALSE
- */
- bool CheckTurnListArray();
-
- /**
- * @brief Checks update turn list param
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if update turn list contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(UpdateTurnListRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h
deleted file mode 100644
index 481ad9f219..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateTurnListResponse command class
- **/
-class UpdateTurnListResponse : public CommandResponseImpl {
- public:
- /**
- * @brief UpdateTurnListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateTurnListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateTurnListResponse class destructor
- **/
- virtual ~UpdateTurnListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateTurnListResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_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
new file mode 100644
index 0000000000..8bbbd0e3de
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h
@@ -0,0 +1,67 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class NotificationFromHMI : public CommandImpl {
+ public:
+ NotificationFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~NotificationFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotificationToMobile(const MessageSharedPtr& message);
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/notification_to_hmi.h b/src/components/application_manager/include/application_manager/commands/notification_to_hmi.h
new file mode 100644
index 0000000000..96a8cdf1aa
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/notification_to_hmi.h
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class NotificationToHMI : public CommandImpl {
+ public:
+ NotificationToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~NotificationToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotification();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
new file mode 100644
index 0000000000..927a45c6a6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
@@ -0,0 +1,100 @@
+/*
+ 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_REQUEST_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
+
+class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
+ public:
+ RequestFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ virtual ~RequestFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ virtual void on_event(const event_engine::Event& event);
+ /**
+ * @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);
+
+ /**
+ * @brief SendResponse allows to send error response to hmi
+ * @param correlation_id the correlation id for the response.
+ * @param function_id the function id for which response will be sent
+ * @param result_code the result code.
+ * @param error_message info message for error.
+ */
+ void SendErrorResponse(const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const std::string error_message);
+
+ private:
+ /**
+ * @brief Fills common parameters for SO
+ * @param message Contains SO for filling
+ * @param correlation_id the correlation id for the response.
+ * @param function_id the function id for which response will be sent
+ */
+ void FillCommonParametersOfSO(
+ ns_smart_device_link::ns_smart_objects::SmartObject& message,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h
new file mode 100644
index 0000000000..91586a74ce
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h
@@ -0,0 +1,92 @@
+/*
+ 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_REQUEST_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Check if HMI's interface is available.
+ * @param application_manager contains application manager component
+ * @param interface contains name of HMI's interface
+ * @return true if interface is available otherwise return fasle.
+ */
+bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
+ HmiInterfaces::InterfaceID interface);
+
+/**
+ * @brief Change interface state
+ * @param application_manager contains ApplicationManager instance
+ * @param response_from_hmi contains response from HMI
+ * @param interface contanins InterfaceID whose state is changed.
+ * @return true if field available exist and contains true in response params
+ * otherwise return false.
+ */
+bool ChangeInterfaceState(ApplicationManager& application_manager,
+ const smart_objects::SmartObject& response_from_hmi,
+ HmiInterfaces::InterfaceID interface);
+
+class RequestToHMI : public CommandImpl {
+ public:
+ RequestToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ virtual ~RequestToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ 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(RequestToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_REQUEST_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/response_from_hmi.h
new file mode 100644
index 0000000000..605d04067e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/response_from_hmi.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_RESPONSE_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+namespace commands {
+
+class ResponseFromHMI : public CommandImpl {
+ public:
+ ResponseFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~ResponseFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendResponseToMobile(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /*
+ * @brief Creates HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ */
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseFromHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/response_to_hmi.h
new file mode 100644
index 0000000000..aa43d2e6d1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/response_to_hmi.h
@@ -0,0 +1,66 @@
+
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
+
+class ResponseToHMI : public CommandImpl {
+ public:
+ ResponseToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~ResponseToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseToHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h
deleted file mode 100644
index 5e95ecd245..0000000000
--- a/src/components/application_manager/include/application_manager/core_service.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_
-
-#include <string>
-#include <vector>
-#include "application_manager/service.h"
-#include "application_manager/application.h"
-#include "policy/policy_types.h"
-
-namespace Json {
-class Value;
-}
-
-namespace application_manager {
-
-struct CommandParametersPermissions;
-
-/**
- * @brief Class through which the plug-in can interact with the core
- */
-class CoreService : public Service {
- public:
- /**
- * @brief CoreService class destructor
- */
- explicit CoreService(ApplicationManager& application_manager);
-
- /**
- * @brief CoreService class destructor
- */
- virtual ~CoreService();
-
- /**
- * @brief Checks message permissions and cuts parameters according
- * to policy table permissions
- * @param msg message to cut disallowed parameters
- * @return result according by mobile API
- */
- mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) FINAL;
-
- /**
- * Checks if module for application is present in policy table
- * @param app_id id of application
- * @param module type
- * @return true if module is present, otherwise - false
- */
- bool CheckModule(const ApplicationId& app_id,
- const std::string& module) FINAL;
-
- /**
- * Checks if application has remote control functions
- * @param app application
- * @return true if application has remote control functions
- */
- bool IsRemoteControlApplication(ApplicationSharedPtr app) const FINAL;
-
- /**
- * @brief Gets current state of the specified interface
- * @param interface which state to get
- * @return true if specified interface available otherwise false
- */
- bool IsInterfaceAvailable(
- const HmiInterfaces::InterfaceID interface) const FINAL;
-
- /**
- * Removes fake parameters from request to HMI
- * @param message message to handle
- */
- void RemoveHMIFakeParameters(application_manager::MessagePtr& message) FINAL;
-
- /**
- * @brief Get pointer to application by application id
- * @param app_id application id
- * return pointer to application
- */
- ApplicationSharedPtr GetApplication(ApplicationId app_id) FINAL;
-
- /**
- * @brief Send message to HMI
- * @param message Message to HMI
- */
- void SendMessageToHMI(const MessagePtr& message) FINAL;
-
- /**
- * @brief Send message to mobile device
- * @param message Message to mobile
- */
- void SendMessageToMobile(const MessagePtr& message) FINAL;
-
- /**
- * @brief Returns unique correlation ID for next HMI request
- *
- * @return Unique correlation ID
- */
- uint32_t GetNextCorrelationID() FINAL;
-
- /**
- * @brief Returns all applications
- *
- * @return List with shared pointers to applications
- */
- std::vector<ApplicationSharedPtr> GetApplications(AppExtensionUID uid) FINAL;
-
- /**
- * @brief Change hmi level of app and notify it
- * @param app Application to be changed and notified
- * @param level New HMI level of app
- */
- void ChangeNotifyHMILevel(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level) FINAL;
-
- const smart_objects::SmartObject* GetRCCapabilities() const FINAL;
- /**
- * @brief Notify HMI about app changing HMI Level
- * only NONE, BACKGROUND and LIMITED levels are sent
- * @param app Application to be changed and notified
- * @param level New HMI level of app
- */
- void NotifyHMIAboutHMILevel(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level) FINAL;
-
- /**
- * Gets all allowed module types
- * @param app_id unique identifier of application
- * @param list of allowed module types
- * @return true if application has allowed modules
- */
- bool GetModuleTypes(const std::string& policy_app_id,
- std::vector<std::string>* modules) const FINAL;
-
- /**
- * @brief ValidateMessageBySchema Checks whether message is valid according
- * to API
- * @param message Message to check
- * @return Check result
- */
- MessageValidationResult ValidateMessageBySchema(const Message& message) FINAL;
-
- /**
- * @brief Gets application manager settings structure
- * @return reference to application manager settings structure
- */
- const ApplicationManagerSettings& GetSettings() const FINAL;
-
- private:
- /**
- * @brief AreParametersAllowed Checks message parameters across current policy
- * permissions
- * @param msg Message having parameters
- * @param params Parameters sorted by permissions
- * @return True if allowed, otherwise - false
- */
- bool AreParametersAllowed(MessagePtr msg,
- const CommandParametersPermissions& params);
-
- /**
- * @brief CheckParams Checks object params with allowed parameters received
- * from policy
- * @param object Message object
- * @param allowed_params Parameters allowed by policy
- * @return True if all parameters allowed, otherwise - false
- */
- bool CheckParams(const Json::Value& object,
- const policy::RPCParams& allowed_params);
-
- /**
- * @brief IsAllowed Checks particular parameter among allowed list
- * @param name Parameter name
- * @param allowed_params List of allowed parameters
- * @return True if found, otherwise - false
- */
- bool IsAllowed(const std::string& name,
- const policy::RPCParams& allowed_params);
-
- ApplicationManager& application_manager_;
-
- DISALLOW_COPY_AND_ASSIGN(CoreService);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_
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 4cdbb902de..ed923369ac 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
@@ -118,7 +118,7 @@ class EventDispatcherImpl : public EventDispatcher {
private:
// Members section
sync_primitives::Lock state_lock_;
- sync_primitives::Lock observer_lock_;
+ sync_primitives::RecursiveLock observer_lock_;
EventObserverMap observers_event_;
ObserverVector observers_;
};
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager.h b/src/components/application_manager/include/application_manager/help_prompt_manager.h
new file mode 100644
index 0000000000..a0c34e77d7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager.h
@@ -0,0 +1,96 @@
+/*
+ * 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_HELP_PROMPT_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
+
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+/**
+ * @brief The HelpPromptManager is a mechanism for handling "help" requests
+ * by the user when the application does not provide any or such information.
+ */
+class HelpPromptManager {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~HelpPromptManager() {}
+
+ /**
+ * @brief Adds command to constructed values, and sends SetGlobalProperties if
+ * required
+ * @param cmd_id command unique ID
+ * @param command smart object with commands to add
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ virtual void OnVrCommandAdded(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) = 0;
+
+ /**
+ * @brief Removes command from constructed values, and send
+ * SetGlobalProperties if required
+ * @param cmd_id command unique ID
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ virtual void OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) = 0;
+
+ /**
+ * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
+ * message
+ * @param msg containing GlobalProperties
+ * @param is_response determines is the request or response for the for
+ * the SetGlobalPropertiesRequest
+ */
+ virtual void OnSetGlobalPropertiesReceived(
+ const smart_objects::SmartObject& msg, const bool is_response) = 0;
+
+ /**
+ * @brief Requests sending type behavior
+ */
+ enum class SendingType { kNoneSend, kSendHelpPrompt, kSendVRHelp, kSendBoth };
+
+ /**
+ * @brief Get current sending type
+ * @return current sending type
+ */
+ virtual SendingType GetSendingType() const = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
new file mode 100644
index 0000000000..81754a60b0
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
@@ -0,0 +1,197 @@
+/*
+ * 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_HELP_PROMPT_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
+
+#include "application_manager/help_prompt_manager.h"
+
+#include <algorithm>
+#include <vector>
+
+#include "utils/lock.h"
+#include "utils/timer.h"
+
+namespace application_manager {
+
+class Application;
+class ApplicationManager;
+
+/**
+ * @brief The HelpPromptManagerImpl class implemented interface
+ * HelpPromptManager
+ * is a mechanism for handling "help" requests
+ * by the user when the application does not provide any or such information.
+ */
+class HelpPromptManagerImpl : public HelpPromptManager {
+ public:
+ /**
+ * @brief Container for buffering VR help commands
+ */
+ typedef std::pair<uint32_t, smart_objects::SmartObjectSPtr> VRCommandPair;
+ typedef std::vector<VRCommandPair> VRCommandPairs;
+
+ /**
+ * @brief Class constructor
+ * @param app owner for this class
+ */
+ HelpPromptManagerImpl(Application& app, ApplicationManager& app_manager);
+
+ /**
+ * @brief Class destructor
+ */
+ ~HelpPromptManagerImpl();
+
+ /**
+ * @brief Adds command to constructed values, and sends SetGlobalProperties if
+ * required
+ * @param cmd_id command unique ID
+ * @param command smart object with commands to add
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ void OnVrCommandAdded(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) OVERRIDE;
+
+ /**
+ * @brief Removes command from constructed values, and send
+ * SetGlobalProperties if required
+ * @param cmd_id command unique ID
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ void OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) OVERRIDE;
+
+ /**
+ * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
+ * message
+ * @param msg containing GlobalProperties
+ * @param is_response determines is the request or response for the for
+ * the SetGlobalPropertiesRequest
+ */
+ void OnSetGlobalPropertiesReceived(const smart_objects::SmartObject& msg,
+ const bool is_response) OVERRIDE;
+
+ /**
+ * @brief Get current sending type
+ * @return current sending type
+ */
+ SendingType GetSendingType() const OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HelpPromptManagerImpl);
+
+ /**
+ * @brief Add new smart object with VR command to the map
+ * @param cmd_id ID of VR command
+ * @param command smart object containing VR command structure
+ * @return true if first kLimitCommand commands was changed after adding
+ * of the current command otherwise returns false
+ */
+ bool AddCommand(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command);
+ /**
+ * @brief Delete VR command from map by its cmd_id
+ * @param cmd_id ID of VR command
+ * @return true if first kLimitCommand commands was changed after deleting
+ * of the current command otherwise returns false
+ */
+ bool DeleteCommand(const uint32_t cmd_id);
+
+ /**
+ * @brief Send TTS request to HMI
+ */
+ void SendTTSRequest();
+
+ /**
+ * @brief Send UI request to HMI
+ */
+ void SendUIRequest();
+
+ /**
+ * @brief Send TTS and UI requests to HMI
+ */
+ void SendBothRequests();
+
+ /**
+ * @brief Send TTS or UI or both Requests
+ */
+ void SendRequests();
+
+ /**
+ * @brief Construct the helpPrompt parameter
+ */
+ void CreatePromptMsg(smart_objects::SmartObject& out_msg_params);
+
+ /**
+ * @brief Construct the vrHelp parameter
+ */
+ void CreateVRMsg(smart_objects::SmartObject& out_msg_params);
+
+ /**
+ * @brief Setting request type to send HMI
+ * @param msg containing request or response for the
+ * SetGlobalPropertiesRequest
+ */
+ void SetSendingType(const smart_objects::SmartObject& msg);
+
+ /**
+ * @brief Get the total count of commands in VRCommand pairs
+ * @param end_element pointer to VRCommandPairs element to which commands
+ * should be counted
+ * @return total count of commands
+ */
+ size_t GetCommandsCount(VRCommandPairs::const_iterator end_element) const;
+
+ /**
+ * @brief Generate help prompt/vr help items array and write it into provided
+ * smart object
+ * @param out_msg_params output smart object
+ * @param vr_key name of vr item in response
+ */
+ void GenerateVrItems(smart_objects::SmartObject& out_msg_params,
+ const char* vr_key) const;
+
+ Application& app_;
+ ApplicationManager& app_manager_;
+ VRCommandPairs vr_commands_;
+ sync_primitives::Lock vr_commands_lock_;
+ SendingType sending_type_;
+ bool is_tts_send_;
+ bool is_ui_send_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/helpers/application_helper.h b/src/components/application_manager/include/application_manager/helpers/application_helper.h
index cecda0cd6f..145bef659e 100644
--- a/src/components/application_manager/include/application_manager/helpers/application_helper.h
+++ b/src/components/application_manager/include/application_manager/helpers/application_helper.h
@@ -75,16 +75,6 @@ std::vector<ApplicationSharedPtr> FindAllApps(
}
/**
- * @brief The SubscribedToIVIPredicate is predicate for lookup within
- * applications list for apps subscribed for specific vehicle data
- */
-struct SubscribedToIVIPredicate {
- uint32_t vehicle_info_;
- explicit SubscribedToIVIPredicate(uint32_t vehicle_info);
- bool operator()(const ApplicationSharedPtr app) const;
-};
-
-/**
* @brief RecallApplicationData cleans up data within application instance to
* its initial state and notifies HMI to delete same data on its side
* @param app Application to clean its data
diff --git a/src/components/application_manager/include/application_manager/hmi_command_factory.h b/src/components/application_manager/include/application_manager/hmi_command_factory.h
deleted file mode 100644
index 6603563c6d..0000000000
--- a/src/components/application_manager/include/application_manager/hmi_command_factory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
-
-#include "application_manager/commands/command.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
-class ApplicationManager;
-/**
- * @brief Factory class for command creation
- **/
-class HMICommandFactory {
- public:
- /**
- * @brief Create command object and return pointer to it
- *
- * @param smartObject SmartObject shared pointer.
- * @return Pointer to created command object.
- **/
- static CommandSharedPtr CreateCommand(
- const commands::MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- private:
- HMICommandFactory();
- DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
index f2d665d998..07d9c8dc23 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -33,9 +33,10 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
+#include <iosfwd>
#include <list>
+#include <memory>
#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
#include "utils/macro.h"
namespace application_manager {
@@ -44,7 +45,7 @@ class HmiState;
class ApplicationManager;
class Application;
-typedef utils::SharedPtr<HmiState> HmiStatePtr;
+typedef std::shared_ptr<HmiState> HmiStatePtr;
/**
* @brief The HmiState class
@@ -53,10 +54,12 @@ typedef utils::SharedPtr<HmiState> HmiStatePtr;
*
*/
class HmiState {
+ friend std::ostream& operator<<(std::ostream& os, const HmiState& src);
+
public:
/**
* @brief The StateID enum describes state of application
- * If no events occured STATE_ID_DEFAULT shuld be presented
+ * If no events occurred STATE_ID_DEFAULT should be presented
*/
enum StateID {
STATE_ID_CURRENT,
@@ -66,6 +69,7 @@ class HmiState {
STATE_ID_SAFETY_MODE,
STATE_ID_VR_SESSION,
STATE_ID_TTS_SESSION,
+ STATE_ID_VIDEO_STREAMING,
STATE_ID_NAVI_STREAMING,
STATE_ID_DEACTIVATE_HMI,
STATE_ID_AUDIO_SOURCE,
@@ -77,7 +81,7 @@ class HmiState {
* @param app Application pointer
* @param app_mngr Application manager
*/
- HmiState(utils::SharedPtr<Application> app,
+ HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
/**
@@ -86,26 +90,7 @@ class HmiState {
* @param app_mngr Application manager
* @param state_id HMI state to assign
*/
- HmiState(utils::SharedPtr<Application> app,
- const ApplicationManager& app_mngr,
- StateID state_id);
-
- /**
- * DEPRECATED
- * @brief HmiState constructor
- * @param app_id Application id
- * @param app_mngr Application manager
- */
- HmiState(uint32_t app_id, const ApplicationManager& app_mngr);
-
- /**
- * DEPRECATED
- * @brief HmiState constructor
- * @param app_id Application id
- * @param app_mngr Application manager
- * @param state_id HMI state to assign
- */
- HmiState(uint32_t app_id,
+ HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id);
@@ -154,6 +139,28 @@ class HmiState {
}
return audio_streaming_state_;
}
+
+ /**
+ * @brief video_streaming_state
+ * @return return video streaming state member
+ */
+ virtual mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const {
+ if (parent_) {
+ return parent_->video_streaming_state();
+ }
+ return video_streaming_state_;
+ }
+
+ /**
+ * @brief set_video_streaming_state set set_video_streaming_state member
+ * @param video_state video_state to setup
+ */
+ virtual void set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType video_state) {
+ video_streaming_state_ = video_state;
+ }
+
/**
* @brief set_audio_streaming_state set audio_streaming_state member
* @param audio_state audio_state to setup
@@ -195,17 +202,18 @@ class HmiState {
* @brief set_state_id sets state id
* @param state_id state id to setup
*/
- virtual void set_state_id(StateID state_id) {
+ void set_state_id(StateID state_id) {
state_id_ = state_id;
}
protected:
- utils::SharedPtr<Application> app_;
+ std::shared_ptr<Application> app_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
mobile_apis::HMILevel::eType hmi_level_;
mobile_apis::AudioStreamingState::eType audio_streaming_state_;
+ mobile_apis::VideoStreamingState::eType video_streaming_state_;
mobile_apis::SystemContext::eType system_context_;
protected:
@@ -245,10 +253,8 @@ class VRHmiState : public HmiState {
public:
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
- VRHmiState(utils::SharedPtr<Application> app,
+ VRHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
-
- DEPRECATED VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
};
/**
@@ -256,26 +262,34 @@ class VRHmiState : public HmiState {
*/
class TTSHmiState : public HmiState {
public:
- TTSHmiState(utils::SharedPtr<Application> app,
+ TTSHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
-
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
};
/**
- * @brief The NaviStreamingState class implements logic of NaviStreaming
+ * @brief The VideoStreamingState class implements logic of video streaming
* temporary state
*/
-class NaviStreamingHmiState : public HmiState {
+class VideoStreamingHmiState : public HmiState {
public:
- NaviStreamingHmiState(utils::SharedPtr<Application> app,
- const ApplicationManager& app_mngr);
+ VideoStreamingHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
- DEPRECATED NaviStreamingHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr);
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE;
+};
+
+/**
+ * @brief The NaviStreamingHmiState class implements logic of navigation
+ * streaming temporary state that is more specific than VideoStreamingHmiState
+ */
+class NaviStreamingHmiState : public VideoStreamingHmiState {
+ public:
+ NaviStreamingHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
@@ -287,12 +301,9 @@ class NaviStreamingHmiState : public HmiState {
*/
class PhoneCallHmiState : public HmiState {
public:
- PhoneCallHmiState(utils::SharedPtr<Application> app,
+ PhoneCallHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED PhoneCallHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -306,16 +317,17 @@ class PhoneCallHmiState : public HmiState {
*/
class SafetyModeHmiState : public HmiState {
public:
- SafetyModeHmiState(utils::SharedPtr<Application> app,
+ SafetyModeHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED SafetyModeHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr);
-
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
};
/**
@@ -324,16 +336,18 @@ class SafetyModeHmiState : public HmiState {
*/
class DeactivateHMI : public HmiState {
public:
- DeactivateHMI(utils::SharedPtr<Application> app,
+ DeactivateHMI(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
};
/**
@@ -342,16 +356,21 @@ class DeactivateHMI : public HmiState {
*/
class AudioSource : public HmiState {
public:
- AudioSource(utils::SharedPtr<Application> app,
+ AudioSource(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED AudioSource(uint32_t app_id, const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
+
+ private:
+ bool keep_context_;
};
/**
@@ -361,16 +380,36 @@ class AudioSource : public HmiState {
*/
class EmbeddedNavi : public HmiState {
public:
- EmbeddedNavi(utils::SharedPtr<Application> app,
+ EmbeddedNavi(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
};
-}
+
+/**
+ * @brief Outputs StateID to ostream in human readable format
+ * @param os output stream to insert data to
+ * @param src StateID value to output
+ * @return os
+ */
+std::ostream& operator<<(std::ostream& os, const HmiState::StateID src);
+
+/**
+ * @brief Outputs HmiState to ostream in human readable format
+ * @param os output stream to insert data to
+ * @param src HmiState value to output
+ * @return os
+ */
+std::ostream& operator<<(std::ostream& os, const HmiState& src);
+
+} // namespace application_manager
+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h
index f399da6870..1c319cf204 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -36,7 +36,6 @@
#include <string>
#include <vector>
-#include "utils/shared_ptr.h"
#include "protocol/message_priority.h"
#include "protocol/rpc_type.h"
#include "protocol/common.h"
@@ -68,9 +67,7 @@ class Message {
//! --------------------------------------------------------------------------
int32_t function_id() const;
-#ifdef SDL_REMOTE_CONTROL
std::string function_name() const;
-#endif // SDL_REMOTE_CONTROL
int32_t correlation_id() const;
int32_t connection_key() const;
@@ -87,13 +84,10 @@ class Message {
//!
//--------------------------------------------------------------------------.
void set_function_id(int32_t id);
-#ifdef SDL_REMOTE_CONTROL
void set_function_name(const std::string& name);
-#endif // SDL_REMOTE_CONTROL
void set_correlation_id(int32_t id);
void set_connection_key(int32_t key);
void set_message_type(MessageType type);
- DEPRECATED void set_binary_data(BinaryData* data);
void set_binary_data(const BinaryData* data);
void set_json_message(const std::string& json_message);
void set_protocol_version(protocol_handler::MajorProtocolVersion version);
@@ -113,9 +107,7 @@ class Message {
int32_t function_id_; // @remark protocol V2.
int32_t correlation_id_; // @remark protocol V2.
MessageType type_; // @remark protocol V2.
-#ifdef SDL_REMOTE_CONTROL
std::string function_name_;
-#endif // SDL_REMOTE_CONTROL
// Pre-calculated message priority, higher priority messages are
// Processed first
@@ -132,8 +124,8 @@ class Message {
protocol_handler::MajorProtocolVersion version_;
};
-typedef utils::SharedPtr<application_manager::Message> MobileMessage;
-typedef utils::SharedPtr<application_manager::Message> MessagePtr;
+typedef std::shared_ptr<application_manager::Message> MobileMessage;
+typedef std::shared_ptr<application_manager::Message> MessagePtr;
} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
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 fc84538dae..609b240301 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -2,6 +2,9 @@
Copyright (c) 2015, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -47,6 +50,7 @@
#include "application_manager/policies/policy_handler_interface.h"
#include "smart_objects/smart_object.h"
#include "transport_manager/common.h"
+#include <application_manager/smart_object_keys.h>
namespace policy {
class PolicyHandlerInterface;
@@ -69,7 +73,23 @@ typedef std::map<std::string, mobile_apis::VehicleDataType::eType> VehicleData;
class MessageHelper {
public:
/**
- * @brief Creates request for different interfaces(JSON, DBUS)
+ * @brief CreateNotification creates basic mobile notification smart object
+ * @param function_id Notification function ID
+ * @param app_id application to send notification
+ * @return basic mobile notification smart object
+ */
+ static smart_objects::SmartObjectSPtr CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id);
+ /**
+ * @brief CreateHMINotification creates basic hmi notification smart object
+ * @param function_id Notification function ID
+ * @return basic hmi notification smart object
+ */
+ static smart_objects::SmartObjectSPtr CreateHMINotification(
+ hmi_apis::FunctionID::eType function_id);
+
+ /**
+ * @brief Creates request for different interfaces(JSON)
* @param correlation_id unique ID
* @param params Vector of arguments that we need in GetVehicleData request
* (e.g. gps, odometer, fuel_level)
@@ -104,6 +124,15 @@ class MessageHelper {
static void SendDecryptCertificateToHMI(const std::string& file_name,
ApplicationManager& app_mngr);
+ /**
+ * @brief SendGetSystemTimeRequest sends mentioned request to HMI.
+ * @param correlation_id the message correlation id, required for proper
+ * response processing.
+ * @param app_mngr
+ */
+ static void SendGetSystemTimeRequest(const uint32_t correlation_id,
+ ApplicationManager& app_mngr);
+
/*
* @brief Retrieve vehicle data map for param name in mobile request
* to VehicleDataType
@@ -215,18 +244,6 @@ class MessageHelper {
const std::string& path_to_icon, uint32_t app_id);
/**
- * @brief Sends IVI subscription requests
- */
- static bool SendIVISubscribtions(const uint32_t app_id,
- ApplicationManager& app_mngr);
-
- /**
- * @brief Returns IVI subscription requests
- */
- static smart_objects::SmartObjectList GetIVISubscriptionRequests(
- ApplicationSharedPtr app, ApplicationManager& app_mngr);
-
- /**
* @brief Sends button subscription notification
*/
static void SendOnButtonSubscriptionNotification(
@@ -286,6 +303,24 @@ class MessageHelper {
ApplicationManager& app_mngr);
/*
+ * @brief Create Common.DeviceInfo struct from device handle
+ * @param device_handle device handle of the app
+ * @param session_observer instance of SessionObserver to retrieve device
+ * information
+ * @param policy_handler instance of PolicyHandlerInterface to get the value
+ * of 'isSDLAllowed'
+ * @param app_mngr instance of ApplicationManager
+ * @param output smart object to store created Common.DeviceInfo struct
+ * @return true on success, false otherwise
+ */
+ static bool CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output);
+
+ /*
* @brief Create Common.HMIApplication struct application instance
* @param app : applicaton instace
* @param output smart object to store Common.HMIApplication struct
@@ -313,7 +348,7 @@ class MessageHelper {
bool is_unexpected_disconnect,
ApplicationManager& app_mngr);
- static NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr
+ static ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
@@ -425,7 +460,7 @@ class MessageHelper {
static void SendSystemRequestNotification(
uint32_t connection_key,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& content,
+ ns_smart_device_link::ns_smart_objects::SmartObject& content,
ApplicationManager& app_mngr);
/**
@@ -533,7 +568,7 @@ class MessageHelper {
/**
* @brief Sends UnsubscribeWayPoints request
- * @return true if UnSubscribedWayPoints is send otherwise false
+ * @return true if UnsubscribedWayPoints is send otherwise false
*/
static bool SendUnsubscribedWayPoints(ApplicationManager& app_mngr);
@@ -544,16 +579,46 @@ class MessageHelper {
int32_t result_code);
/**
+ * @brief Get the full file path of an app file
+ *
+ * @param file_name The relative path of an application file
+ * @param app Current application
+ * @param app_mngr Application manager
+ *
+ * @return The full file path of the application file if valid,
+ * empty string otherwise
+ */
+ static std::string GetAppFilePath(std::string file_name,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief Verify that all ttsChunks with FILE type
+ * in an array include an existing file and set full path
+ *
+ * @param tts_chunks SmartObject with an array of TTSChunks
+ * @param app Current application
+ * @param app_mngr Application manager
+ *
+ * @return FILE_NOT_FOUND if one of the TTSChunks
+ * included a file which wasn't present on disk,
+ * SUCCESS otherwise
+ */
+ static mobile_apis::Result::eType VerifyTtsFiles(
+ smart_objects::SmartObject& tts_chunks,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
+
+ /**
* @brief Verify image and add image file full path
* and add path, although the image doesn't exist
* @param SmartObject with image
* @param app current application
* @return verification result
*/
- static mobile_apis::Result::eType VerifyImageApplyPath(
- smart_objects::SmartObject& image,
- ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr);
+ static void ApplyImagePath(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
/*
* @brief Verify image and add image file full path
@@ -570,6 +635,21 @@ class MessageHelper {
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr);
+ /**
+ * @brief Stores whether each choice in a set has the vrCommands parameter
+ * MIXED means some choices have vrCommands and others don't
+ * ALL means all do, NONE means none do
+ */
+ enum ChoiceSetVRCommandsStatus { MIXED, ALL, NONE };
+
+ /**
+ * @brief Check whether each choice in the set has the vrCommands parameter
+ * @param choice set to check
+ * @return a ChoiceSetVRCommandsStatus with the state of the choice set
+ */
+ static ChoiceSetVRCommandsStatus CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set);
+
/*
* @brief Finds "Image" structure in request and verify image file presence
* in Core.
@@ -598,7 +678,7 @@ class MessageHelper {
* @return returns FALSE if string contains incorrect character or
* string is empty otherwise returns TRUE
*/
- static bool VerifySoftButtonString(const std::string& str);
+ static bool VerifyString(const std::string& str);
static mobile_apis::Result::eType ProcessSoftButtons(
smart_objects::SmartObject& message_params,
@@ -620,6 +700,14 @@ class MessageHelper {
ApplicationSharedPtr app,
int32_t function_id);
+ /**
+ * @brief Prints SmartObject contents to log file
+ * @param object - SmartObject to print
+ * @return always True as this function is used for internal debug purposes
+ * only
+ * @note Function prints SmartObject only in DEBUG build mode. There will not
+ * be any print in RELEASE build mode
+ */
static bool PrintSmartObject(const smart_objects::SmartObject& object);
template <typename From, typename To>
@@ -758,18 +846,6 @@ class MessageHelper {
ApplicationManager& app_mngr);
/**
- * @brief SendUnsubscribeIVIRequest sends request to HMI to remove vehicle
- * data subscription for application
- * @param ivi_id Vehicle data item id
- * @param application Application to unsubscribe
- * @param app_mngr Application manager
- */
- static void SendUnsubscribeIVIRequest(int32_t ivi_id,
- ApplicationSharedPtr application,
- ApplicationManager& app_mngr);
-
-#ifdef SDL_REMOTE_CONTROL
- /**
* @brief Sends HMI status notification to mobile
* @param application_impl application with changed HMI status
**/
@@ -791,9 +867,7 @@ class MessageHelper {
ApplicationManager& application_manager,
hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL,
bool send_policy_priority = true);
-#endif // SDL_REMOTE_CONTROL
- private:
/**
* @brief CreateMessageForHMI Creates HMI message with prepared header
* acccoring to message type
@@ -804,6 +878,7 @@ class MessageHelper {
static smart_objects::SmartObjectSPtr CreateMessageForHMI(
hmi_apis::messageType::eType message_type, const uint32_t correlation_id);
+ private:
/**
* @brief Allows to fill SO according to the current permissions.
* @param permissions application permissions.
diff --git a/src/components/application_manager/include/application_manager/mobile_command_factory.h b/src/components/application_manager/include/application_manager/mobile_command_factory.h
deleted file mode 100644
index 1f270b28db..0000000000
--- a/src/components/application_manager/include/application_manager/mobile_command_factory.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
-
-#include "application_manager/commands/command.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
-class ApplicationManager;
-
-/**
- * @brief Factory class for command creation
- **/
-class MobileCommandFactory {
- public:
- /**
- * @brief Create command object and return pointer to it
- *
- * @param smartObject SmartObject shared pointer.
- * @return Pointer to created command object.
- **/
- static CommandSharedPtr CreateCommand(
- const commands::MessageSharedPtr& message,
- commands::Command::CommandOrigin origin,
- ApplicationManager& application_manager);
-
- private:
- MobileCommandFactory();
- DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h
index ad660d0b66..b2ad963f46 100644
--- a/src/components/application_manager/include/application_manager/mobile_message_handler.h
+++ b/src/components/application_manager/include/application_manager/mobile_message_handler.h
@@ -38,7 +38,7 @@
#include "application_manager/message.h"
namespace application_manager {
-typedef utils::SharedPtr<application_manager::Message> MobileMessage;
+typedef std::shared_ptr<application_manager::Message> MobileMessage;
class MobileMessageHandler {
public:
static application_manager::Message* HandleIncomingMessageProtocol(
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h
new file mode 100644
index 0000000000..09a412b2ac
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h
@@ -0,0 +1,125 @@
+/*
+ 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_PLUGIN_MANAGER_RPC_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H
+#include <memory>
+#include "utils/macro.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/application.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace application_manager {
+class CommandFactory;
+
+namespace plugin_manager {
+
+/**
+ * @brief The PolicyEvent enum defines events related to policy
+ */
+enum PolicyEvent { kApplicationPolicyUpdated = 0, kApplicationsDisabled };
+
+/**
+ * @brief The ApplicationEvent enum defines events related to single application
+ */
+enum ApplicationEvent {
+ kApplicationExit = 0,
+ kApplicationRegistered,
+ kApplicationUnregistered,
+ kDeleteApplicationData
+};
+
+class RPCPlugin {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~RPCPlugin() {}
+
+ /**
+ * @brief Command initialization function
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @return true in case initialization was succesful, false otherwise.
+ **/
+ virtual bool Init(ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) = 0;
+ /**
+ * @brief IsAbleToProcess check if plugin is able to process function
+ * @param function_id RPC identifier
+ * @param message_source source of message to process (from HMI from mobile
+ * ...)
+ * @return true if plugin is able to process this RPC, false if not
+ */
+ virtual bool IsAbleToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) = 0;
+
+ /**
+ * @brief PluginName plugin name
+ * @return plugin name
+ */
+ virtual std::string PluginName() = 0;
+
+ /**
+ * @brief GetCommandFactory get that is able to generate command
+ * from message
+ * @return plugins command factory
+ */
+ virtual CommandFactory& GetCommandFactory() = 0;
+ /**
+ * @brief OnPolicyEvent Notifies modules on certain events from policy
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(PolicyEvent event) = 0;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) = 0;
+};
+typedef std::unique_ptr<RPCPlugin> RPCPluginPtr;
+
+} // namespace plugin_manager
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
new file mode 100644
index 0000000000..692d296607
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.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_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
+#include <cstdint>
+#include <string>
+#include <memory>
+#include <vector>
+#include <functional>
+
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "utils/optional.h"
+namespace application_manager {
+namespace plugin_manager {
+
+class RPCPluginManager {
+ public:
+ virtual ~RPCPluginManager() {}
+ /**
+ * @brief LoadPlugins load plugins from plugin folder.
+ * Already loaded plugins should continue be loaded.
+ *
+ * @param plugin_folder folder to search for plugins
+ * @return amount of loaded plugins
+ */
+ virtual uint32_t LoadPlugins(const std::string& plugins_path) = 0;
+
+ /**
+ * @brief GetPlugins get list of plugins
+ * @return list of loaded plugins
+ */
+ virtual std::vector<RPCPluginPtr>& GetPlugins() = 0;
+
+ /**
+ * @brief FindPluginToProcess find plugin to process message
+ * @param function_id RPC identifier to process
+ * @param message_source message_source source of message to process
+ * @return plugin that is able to process the message
+ */
+ virtual utils::Optional<RPCPlugin> FindPluginToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) = 0;
+
+ /**
+ * @brief OnPolicyEvent Notifies modules on certain events from policy
+ * @param event Policy event
+ */
+ virtual void ForEachPlugin(std::function<void(RPCPlugin&)> functor) = 0;
+};
+} // namespace plugin_manager
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h
new file mode 100644
index 0000000000..5f85d45b6e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h
@@ -0,0 +1,79 @@
+/*
+ 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_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "utils/optional.h"
+
+namespace application_manager {
+namespace plugin_manager {
+
+class RPCPluginManagerImpl : public RPCPluginManager {
+ // RPCPluginManager interface
+ public:
+ /**
+ * @brief RPCPluginManagerImpl class constructor
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ **/
+ RPCPluginManagerImpl(ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ uint32_t LoadPlugins(const std::string& plugins_path) OVERRIDE;
+ std::vector<RPCPluginPtr>& GetPlugins() OVERRIDE;
+ utils::Optional<RPCPlugin> FindPluginToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) OVERRIDE;
+
+ private:
+ std::vector<RPCPluginPtr> loaded_plugins_;
+ ApplicationManager& app_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ // RPCPluginManager interface
+ public:
+ void ForEachPlugin(std::function<void(RPCPlugin&)> functor) OVERRIDE;
+};
+} // namespace plugin_manager
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
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 b4653c6cb2..c8f3bcf888 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
@@ -113,7 +113,6 @@ class PolicyHandler : public PolicyHandlerInterface,
virtual DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Sets HMI default type for specified application
* @param application_id ID application
@@ -177,7 +176,6 @@ class PolicyHandler : public PolicyHandlerInterface,
*/
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
bool GetDefaultHmi(const std::string& policy_app_id,
std::string* default_hmi) const OVERRIDE;
@@ -208,7 +206,7 @@ class PolicyHandler : public PolicyHandlerInterface,
void add_listener(PolicyHandlerObserver* listener) OVERRIDE;
void remove_listener(PolicyHandlerObserver* listener) OVERRIDE;
- utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager()
+ std::shared_ptr<usage_statistics::StatisticsManager> GetStatisticManager()
const OVERRIDE;
/**
@@ -487,6 +485,32 @@ class PolicyHandler : public PolicyHandlerInterface,
mobile_apis::RequestType::eType type) const OVERRIDE;
/**
+ * @brief Checks if certain request subtype is allowed for application
+ * @param policy_app_id Unique applicaion id
+ * @param request_subtype Request subtype
+ * @return true, if allowed, otherwise - false
+ */
+ bool IsRequestSubTypeAllowed(
+ const std::string& policy_app_id,
+ const std::string& request_subtype) const OVERRIDE;
+
+ /**
+ * @brief Gets application request types state
+ * @param policy_app_id Unique application id
+ * @return request types state
+ */
+ RequestType::State GetAppRequestTypeState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Gets application request subtypes state
+ * @param policy_app_id Unique application id
+ * @return request subtypes state
+ */
+ RequestSubType::State GetAppRequestSubTypeState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Gets application request types
* @param policy_app_id Unique application id
* @return request types
@@ -495,6 +519,14 @@ class PolicyHandler : public PolicyHandlerInterface,
const std::string& policy_app_id) const OVERRIDE;
/**
+ * @brief Gets application request subtypes
+ * @param policy_app_id Unique application id
+ * @return app request subtypes
+ */
+ const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Gets vehicle information
* @return Structure with vehicle information
*/
@@ -520,7 +552,7 @@ class PolicyHandler : public PolicyHandlerInterface,
int32_t timespan_seconds) OVERRIDE;
#ifdef BUILD_TESTS
- void SetPolicyManager(utils::SharedPtr<PolicyManager> pm) {
+ void SetPolicyManager(std::shared_ptr<PolicyManager> pm) {
policy_manager_ = pm;
}
#endif // BUILD_TESTS
@@ -593,7 +625,6 @@ class PolicyHandler : public PolicyHandlerInterface,
PermissionConsent& out_permissions) OVERRIDE;
#endif
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Updates HMI level for specified application and send notification
* @param app application where HMI level was changed
@@ -603,7 +634,6 @@ class PolicyHandler : public PolicyHandlerInterface,
mobile_apis::HMILevel::eType level);
std::vector<std::string> GetDevicesIds(
const std::string& policy_app_id) OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Sets days after epoch on successful policy update
@@ -702,9 +732,9 @@ class PolicyHandler : public PolicyHandlerInterface,
private:
mutable sync_primitives::RWLock policy_manager_lock_;
- utils::SharedPtr<PolicyManager> policy_manager_;
+ std::shared_ptr<PolicyManager> policy_manager_;
void* dl_handle_;
- utils::SharedPtr<PolicyEventObserver> event_observer_;
+ std::shared_ptr<PolicyEventObserver> event_observer_;
uint32_t last_activated_app_id_;
/**
@@ -726,9 +756,9 @@ class PolicyHandler : public PolicyHandlerInterface,
std::map<std::string, std::string> app_to_device_link_;
// Lock for app to device list
- sync_primitives::Lock app_to_device_link_lock_;
+ sync_primitives::RecursiveLock app_to_device_link_lock_;
- utils::SharedPtr<StatisticManagerImpl> statistic_manager_impl_;
+ std::shared_ptr<StatisticManagerImpl> statistic_manager_impl_;
const PolicySettings& settings_;
application_manager::ApplicationManager& application_manager_;
friend class AppPermissionDelegate;
diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h
index d3a5a0b821..ea8d95a92a 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -38,7 +38,7 @@
#include <list>
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/threads/thread.h"
#include "utils/conditional_variable.h"
#include "utils/threads/thread_delegate.h"
@@ -289,6 +289,13 @@ class RequestController {
*/
std::list<RequestPtr> notification_list_;
+ /**
+ * @brief Map keeping track of how many duplicate messages were sent for a
+ * given correlation id, to prevent early termination of a request
+ */
+ std::map<uint32_t, uint32_t> duplicate_message_count_;
+ sync_primitives::Lock duplicate_message_count_lock_;
+
/*
* timer for checking requests timeout
*/
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h
index 5ebcac71f8..be28bad63c 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -40,7 +40,7 @@
#include <set>
#include "application_manager/commands/command_request_impl.h"
-#include "commands/hmi/request_to_hmi.h"
+#include "commands/request_to_hmi.h"
#include "utils/date_time.h"
@@ -52,7 +52,7 @@ namespace request_controller {
* @brief Typedef for active mobile request
*
*/
-typedef utils::SharedPtr<commands::Command> RequestPtr;
+typedef std::shared_ptr<commands::Command> RequestPtr;
struct RequestInfo {
enum RequestType { RequestNone, MobileRequest, HMIRequest };
@@ -60,25 +60,28 @@ struct RequestInfo {
RequestInfo()
: timeout_msec_(0)
, app_id_(0)
- , requst_type_(RequestNone)
+ , request_type_(RequestNone)
, correlation_id_(0) {
- start_time_ = date_time::DateTime::getCurrentTime();
+ start_time_ = date_time::getCurrentTime();
updateEndTime();
}
virtual ~RequestInfo() {}
RequestInfo(RequestPtr request,
- const RequestType requst_type,
+ const RequestType request_type,
const uint64_t timeout_msec)
- : request_(request), timeout_msec_(timeout_msec), correlation_id_(0) {
- start_time_ = date_time::DateTime::getCurrentTime();
+ : request_(request)
+ , timeout_msec_(timeout_msec)
+ , app_id_(0)
+ , correlation_id_(0) {
+ start_time_ = date_time::getCurrentTime();
updateEndTime();
- requst_type_ = requst_type;
+ request_type_ = request_type;
}
RequestInfo(RequestPtr request,
- const RequestType requst_type,
- const TimevalStruct& start_time,
+ const RequestType request_type,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
void updateEndTime();
@@ -87,11 +90,11 @@ struct RequestInfo {
bool isExpired();
- TimevalStruct start_time() {
+ date_time::TimeDuration start_time() {
return start_time_;
}
- void update_start_time(TimevalStruct start_time) {
+ void update_start_time(date_time::TimeDuration start_time) {
start_time_ = start_time;
}
@@ -103,7 +106,7 @@ struct RequestInfo {
timeout_msec_ = timeout;
}
- TimevalStruct end_time() {
+ date_time::TimeDuration end_time() {
return end_time_;
}
@@ -111,8 +114,8 @@ struct RequestInfo {
return app_id_;
}
- RequestType requst_type() const {
- return requst_type_;
+ RequestType request_type() const {
+ return request_type_;
}
uint32_t requestId() {
@@ -128,27 +131,27 @@ struct RequestInfo {
protected:
RequestPtr request_;
- TimevalStruct start_time_;
+ date_time::TimeDuration start_time_;
uint64_t timeout_msec_;
- TimevalStruct end_time_;
+ date_time::TimeDuration end_time_;
uint32_t app_id_;
- RequestType requst_type_;
+ RequestType request_type_;
uint32_t correlation_id_;
};
-typedef utils::SharedPtr<RequestInfo> RequestInfoPtr;
+typedef std::shared_ptr<RequestInfo> RequestInfoPtr;
struct MobileRequestInfo : public RequestInfo {
MobileRequestInfo(RequestPtr request, const uint64_t timeout_msec);
MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
};
struct HMIRequestInfo : public RequestInfo {
HMIRequestInfo(RequestPtr request, const uint64_t timeout_msec);
HMIRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
};
@@ -261,8 +264,7 @@ class RequestInfoSet {
TimeSortedRequestInfoSet time_sorted_pending_requests_;
HashSortedRequestInfoSet hash_sorted_pending_requests_;
- // the lock caled this_lock_, since the class represent collection by itself.
- sync_primitives::Lock this_lock_;
+ sync_primitives::Lock pending_requests_lock_;
};
/**
@@ -270,13 +272,13 @@ class RequestInfoSet {
* during time scale
*/
struct TimeScale {
- TimeScale(const TimevalStruct& start,
- const TimevalStruct& end,
+ TimeScale(const date_time::TimeDuration& start,
+ const date_time::TimeDuration& end,
const uint32_t& app_id)
: start_(start), end_(end), app_id_(app_id) {}
bool operator()(RequestInfoPtr setEntry) {
- if (!setEntry.valid()) {
+ if (setEntry.use_count() == 0) {
return false;
}
@@ -292,8 +294,8 @@ struct TimeScale {
}
private:
- TimevalStruct start_;
- TimevalStruct end_;
+ date_time::TimeDuration start_;
+ date_time::TimeDuration end_;
uint32_t app_id_;
};
diff --git a/src/components/application_manager/include/application_manager/request_tracker.h b/src/components/application_manager/include/application_manager/request_tracker.h
index 36ab3eaefb..b351e716a7 100644
--- a/src/components/application_manager/include/application_manager/request_tracker.h
+++ b/src/components/application_manager/include/application_manager/request_tracker.h
@@ -85,7 +85,7 @@ class RequestTracker {
const mobile_apis::HMILevel::eType level);
private:
- typedef std::vector<TimevalStruct> RequestAddedAt;
+ typedef std::vector<date_time::TimeDuration> RequestAddedAt;
typedef std::map<ApplicationID, RequestAddedAt> ApplicationsRequestsTracker;
/**
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
index 0ec58f2419..f9a60c862b 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
@@ -34,14 +34,14 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_
#include <stdint.h>
-#include "utils/shared_ptr.h"
+#include <time.h>
#include "application_manager/resumption/resumption_data.h"
namespace application_manager {
class ApplicationManager;
class Application;
-typedef utils::SharedPtr<Application> ApplicationSharedPtr;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<Application> ApplicationSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
}
namespace app_mngr = application_manager;
@@ -125,6 +125,16 @@ class ResumeCtrl {
virtual void OnAwake() = 0;
/**
+ * @brief Saves Low Voltage signal timestamp
+ */
+ virtual void SaveLowVoltageTime() = 0;
+
+ /**
+ * @brief Saves Wake Up signal timestamp
+ */
+ virtual void SaveWakeUpTime() = 0;
+
+ /**
* @brief Checks if SDL has already received OnExitAllApplication notification
* with "SUSPEND" reason
*
@@ -134,13 +144,19 @@ class ResumeCtrl {
virtual bool is_suspended() const = 0;
/**
- * @brief Method stops timer "RsmCtrlPercist" when SDL
+ * @brief Method stops timer "RsmCtrlPersist" when SDL
* receives OnExitAllApplication notification
* with reason "SUSPEND"
*/
virtual void StopSavePersistentDataTimer() = 0;
/**
+ * @brief Method starts timer "RsmCtrlPersist" when
+ * SDL receives onAwakeSDL notification
+ */
+ virtual void StartSavePersistentDataTimer() = 0;
+
+ /**
* @brief Start timer for resumption applications
* Restore D1-D5 data
* @param application that is need to be restored
@@ -158,6 +174,13 @@ class ResumeCtrl {
app_mngr::ApplicationSharedPtr application) = 0;
/**
+ * @brief Retry resumption of an app if it has been disabled or limited
+ * due to absence of high-bandwidth transport.
+ * @param app_id ID of the app to resume
+ */
+ virtual void RetryResumption(const uint32_t app_id) = 0;
+
+ /**
* @brief Check if there are all files need for resumption
* @param application that is need to be restored
* @return true if it all files exist, otherwise return false
@@ -263,7 +286,9 @@ class ResumeCtrl {
#ifdef BUILD_TESTS
virtual void set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) = 0;
+ std::shared_ptr<ResumptionData> mock_storage) = 0;
+
+ virtual bool get_resumption_active() const = 0;
#endif // BUILD_TESTS
};
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
index d7ff621c95..e749118140 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
@@ -33,6 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
+#include "application_manager/resumption/resume_ctrl.h"
+
#include <stdint.h>
#include <vector>
#include <map>
@@ -46,7 +48,6 @@
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "application_manager/resumption/resumption_data.h"
-#include "application_manager/resumption/resume_ctrl.h"
#include "utils/timer.h"
namespace resumption {
@@ -138,6 +139,10 @@ class ResumeCtrlImpl : public ResumeCtrl,
*/
void OnAwake() OVERRIDE;
+ void SaveLowVoltageTime() OVERRIDE;
+
+ void SaveWakeUpTime() OVERRIDE;
+
/**
* @brief Checks if SDL has already received OnExitAllApplication notification
* with "SUSPEND" reason
@@ -155,6 +160,13 @@ class ResumeCtrlImpl : public ResumeCtrl,
void StopSavePersistentDataTimer() OVERRIDE;
/**
+ * @brief Check if all IGNITION OFF and IGNITION ON records
+ * saved in resumption data base
+ * @return True if all records saved, otherwise False
+ */
+ bool CheckIgnCyclesData() const;
+
+ /**
* @brief Method stops restore_hmi_level_timer_ "RsmCtrlRstore" in OnSuspend()
*/
void StopRestoreHmiLevelTimer();
@@ -178,6 +190,13 @@ class ResumeCtrlImpl : public ResumeCtrl,
app_mngr::ApplicationSharedPtr application) OVERRIDE;
/**
+ * @brief Retry resumption of an app if it has been disabled or limited
+ * due to absence of high-bandwidth transport.
+ * @param app_id ID of the app to resume
+ */
+ void RetryResumption(const uint32_t app_id) OVERRIDE;
+
+ /**
* @brief Check if there are all files need for resumption
* @param application that is need to be restored
* @return true if it all files exist, otherwise return false
@@ -293,14 +312,30 @@ class ResumeCtrlImpl : public ResumeCtrl,
* @brief Method starts timer "RsmCtrlPercist" when
* SDL receives onAwakeSDL notification
*/
- void StartSavePersistentDataTimer();
+ void StartSavePersistentDataTimer() OVERRIDE;
#ifdef BUILD_TESTS
void set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) OVERRIDE;
+ std::shared_ptr<ResumptionData> mock_storage) OVERRIDE;
+
+ bool get_resumption_active() const OVERRIDE;
#endif // BUILD_TESTS
private:
/**
+ * @brief Returns Low Voltage signal timestamp
+ * @return Low Voltage event timestamp if event LOW VOLTAGE event occures
+ * otherwise 0
+ */
+ time_t LowVoltageTime() const;
+
+ /**
+ * @brief Returns Wake Up signal timestamp
+ * @return Wake Up timestamp if Wake Up signal occures
+ * otherwise 0
+ */
+ time_t WakeUpTime() const;
+
+ /**
* @brief restores saved data of application
* @param application contains application for which restores data
* @return true if success, otherwise return false
@@ -381,11 +416,27 @@ class ResumeCtrlImpl : public ResumeCtrl,
void AddWayPointsSubscription(app_mngr::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is allowed for resumption
+ * by Ignition Cycle restrictions
+ * @param saved_app application specific section from backup file
+ * @return True if allowed , otherwise - False
+ */
bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app);
- bool DisconnectedJustBeforeIgnOff(
- const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is allowed for resumption
+ * by Low Voltage restrictions
+ * @param saved_app application specific section from backup file
+ * @return True if allowed , otherwise - False
+ */
+ bool CheckLowVoltageRestrictions(const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is applicable for resumption
+ * @param saved_app application specific section from backup file
+ * @return True fs allowed , otherwise - False
+ */
bool CheckAppRestrictions(app_mngr::ApplicationConstSharedPtr application,
const smart_objects::SmartObject& saved_app);
@@ -400,10 +451,38 @@ class ResumeCtrlImpl : public ResumeCtrl,
/**
* @brief CheckDelayAfterIgnOn should check if SDL was started less
- * then N seconds ago. N will be readed from profile.
+ * than N seconds ago. N will be read from profile.
* @return true if SDL started N seconds ago, otherwise return false
*/
- bool CheckDelayAfterIgnOn();
+ bool CheckDelayAfterIgnOn() const;
+
+ /**
+ * @brief CheckDelayBeforeIgnOff checks if app was unregistered less
+ * than N seconds before Ignition OFF. N will be read from profile.
+ * @return true if app was disconnected within timeframe of N seconds before
+ * Ignition Off,
+ * otherwise return false
+ */
+ bool CheckDelayBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app) const;
+
+ /**
+ * @brief CheckDelayAfterWakeUp should check if app was registered
+ * during the first N seconds after WakeUp signal. N will be read from
+ * profile.
+ * @return true if app registered within N seconds after WakeUp, otherwise
+ * return false
+ */
+ bool CheckDelayAfterWakeUp() const;
+
+ /**
+ * @brief CheckDelayBeforeLowVoltage checks if app was unregistered within
+ * N seconds before Low Voltage signal. N will be read from profile.
+ * @return true if app was disconnected within timeframe of N seconds before
+ * Low Voltage , otherwise return false
+ */
+ bool CheckDelayBeforeLowVoltage(
+ const smart_objects::SmartObject& saved_app) const;
typedef std::pair<uint32_t, uint32_t> application_timestamp;
@@ -438,7 +517,7 @@ class ResumeCtrlImpl : public ResumeCtrl,
* @brief Get the last ignition off time from LastState
* @return the last ignition off time from LastState
*/
- time_t GetIgnOffTime();
+ time_t GetIgnOffTime() const;
/**
* @brief Setup IgnOff time to LastState
@@ -500,6 +579,19 @@ class ResumeCtrlImpl : public ResumeCtrl,
const application_manager::ApplicationSharedPtr application) const;
/**
+ * @brief Retrieve the HMI level of the app when high-bandwidth transport
+ *isn't available
+ *
+ * The value is configured through smartDeviceLink.ini file
+ *
+ * @param application an instance of the app
+ * @return HMI level that the app is allowed when high-bandwidth transport
+ *isn't available
+ */
+ mobile_apis::HMILevel::eType GetHmiLevelOnLowBandwidthTransport(
+ app_mngr::ApplicationConstSharedPtr application) const;
+
+ /**
*@brief Mapping applications to time_stamps
* wait for timer to resume HMI Level
*
@@ -513,7 +605,9 @@ class ResumeCtrlImpl : public ResumeCtrl,
bool is_data_saved_;
bool is_suspended_;
time_t launch_time_;
- utils::SharedPtr<ResumptionData> resumption_storage_;
+ time_t low_voltage_time_;
+ time_t wake_up_time_;
+ std::shared_ptr<ResumptionData> resumption_storage_;
application_manager::ApplicationManager& application_manager_;
};
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
index bee2bce570..c2634173a5 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
@@ -95,20 +95,26 @@ class ResumptionData {
virtual void IncrementIgnOffCount() = 0;
/**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
+ * @brief Decrements ignition counter for all registered applications
*/
- DEPRECATED virtual void OnSuspend() = 0;
+ virtual void DecrementIgnOffCount() = 0;
/**
- * @brief Decrements ignition counter for all registered applications
+ * @brief Increments global ignition on counter
+ * by 1
*/
- virtual void DecrementIgnOffCount() = 0;
+ virtual void IncrementGlobalIgnOnCounter() = 0;
/**
- * @brief Decrements ignition counter for all registered applications
+ * @brief Get the global ignition on counter
+ * @return the global ignition on counter
+ */
+ virtual uint32_t GetGlobalIgnOnCounter() const = 0;
+
+ /**
+ * @brief Resets global ignition on counter
*/
- DEPRECATED virtual void OnAwake() = 0;
+ virtual void ResetGlobalIgnOnCount() = 0;
/**
* @brief Retrieves hash ID for the given mobile app ID
@@ -276,7 +282,7 @@ class ResumptionData {
++first;
}
}
- mutable sync_primitives::Lock resumption_lock_;
+ mutable sync_primitives::RecursiveLock resumption_lock_;
const application_manager::ApplicationManager& application_manager_;
};
} // namespace resumption
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
index a8032d1f65..2b5a1fdcc9 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
@@ -110,16 +110,11 @@ class ResumptionDataDB : public ResumptionData {
virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id,
const std::string& device_id) const;
- /**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- DEPRECATED void OnSuspend() FINAL;
+ void IncrementGlobalIgnOnCounter() OVERRIDE;
- /**
- * @brief Decrements ignition counter for all registered applications
- */
- DEPRECATED void OnAwake() FINAL;
+ uint32_t GetGlobalIgnOnCounter() const OVERRIDE;
+
+ void ResetGlobalIgnOnCount() OVERRIDE;
/**
* @brief Increments ignition counter for all registered applications
@@ -683,7 +678,7 @@ class ResumptionDataDB : public ResumptionData {
smart_objects::SmartObject& saved_app) const;
/**
- * @brief Selects data from applicationSubscribtionsArray table
+ * @brief Selects data from applicationSubscriptionsArray table
* @param policy_app_id contains mobile application id of application
* @param device_id contains id of device on which is running application
* @param saved_app will contain subscriptions
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
index 82ec1d9e5c..e2418fd033 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
@@ -80,18 +80,6 @@ class ResumptionDataJson : public ResumptionData {
*/
virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id,
const std::string& device_id) const;
-
- /**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- DEPRECATED void OnSuspend() FINAL;
-
- /**
- * @brief Decrements ignition counter for all registered applications
- */
- DEPRECATED void OnAwake() FINAL;
-
/**
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
@@ -145,6 +133,12 @@ class ResumptionDataJson : public ResumptionData {
*/
virtual uint32_t GetIgnOffTime() const;
+ void IncrementGlobalIgnOnCounter() OVERRIDE;
+
+ uint32_t GetGlobalIgnOnCounter() const OVERRIDE;
+
+ void ResetGlobalIgnOnCount() OVERRIDE;
+
/**
* @brief Checks if saved data have application
* @param policy_app_id - mobile application id
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
index d61baff7d2..eee7650697 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
@@ -57,12 +57,15 @@ extern const std::string kUpdateIgnOffCount;
extern const std::string kCountApplicationsIgnOff;
extern const std::string kSelectApplicationsIgnOffCount;
extern const std::string kUpdateSuspendData;
-extern const std::string KUpdateLastIgnOffTime;
+extern const std::string kUpdateLastIgnOffTime;
+extern const std::string kUpdateGlobalIgnOnCount;
+extern const std::string kResetGlobalIgnOnCount;
+extern const std::string kSelectGlobalIgnOnCounter;
extern const std::string kDeleteFile;
extern const std::string kDeleteApplicationFilesArray;
extern const std::string kDeleteSubMenu;
extern const std::string kDeleteApplicationSubMenuArray;
-extern const std::string kDeleteApplicationSubscribtionsArray;
+extern const std::string kDeleteApplicationSubscriptionsArray;
extern const std::string kDeleteImageFromCommands;
extern const std::string kDeleteVrCommands;
extern const std::string kDeleteCommands;
diff --git a/src/components/application_manager/include/application_manager/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
new file mode 100644
index 0000000000..cc93e4213c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_IMPL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_IMPL_H
+
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_handler.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/mobile_message_handler.h"
+#include "application_manager/policies/policy_handler_observer.h"
+
+#include "protocol_handler/protocol_observer.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+#include "hmi_message_handler/hmi_message_sender.h"
+
+#include "formatters/formatter_json_rpc.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+#ifdef TELEMETRY_MONITOR
+#include "telemetry_observer.h"
+#endif // TELEMETRY_MONITOR
+
+#include "interfaces/v4_protocol_v1_2_no_extra.h"
+#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
+
+#include "utils/threads/message_loop_thread.h"
+#include "utils/semantic_version.h"
+
+namespace application_manager {
+namespace rpc_handler {
+
+namespace impl {
+struct MessageFromMobile : public std::shared_ptr<Message> {
+ MessageFromMobile() {}
+ explicit MessageFromMobile(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+struct MessageFromHmi : public std::shared_ptr<Message> {
+ MessageFromHmi() {}
+ explicit MessageFromHmi(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+// Short type names for prioritized message queues
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> >
+ FromMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> >
+ FromHmiQueue;
+}
+
+class RPCHandlerImpl : public RPCHandler,
+ public impl::FromMobileQueue::Handler,
+ public impl::FromHmiQueue::Handler {
+ public:
+ RPCHandlerImpl(ApplicationManager& app_manager);
+ ~RPCHandlerImpl();
+
+ // CALLED ON messages_from_mobile_ thread!
+ void Handle(const impl::MessageFromMobile message) OVERRIDE;
+ // CALLED ON messages_from_hmi_ thread!
+ void Handle(const impl::MessageFromHmi message) OVERRIDE;
+
+ // Overriden HMIMessageObserver method
+ /**
+ * @brief OnMessageReceived overriden HMIMessageObserver method,
+ * process message from HMI
+ * @param message pointer to received message
+ */
+ void OnMessageReceived(
+ hmi_message_handler::MessageSharedPointer message) OVERRIDE;
+
+ /**
+ * @brief OnErrorSending overriden HMIMessageObserver method
+ * @param message pointer to received message
+ */
+ void OnErrorSending(
+ hmi_message_handler::MessageSharedPointer message) OVERRIDE;
+
+ // Overriden ProtocolObserver method
+ /**
+ * @brief OnMessageReceived overriden ProtocolObserver method,
+ * process message from mobile
+ * @param message pointer to received message
+ */
+ void OnMessageReceived(
+ const ::protocol_handler::RawMessagePtr message) OVERRIDE;
+
+ /**
+ * @brief OnMobileMessageSent overriden ProtocolObserver method,
+ * post message to mobile
+ * @param message pointer to received message
+ */
+ void OnMobileMessageSent(
+ const ::protocol_handler::RawMessagePtr message) OVERRIDE;
+
+#ifdef TELEMETRY_MONITOR
+ /**
+ * @brief Setup observer for time metric.
+ *
+ * @param observer - pointer to observer
+ */
+ void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE;
+#endif // TELEMETRY_MONITOR
+
+ /**
+ * @brief Extracts and validates the syncMsgVersion included in
+ * a RegisterAppInterfaceRequest
+ *
+ * @param output - SmartObject Message received from mobile
+ * @param messageVersion - message version to be updated
+ */
+ void GetMessageVersion(
+ ns_smart_device_link::ns_smart_objects::SmartObject& output,
+ utils::SemanticVersion& message_version);
+
+ private:
+ void ProcessMessageFromMobile(const std::shared_ptr<Message> message);
+ void ProcessMessageFromHMI(const std::shared_ptr<Message> message);
+ bool ConvertMessageToSO(const Message& message,
+ smart_objects::SmartObject& output);
+ std::shared_ptr<Message> ConvertRawMsgToMessage(
+ const ::protocol_handler::RawMessagePtr message);
+ hmi_apis::HMI_API& hmi_so_factory();
+ mobile_apis::MOBILE_API& mobile_so_factory();
+
+ ApplicationManager& app_manager_;
+ // Thread that pumps messages coming from mobile side.
+ impl::FromMobileQueue messages_from_mobile_;
+ // Thread that pumps messages coming from HMI.
+ impl::FromHmiQueue messages_from_hmi_;
+
+ hmi_apis::HMI_API hmi_so_factory_;
+ mobile_apis::MOBILE_API mobile_so_factory_;
+#ifdef TELEMETRY_MONITOR
+ AMTelemetryObserver* metric_observer_;
+#endif // TELEMETRY_MONITOR
+};
+
+} // namespace rpc_handler
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_IMPL_H
diff --git a/src/components/application_manager/include/application_manager/rpc_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h
new file mode 100644
index 0000000000..1eaeb46255
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/rpc_service_impl.h
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/usage_statistics.h"
+#include "application_manager/mobile_message_handler.h"
+#include "application_manager/command_holder_impl.h"
+
+#include "formatters/formatter_json_rpc.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+
+#include "interfaces/v4_protocol_v1_2_no_extra.h"
+#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
+
+#include "utils/threads/message_loop_thread.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+namespace rpc_service {
+
+namespace impl {
+
+struct MessageToMobile : public std::shared_ptr<Message> {
+ MessageToMobile() : is_final(false) {}
+ explicit MessageToMobile(const std::shared_ptr<Message>& message,
+ bool final_message)
+ : std::shared_ptr<Message>(message), is_final(final_message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+ // Signals if connection to mobile must be closed after sending this message
+ bool is_final;
+};
+
+struct MessageToHmi : public std::shared_ptr<Message> {
+ MessageToHmi() {}
+ explicit MessageToHmi(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> >
+ ToMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> >
+ ToHmiQueue;
+}
+
+class RPCServiceImpl : public RPCService,
+ public impl::ToMobileQueue::Handler,
+ public impl::ToHmiQueue::Handler {
+ public:
+ /**
+ * @brief RPCServiceImpl class constructor
+ * @param app_manager ApplicationManager
+ * @param request_ctrl RequestController
+ * @param protocol_handler ProtocolHandler
+ * @param hmi_handler HMIMessageHandler
+ * @param commands_holder CommandHolder
+ **/
+ RPCServiceImpl(ApplicationManager& app_manager,
+ request_controller::RequestController& request_ctrl,
+ protocol_handler::ProtocolHandler* protocol_handler,
+ hmi_message_handler::HMIMessageHandler* hmi_handler,
+ CommandHolder& commands_holder);
+ ~RPCServiceImpl();
+
+ bool ManageMobileCommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) OVERRIDE;
+ bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE;
+
+ // CALLED ON messages_to_hmi_ thread!
+ void Handle(const impl::MessageToHmi message) OVERRIDE;
+ // CALLED ON messages_to_mobile_ thread!
+ void Handle(const impl::MessageToMobile message) OVERRIDE;
+
+ void SendMessageToMobile(const commands::MessageSharedPtr message,
+ bool final_message = false) OVERRIDE;
+ void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE;
+
+ void set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) OVERRIDE;
+ void set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) OVERRIDE;
+
+ private:
+ bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
+ Message& output);
+ hmi_apis::HMI_API& hmi_so_factory();
+ mobile_apis::MOBILE_API& mobile_so_factory();
+
+ ApplicationManager& app_manager_;
+ request_controller::RequestController& request_ctrl_;
+ protocol_handler::ProtocolHandler* protocol_handler_;
+ hmi_message_handler::HMIMessageHandler* hmi_handler_;
+ CommandHolder& commands_holder_;
+ // Thread that pumps messages being passed to mobile side.
+ impl::ToMobileQueue messages_to_mobile_;
+ // Thread that pumps messages being passed to HMI.
+ impl::ToHmiQueue messages_to_hmi_;
+
+ hmi_apis::HMI_API hmi_so_factory_;
+ mobile_apis::MOBILE_API mobile_so_factory_;
+};
+} // namespace rpc_service
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H
diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h
deleted file mode 100644
index da08957afa..0000000000
--- a/src/components/application_manager/include/application_manager/service.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_
-
-#include <string>
-#include <sstream>
-#include <vector>
-#include "application_manager/application.h"
-#include "application_manager/application_manager_settings.h"
-#include "application_manager/message.h"
-#include "application_manager/hmi_interfaces.h"
-
-namespace application_manager {
-
-enum TypeAccess { kDisallowed, kAllowed };
-
-enum MessageValidationResult {
- SUCCESS = 0,
- INVALID_JSON,
- INVALID_METADATA,
- SCHEMA_MISMATCH,
- UNSUPPORTED_PROTOCOL
-};
-
-typedef std::string PluginFunctionID;
-
-/**
- * @brief Interface to core service
- */
-class Service {
- public:
- virtual ~Service() {}
-
- /**
- * @brief Checks message permissions and cuts parameters according
- * to policy table permissions
- * @param msg message to cut disallowed parameters
- * @return result according by mobile API
- */
- virtual mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) = 0;
-
- /**
- * Checks if module for application is present in policy table
- * @param app_id id of application
- * @param module type
- * @return true if module is present, otherwise - false
- */
- virtual bool CheckModule(const ApplicationId& app_id,
- const std::string& module) = 0;
-
- /**
- * @brief Get pointer to application by application id
- * @param app_id application id
- * return pointer to application
- */
- virtual ApplicationSharedPtr GetApplication(ApplicationId app_id) = 0;
-
- /**
- * Removes parameters not listed in HMI API from HMI request
- * @param message message to handle
- */
- virtual void RemoveHMIFakeParameters(
- application_manager::MessagePtr& message) = 0;
- /**
- * @brief Send message to HMI
- * @param message Message to HMI
- */
- virtual void SendMessageToHMI(const MessagePtr& message) = 0;
-
- /**
- * @brief Send message to mobile device
- * @param message Message to mobile
- */
- virtual void SendMessageToMobile(const MessagePtr& message) = 0;
-
- /**
- * @brief Returns unique correlation ID for next HMI request
- *
- * @return Unique correlation ID
- */
- virtual uint32_t GetNextCorrelationID() = 0;
-
- /**
- * @brief Returns all applications related to plugin
- * @param uid ID provided by plugin to its extension to app.
- * @return List with shared pointers to applications
- */
- virtual std::vector<ApplicationSharedPtr> GetApplications(
- AppExtensionUID uid) = 0;
-
- /**
- * @brief Change hmi level of app and notify it
- * @param app Application to be changed and notified
- * @param level New HMI level of app
- */
- virtual void ChangeNotifyHMILevel(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level) = 0;
-
- /**
- * @brief Notify HMI about app changing HMI Level
- * only NONE, BACKGROUND and LIMITED levels are sent
- * @param app Application to be changed and notified
- * @param level New HMI level of app
- */
- virtual void NotifyHMIAboutHMILevel(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level) = 0;
-
- virtual const smart_objects::SmartObject* GetRCCapabilities() const = 0;
- /**
- * Checks if application has remote control functions
- * @param app application
- * @return true if application has remote control functions
- */
- virtual bool IsRemoteControlApplication(ApplicationSharedPtr app) const = 0;
-
- /**
- * @brief Gets current state of the specified interface
- * @param interface which state to get
- * @return true if specified interface available otherwise false
- */
- virtual bool IsInterfaceAvailable(
- const HmiInterfaces::InterfaceID interface) const = 0;
-
- /**
- * Gets all allowed module types
- * @param app_id unique identifier of application
- * @param list of allowed module types
- * @return true if application has allowed modules
- */
- virtual bool GetModuleTypes(const std::string& policy_app_id,
- std::vector<std::string>* modules) const = 0;
-
- /**
- * @brief ValidateMessageBySchema validates message by xml schema
- * @param message message for validation
- * @return true if message is valid according to schema, otherwise false
- */
- virtual MessageValidationResult ValidateMessageBySchema(
- const Message& message) = 0;
-
- /**
- * @brief Gets application manager settings structure
- * @return reference to application manager settings structure
- */
- virtual const ApplicationManagerSettings& GetSettings() const = 0;
-};
-
-typedef utils::SharedPtr<Service> ServicePtr;
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_
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 0d4eeea0c4..6e32853a3d 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
@@ -2,9 +2,6 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
- Copyright (c) 2017 Xevo Inc.
- All rights reserved.
-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -16,7 +13,7 @@
disclaimer in the documentation and/or other materials provided with the
distribution.
- Neither the name of the copyright holders nor the names of their contributors
+ 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.
@@ -54,6 +51,7 @@ extern const char* msg_params;
extern const char* method_name;
extern const char* info;
extern const char* app_id;
+extern const char* full_app_id;
extern const char* bundle_id;
extern const char* app_info;
extern const char* app_launch;
@@ -160,10 +158,12 @@ extern const char* hours;
extern const char* minutes;
extern const char* seconds;
extern const char* update_mode;
+extern const char* audioStreamingIndicator;
extern const char* trigger_source;
extern const char* hmi_level;
extern const char* activate_app_hmi_level;
extern const char* audio_streaming_state;
+extern const char* video_streaming_state;
extern const char* system_context;
extern const char* speech_capabilities;
extern const char* vr_capabilities;
@@ -178,17 +178,30 @@ extern const char* navigation_capability;
extern const char* phone_capability;
extern const char* video_streaming_capability;
extern const char* rc_capability;
+extern const char* day_color_scheme;
+extern const char* night_color_scheme;
+extern const char* primary_color;
+extern const char* secondary_color;
+extern const char* background_color;
+extern const char* red;
+extern const char* green;
+extern const char* blue;
+extern const char* display_layout;
+extern const char* icon_resumed;
// PutFile
extern const char* sync_file_name;
extern const char* file_name;
extern const char* file_type;
extern const char* file_size;
+extern const char* crc32_check_sum;
extern const char* request_type;
+extern const char* request_subtype;
extern const char* persistent_file;
extern const char* file_data;
extern const char* space_available;
extern const char* image_type;
+extern const char* is_template;
extern const char* image;
extern const char* type;
extern const char* system_file;
@@ -204,6 +217,7 @@ extern const char* did_location;
extern const char* app_list;
extern const char* device_list;
extern const char* device_info;
+extern const char* secondary_device_info;
extern const char* name;
extern const char* id;
extern const char* isSDLAllowed;
@@ -238,12 +252,15 @@ extern const char* rpm;
extern const char* fuel_level;
extern const char* fuel_level_state;
extern const char* instant_fuel_consumption;
+extern const char* fuel_range;
extern const char* external_temp;
+extern const char* turn_signal;
extern const char* vin;
extern const char* prndl;
extern const char* tire_pressure;
extern const char* odometer;
extern const char* belt_status;
+extern const char* electronic_park_brake_status;
extern const char* body_information;
extern const char* device_status;
extern const char* driver_braking;
@@ -274,6 +291,7 @@ extern const char* remote_control;
extern const char* sdl_version;
extern const char* system_software_version;
extern const char* priority;
+extern const char* engine_oil_life;
// resuming
extern const char* application_commands;
@@ -282,7 +300,7 @@ extern const char* application_choice_sets;
extern const char* application_global_properties;
extern const char* application_vehicle_info;
extern const char* application_buttons;
-extern const char* application_subscribtions;
+extern const char* application_subscriptions;
extern const char* application_files;
extern const char* application_show;
extern const char* resumption;
@@ -293,6 +311,8 @@ extern const char* resume_vr_grammars;
extern const char* ign_off_count;
+extern const char* global_ign_on_counter;
+
extern const char* connection_info;
extern const char* is_download_complete;
@@ -406,7 +426,19 @@ extern const char* kFull;
extern const char* kLimited;
extern const char* kBackground;
extern const char* kNone;
-}
+} // namespace hmi_levels
+
+namespace time_keys {
+extern const char* millisecond;
+extern const char* second;
+extern const char* minute;
+extern const char* hour;
+extern const char* day;
+extern const char* month;
+extern const char* year;
+extern const char* tz_hour;
+extern const char* tz_minute;
+} // namespace time_keys
namespace hmi_request {
extern const char* parent_id;
@@ -468,6 +500,7 @@ extern const char* dtc;
extern const char* ecu_header;
extern const char* image_capabilities;
extern const char* display_type;
+extern const char* display_name;
extern const char* text_fields;
extern const char* media_clock_formats;
extern const char* graphic_supported;
@@ -478,7 +511,7 @@ extern const char* num_custom_presets_available;
extern const char* urls;
extern const char* policy_app_id;
extern const char* enabled;
-
+extern const char* system_time;
} // namespace hmi_response
namespace hmi_notification {
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 1b2033f5a8..99113d6d00 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
@@ -32,8 +32,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_IMPL_H_
-#include <list>
+#include <list>
+#include <map>
#include "application_manager/hmi_state.h"
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
@@ -67,12 +68,14 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param app appication to setup regular State
* @param hmi_level of new regular state
* @param audio_state of new regular state
+ * @paran video_state of new regular state
* @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
virtual void SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool SendActivateApp);
/**
@@ -91,6 +94,7 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param app appication to setup regular State
* @param hmi_level of new regular state
* @param audio_state of new regular state
+ * @param video_state of new regular state
* @param system_context of new regular state
* @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
@@ -98,6 +102,7 @@ class StateControllerImpl : public event_engine::EventObserver,
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool SendActivateApp);
@@ -114,10 +119,12 @@ class StateControllerImpl : public event_engine::EventObserver,
* @brief SetRegularState Change regular audio state
* @param app appication to setup regular State
* @param audio_state of new regular state
+ * @param video_state of new regular state
*/
virtual void SetRegularState(
ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state);
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state);
/**
* @brief SetRegularState Change regular system context
@@ -149,17 +156,19 @@ class StateControllerImpl : public event_engine::EventObserver,
const mobile_apis::HMILevel::eType default_level);
/**
- * @brief OnNaviStreamingStarted process Navi streaming started
+ * @brief OnVideoStreamingStarted process video streaming started
+ * @param app projection or navigation application starting streaming
*/
- virtual void OnNaviStreamingStarted();
+ virtual void OnVideoStreamingStarted(ApplicationConstSharedPtr app);
/**
- * @brief OnNaviStreamingStopped process Navi streaming stopped
+ * @brief OnVideoStreamingStopped process video streaming stopped
+ * @param app projection or navigation application stopping streaming
*/
- virtual void OnNaviStreamingStopped();
+ virtual void OnVideoStreamingStopped(ApplicationConstSharedPtr app);
/**
- * @brief OnStateChanged send HMIStatusNotification if neded
+ * @brief OnStateChanged send HMIStatusNotification if needed
* @param app application
* @param old_state state before change
* @param new_state state after change
@@ -184,11 +193,11 @@ class StateControllerImpl : public event_engine::EventObserver,
* Move other application to HmiStates if applied moved to FULL or LIMITED
*/
struct HmiLevelConflictResolver {
- ApplicationSharedPtr applied_;
- HmiStatePtr state_;
+ const ApplicationSharedPtr applied_;
+ const HmiStatePtr state_;
StateControllerImpl* state_ctrl_;
- HmiLevelConflictResolver(ApplicationSharedPtr app,
- HmiStatePtr state,
+ HmiLevelConflictResolver(const ApplicationSharedPtr app,
+ const HmiStatePtr state,
StateControllerImpl* state_ctrl)
: applied_(app), state_(state), state_ctrl_(state_ctrl) {}
void operator()(ApplicationSharedPtr to_resolve);
@@ -330,6 +339,7 @@ class StateControllerImpl : public event_engine::EventObserver,
DCHECK_OR_RETURN_VOID(old_hmi_state);
old_hmi_state->set_hmi_level(cur->hmi_level());
old_hmi_state->set_audio_streaming_state(cur->audio_streaming_state());
+ old_hmi_state->set_video_streaming_state(cur->video_streaming_state());
old_hmi_state->set_system_context(cur->system_context());
app->RemoveHMIState(ID);
HmiStatePtr new_hmi_state = app->CurrentHmiState();
@@ -353,39 +363,18 @@ class StateControllerImpl : public event_engine::EventObserver,
void SetupRegularHmiState(ApplicationSharedPtr app, HmiStatePtr state);
/**
- * @brief IsSameAppType checks if apps has same types
- * @param app1
- * @param app2
- * @return true if aps have same types, otherwise return false
- */
- bool IsSameAppType(ApplicationConstSharedPtr app1,
- ApplicationConstSharedPtr app2);
-
- /**
* @brief SetupRegularHmiState set regular HMI State without
* resolving conflicts and ActivateApp request
* @param app application
* @param hmi_level of new regular state
* @param audio_state of new regular state
- * @param system_context of new regular state
+ * @param video_state of new regular state
*/
void SetupRegularHmiState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
- const mobile_apis::SystemContext::eType system_context);
-
- /**
- * @brief SetupRegularHmiState set regular HMI State without
- * resolving conflicts and ActivateApp request
- * @param app application
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- */
- void SetupRegularHmiState(
- ApplicationSharedPtr app,
- const mobile_apis::HMILevel::eType hmi_level,
- const mobile_apis::AudioStreamingState::eType audio_state);
+ const mobile_apis::VideoStreamingState::eType video_state);
/**
* @brief OnActivateAppResponse calback for activate app response
@@ -431,17 +420,35 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param state_id state id
* @return
*/
- HmiStatePtr CreateHmiState(utils::SharedPtr<Application> app,
+ HmiStatePtr CreateHmiState(std::shared_ptr<Application> app,
HmiState::StateID state_id) const;
+ /**
+ * @brief Determines AudioStreamingState value
+ * for application with HMI level specified.
+ * @param app an application to calculate for
+ * @param hmi_level HMI level
+ * @return AudioStreamingState value
+ */
mobile_apis::AudioStreamingState::eType CalcAudioState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level) const;
+ /**
+ * @brief Determines VideoStreamingState value
+ * for application with HMI level specified.
+ * @param app an application to calculate for
+ * @param hmi_level HMI level
+ * @return VideoStreamingState value
+ */
+ mobile_apis::VideoStreamingState::eType CalcVideoState(
+ ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level) const;
+
typedef std::list<HmiState::StateID> StateIDList;
StateIDList active_states_;
mutable sync_primitives::Lock active_states_lock_;
- std::map<uint32_t, HmiStatePtr> waiting_for_activate;
+ std::map<uint32_t, HmiStatePtr> waiting_for_activate_;
ApplicationManager& app_mngr_;
};
}
diff --git a/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h
new file mode 100644
index 0000000000..add440ad80
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h
@@ -0,0 +1,160 @@
+/*
+ * 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_SYSTEM_TIME_SYSTEM_TIME_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SYSTEM_TIME_SYSTEM_TIME_HANDLER_IMPL_H_
+
+#include <time.h>
+#include <vector>
+
+#include "utils/lock.h"
+#include "utils/macro.h"
+#include "utils/system_time_handler.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/event_engine/event_observer.h"
+
+namespace application_manager {
+
+/**
+ * @brief The SystemTimeHandlerImpl class.
+ * Responsible for the system time notification. It keeps the list
+ * of system time listeners, sends appropriate request to the system
+ * and notifies the listeners with new time right after response has appeared.
+ */
+class SystemTimeHandlerImpl : public utils::SystemTimeHandler,
+ public event_engine::EventObserver {
+ public:
+ /**
+ * @brief SystemTimeHandlerImpl creates the instance of the class.
+ */
+ explicit SystemTimeHandlerImpl(ApplicationManager& application_manager);
+
+ /**
+ * @brief ~SystemTimeHandlerImpl
+ */
+ ~SystemTimeHandlerImpl();
+
+ private:
+ /**
+ * @brief on_event allows to process certain events from the system.
+ * Event which are handles within this methods are: OnSystemTimeReady
+ * in order to send system time query and GetSystemTimeResponse in order
+ * to retrieve utc time and notify all the listeners with new time value.
+ */
+ void on_event(const application_manager::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief DoSystemTimeQuery sends the appropriate request to the system
+ * and subscribes the class to the response. This is asynchronous request
+ * thus it won't block until the system respond and returns immediately.
+ */
+ void DoSystemTimeQuery() FINAL;
+
+ /**
+ * @brief DoSubscribe allows to subscribe certain listener for
+ * SystemTime. This certain implementation does not maintain
+ * listeners collection instead it save the pointer to listener.
+ * @note the class is not reponsible for the pointer's lifecycle.
+ * So consider to explicitly unsibsscribe from event when listener
+ * is going to be destroyed.
+ * @param listener the listener which will be notified
+ * in case of SystemTime appeared.
+ */
+ void DoSubscribe(utils::SystemTimeListener* listener) FINAL;
+
+ /**
+ * @brief DoUnsubscribe assigns the pointer to listener to NULL.
+ * This certain implementation ignores passed parameter.
+ * @param listener pointer to the object which should be
+ * unsubscribed from events.
+ */
+ void DoUnsubscribe(utils::SystemTimeListener* listener) FINAL;
+
+ /**
+ * @brief FetchSystemTime this method allows to obtain
+ * recently received utc time.
+ * @note it is up to user to check whether the returned
+ * argument is valid
+ * @return the time value returned by system.
+ */
+ time_t FetchSystemTime() FINAL;
+
+ /**
+ * @brief SendTimeRequest sends the request to the system
+ * and subscribes for response.
+ */
+ void SendTimeRequest();
+
+ /**
+ * @brief ProcessSystemTimeResponse allows to process GetSystemTimeResponse
+ * @param event contains response parameters aka "systemTime".
+ */
+ void ProcessSystemTimeResponse(
+ const application_manager::event_engine::Event& event);
+
+ /**
+ * @brief ProcessSystemTimeReadyNotification allows to process
+ * OnSystemTimeready notification
+ * from HMI. It unsubscribes from the mentioned notification and sends
+ * GetSystemTimeRequest to HMI in order to obtain system time
+ */
+ void ProcessSystemTimeReadyNotification();
+
+ /**
+ * @brief Checks if UTC time is ready to provided by HMI
+ * and can be requested by GetSystemTime request
+ * @return True if HMI is ready to provide UTC time
+ * otherwise False
+ */
+ bool utc_time_can_be_received() const FINAL;
+
+ mutable sync_primitives::Lock state_lock_;
+ // Variable means HMI readiness to provide system time by request
+ volatile bool utc_time_can_be_received_;
+
+ /**
+ * @brief Flag used to control that only GetSystemTime request at time could
+ * be sent to HMI
+ */
+ volatile bool awaiting_get_system_time_;
+
+ // Varible used to store result for GetSystemTime request
+ time_t last_time_;
+
+ sync_primitives::Lock system_time_listener_lock_;
+ utils::SystemTimeListener* system_time_listener_;
+ ApplicationManager& app_manager_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SYSTEM_TIME_SYSTEM_TIME_HANDLER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/telemetry_observer.h b/src/components/application_manager/include/application_manager/telemetry_observer.h
index 20b3aaca5a..49f15165db 100644
--- a/src/components/application_manager/include/application_manager/telemetry_observer.h
+++ b/src/components/application_manager/include/application_manager/telemetry_observer.h
@@ -36,7 +36,7 @@
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "json/json.h"
-#include "utils/shared_ptr.h"
+
#include "utils/date_time.h"
namespace application_manager {
@@ -44,11 +44,11 @@ namespace application_manager {
class AMTelemetryObserver {
public:
struct MessageMetric {
- TimevalStruct begin;
- TimevalStruct end;
- utils::SharedPtr<smart_objects::SmartObject> message;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
+ std::shared_ptr<smart_objects::SmartObject> message;
};
- typedef utils::SharedPtr<MessageMetric> MessageMetricSharedPtr;
+ typedef std::shared_ptr<MessageMetric> MessageMetricSharedPtr;
virtual void OnMessage(MessageMetricSharedPtr) = 0;
virtual ~AMTelemetryObserver() {}
diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h
index 886389b05c..6d0b5cd6bd 100644
--- a/src/components/application_manager/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -38,7 +38,7 @@
#include "policy/usage_statistics/counter.h"
#include "policy/usage_statistics/app_stopwatch.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "interfaces/MOBILE_API.h"
namespace application_manager {
@@ -47,10 +47,10 @@ class UsageStatistics {
public:
UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager);
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager);
UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
usage_statistics::AppStopwatch* time_in_hmi_state_ptr);
void RecordHmiStateChanged(mobile_apis::HMILevel::eType new_hmi_level);
void RecordAppRegistrationGuiLanguage(
@@ -66,7 +66,7 @@ class UsageStatistics {
void RecordTLSError();
private:
- std::auto_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
+ std::unique_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
usage_statistics::AppInfo app_registration_language_gui_;
usage_statistics::AppInfo app_registration_language_vui_;
usage_statistics::AppCounter count_of_rejected_rpc_calls_;
diff --git a/src/components/application_manager/rpc_plugins/CMakeLists.txt b/src/components/application_manager/rpc_plugins/CMakeLists.txt
new file mode 100644
index 0000000000..c9ef282c12
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# --- Utils
+add_subdirectory(vehicle_info_plugin)
+add_subdirectory(sdl_rpc_plugin)
+add_subdirectory(rc_rpc_plugin)
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt
new file mode 100644
index 0000000000..00de927b6e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt
@@ -0,0 +1,80 @@
+# 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 copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories(include)
+
+set (COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands
+)
+
+set (MOBILE_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/mobile
+)
+
+set (HMI_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/hmi
+)
+
+collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
+collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
+collect_sources(COMMANDS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/commands")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ Utils
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+add_library("rc_rpc_plugin" SHARED ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${COMMANDS_SOURCES})
+target_link_libraries("rc_rpc_plugin" ${LIBRARIES})
+
+add_library("RCRpcPluginStaticLib" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS})
+target_link_libraries("RCRpcPluginStaticLib" ${LIBRARIES})
+
+set(INSTALL_DESTINATION bin)
+
+install(TARGETS rc_rpc_plugin
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h
new file mode 100644
index 0000000000..3bc34be8d1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCButtonPressRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief RCButtonPressRequest class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCButtonPressRequest(const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ /**
+ * @brief Execute command
+ */
+ void Run() OVERRIDE;
+ ~RCButtonPressRequest();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h
new file mode 100644
index 0000000000..939d5fa468
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCButtonPressResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCButtonPressResponse class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCButtonPressResponse(const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCButtonPressResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
new file mode 100644
index 0000000000..97df5e8390
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataConsentRequest
+ : public application_manager::commands::RequestToHMI {
+ public:
+ RCGetInteriorVehicleDataConsentRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+ ~RCGetInteriorVehicleDataConsentRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
new file mode 100644
index 0000000000..46232987a5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataConsentResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCGetInteriorVehicleDataConsentResponse class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCGetInteriorVehicleDataConsentResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCGetInteriorVehicleDataConsentResponse();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..a88a39aa7a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataRequest
+ : public application_manager::commands::RequestToHMI {
+ public:
+ RCGetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+ ~RCGetInteriorVehicleDataRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..c9e5d39d1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ RCGetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCGetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h
new file mode 100644
index 0000000000..aeb0a06d22
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h
@@ -0,0 +1,72 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCOnInteriorVehicleDataNotification
+ : public application_manager::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief RCOnInteriorVehicleDataNotification class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCOnInteriorVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ ~RCOnInteriorVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h
new file mode 100644
index 0000000000..7aa1aa3dba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+class InteriorDataManager;
+
+namespace commands {
+class RCOnRemoteControlSettingsNotification
+ : public application_manager::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief RCOnRemoteControlSettingsNotification class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCOnRemoteControlSettingsNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ ~RCOnRemoteControlSettingsNotification();
+
+ private:
+ ResourceAllocationManager& resource_allocation_manager_;
+ InteriorDataManager& interior_data_manager_;
+ /**
+ * @brief Disalows RC functionality for all RC apps
+ * All registered apps will be unsubsribed from OnInteriorVehicleData
+ * notifications
+ */
+ void DisallowRCFunctionality();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..69b48bfecf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCSetInteriorVehicleDataRequest
+ : public application_manager::commands::RequestToHMI {
+ public:
+ /**
+ * @brief RCSetInteriorVehicleDataRequest class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCSetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ void Run() OVERRIDE;
+ ~RCSetInteriorVehicleDataRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..8a63503220
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCSetInteriorVehicleDataResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCSetInteriorVehicleDataResponse class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCSetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCSetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h
new file mode 100644
index 0000000000..d6ecfd0128
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
+
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class ButtonPressRequest : public RCCommandRequest {
+ public:
+ ButtonPressRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ /**
+ * @brief Execute command
+ * send HMI request if message contains appropriate
+ * button name and module type
+ * otherwise sends negative sesponse to mobile
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief AcquireResource Tries to acquire specific resource
+ * @param message Incoming message containg the resource name
+ * @return Acquire result
+ */
+ AcquireResult::eType AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ /**
+ * @brief SetResourceState changes state of resource
+ * @param state State to set for resource
+ */
+ void SetResourceState(const std::string& module_type,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ std::string ModuleType() FINAL;
+
+ /**
+ * @brief ButtonPressRequest class destructor
+ */
+ ~ButtonPressRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h
new file mode 100644
index 0000000000..0f3964494e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class ButtonPressResponse
+ : public application_manager::commands::CommandResponseImpl {
+ public:
+ ButtonPressResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ void Run() OVERRIDE;
+ /**
+ * @brief ButtonPressResponse class destructor
+ */
+ ~ButtonPressResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..01588cc6b7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h
@@ -0,0 +1,102 @@
+/*
+ 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 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_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include <string>
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class GetInteriorVehicleDataRequest : public RCCommandRequest {
+ public:
+ GetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief GetInteriorVehicleDataRequest class destructor
+ */
+ ~GetInteriorVehicleDataRequest();
+
+ private:
+ std::vector<application_manager::ApplicationSharedPtr>
+ AppsSubscribedToModuleType(const std::string& module_type);
+
+ /**
+ * @brief Check if app wants to proceed with already setup subscription
+ * @param request_params request parameters to check
+ * @return true if app already subscribed(unsubsribed) for module type but
+ * wants to subscribe(unsubscribe) for the same module again
+ * otherwise - false
+ */
+ bool HasRequestExcessiveSubscription();
+
+ /**
+ * @brief Handle subscription to vehicle data
+ * @param hmi_response json message with response from HMI
+ */
+ void ProccessSubscription(const smart_objects::SmartObject& hmi_response);
+
+ /**
+ * @brief Cuts off subscribe parameter
+ * @param request_params request parameters to handle
+ */
+ void RemoveExcessiveSubscription();
+
+ std::string ModuleType() FINAL;
+ bool excessive_subscription_occured_;
+ bool ProcessCapabilities();
+ void ProcessResponseToMobileFromCache(app_mngr::ApplicationSharedPtr app);
+ bool CheckRateLimits();
+ bool AppShouldBeUnsubscribed();
+ bool TheLastAppShouldBeUnsubscribed(app_mngr::ApplicationSharedPtr app);
+ void FilterDisabledModuleData(smart_objects::SmartObject& module_data);
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..bf8208edc2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h
@@ -0,0 +1,60 @@
+/*
+ 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 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_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class GetInteriorVehicleDataResponse
+ : public application_manager::commands::CommandResponseImpl {
+ public:
+ GetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~GetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h
new file mode 100644
index 0000000000..931e79366c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h
@@ -0,0 +1,67 @@
+/*
+ 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 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_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+
+#include <string>
+#include "application_manager/commands/command_notification_impl.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class OnInteriorVehicleDataNotification
+ : public application_manager::commands::CommandNotificationImpl {
+ public:
+ OnInteriorVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ std::string ModuleType();
+
+ ~OnInteriorVehicleDataNotification();
+
+ private:
+ InteriorDataCache& interior_data_cache_;
+ void AddDataToCache(const std::string& module_type);
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..128c668ee9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+enum capabilitiesStatus { success, missedLightName, missedParam, readOnly };
+
+typedef std::pair<std::string, capabilitiesStatus> ModuleCapability;
+
+class SetInteriorVehicleDataRequest : public RCCommandRequest {
+ public:
+ SetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief AcquireResource proxy AcquireResource to Resource allocation manager
+ * @param message message of requires contatin module types
+ * @return result of acauiring resources
+ */
+ AcquireResult::eType AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ /**
+ * @brief SetResourceState changes state of resource
+ * @param state State to set for resource
+ */
+ void SetResourceState(const std::string& module_type,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Method that check if READ_ONLY parameters present
+ * @param request_params params from received message,
+ * @param module_data_capabilities info for notification to mobile
+ * @return true if present , false - otherwise
+ */
+ bool AreReadOnlyParamsPresent(const smart_objects::SmartObject& module_data,
+ ModuleCapability& module_data_capabilities);
+
+ /**
+ * @brief Method that check if all request parameters are READ_ONLY
+ * @param request_params params from received message
+ * @return true if all are read only , false - otherwise
+ */
+ bool AreAllParamsReadOnly(const smart_objects::SmartObject& module_data);
+
+ /**
+ * @brief Method that cuts-off READ_ONLY parameters
+ * @param module_data params to handle
+ */
+ void CutOffReadOnlyParams(smart_objects::SmartObject& module_data);
+
+ std::string ModuleType() FINAL;
+
+ /**
+ * @brief SetInteriorVehicleDataRequest class destructor
+ */
+ ~SetInteriorVehicleDataRequest();
+
+ private:
+ /**
+ * @brief ControlData
+ * @param module_data received params
+ * @return value of module data depending on module type
+ */
+ const smart_objects::SmartObject& ControlData(
+ const smart_objects::SmartObject& module_data);
+
+ /**
+ * @brief CheckAudioSource check that if app wants to change
+ * the audio source from MOBILE_APP to other types of audio
+ * source without keepContext parameter or with keepContext=false
+ * then this app will go to HMI level 'BACKGROUND'
+ * @param module_data received params
+ */
+ void CheckAudioSource(const smart_objects::SmartObject& audio_data);
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..1ab5ccc6bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class SetInteriorVehicleDataResponse
+ : public application_manager::commands::CommandResponseImpl {
+ public:
+ SetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~SetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
new file mode 100644
index 0000000000..8e7ed9c667
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
+
+namespace application_manager {
+class ApplicationManager;
+namespace rpc_service {
+class RPCService;
+}
+class HMICapabilities;
+}
+
+namespace policy {
+class PolicyHandlerInterface;
+}
+
+namespace rc_rpc_plugin {
+
+class ResourceAllocationManager;
+class InteriorDataCache;
+class InteriorDataManager;
+
+struct RCCommandParams {
+ application_manager::ApplicationManager& application_manager_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+ application_manager::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager_;
+ rc_rpc_plugin::InteriorDataCache& interior_data_cache_;
+ rc_rpc_plugin::InteriorDataManager& interior_data_manager_;
+};
+}
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h
new file mode 100644
index 0000000000..ce95617b6c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h
@@ -0,0 +1,172 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
+
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_params.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+enum TypeAccess { kDisallowed, kAllowed };
+
+namespace commands {
+
+class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief RCCommandRequest class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ virtual ~RCCommandRequest();
+
+ void onTimeOut() OVERRIDE;
+
+ void Run() OVERRIDE;
+
+ virtual void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ protected:
+ bool is_subscribed;
+ bool auto_allowed_;
+
+ ResourceAllocationManager& resource_allocation_manager_;
+ InteriorDataCache& interior_data_cache_;
+ InteriorDataManager& interior_data_manager_;
+ /**
+ * @brief AcquireResource try to allocate resource for application
+ * In case if allocation of resource is not required, return ALLOWED by
+ * default.
+ * This method should be overrided in RPCs that requires resource allocation
+ * @return result of resource allocation, in case if allocation os not
+ * required, return ALLOWED
+ */
+ virtual AcquireResult::eType AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) {
+ return AcquireResult::ALLOWED;
+ }
+
+ /**
+ * @brief IsResourceFree check resource state
+ * This is default implementation which has to be redefined for RPCs which
+ * need to manage the resources
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ virtual bool IsResourceFree(const std::string& module_type) const {
+ UNUSED(module_type);
+ return true;
+ }
+ /**
+ * @brief SetResourceState changes state of resource
+ * This is default implementation which has to be redefined for RPCs which
+ * need to manage the resources
+ * @param module_type Resource name
+ * @param State to set for resource
+ */
+ virtual void SetResourceState(const std::string& module_type,
+ const ResourceState::eType) {}
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type Resource name
+ * @return kAllowed if module is present, otherwise - kDisallowed
+ */
+ TypeAccess CheckModule(const std::string& module_type,
+ application_manager::ApplicationSharedPtr app);
+
+ bool auto_allowed() const {
+ return auto_allowed_;
+ }
+
+ void set_auto_allowed(const bool value) {
+ auto_allowed_ = value;
+ }
+
+ /**
+ * @brief executes specific logic of children classes
+ */
+ void virtual Execute() = 0;
+
+ void set_disallowed_info(const std::string& info) {
+ disallowed_info_ = info;
+ }
+
+ virtual std::string ModuleType() = 0;
+
+ private:
+ /**
+ * @brief CheckDriverConsent checks driver consent defined in policy table
+ * @return True if no consent is required, otherwise - false
+ */
+ bool CheckDriverConsent();
+
+ /**
+ * @brief AcquireResources checks whether resource status is busy or not and
+ * then tries to acquire this resource. In case driver consent is required -
+ * sends consent request to HMI.
+ * @return True in case of resource is free and successfully acquired,
+ * otherwise false
+ */
+ bool AcquireResources();
+ void SendDisallowed(TypeAccess access);
+
+ /**
+ * @brief SendGetUserConsent sends consent request to HMI
+ * @param module_type Resource name
+ */
+ void SendGetUserConsent(const std::string& module_type);
+ void ProcessAccessResponse(const app_mngr::event_engine::Event& event);
+ bool IsInterfaceAvailable(
+ const app_mngr::HmiInterfaces::InterfaceID interface) const;
+
+ std::string disallowed_info_;
+};
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
new file mode 100644
index 0000000000..bb45247fae
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
+#include <string>
+#include "smart_objects/smart_object.h"
+
+namespace rc_rpc_plugin {
+
+/**
+ * @brief The InteriorDataCache interface for caching data class
+ * Provide ability to cache module data by module type name and clear cache
+ */
+class InteriorDataCache {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~InteriorDataCache() {}
+
+ /**
+ * @brief Add module data to cache
+ * @param module_type module type name
+ * @param module_data data to be cached
+ */
+ virtual void Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) = 0;
+
+ /**
+ * @brief Retrieve Get cached data
+ * @param module_type data type to get from cache
+ * @return smart object with cached data, or nulll smart object
+ */
+ virtual smart_objects::SmartObject Retrieve(
+ const std::string& module_type) const = 0;
+
+ /**
+ * @brief Contains check if data exists in cache
+ * @param module_type module type name to check in cache
+ * @return true if cached, false otherwize
+ */
+ virtual bool Contains(const std::string& module_type) const = 0;
+
+ /**
+ * @brief Remove cached data
+ * @param module_type data type to remove from cache
+ */
+ virtual void Remove(const std::string& module_type) = 0;
+
+ /**
+ * @brief Clear clear all cached data
+ */
+ virtual void Clear() = 0;
+};
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
new file mode 100644
index 0000000000..f2971e3d72
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
+
+#include <map>
+
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+namespace rc_rpc_plugin {
+class InteriorDataCacheImpl : public InteriorDataCache {
+ public:
+ InteriorDataCacheImpl();
+
+ ~InteriorDataCacheImpl();
+
+ void Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) OVERRIDE;
+ smart_objects::SmartObject Retrieve(
+ const std::string& module_type) const OVERRIDE;
+ bool Contains(const std::string& module_type) const OVERRIDE;
+ void Remove(const std::string& module_type) OVERRIDE;
+ void Clear() OVERRIDE;
+
+ private:
+ std::map<std::string, smart_objects::SmartObject> cached_data_;
+ mutable sync_primitives::Lock cached_data_lock_;
+};
+
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
new file mode 100644
index 0000000000..f28c388055
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
+
+#include "application_manager/application.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
+
+namespace rc_rpc_plugin {
+
+namespace app_mngr = application_manager;
+namespace plugins = application_manager::plugin_manager;
+
+class InteriorDataManager {
+ public:
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) = 0;
+
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) = 0;
+
+ /**
+ * @brief OnDisablingRC process disable RC event. Unsubscribe from all modules
+ * and clear cache
+ */
+ virtual void OnDisablingRC() = 0;
+
+ /**
+ * @brief StoreRequestToHMITime save information and time stamp of
+ * current interior data subscriptions
+ */
+ virtual void StoreRequestToHMITime(const std::string& module_type) = 0;
+
+ /**
+ * @brief CheckRequestsToHMIFrequency check that rate limits are not allowed of
+ * bounce during current time frame.
+ * calculate amount of requests per module type in time frame and checks if it
+ * bigger then allowed by ini file
+ * @param module_type moduletype to calculate frequency on
+ * @return true if amount of requests was not exceeded, otherwise return false.
+ */
+ virtual bool CheckRequestsToHMIFrequency(const std::string& module_type) = 0;
+};
+
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
new file mode 100644
index 0000000000..9b16a2c4da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
+#include "rc_rpc_plugin/interior_data_manager.h"
+#include "utils/date_time.h"
+
+namespace application_manager {
+class ApplicationManager;
+namespace rpc_service {
+class RPCService;
+}
+}
+namespace rc_rpc_plugin {
+
+class InteriorDataCache;
+class RCRPCPlugin;
+
+class InteriorDataManagerImpl : public InteriorDataManager {
+ public:
+ InteriorDataManagerImpl(
+ RCRPCPlugin& rc_plugin,
+ InteriorDataCache& cache,
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service);
+
+ void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) OVERRIDE;
+
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ void OnDisablingRC() OVERRIDE;
+
+ void StoreRequestToHMITime(const std::string& module_type) OVERRIDE;
+
+ bool CheckRequestsToHMIFrequency(const std::string& module_type) OVERRIDE;
+
+ private:
+ /**
+ * @brief UpdateHMISubscriptionsOnPolicyUpdated process policy update event.
+ * If some modules was disabeled by policies and there are no applications
+ * that subscribed to them - send RC.GetInteriorVehicleData(subscribe=false)
+ * and clear cache
+ */
+ void UpdateHMISubscriptionsOnPolicyUpdated();
+
+ /**
+ * @brief UpdateHMISubscriptionsOnAppUnregistered process AppUnregistered
+ * event and unsubscribed from not actual module types
+ * @param app application that was unregistered
+ */
+ void UpdateHMISubscriptionsOnAppUnregistered(
+ application_manager::Application& app);
+
+ /**
+ * @brief UnsubscribeFromInteriorVehicleData remove module_type from cache and
+ * send RC.GetInteriorVehicleData(subscribe=false) to HMI
+ * @param module_type module type that need to be unsubscribed
+ */
+ void UnsubscribeFromInteriorVehicleData(const std::string& module_type);
+
+ void ClearOldRequestsToHMIHistory();
+ /**
+ * @brief AppsModules mapping from applications to list of modules
+ */
+ typedef std::map<application_manager::ApplicationSharedPtr,
+ std::vector<std::string> > AppsModules;
+
+ /**
+ * @brief AppsSubscribedModules get mapping of application to list of
+ * subscribed modules
+ * @return map of applications to list of subscribed modules
+ */
+ AppsModules AppsSubscribedModules();
+
+ /**
+ * @brief RequestsToHMIHistory mapping from module type to vector of time
+ * stamps
+ */
+ typedef std::map<std::string, std::deque<date_time::TimeDuration> >
+ RequestsToHMIHistory;
+ RequestsToHMIHistory requests_to_hmi_history_;
+ mutable sync_primitives::Lock requests_to_hmi_history_lock_;
+
+ RCRPCPlugin& rc_plugin_;
+ InteriorDataCache& cache_;
+ application_manager::ApplicationManager& app_mngr_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+};
+
+} // namespace rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
new file mode 100644
index 0000000000..e36968fc4b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
+
+#include <string>
+#include <set>
+#include <memory>
+#include "utils/macro.h"
+#include "application_manager/app_extension.h"
+
+namespace rc_rpc_plugin {
+class RCAppExtension : public application_manager::AppExtension {
+ public:
+ explicit RCAppExtension(application_manager::AppExtensionUID uid);
+ ~RCAppExtension();
+
+ /**
+ * @brief Subscribe to OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ void SubscribeToInteriorVehicleData(const std::string& module_type);
+
+ /**
+ * @brief Unsubscribe from OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ void UnsubscribeFromInteriorVehicleData(const std::string& module_type);
+
+ /**
+ * @brief UnsubscribeFromInteriorVehicleData removes all subscriptions for
+ * interior data
+ */
+ void UnsubscribeFromInteriorVehicleData();
+
+ /**
+ * @brief Check if application subscribed to OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ bool IsSubscibedToInteriorVehicleData(const std::string& module_type);
+
+ /**
+ * @brief get list of subscriptions of application
+ * @return list of subscriptions of application
+ */
+ std::set<std::string> InteriorVehicleDataSubscriptions() const;
+
+ private:
+ std::set<std::string> subscribed_interior_vehicle_data_;
+
+ // AppExtension interface
+ public:
+ void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+ void ProcessResumption(
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+};
+
+typedef std::shared_ptr<RCAppExtension> RCAppExtensionPtr;
+
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
new file mode 100644
index 0000000000..56be342b56
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
+
+#include <memory>
+#include "application_manager/command_factory.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/command_factory.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_params.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+using policy::PolicyHandlerInterface;
+class RCCommandFactory : public application_manager::CommandFactory {
+ public:
+ /**
+ * @brief RCCommandFactory class constructor
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @param allocation_manager ResourceAllocationManager
+ **/
+ RCCommandFactory(const RCCommandParams& params);
+ application_manager::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ /**
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
+ virtual bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::CommandCreator& get_mobile_creator_factory(
+ mobile_apis::FunctionID::eType id,
+ mobile_apis::messageType::eType message_type) const;
+
+ app_mngr::CommandCreator& get_hmi_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type) const;
+
+ RCCommandParams params_;
+};
+} // namespace rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
new file mode 100644
index 0000000000..cf3c6cd5e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
@@ -0,0 +1,96 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
+
+#include <map>
+#include <string>
+#include "application_manager/application.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+
+namespace rc_rpc_plugin {
+class RCRPCPlugin;
+
+/**
+ * @brief The RCHelpers class contains frequently used static data
+ * structures related strictly to RC
+ * Converters, mapping, factory functions
+ */
+class RCHelpers {
+ public:
+ /**
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module data filed name
+ * @return module mapping from enum naming to filed name
+ */
+ static const std::function<std::string(const std::string& module_type)>
+ GetModuleTypeToDataMapping();
+
+ /**
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module capabilities key
+ * @return module mapping from enum naming to capabilities key
+ */
+ static const std::function<std::string(const std::string& module_type)>
+ GetModuleTypeToCapabilitiesMapping();
+
+ /**
+ * @brief GetModulesList get list of all known modules
+ * @return vector contains all known modules
+ */
+ static const std::vector<std::string> GetModulesList();
+
+ /**
+ * @brief GetRCExtension extract RC extension from application
+ * @param app application to extract extension
+ * @return rc extension of app is rc applicaiton, otherwise return emty shared
+ * pointer.
+ */
+ static RCAppExtensionPtr GetRCExtension(
+ application_manager::Application& app);
+
+ static smart_objects::SmartObjectSPtr CreateUnsubscribeRequestToHMI(
+ const std::string& module_type, const uint32_t correlation_id);
+
+ static std::vector<application_manager::ApplicationSharedPtr>
+ AppsSubscribedToModuleType(application_manager::ApplicationManager& app_mngr,
+ const std::string& module_type);
+
+ typedef std::map<application_manager::ApplicationSharedPtr,
+ std::vector<std::string> > AppsModules;
+ static AppsModules GetApplicationsAllowedModules(
+ application_manager::ApplicationManager& app_mngr);
+};
+
+} // rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
new file mode 100644
index 0000000000..18014e6270
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
@@ -0,0 +1,279 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
+
+namespace rc_rpc_plugin {
+
+namespace strings {
+// RemoteControlCapabilities constants
+const char kclimateControlCapabilities[] = "climateControlCapabilities";
+const char kradioControlCapabilities[] = "radioControlCapabilities";
+const char kbuttonCapabilities[] = "buttonCapabilities";
+const char kaudioControlCapabilities[] = "audioControlCapabilities";
+const char klightControlCapabilities[] = "lightControlCapabilities";
+const char khmiSettingsControlCapabilities[] = "hmiSettingsControlCapabilities";
+const char kseatControlCapabilities[] = "seatControlCapabilities";
+// RemoteControlCapabilities constants
+
+const char kRadioControlData[] = "radioControlData";
+const char kClimateControlData[] = "climateControlData";
+const char kSupportedLights[] = "supportedLights";
+
+// LightControlCapabilities
+const char kName[] = "name";
+const char kStatusAvailable[] = "statusAvailable";
+const char kDensityAvailable[] = "densityAvailable";
+const char kRGBColorSpaceAvailable[] = "rgbColorSpaceAvailable";
+
+// RadioControlCapabilities
+const char kSiriusxmRadioAvailable[] = "siriusxmRadioAvailable";
+} // strings
+
+namespace result_codes {
+const char kSuccess[] = "SUCCESS";
+const char kUnsupportedRequest[] = "UNSUPPORTED_REQUEST";
+const char kUnsupportedResource[] = "UNSUPPORTED_RESOURCE";
+const char kDisallowed[] = "DISALLOWED";
+const char kRejected[] = "REJECTED";
+const char kAborted[] = "ABORTED";
+const char kIgnored[] = "IGNORED";
+const char kRetry[] = "RETRY";
+const char kInUse[] = "IN_USE";
+const char kVehicleDataNotAvailable[] = "VEHICLE_DATA_NOT_AVAILABLE";
+const char kTimedOut[] = "TIMED_OUT";
+const char kInvalidData[] = "INVALID_DATA";
+const char kCharLimitExceeded[] = "CHAR_LIMIT_EXCEEDED";
+const char kInvalidId[] = "INVALID_ID";
+const char kDuplicateName[] = "DUPLICATE_NAME";
+const char kApplicationNotRegistered[] = "APPLICATION_NOT_REGISTERED";
+const char kOutOfMemory[] = "OUT_OF_MEMORY";
+const char kTooManyPendingRequests[] = "TOO_MANY_PENDING_REQUESTS";
+const char kWarnings[] = "WARNINGS";
+const char kWrongLanguage[] = "WRONG_LANGUAGE";
+const char kGenericError[] = "GENERIC_ERROR";
+const char kUserDisallowed[] = "USER_DISALLOWED";
+const char kReadOnly[] = "READ_ONLY";
+} // result_codes
+
+namespace json_keys {
+const char kParams[] = "params";
+const char kSuccess[] = "success";
+const char kResultCode[] = "resultCode";
+const char kResult[] = "result";
+const char kInfo[] = "info";
+const char kId[] = "id";
+const char kJsonrpc[] = "jsonrpc";
+const char kMethod[] = "method";
+const char kError[] = "error";
+const char kMessage[] = "message";
+const char kData[] = "data";
+const char kAppId[] = "appID";
+const char kCode[] = "code";
+} // json_keys
+
+namespace message_params {
+const char kName[] = "name";
+const char kId[] = "id";
+
+// SetInteriorVehicleData request
+const char kModuleData[] = "moduleData";
+// SetInteriorVehicleData request
+
+// GetInteriorVehicleData request
+const char kSubscribe[] = "subscribe";
+// GetInteriorVehicleData request
+
+// GetInteriorVehicleData response
+const char kIsSubscribed[] = "isSubscribed";
+// GetInteriorVehicleData response
+
+// OnRemoteControlSettings notification
+const char kAccessMode[] = "accessMode";
+const char kAllowed[] = "allowed";
+// OnRemoteControlSettings notification
+
+// ButtonPress request
+const char kModuleType[] = "moduleType";
+const char kButtonName[] = "buttonName";
+const char kButtonPressMode[] = "buttonPressMode";
+// ButtonPress request
+
+// OnRCStatusNotification
+const char kAllocatedModules[] = "allocatedModules";
+const char kFreeModules[] = "freeModules";
+// OnRCStatusNotification
+
+// RdsData struct
+const char kPS[] = "PS";
+const char kRT[] = "RT";
+const char kCT[] = "CT";
+const char kPI[] = "PI";
+const char kPTY[] = "PTY";
+const char kTA[] = "TA";
+const char kTP[] = "TP";
+const char kREG[] = "REG";
+// RdsData struct
+
+// RadioControlData struct
+const char kFrequencyInteger[] = "frequencyInteger";
+const char kFrequencyFraction[] = "frequencyFraction";
+const char kBand[] = "band";
+const char kRdsData[] = "rdsData";
+const char kHdRadioEnable[] = "hdRadioEnable";
+const char kAvailableHDs[] = "availableHDs";
+const char kHdChannel[] = "hdChannel";
+const char kSignalStrength[] = "signalStrength";
+const char kSignalChangeThreshold[] = "signalChangeThreshold";
+const char kRadioEnable[] = "radioEnable";
+const char kState[] = "state";
+const char kSisData[] = "sisData";
+// RadioControlData struct
+
+// ClimateControlData struct
+const char kFanSpeed[] = "fanSpeed";
+const char kCurrentTemperature[] = "currentTemperature";
+const char kDesiredTemperature[] = "desiredTemperature";
+const char kTemperatureUnit[] = "temperatureUnit";
+const char kACEnable[] = "acEnable";
+const char kCirculateAirEnable[] = "circulateAirEnable";
+const char kAutoModeEnable[] = "autoModeEnable";
+const char kDefrostZone[] = "defrostZone";
+const char kDualModeEnable[] = "dualModeEnable";
+const char kACMaxEnable[] = "acMaxEnable";
+const char kVentilationMode[] = "ventilationMode";
+const char kHeatedSteeringWheelEnable[] = "heatedSteeringWheelEnable";
+const char kHeatedWindshieldEnable[] = "heatedWindshieldEnable";
+const char kHeatedRearWindowEnable[] = "heatedRearWindowEnable";
+const char kHeatedMirrorsEnable[] = "heatedMirrorsEnable";
+// ClimateControlData struct
+
+// LightControlData
+const char kLightState[] = "lightState";
+const char kLightStatus[] = "status";
+const char kLightDensity[] = "density";
+const char kLightColor[] = "color";
+
+// AudioControlData
+const char kSource[] = "source";
+const char kKeepContext[] = "keepContext";
+const char kEqualizerSettings[] = "equalizerSettings";
+const char kChannelName[] = "channelName";
+
+// ModuleData struct
+const char kRadioControlData[] = "radioControlData";
+const char kClimateControlData[] = "climateControlData";
+const char kAudioControlData[] = "audioControlData";
+const char kLightControlData[] = "lightControlData";
+const char kHmiSettingsControlData[] = "hmiSettingsControlData";
+const char kSeatControlData[] = "seatControlData";
+// ModuleData struct
+
+const char kHMIAppID[] = "appID";
+const char kHmiLevel[] = "hmiLevel";
+const char kSysContext[] = "systemContext";
+const char kAudioState[] = "audioStreamingState";
+} // namespace message_params
+
+namespace enums_value {
+
+// ModuleType enum
+const char kClimate[] = "CLIMATE";
+const char kRadio[] = "RADIO";
+const char kSeat[] = "SEAT";
+const char kAudio[] = "AUDIO";
+const char kLight[] = "LIGHT";
+const char kHmiSettings[] = "HMI_SETTINGS";
+// ModuleType enum
+
+// RadioBand enum
+const char kAM[] = "AM";
+const char kFM[] = "FM";
+const char kXM[] = "XM";
+// RadioBand enum
+
+// RadioState enum
+const char kAcquiring[] = "ACQUIRING";
+const char kAcquired[] = "ACQUIRED";
+const char kMulticast[] = "MULTICAST";
+const char kNotFound[] = "NOT_FOUND";
+// RadioState enum
+
+// DefrostZone enum
+const char kFront[] = "FRONT";
+const char kRear[] = "REAR";
+const char kAll[] = "ALL";
+// DefrostZone enum
+
+// TemperatureUnit enum
+const char kFahrenheit[] = "FAHRENHEIT";
+const char kCelsius[] = "CELSIUS";
+// TemperatureUnit enum
+
+// ButtonName enum
+const char kACMax[] = "AC_MAX";
+const char kAC[] = "AC";
+const char kRecirculate[] = "RECIRCULATE";
+const char kFanUp[] = "FAN_UP";
+const char kFanDown[] = "FAN_DOWN";
+const char kTempUp[] = "TEMP_UP";
+const char kTempDown[] = "TEMP_DOWN";
+const char kDefrostMax[] = "DEFROST_MAX";
+const char kDefrost[] = "DEFROST";
+const char kDefrostRear[] = "DEFROST_REAR";
+const char kUpperVent[] = "UPPER_VENT";
+const char kLowerVent[] = "LOWER_VENT";
+const char kVolumeUp[] = "VOLUME_UP";
+const char kVolumeDown[] = "VOLUME_DOWN";
+const char kEject[] = "EJECT";
+const char kSource[] = "SOURCE";
+const char kShuffle[] = "SHUFFLE";
+const char kRepeat[] = "REPEAT";
+// ButtonName enum
+
+// ButtonPressMode enum
+const char kLong[] = "LONG";
+const char kShort[] = "SHORT";
+// ButtonPressMode enum
+
+// Access mode enum
+const char kAutoAllow[] = "AUTO_ALLOW";
+const char kAutoDeny[] = "AUTO_DENY";
+const char kAskDriver[] = "ASK_DRIVER";
+// Access mode enum
+
+} // namespace enums_value
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
new file mode 100644
index 0000000000..ae88ed9cc0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
@@ -0,0 +1,113 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
+
+#include <memory>
+
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "application_manager/command_factory.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
+
+namespace rc_rpc_plugin {
+namespace plugins = application_manager::plugin_manager;
+namespace app_mngr = application_manager;
+
+class RCRPCPlugin : public plugins::RPCPlugin {
+ public:
+ /**
+ * @brief Command initialization function
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @return true in case initialization was succesful, false otherwise.
+ **/
+ bool Init(app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
+ /**
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource message_source) OVERRIDE;
+ /**
+ * @brief PluginName plugin name
+ * @return plugin name
+ */
+ std::string PluginName() OVERRIDE;
+ /**
+ * @brief GetCommandFactory get that is able to generate command
+ * from message
+ * @return plugins command factory
+ */
+ app_mngr::CommandFactory& GetCommandFactory() OVERRIDE;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) OVERRIDE;
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ static const uint32_t kRCPluginID = 153;
+
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+ static Apps GetRCApplications(
+ application_manager::ApplicationManager& app_mngr);
+
+ private:
+ application_manager::rpc_service::RPCService* rpc_service_;
+ application_manager::ApplicationManager* app_mngr_;
+ std::unique_ptr<application_manager::CommandFactory> command_factory_;
+ std::unique_ptr<ResourceAllocationManager> resource_allocation_manager_;
+ std::unique_ptr<InteriorDataCache> interior_data_cache_;
+ std::unique_ptr<InteriorDataManager> interior_data_manager_;
+};
+} // namespace rc_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
new file mode 100644
index 0000000000..67598b667b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
@@ -0,0 +1,178 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
+#include <string>
+#include "utils/macro.h"
+
+#include "interfaces/HMI_API.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+
+namespace rc_rpc_plugin {
+
+/**
+ * Enum for list of results of allocation resources
+ */
+namespace AcquireResult {
+enum eType { ALLOWED = 0, IN_USE, ASK_DRIVER, REJECTED };
+}
+
+/**
+ * Defines states of acquired resource
+ */
+namespace ResourceState {
+enum eType { FREE = 0, BUSY };
+}
+
+/**
+ * Defines triggers for OnRCStatus notification sending
+ */
+namespace NotificationTrigger {
+/**
+ * @brief The eType
+ * APP_REGISTRATION RC app registation event
+ * RC_STATE_CHANGING enabling/disabling RC on HMI event
+ * MODULE_ALLOCATION module allocation/deallocation event
+ */
+enum eType { APP_REGISTRATION = 0, MODULE_ALLOCATION, RC_STATE_CHANGING };
+}
+
+/**
+ * @brief Resources defines list of resources
+ */
+typedef std::vector<std::string> Resources;
+
+class ResourceAllocationManager {
+ public:
+ /**
+ * @brief AcquireResource acquires resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ * @return ALLOWED if resource acquired \
+ * IN_USE if resource already acquired
+ * ASK_DRIVER if driver confirmation is required
+ */
+ virtual AcquireResult::eType AcquireResource(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief SetResourceState changes resource state. Resource must be acquired
+ * beforehand.
+ * @param module_type Resource to change its state
+ * @param app_id Application aquired resource before
+ * @param state State to set for resource
+ */
+ virtual void SetResourceState(const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) = 0;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ virtual bool IsResourceFree(const std::string& module_type) const = 0;
+
+ /**
+ * @brief AcquireResource forces acquiring resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ */
+ virtual void ForceAcquireResource(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief OnDriverDisallowed callback for rejecting acquiring resource
+ * @param module_type resource type
+ * @param app_id application id
+ */
+ virtual void OnDriverDisallowed(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) = 0;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) = 0;
+
+ /**
+ * @brief Set current access mode for acquiring resource
+ * @param access_mode
+ */
+ virtual void SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) = 0;
+
+ /**
+ * @brief Get last set access mode for acquiring resource
+ * @param access_mode
+ */
+ virtual hmi_apis::Common_RCAccessMode::eType GetAccessMode() const = 0;
+
+ /**
+ * @brief Remove all information about all allocations
+ */
+ virtual void ResetAllAllocations() = 0;
+
+ /**
+ * @brief Create and send OnRCStatusNotification to mobile and HMI
+ * @param event trigger for notification sending
+ * @param application - app that should receive notification
+ * in case of registration; in cases of RC enabling/disabling
+ * or module allocation - application is just empty shared ptr,
+ * because in these cases all registered RC apps should
+ * receive a notification
+ */
+ virtual void SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
+ application_manager::ApplicationSharedPtr application) = 0;
+
+ virtual bool is_rc_enabled() const = 0;
+
+ virtual void set_rc_enabled(const bool value) = 0;
+
+ virtual ~ResourceAllocationManager() {}
+};
+
+} // namespace rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
new file mode 100644
index 0000000000..b359ee4d29
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
@@ -0,0 +1,224 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "application_manager/application_impl.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+
+namespace rc_rpc_plugin {
+
+typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+
+class ResourceAllocationManagerImpl : public ResourceAllocationManager {
+ public:
+ ResourceAllocationManagerImpl(
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service);
+
+ ~ResourceAllocationManagerImpl();
+
+ /**
+ * @brief AcquireResource forces acquiring resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resourc
+ * @return result of acauiring resources
+ */
+ AcquireResult::eType AcquireResource(const std::string& module_type,
+ const uint32_t app_id) OVERRIDE FINAL;
+ /**
+ * @brief ForceAcquireResource forces acquiring resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ */
+ void ForceAcquireResource(const std::string& module_type,
+ const uint32_t app_id) FINAL;
+
+ /**
+ * @brief SetResourceState changes resource state. Resource must be acquired
+ * beforehand.
+ * @param module_type Resource to change its state
+ * @param app_id Application aquired resource before
+ * @param state State to set for resource
+ */
+ void SetResourceState(const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ void SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL;
+
+ hmi_apis::Common_RCAccessMode::eType GetAccessMode() const FINAL;
+
+ void OnDriverDisallowed(const std::string& module_type,
+ const uint32_t app_id) FINAL;
+
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ void OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) FINAL;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) FINAL;
+
+ void ResetAllAllocations() FINAL;
+
+ void SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
+ application_manager::ApplicationSharedPtr application) FINAL;
+
+ bool is_rc_enabled() const FINAL;
+
+ void set_rc_enabled(const bool value) FINAL;
+
+ private:
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+
+ /**
+ * @brief Create OnRCStatusNotification creates OnRCStatus notification smart
+ * object for mobile application
+ * @param app_id application to send OnRCStatusNotification
+ * @return smart object with mobile OnRCStatusNotification
+ */
+ smart_objects::SmartObjectSPtr CreateOnRCStatusNotificationToMobile(
+ const application_manager::ApplicationSharedPtr app);
+
+ smart_objects::SmartObjectSPtr CreateOnRCStatusNotificationToHmi(
+ const application_manager::ApplicationSharedPtr app);
+
+ /**
+ * @brief IsModuleTypeRejected check if current resource was rejected by
+ * driver for current application
+ * @param module_type resource to check
+ * @param app_id application id
+ * @return true if current resource was rejected by driver for current
+ * application, otherwise - false
+ */
+ bool IsModuleTypeRejected(const std::string& module_type,
+ const uint32_t app_id);
+
+ /**
+ * @brief ReleaseResource Releases resource acquired by application
+ * @param module_type Module name
+ * @param application_id Application id
+ */
+ void ReleaseResource(const std::string& module_type,
+ const uint32_t application_id);
+
+ /**
+ * @brief GetAcquiredResources Provides resources acquired by particular
+ * application currently
+ * @param application_id Application id
+ * @return List of acquired resources by specific application
+ */
+ Resources GetAcquiredResources(const uint32_t application_id) const;
+
+ /**
+ * @brief ProcessApplicationPolicyUpdate Checks if allowed modules list is
+ * changed for registered RC applications and releases in case some modules
+ * now out of the list
+ */
+ void ProcessApplicationPolicyUpdate();
+
+ /**
+ * @brief RemoveAppsSubscriptions Removes subscriptions for interior data for
+ * applications in the list
+ * @param apps Application list
+ */
+ void RemoveAppsSubscriptions(const Apps& apps);
+
+ /**
+ * @brief SetResourceAquired mark resourse as aquired and process logic of
+ * changing state of aquired resources
+ * @param module_type resource name
+ * @param app applicastion that aquire resource
+ */
+ void SetResourceAquired(const std::string& module_type,
+ const uint32_t app_id);
+ /**
+ * @brief SetResourceFree mark resourse as free and process logic of
+ * changing state of aquired resources
+ * @param module_type resource name
+ * @param app applicastion that aquire resource
+ */
+ void SetResourceFree(const std::string& module_type, const uint32_t app_id);
+
+ /**
+ * @brief AllocatedResources contains link between resource and application
+ * owning that resource
+ */
+ typedef std::map<std::string, uint32_t> AllocatedResources;
+ AllocatedResources allocated_resources_;
+ mutable sync_primitives::Lock allocated_resources_lock_;
+
+ /**
+ * @brief ResourcesState contains states of ALLOCATED resources
+ */
+ typedef std::map<std::string, ResourceState::eType> ResourcesState;
+ ResourcesState resources_state_;
+ mutable sync_primitives::Lock resources_state_lock_;
+
+ /**
+ * @brief RejectedResources type for connecting list of resources rejected by
+ * driver for application
+ * application_id : [vector of rejected resources]
+ */
+ typedef std::map<uint32_t, std::vector<std::string> > RejectedResources;
+ RejectedResources rejected_resources_for_application_;
+ mutable sync_primitives::Lock rejected_resources_for_application_lock_;
+
+ hmi_apis::Common_RCAccessMode::eType current_access_mode_;
+ application_manager::ApplicationManager& app_mngr_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+ bool is_rc_enabled_;
+};
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc
new file mode 100644
index 0000000000..75faf5db8c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc
@@ -0,0 +1,58 @@
+/*
+ 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 "rc_rpc_plugin/commands/hmi/rc_button_press_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCButtonPressRequest::RCButtonPressRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : app_mngr::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCButtonPressRequest::~RCButtonPressRequest() {}
+
+void RCButtonPressRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc
new file mode 100644
index 0000000000..5c1691ed7b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_button_press_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCButtonPressResponse::RCButtonPressResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCButtonPressResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::Buttons_ButtonPress);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCButtonPressResponse::~RCButtonPressResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc
new file mode 100644
index 0000000000..774ee04677
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc
@@ -0,0 +1,57 @@
+/*
+ * 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 "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataConsentRequest::RCGetInteriorVehicleDataConsentRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCGetInteriorVehicleDataConsentRequest::
+ ~RCGetInteriorVehicleDataConsentRequest() {}
+
+void RCGetInteriorVehicleDataConsentRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc
new file mode 100644
index 0000000000..3244857656
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc
@@ -0,0 +1,64 @@
+/*
+ * 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 "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataConsentResponse::
+ RCGetInteriorVehicleDataConsentResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCGetInteriorVehicleDataConsentResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent);
+
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCGetInteriorVehicleDataConsentResponse::
+ ~RCGetInteriorVehicleDataConsentResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..c7baf75e27
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc
@@ -0,0 +1,56 @@
+/*
+ * 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 "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataRequest::RCGetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCGetInteriorVehicleDataRequest::~RCGetInteriorVehicleDataRequest() {}
+
+void RCGetInteriorVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..e56f9088bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc
@@ -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.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "application_manager/event_engine/event.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataResponse::RCGetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCGetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+
+ smart_objects::SmartObject& module_data = (*message_)
+ [application_manager::strings::msg_params][message_params::kModuleData];
+ if (module_data.keyExists(message_params::kAudioControlData)) {
+ smart_objects::SmartObject& audio_control_data =
+ module_data[message_params::kAudioControlData];
+ if (audio_control_data.keyExists(message_params::kKeepContext)) {
+ audio_control_data.erase(message_params::kKeepContext);
+ }
+ }
+
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCGetInteriorVehicleDataResponse::~RCGetInteriorVehicleDataResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc
new file mode 100644
index 0000000000..0117003f11
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc
@@ -0,0 +1,71 @@
+/*
+ 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 "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCOnInteriorVehicleDataNotification::RCOnInteriorVehicleDataNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::NotificationFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCOnInteriorVehicleDataNotification::~RCOnInteriorVehicleDataNotification() {}
+
+void RCOnInteriorVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[app_mngr::strings::params][app_mngr::strings::function_id] =
+ static_cast<int>(mobile_apis::FunctionID::eType::OnInteriorVehicleDataID);
+
+ smart_objects::SmartObject& module_data = (*message_)
+ [application_manager::strings::msg_params][message_params::kModuleData];
+ if (module_data.keyExists(rc_rpc_plugin::message_params::kAudioControlData)) {
+ smart_objects::SmartObject& audio_control_data =
+ module_data[message_params::kAudioControlData];
+ if (audio_control_data.keyExists(message_params::kKeepContext)) {
+ audio_control_data.erase(message_params::kKeepContext);
+ }
+ }
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc
new file mode 100644
index 0000000000..91cb6cb7ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc
@@ -0,0 +1,138 @@
+/*
+ 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 "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+namespace {
+std::map<std::string, hmi_apis::Common_RCAccessMode::eType> access_modes{
+ {enums_value::kAutoAllow, hmi_apis::Common_RCAccessMode::AUTO_ALLOW},
+ {enums_value::kAutoDeny, hmi_apis::Common_RCAccessMode::AUTO_DENY},
+ {enums_value::kAskDriver, hmi_apis::Common_RCAccessMode::ASK_DRIVER}};
+}
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+RCOnRemoteControlSettingsNotification::RCOnRemoteControlSettingsNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::NotificationFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , resource_allocation_manager_(params.resource_allocation_manager_)
+ , interior_data_manager_(params.interior_data_manager_) {}
+
+RCOnRemoteControlSettingsNotification::
+ ~RCOnRemoteControlSettingsNotification() {}
+
+hmi_apis::Common_RCAccessMode::eType AccessModeFromString(
+ const std::string& access_mode) {
+ std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
+ mode = access_modes.find(access_mode);
+ return access_modes.end() != mode
+ ? mode->second
+ : hmi_apis::Common_RCAccessMode::INVALID_ENUM;
+}
+
+std::string AccessModeToString(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
+ it = access_modes.begin();
+ for (; access_modes.end() != it; ++it) {
+ if (access_mode == it->second) {
+ return it->first;
+ }
+ }
+ const std::string error = "UNKNOW_ACCESS_MODE";
+ DCHECK_OR_RETURN(false, error);
+ return error;
+}
+
+void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ interior_data_manager_.OnDisablingRC();
+}
+
+void RCOnRemoteControlSettingsNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!(*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kAllowed)) {
+ LOG4CXX_DEBUG(logger_,
+ "Notification is ignored due to \"allow\" parameter absense");
+ LOG4CXX_DEBUG(logger_, "RC Functionality remains unchanged");
+ return;
+ }
+
+ const bool is_allowed =
+ (*message_)[app_mngr::strings::msg_params][message_params::kAllowed]
+ .asBool();
+ if (is_allowed) {
+ hmi_apis::Common_RCAccessMode::eType access_mode =
+ hmi_apis::Common_RCAccessMode::INVALID_ENUM;
+ LOG4CXX_DEBUG(logger_, "Allowing RC Functionality");
+ resource_allocation_manager_.set_rc_enabled(true);
+ if ((*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kAccessMode)) {
+ access_mode = static_cast<hmi_apis::Common_RCAccessMode::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kAccessMode].asUInt());
+ LOG4CXX_DEBUG(
+ logger_,
+ "Setting up access mode : " << AccessModeToString(access_mode));
+ } else {
+ access_mode = resource_allocation_manager_.GetAccessMode();
+ LOG4CXX_DEBUG(logger_,
+ "No access mode received. Using last known: "
+ << AccessModeToString(access_mode));
+ }
+ resource_allocation_manager_.SetAccessMode(access_mode);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality");
+ DisallowRCFunctionality();
+ resource_allocation_manager_.ResetAllAllocations();
+ resource_allocation_manager_.set_rc_enabled(false);
+ }
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..f0d5ecc177
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc
@@ -0,0 +1,55 @@
+/*
+ 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 "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCSetInteriorVehicleDataRequest::RCSetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+RCSetInteriorVehicleDataRequest::~RCSetInteriorVehicleDataRequest() {}
+
+void RCSetInteriorVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..56d924debe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCSetInteriorVehicleDataResponse::RCSetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCSetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::RC_SetInteriorVehicleData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCSetInteriorVehicleDataResponse::~RCSetInteriorVehicleDataResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc
new file mode 100644
index 0000000000..5ce047071c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc
@@ -0,0 +1,290 @@
+/*
+ * 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 "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+typedef std::map<std::string, mobile_apis::ButtonName::eType> ButtonsMap;
+
+ButtonPressRequest::ButtonPressRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params) {}
+
+ButtonPressRequest::~ButtonPressRequest() {}
+
+const std::vector<std::string> buttons_climate() {
+ std::vector<std::string> data;
+ data.push_back(enums_value::kACMax);
+ data.push_back(enums_value::kAC);
+ data.push_back(enums_value::kRecirculate);
+ data.push_back(enums_value::kFanUp);
+ data.push_back(enums_value::kFanDown);
+ data.push_back(enums_value::kTempUp);
+ data.push_back(enums_value::kTempDown);
+ data.push_back(enums_value::kDefrostMax);
+ data.push_back(enums_value::kDefrost);
+ data.push_back(enums_value::kDefrostRear);
+ data.push_back(enums_value::kUpperVent);
+ data.push_back(enums_value::kLowerVent);
+ return data;
+}
+
+const std::vector<std::string> buttons_radio() {
+ std::vector<std::string> data;
+ data.push_back(enums_value::kVolumeUp);
+ data.push_back(enums_value::kVolumeDown);
+ data.push_back(enums_value::kEject);
+ data.push_back(enums_value::kSource);
+ data.push_back(enums_value::kShuffle);
+ data.push_back(enums_value::kRepeat);
+ return data;
+}
+
+const ButtonsMap buttons_map() {
+ using namespace mobile_apis;
+
+ ButtonsMap buttons_map;
+ buttons_map[enums_value::kACMax] = ButtonName::AC_MAX;
+ buttons_map[enums_value::kAC] = ButtonName::AC;
+ buttons_map[enums_value::kRecirculate] = ButtonName::RECIRCULATE;
+ buttons_map[enums_value::kFanUp] = ButtonName::FAN_UP;
+ buttons_map[enums_value::kFanDown] = ButtonName::FAN_DOWN;
+ buttons_map[enums_value::kTempUp] = ButtonName::TEMP_UP;
+ buttons_map[enums_value::kTempDown] = ButtonName::TEMP_DOWN;
+ buttons_map[enums_value::kDefrostMax] = ButtonName::DEFROST_MAX;
+ buttons_map[enums_value::kDefrost] = ButtonName::DEFROST;
+ buttons_map[enums_value::kDefrostRear] = ButtonName::DEFROST_REAR;
+ buttons_map[enums_value::kUpperVent] = ButtonName::UPPER_VENT;
+ buttons_map[enums_value::kLowerVent] = ButtonName::LOWER_VENT;
+ buttons_map[enums_value::kVolumeUp] = ButtonName::VOLUME_UP;
+ buttons_map[enums_value::kVolumeDown] = ButtonName::VOLUME_DOWN;
+ buttons_map[enums_value::kEject] = ButtonName::EJECT;
+ buttons_map[enums_value::kSource] = ButtonName::SOURCE;
+ buttons_map[enums_value::kShuffle] = ButtonName::SHUFFLE;
+ buttons_map[enums_value::kRepeat] = ButtonName::REPEAT;
+
+ return buttons_map;
+}
+
+bool CheckIfButtonExistInRCCaps(
+ const smart_objects::SmartObject& rc_capabilities,
+ const mobile_apis::ButtonName::eType button) {
+ if (rc_capabilities.keyExists(strings::kbuttonCapabilities)) {
+ const smart_objects::SmartObject& button_caps =
+ rc_capabilities[strings::kbuttonCapabilities];
+ auto it = button_caps.asArray()->begin();
+ for (; it != button_caps.asArray()->end(); ++it) {
+ smart_objects::SmartObject& so = *it;
+ int64_t current_id = so[message_params::kName].asInt();
+ if (-1 == current_id) {
+ // capabilities received from HMI contains enum values
+ // capabilities loaded from file contains string values
+ // TODO : unificate capabilities storing
+ const std::string& bt_name = so[message_params::kName].asString();
+ static ButtonsMap btn_map = buttons_map();
+ current_id = btn_map[bt_name];
+ }
+ const mobile_apis::ButtonName::eType current_button =
+ static_cast<mobile_apis::ButtonName::eType>(current_id);
+ if (current_button == button) {
+ LOG4CXX_TRACE(logger_,
+ "Button id " << current_button
+ << " exist in capabilities");
+ return true;
+ }
+ }
+ }
+ LOG4CXX_TRACE(logger_,
+ "Button id " << button << " do not exist in capabilities");
+ return false;
+}
+
+bool CheckButtonName(const std::string& module_type,
+ const std::string& button_name,
+ const smart_objects::SmartObject* rc_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (rc_capabilities == NULL) {
+ LOG4CXX_ERROR(logger_, "No remote controll capabilities available");
+ return false;
+ }
+
+ if (enums_value::kRadio == module_type) {
+ if (!helpers::in_range(buttons_radio(), button_name)) {
+ LOG4CXX_WARN(logger_,
+ "Trying to acceess climate button with module type radio");
+ return false;
+ }
+ }
+
+ if (enums_value::kClimate == module_type) {
+ if (!helpers::in_range(buttons_climate(), button_name)) {
+ LOG4CXX_WARN(logger_,
+ "Trying to acceess radio button with module type climate");
+ return false;
+ }
+ }
+ return true;
+}
+
+void ButtonPressRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const char* button_name;
+ ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::ButtonName::eType>::EnumToCString(
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kButtonName].asUInt()),
+ &button_name);
+
+ const std::string module_type = ModuleType();
+ static ButtonsMap btn_map = buttons_map();
+ mobile_apis::ButtonName::eType button_id =
+ mobile_apis::ButtonName::INVALID_ENUM;
+ if (btn_map.end() != btn_map.find(button_name)) {
+ button_id = btn_map[button_name];
+ }
+
+ const smart_objects::SmartObject* rc_capabilities =
+ hmi_capabilities_.rc_capability();
+ const bool button_name_matches_module_type =
+ CheckButtonName(module_type, button_name, rc_capabilities);
+ const bool button_id_exist_in_caps =
+ rc_capabilities &&
+ CheckIfButtonExistInRCCaps(*rc_capabilities, button_id);
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ (*message_)[app_mngr::strings::msg_params][app_mngr::strings::app_id] =
+ app->app_id();
+
+ if (button_name_matches_module_type && button_id_exist_in_caps) {
+ SendHMIRequest(hmi_apis::FunctionID::Buttons_ButtonPress,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+ } else if (!button_name_matches_module_type) {
+ LOG4CXX_WARN(logger_, "Request module type and button name mismatch!");
+ SetResourceState(module_type, ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Request module type and button name mismatch!");
+ } else {
+ LOG4CXX_WARN(logger_, "Requested button is not exists in capabilities!");
+ SetResourceState(module_type, ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ "Requested button is not exists in capabilities!");
+ }
+}
+
+AcquireResult::eType ButtonPressRequest::AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ return resource_allocation_manager_.AcquireResource(module_type,
+ app->app_id());
+}
+
+bool ButtonPressRequest::IsResourceFree(const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return resource_allocation_manager_.IsResourceFree(module_type);
+}
+
+void ButtonPressRequest::SetResourceState(const std::string& module_type,
+ const ResourceState::eType state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ resource_allocation_manager_.SetResourceState(
+ module_type, app->app_id(), state);
+}
+
+void ButtonPressRequest::on_event(const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RCCommandRequest::on_event(event);
+
+ if (hmi_apis::FunctionID::Buttons_ButtonPress != event.id()) {
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ if (mobile_apis::Result::READ_ONLY == result_code) {
+ result = false;
+ result_code = mobile_apis::Result::GENERIC_ERROR;
+ }
+ std::string response_info;
+ GetInfo(message, response_info);
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(result, result_code, response_info.c_str());
+}
+
+std::string ButtonPressRequest::ModuleType() {
+ mobile_apis::ModuleType::eType module_type = static_cast<
+ mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc
new file mode 100644
index 0000000000..491b0363c9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc
@@ -0,0 +1,56 @@
+/*
+ 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 "rc_rpc_plugin/commands/mobile/button_press_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+ButtonPressResponse::ButtonPressResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+ButtonPressResponse::~ButtonPressResponse() {}
+
+void ButtonPressResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.GetRPCService().SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..4d12b4f375
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
@@ -0,0 +1,404 @@
+/*
+ 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 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 "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params)
+
+ , excessive_subscription_occured_(false) {}
+
+bool CheckIfModuleTypeExistInCapabilities(
+ const smart_objects::SmartObject& rc_capabilities,
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& mapping = RCHelpers::GetModuleTypeToCapabilitiesMapping();
+ const auto& module_list = RCHelpers::GetModulesList();
+ bool is_module_type_valid = false;
+ for (const auto& module : module_list) {
+ if (module == module_type) {
+ if (rc_capabilities.keyExists(mapping(module))) {
+ is_module_type_valid = true;
+ break;
+ }
+ }
+ }
+ return is_module_type_valid;
+}
+
+bool GetInteriorVehicleDataRequest::ProcessCapabilities() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject* rc_capabilities =
+ hmi_capabilities_.rc_capability();
+
+ const std::string module_type = ModuleType();
+ if (rc_capabilities &&
+ !CheckIfModuleTypeExistInCapabilities(*rc_capabilities, module_type)) {
+ LOG4CXX_WARN(logger_, "Accessing not supported module data");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ "Accessing not supported module data");
+ return false;
+ }
+ return true;
+}
+
+void GetInteriorVehicleDataRequest::FilterDisabledModuleData(
+ smart_objects::SmartObject& module_data) {
+ // If radioEnable is false, remove all other radio parameters from the
+ // message.
+ if (module_data.keyExists(message_params::kRadioEnable) &&
+ module_data[message_params::kRadioEnable].asBool() == false) {
+ for (auto data = module_data.map_begin(); data != module_data.map_end();) {
+ auto key = data->first;
+ ++data;
+ if (key != message_params::kRadioEnable) {
+ module_data.erase(key);
+ }
+ }
+ }
+ // If hdRadioEnable is false, find and remove the HDChannel if parameter is
+ // present.
+ if (module_data.keyExists(message_params::kHdRadioEnable) &&
+ module_data[message_params::kHdRadioEnable].asBool() == false) {
+ module_data.erase(message_params::kHdChannel);
+ module_data.erase(message_params::kAvailableHDs);
+ module_data.erase(message_params::kSisData);
+ }
+}
+
+void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache(
+ app_mngr::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ auto data = interior_data_cache_.Retrieve(ModuleType());
+ FilterDisabledModuleData(data);
+ auto response_msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ response_msg_params[message_params::kModuleData][data_mapping(ModuleType())] =
+ data;
+ response_msg_params[message_params::kModuleData]
+ [message_params::kModuleType] = ModuleType();
+
+ const auto& request_msg_params = (*message_)[app_mngr::strings::msg_params];
+ LOG4CXX_DEBUG(logger_,
+ "kSubscribe exist" << request_msg_params.keyExists(
+ message_params::kSubscribe));
+ if (request_msg_params.keyExists(message_params::kSubscribe)) {
+ response_msg_params[message_params::kIsSubscribed] =
+ request_msg_params[message_params::kSubscribe].asBool();
+ if (request_msg_params[message_params::kSubscribe].asBool()) {
+ auto extension = RCHelpers::GetRCExtension(*app);
+ DCHECK(extension);
+ extension->SubscribeToInteriorVehicleData(ModuleType());
+ }
+ }
+ SendResponse(
+ true, mobile_apis::Result::SUCCESS, nullptr, &response_msg_params);
+ if (AppShouldBeUnsubscribed()) {
+ auto extension = RCHelpers::GetRCExtension(*app);
+ DCHECK(extension);
+ extension->UnsubscribeFromInteriorVehicleData(ModuleType());
+ }
+}
+
+bool GetInteriorVehicleDataRequest::CheckRateLimits() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return interior_data_manager_.CheckRequestsToHMIFrequency(ModuleType());
+}
+
+bool GetInteriorVehicleDataRequest::AppShouldBeUnsubscribed() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& msg_params = (*message_)[app_mngr::strings::msg_params];
+ if (msg_params.keyExists(message_params::kSubscribe)) {
+ return !(msg_params[message_params::kSubscribe].asBool());
+ }
+ return false;
+}
+
+bool GetInteriorVehicleDataRequest::TheLastAppShouldBeUnsubscribed(
+ app_mngr::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (AppShouldBeUnsubscribed()) {
+ const auto subscribed_to_module_type =
+ RCHelpers::AppsSubscribedToModuleType(application_manager_,
+ ModuleType());
+ if (subscribed_to_module_type.size() == 1 &&
+ subscribed_to_module_type.front() == app) {
+ LOG4CXX_DEBUG(logger_,
+ "The last application unsubscribes from " << ModuleType());
+ return true;
+ }
+ }
+ return false;
+}
+
+void GetInteriorVehicleDataRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!ProcessCapabilities()) {
+ return;
+ }
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (TheLastAppShouldBeUnsubscribed(app) ||
+ !interior_data_cache_.Contains(ModuleType())) {
+ if (HasRequestExcessiveSubscription()) {
+ excessive_subscription_occured_ = true;
+ is_subscribed =
+ (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
+ .asBool();
+ RemoveExcessiveSubscription();
+ }
+ if (!CheckRateLimits()) {
+ LOG4CXX_WARN(logger_, "GetInteriorVehicleData frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ interior_data_manager_.StoreRequestToHMITime(ModuleType());
+ SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleData,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+ return;
+ }
+ ProcessResponseToMobileFromCache(app);
+}
+
+void GetInteriorVehicleDataRequest::on_event(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RCCommandRequest::on_event(event);
+
+ if (hmi_apis::FunctionID::RC_GetInteriorVehicleData != event.id()) {
+ return;
+ }
+
+ smart_objects::SmartObject& hmi_response =
+ const_cast<smart_objects::SmartObject&>(event.smart_object());
+
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ hmi_response[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ if (mobile_apis::Result::READ_ONLY == result_code) {
+ result = false;
+ result_code = mobile_apis::Result::GENERIC_ERROR;
+ }
+
+ if (result) {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ DCHECK_OR_RETURN_VOID(app);
+ if (TheLastAppShouldBeUnsubscribed(app)) {
+ interior_data_cache_.Remove(ModuleType());
+ }
+ ProccessSubscription(hmi_response);
+ if (is_subscribed) {
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ const auto module_data =
+ hmi_response[app_mngr::strings::msg_params]
+ [message_params::kModuleData][data_mapping(ModuleType())];
+ interior_data_cache_.Add(ModuleType(), module_data);
+ }
+ } else {
+ hmi_response[app_mngr::strings::msg_params].erase(
+ message_params::kIsSubscribed);
+ }
+ std::string response_info;
+ GetInfo(hmi_response, response_info);
+ SetResourceState(ModuleType(), ResourceState::FREE);
+
+ SendResponse(result,
+ result_code,
+ response_info.c_str(),
+ &hmi_response[app_mngr::strings::msg_params]);
+}
+
+GetInteriorVehicleDataRequest::~GetInteriorVehicleDataRequest() {}
+
+void GetInteriorVehicleDataRequest::ProccessSubscription(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& hmi_response) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const bool is_subscribe_present_in_request =
+ (*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kSubscribe) ||
+ excessive_subscription_occured_;
+
+ const bool isSubscribed_present_in_response =
+ hmi_response[app_mngr::strings::msg_params].keyExists(
+ message_params::kIsSubscribed);
+
+ smart_objects::SmartObject& temp_hmi_response =
+ const_cast<smart_objects::SmartObject&>(hmi_response);
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ const auto extension = RCHelpers::GetRCExtension(*app);
+ const char* module_type;
+ ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::ModuleType::eType>::EnumToCString(
+ static_cast<mobile_apis::ModuleType::eType>(
+ hmi_response[app_mngr::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kModuleType].asUInt()),
+ &module_type);
+ if (excessive_subscription_occured_) {
+ is_subscribed = extension->IsSubscibedToInteriorVehicleData(module_type);
+ temp_hmi_response[app_mngr::strings::msg_params]
+ [message_params::kIsSubscribed] = is_subscribed;
+ return;
+ }
+ if (!is_subscribe_present_in_request && !isSubscribed_present_in_response) {
+ return;
+ }
+
+ if (is_subscribe_present_in_request && !isSubscribed_present_in_response) {
+ LOG4CXX_WARN(logger_,
+ "conditional mandatory parameter "
+ << message_params::kIsSubscribed
+ << " missed in hmi response");
+
+ is_subscribed = extension->IsSubscibedToInteriorVehicleData(module_type);
+ temp_hmi_response[app_mngr::strings::msg_params]
+ [message_params::kIsSubscribed] = is_subscribed;
+ return;
+ }
+
+ if (!is_subscribe_present_in_request && isSubscribed_present_in_response) {
+ LOG4CXX_WARN(logger_,
+ "Parameter " << message_params::kIsSubscribed
+ << " is ignored due to absence '"
+ << message_params::kSubscribe
+ << "' parameter in request");
+ smart_objects::SmartObject& temp_hmi_response =
+ const_cast<smart_objects::SmartObject&>(hmi_response);
+ temp_hmi_response[app_mngr::strings::msg_params].erase(
+ message_params::kIsSubscribed);
+ return;
+ }
+
+ const bool request_subscribe =
+ (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
+ .asBool();
+ const bool response_subscribe =
+ hmi_response[app_mngr::strings::msg_params][message_params::kIsSubscribed]
+ .asBool();
+ is_subscribed = response_subscribe;
+
+ LOG4CXX_TRACE(logger_, "request_subscribe = " << request_subscribe);
+ LOG4CXX_TRACE(logger_, "response_subscribe = " << response_subscribe);
+ if (request_subscribe == response_subscribe) {
+ const std::string module_type = ModuleType();
+ if (response_subscribe) {
+ LOG4CXX_DEBUG(logger_,
+ "SubscribeToInteriorVehicleData " << app->app_id() << " "
+ << module_type);
+ extension->SubscribeToInteriorVehicleData(module_type);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "UnsubscribeFromInteriorVehicleData "
+ << app->app_id() << " " << module_type);
+ extension->UnsubscribeFromInteriorVehicleData(module_type);
+ }
+ }
+}
+
+bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const bool is_subscribe_present_in_request =
+ (*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kSubscribe);
+
+ if (is_subscribe_present_in_request) {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ const auto extension = RCHelpers::GetRCExtension(*app);
+
+ const bool is_app_already_subscribed =
+ extension->IsSubscibedToInteriorVehicleData(ModuleType());
+ const bool app_wants_to_subscribe =
+ (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
+ .asBool();
+ if (!app_wants_to_subscribe && !is_app_already_subscribed) {
+ return true;
+ }
+ return app_wants_to_subscribe && is_app_already_subscribed;
+ }
+ return false;
+}
+
+void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[app_mngr::strings::msg_params].erase(message_params::kSubscribe);
+}
+
+std::string GetInteriorVehicleDataRequest::ModuleType() {
+ mobile_apis::ModuleType::eType module_type = static_cast<
+ mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..a7572f1d62
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
@@ -0,0 +1,56 @@
+/*
+ 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 "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+GetInteriorVehicleDataResponse::GetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {}
+
+void GetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.GetRPCService().SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
new file mode 100644
index 0000000000..37890b7979
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
@@ -0,0 +1,108 @@
+/*
+ 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 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 "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : app_mngr::commands::CommandNotificationImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , interior_data_cache_(params.interior_data_cache_) {}
+
+OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() {}
+
+void OnInteriorVehicleDataNotification::AddDataToCache(
+ const std::string& module_type) {
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ const auto module_data =
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleData]
+ [data_mapping(module_type)];
+ interior_data_cache_.Add(module_type, module_data);
+}
+
+void OnInteriorVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::string module_type = ModuleType();
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(application_manager_, module_type);
+ if (!apps_subscribed.empty()) {
+ AddDataToCache(module_type);
+ }
+ typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs;
+ AppPtrs apps = RCRPCPlugin::GetRCApplications(application_manager_);
+
+ for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) {
+ DCHECK(*it);
+ application_manager::Application& app = **it;
+
+ const auto extension = RCHelpers::GetRCExtension(app);
+ DCHECK(extension);
+ LOG4CXX_TRACE(logger_,
+ "Check subscription for "
+ << app.app_id() << "and module type " << module_type);
+ if (extension->IsSubscibedToInteriorVehicleData(module_type)) {
+ (*message_)[app_mngr::strings::params]
+ [app_mngr::strings::connection_key] = app.app_id();
+ SendNotification();
+ }
+ }
+}
+
+std::string OnInteriorVehicleDataNotification::ModuleType() {
+ mobile_apis::ModuleType::eType module_type =
+ static_cast<mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kModuleData][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..edc45670ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
@@ -0,0 +1,787 @@
+/*
+ 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 "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+namespace {
+std::vector<std::string> GetModuleReadOnlyParams(
+ const std::string& module_type) {
+ std::vector<std::string> module_ro_params;
+ if (enums_value::kClimate == module_type) {
+ module_ro_params.push_back(kCurrentTemperature);
+ } else if (enums_value::kRadio == module_type) {
+ module_ro_params.push_back(kRdsData);
+ module_ro_params.push_back(kAvailableHDs);
+ module_ro_params.push_back(kSignalStrength);
+ module_ro_params.push_back(kSignalChangeThreshold);
+ module_ro_params.push_back(kState);
+ module_ro_params.push_back(kSisData);
+ } else if (enums_value::kLight == module_type) {
+ module_ro_params.push_back(kLightStatus);
+ }
+
+ return module_ro_params;
+}
+
+const std::map<std::string, std::string> GetLightCapabilitiesMapping() {
+ std::map<std::string, std::string> mapping = {
+ {message_params::kId, strings::kName},
+ {message_params::kLightStatus, strings::kStatusAvailable},
+ {message_params::kLightDensity, strings::kDensityAvailable},
+ {message_params::kLightColor, strings::kRGBColorSpaceAvailable}};
+ return mapping;
+}
+
+const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
+ std::map<std::string, std::string> mapping;
+ // climate
+ mapping["fanSpeed"] = "fanSpeedAvailable";
+ mapping["currentTemperature"] = "currentTemperatureAvailable";
+ mapping["desiredTemperature"] = "desiredTemperatureAvailable";
+ mapping["acEnable"] = "acEnableAvailable";
+ mapping["circulateAirEnable"] = "circulateAirEnableAvailable";
+ mapping["autoModeEnable"] = "autoModeEnableAvailable";
+ mapping["defrostZone"] = "defrostZoneAvailable";
+ mapping["dualModeEnable"] = "dualModeEnableAvailable";
+ mapping["acMaxEnable"] = "acMaxEnableAvailable";
+ mapping["ventilationMode"] = "ventilationModeAvailable";
+ mapping["heatedSteeringWheelEnable"] = "heatedSteeringWheelAvailable";
+ mapping["heatedWindshieldEnable"] = "heatedWindshieldAvailable";
+ mapping["heatedMirrorsEnable"] = "heatedMirrorsAvailable";
+ mapping["heatedRearWindowEnable"] = "heatedRearWindowAvailable";
+
+ // radio
+ mapping["band"] = "radioBandAvailable";
+ mapping["frequencyInteger"] = "radioFrequencyAvailable";
+ mapping["frequencyFraction"] = "radioFrequencyAvailable";
+ mapping["rdsData"] = "rdsDataAvailable";
+ mapping["availableHDs"] = "availableHDsAvailable";
+ mapping["hdChannel"] = "availableHDsAvailable";
+ mapping["hdRadioEnable"] = "hdRadioEnableAvailable";
+ mapping["signalStrength"] = "signalStrengthAvailable";
+ mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable";
+ mapping["radioEnable"] = "radioEnableAvailable";
+ mapping["state"] = "stateAvailable";
+ mapping["sisData"] = "sisDataAvailable";
+
+ // seat
+ mapping["heatingEnabled"] = "heatingEnabledAvailable";
+ mapping["coolingEnabled"] = "coolingEnabledAvailable";
+ mapping["heatingLevel"] = "heatingLevelAvailable";
+ mapping["coolingLevel"] = "coolingLevelAvailable";
+ mapping["horizontalPosition"] = "horizontalPositionAvailable";
+ mapping["verticalPosition"] = "verticalPositionAvailable";
+ mapping["frontVerticalPosition"] = "frontVerticalPositionAvailable";
+ mapping["backVerticalPosition"] = "backVerticalPositionAvailable";
+ mapping["backTiltAngle"] = "backTiltAngleAvailable";
+ mapping["headSupportHorizontalPosition"] =
+ "headSupportHorizontalPositionAvailable";
+ mapping["headSupportVerticalPosition"] =
+ "headSupportVerticalPositionAvailable";
+ mapping["massageEnabled"] = "massageEnabledAvailable";
+ mapping["massageMode"] = "massageModeAvailable";
+ mapping["massageCushionFirmness"] = "massageCushionFirmnessAvailable";
+ mapping["memory"] = "memoryAvailable";
+
+ // audio
+ mapping["source"] = "sourceAvailable";
+ mapping["keepContext"] = "keepContextAvailable";
+ mapping["volume"] = "volumeAvailable";
+ mapping["equalizerSettings"] = "equalizerAvailable";
+
+ // hmi settings
+ mapping["distanceUnit"] = "distanceUnitAvailable";
+ mapping["temperatureUnit"] = "temperatureUnitAvailable";
+ mapping["displayMode"] = "displayModeUnitAvailable";
+
+ return mapping;
+}
+} // namespace
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params) {}
+
+SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {}
+
+const std::string LightName(const smart_objects::SmartObject& light_name) {
+ const char* name;
+ const bool ok = ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::LightName::eType>::EnumToCString(
+ static_cast<mobile_apis::LightName::eType>(light_name.asUInt()),
+ &name);
+ return ok ? name : "unknown";
+}
+
+/**
+ * @brief Check whether the parameter exist in capabilities
+ * @param smart object of capabilities
+ * @param mapping - map of module data and capabilities
+ * @param request_parameter - string
+ * @param switched_off_result - ref of mobile_apis::Result
+ * @return success if parameter exist in capabilities missedParam otherwise
+ */
+capabilitiesStatus GetItemCapability(
+ const smart_objects::SmartObject& capabilities,
+ const std::map<std::string, std::string>& mapping,
+ const std::string& request_parameter,
+ const mobile_apis::Result::eType& switched_off_result) {
+ const auto it = mapping.find(request_parameter);
+
+ if (it == mapping.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Parameter " << request_parameter
+ << " doesn't exist in capabilities.");
+ return capabilitiesStatus::missedParam;
+ }
+
+ const std::string& caps_key = it->second;
+
+ LOG4CXX_DEBUG(logger_,
+ "Checking request parameter "
+ << request_parameter
+ << " with capabilities. Appropriate key is " << caps_key);
+
+ if (!capabilities.keyExists(caps_key)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability " << caps_key
+ << " is missed in RemoteControl capabilities");
+ return capabilitiesStatus::missedParam;
+ }
+
+ if (!capabilities[caps_key].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << caps_key
+ << " is switched off in RemoteControl capabilities");
+ capabilitiesStatus status = capabilitiesStatus::missedParam;
+ if (mobile_apis::Result::READ_ONLY == switched_off_result) {
+ status = capabilitiesStatus::readOnly;
+ }
+ return status;
+ }
+
+ return capabilitiesStatus::success;
+}
+
+/**
+ * @brief Check whether the cpabilities for light allowed
+ * @param smart object of capabilities
+ * @param smart object of control_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetLightDataCapabilities(
+ const smart_objects::SmartObject& capabilities,
+ const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::map<std::string, std::string> mapping = GetLightCapabilitiesMapping();
+
+ for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) {
+ const std::string& request_parameter = it->first;
+
+ if (message_params::kId == request_parameter) {
+ continue;
+ }
+
+ const capabilitiesStatus status_item_capability =
+ GetItemCapability(capabilities,
+ mapping,
+ request_parameter,
+ mobile_apis::Result::READ_ONLY);
+
+ if (capabilitiesStatus::success != status_item_capability) {
+ return std::make_pair(message_params::kLightState,
+ status_item_capability);
+ }
+ }
+
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether the light name exists in capabilities
+ * @param smart object of capabilities_status
+ * @param smart object of light_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetLightNameCapabilities(
+ const smart_objects::SmartObject& capabilities_status,
+ const smart_objects::SmartObject& light_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto it = capabilities_status.asArray()->begin();
+ for (; it != capabilities_status.asArray()->end(); ++it) {
+ const smart_objects::SmartObject& so = *it;
+ const int64_t current_id = so[message_params::kName].asInt();
+ if (current_id == light_data[message_params::kId].asInt()) {
+ return GetLightDataCapabilities(so, light_data);
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "There is no such light name in capabilities");
+ return std::make_pair(message_params::kLightState,
+ capabilitiesStatus::missedLightName);
+}
+
+ModuleCapability GetRadioBandByCapabilities(
+ const smart_objects::SmartObject& capabilities_status,
+ const smart_objects::SmartObject& request_parameter) {
+ mobile_apis::RadioBand::eType radio_band =
+ static_cast<mobile_apis::RadioBand::eType>(request_parameter.asUInt());
+ if (mobile_apis::RadioBand::XM == radio_band) {
+ if (!capabilities_status.keyExists(strings::kSiriusxmRadioAvailable)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << strings::kSiriusxmRadioAvailable
+ << " is missed in RemoteControl capabilities");
+ return std::make_pair(strings::kSiriusxmRadioAvailable,
+ capabilitiesStatus::missedParam);
+ }
+ if (!capabilities_status[strings::kSiriusxmRadioAvailable].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << strings::kSiriusxmRadioAvailable
+ << " is switched off in RemoteControl capabilities");
+ return std::make_pair(strings::kSiriusxmRadioAvailable,
+ capabilitiesStatus::missedParam);
+ }
+ }
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether the exists light data related to correspondent
+ * capabilities
+ * @param smart object of capabilities
+ * @param smart object of control_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetControlDataCapabilities(
+ const smart_objects::SmartObject& capabilities,
+ const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::map<std::string, std::string> mapping =
+ GetModuleDataToCapabilitiesMapping();
+
+ for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) {
+ const std::string& request_parameter = it->first;
+ if (message_params::kId == request_parameter) {
+ continue;
+ }
+ if (message_params::kLightState == request_parameter) {
+ auto light_data = control_data[request_parameter].asArray()->begin();
+ ModuleCapability light_capability =
+ std::make_pair("", capabilitiesStatus::success);
+
+ for (; light_data != control_data[request_parameter].asArray()->end();
+ ++light_data) {
+ light_capability = GetLightNameCapabilities(
+ capabilities[strings::kSupportedLights], *light_data);
+
+ if (capabilitiesStatus::success != light_capability.second) {
+ return light_capability;
+ }
+ }
+
+ return light_capability;
+ }
+ if (message_params::kBand == request_parameter) {
+ ModuleCapability radio_capability = GetRadioBandByCapabilities(
+ capabilities, control_data[request_parameter]);
+ if (capabilitiesStatus::success != radio_capability.second) {
+ return radio_capability;
+ }
+ }
+
+ const capabilitiesStatus status_item_capability =
+ GetItemCapability(capabilities,
+ mapping,
+ request_parameter,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE);
+
+ if (capabilitiesStatus::success != status_item_capability) {
+ return std::make_pair("", status_item_capability);
+ }
+ }
+
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether rc module data capabilities are presented
+ * @param smart object of rc_capabilities
+ * @param smart object of module_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetModuleDataCapabilities(
+ const smart_objects::SmartObject& rc_capabilities,
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& get_module_data_key = RCHelpers::GetModuleTypeToDataMapping();
+ const auto& get_capabilities_key =
+ RCHelpers::GetModuleTypeToCapabilitiesMapping();
+ ModuleCapability module_data_capabilities =
+ std::make_pair("", capabilitiesStatus::missedParam);
+
+ for (const auto& module_type : all_module_types) {
+ const auto module_data_key = get_module_data_key(module_type);
+ const auto capabilities_key = get_capabilities_key(module_type);
+ if (module_data.keyExists(module_data_key)) {
+ if (!rc_capabilities.keyExists(capabilities_key)) {
+ LOG4CXX_DEBUG(logger_, module_data_key << " capabilities not present");
+ return module_data_capabilities;
+ }
+ const smart_objects::SmartObject& caps =
+ rc_capabilities[capabilities_key];
+
+ if (message_params::kHmiSettingsControlData == module_data_key ||
+ message_params::kLightControlData == module_data_key) {
+ module_data_capabilities =
+ GetControlDataCapabilities(caps, module_data[module_data_key]);
+ } else {
+ module_data_capabilities =
+ GetControlDataCapabilities(caps[0], module_data[module_data_key]);
+ }
+ }
+ }
+
+ return module_data_capabilities;
+}
+
+/**
+ * @brief Clears unrelated module data parameters
+ * @param module type in request
+ * @param smart object of module_data
+ * @return true if the correct module parameter is present, false otherwise
+ */
+bool ClearUnrelatedModuleData(const std::string& module_type,
+ smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ bool module_type_and_data_match = false;
+ for (const auto& type : all_module_types) {
+ const std::string module_key = data_mapping(type);
+ if (type == module_type) {
+ module_type_and_data_match = module_data.keyExists(module_key);
+ } else if (module_data.keyExists(module_key)) {
+ // Cutting unrelated module data
+ module_data.erase(module_key);
+ }
+ }
+ return module_type_and_data_match;
+}
+
+mobile_apis::Result::eType PrepareResultCodeAndInfo(
+ const ModuleCapability module_data_capabilities, std::string& info) {
+ mobile_apis::Result::eType result_code =
+ mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ if (message_params::kLightState == module_data_capabilities.first) {
+ switch (module_data_capabilities.second) {
+ case capabilitiesStatus::missedLightName:
+ info = "The requested LightName is not supported by the vehicle.";
+ break;
+ case capabilitiesStatus::missedParam:
+ info =
+ "The requested parameter of the given LightName is not supported "
+ "by the vehicle.";
+ break;
+ case capabilitiesStatus::readOnly:
+ info = "The requested parameter is read-only.";
+ result_code = mobile_apis::Result::READ_ONLY;
+ break;
+ default:
+ break;
+ }
+
+ } else {
+ info = "Accessing not supported module data.";
+ }
+ return result_code;
+ LOG4CXX_WARN(logger_, info);
+}
+
+void SetInteriorVehicleDataRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& module_data =
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleData];
+ const std::string module_type = ModuleType();
+
+ if (ClearUnrelatedModuleData(module_type, module_data)) {
+ const smart_objects::SmartObject* rc_capabilities =
+ hmi_capabilities_.rc_capability();
+ ModuleCapability module_data_capabilities;
+
+ if (rc_capabilities) {
+ module_data_capabilities =
+ GetModuleDataCapabilities(*rc_capabilities, module_data);
+
+ if (capabilitiesStatus::success != module_data_capabilities.second) {
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ std::string info;
+ mobile_apis::Result::eType result =
+ PrepareResultCodeAndInfo(module_data_capabilities, info);
+ SendResponse(false, result, info.c_str());
+ return;
+ }
+ }
+
+ if (AreAllParamsReadOnly(module_data)) {
+ LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::READ_ONLY,
+ "All request params in module type are READ ONLY!");
+ return;
+ }
+
+ module_data_capabilities = std::make_pair("", capabilitiesStatus::success);
+
+ if (AreReadOnlyParamsPresent(module_data, module_data_capabilities)) {
+ LOG4CXX_DEBUG(logger_, "Request module type has READ ONLY parameters");
+
+ if (enums_value::kLight == module_data_capabilities.first &&
+ capabilitiesStatus::success != module_data_capabilities.second) {
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(
+ false,
+ mobile_apis::Result::READ_ONLY,
+ "The LightStatus enum passed is READ ONLY and cannot be written.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameters... ");
+
+ CutOffReadOnlyParams(module_data);
+ }
+
+ application_manager_.RemoveHMIFakeParameters(
+ message_, hmi_apis::FunctionID::RC_SetInteriorVehicleData);
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ (*message_)[app_mngr::strings::msg_params][app_mngr::strings::app_id] =
+ app->app_id();
+
+ const bool app_wants_to_set_audio_src =
+ module_data.keyExists(message_params::kAudioControlData) &&
+ module_data[message_params::kAudioControlData].keyExists(
+ message_params::kSource);
+
+ if (app_wants_to_set_audio_src) {
+ if (!app->IsAllowedToChangeAudioSource()) {
+ LOG4CXX_WARN(logger_, "App is not allowed to change audio source");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "App is not allowed to change audio source");
+ return;
+ } else if (module_data[message_params::kAudioControlData].keyExists(
+ message_params::kKeepContext)) {
+ app->set_keep_context(
+ module_data[message_params::kAudioControlData]
+ [message_params::kKeepContext].asBool());
+ }
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::RC_SetInteriorVehicleData,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+ } else {
+ LOG4CXX_WARN(logger_, "Request module type & data mismatch!");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Request module type & data mismatch!");
+ }
+}
+
+void SetInteriorVehicleDataRequest::on_event(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RCCommandRequest::on_event(event);
+
+ if (hmi_apis::FunctionID::RC_SetInteriorVehicleData != event.id()) {
+ return;
+ }
+
+ const smart_objects::SmartObject& hmi_response = event.smart_object();
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ hmi_response[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ smart_objects::SmartObject response_params;
+ if (result) {
+ response_params = hmi_response[app_mngr::strings::msg_params];
+ if (enums_value::kAudio == ModuleType()) {
+ CheckAudioSource((
+ *message_)[app_mngr::strings::msg_params][message_params::kModuleData]
+ [message_params::kAudioControlData]);
+ }
+ } else {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ app->set_keep_context(false);
+ }
+ std::string info;
+ GetInfo(hmi_response, info);
+ SendResponse(
+ result, result_code, info.c_str(), result ? &response_params : nullptr);
+}
+
+const smart_objects::SmartObject& SetInteriorVehicleDataRequest::ControlData(
+ const smart_objects::SmartObject& module_data) {
+ const std::string module_type = ModuleType();
+
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ for (const auto& type : all_module_types) {
+ if (type == module_type) {
+ return module_data[data_mapping(type)];
+ }
+ }
+ NOTREACHED();
+ return module_data[0];
+}
+
+void SetInteriorVehicleDataRequest::CheckAudioSource(
+ const smart_objects::SmartObject& audio_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (audio_data.keyExists(message_params::kSource)) {
+ application_manager_.set_current_audio_source(
+ audio_data[message_params::kSource].asUInt());
+ }
+}
+
+bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly(
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& module_type_params =
+ ControlData(module_data);
+ auto it = module_type_params.map_begin();
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(ModuleType());
+ for (; it != module_type_params.map_end(); ++it) {
+ if (!helpers::in_range(ro_params, it->first)) {
+ return false;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "All params are ReadOnly");
+ return true;
+}
+
+bool CheckReadOnlyParamsForAudio(
+ const smart_objects::SmartObject& module_type_params) {
+ if (module_type_params.keyExists(message_params::kEqualizerSettings)) {
+ const auto& equalizer_settings =
+ module_type_params[message_params::kEqualizerSettings];
+ auto it = equalizer_settings.asArray()->begin();
+
+ for (; it != equalizer_settings.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kChannelName)) {
+ LOG4CXX_DEBUG(logger_,
+ "READ ONLY parameter. ChannelName = "
+ << (*it)[message_params::kChannelName].asString());
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool CheckReadOnlyParamsForLight(
+ const smart_objects::SmartObject& module_type_params) {
+ if (module_type_params.keyExists(message_params::kLightState)) {
+ const auto& light_state = module_type_params[message_params::kLightState];
+ auto it = light_state.asArray()->begin();
+
+ for (; it != light_state.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kLightStatus)) {
+ const mobile_apis::LightStatus::eType light_status =
+ static_cast<mobile_apis::LightStatus::eType>(
+ (*it)[message_params::kLightStatus].asUInt());
+
+ if (helpers::Compare<mobile_apis::LightStatus::eType,
+ helpers::EQ,
+ helpers::ONE>(light_status,
+ mobile_apis::LightStatus::RAMP_UP,
+ mobile_apis::LightStatus::RAMP_DOWN,
+ mobile_apis::LightStatus::UNKNOWN,
+ mobile_apis::LightStatus::INVALID)) {
+ LOG4CXX_DEBUG(logger_,
+ "READ ONLY parameter. Status = "
+ << (*it)[message_params::kLightStatus].asInt());
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+bool SetInteriorVehicleDataRequest::AreReadOnlyParamsPresent(
+ const smart_objects::SmartObject& module_data,
+ ModuleCapability& module_data_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& module_type_params =
+ ControlData(module_data);
+ const std::string module_type = ModuleType();
+
+ if (enums_value::kAudio == module_type) {
+ return CheckReadOnlyParamsForAudio(module_type_params);
+ }
+
+ if (enums_value::kLight == module_type) {
+ const bool result = CheckReadOnlyParamsForLight(module_type_params);
+
+ if (result) {
+ module_data_capabilities =
+ std::make_pair(module_type, capabilitiesStatus::readOnly);
+ }
+
+ return result;
+ }
+
+ const std::vector<std::string> ro_params =
+ GetModuleReadOnlyParams(module_type);
+ auto it = module_type_params.map_begin();
+
+ for (; it != module_type_params.map_end(); ++it) {
+ if (helpers::in_range(ro_params, it->first)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
+ smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& module_type_params =
+ ControlData(module_data);
+ const std::string module_type = ModuleType();
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
+
+ for (auto& it : ro_params) {
+ if (module_type_params.keyExists(it)) {
+ if (enums_value::kClimate == module_type) {
+ module_data[message_params::kClimateControlData].erase(it);
+ } else if (enums_value::kRadio == module_type) {
+ module_data[message_params::kRadioControlData].erase(it);
+ } else {
+ continue;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it);
+ }
+ }
+
+ if (enums_value::kAudio == module_type) {
+ auto& equalizer_settings = module_data[message_params::kAudioControlData]
+ [message_params::kEqualizerSettings];
+ auto it = equalizer_settings.asArray()->begin();
+ for (; it != equalizer_settings.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kChannelName)) {
+ it->erase(message_params::kChannelName);
+ LOG4CXX_DEBUG(logger_,
+ "Cutting-off READ ONLY parameter: "
+ << message_params::kChannelName);
+ }
+ }
+ }
+}
+
+std::string SetInteriorVehicleDataRequest::ModuleType() {
+ mobile_apis::ModuleType::eType module_type =
+ static_cast<mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kModuleData][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+AcquireResult::eType SetInteriorVehicleDataRequest::AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ return resource_allocation_manager_.AcquireResource(module_type,
+ app->app_id());
+}
+
+bool SetInteriorVehicleDataRequest::IsResourceFree(
+ const std::string& module_type) const {
+ return resource_allocation_manager_.IsResourceFree(module_type);
+}
+
+void SetInteriorVehicleDataRequest::SetResourceState(
+ const std::string& module_type, const ResourceState::eType state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ resource_allocation_manager_.SetResourceState(
+ module_type, app->app_id(), state);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..4dedd4b5a2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc
@@ -0,0 +1,25 @@
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+SetInteriorVehicleDataResponse::SetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+SetInteriorVehicleDataResponse::~SetInteriorVehicleDataResponse() {}
+
+void SetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.GetRPCService().SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
new file mode 100644
index 0000000000..c24529d720
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
@@ -0,0 +1,268 @@
+/*
+ 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 "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/hmi_interfaces.h"
+#include "smart_objects/enum_schema_item.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCCommandRequest::RCCommandRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandRequestImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , is_subscribed(false)
+ , auto_allowed_(false)
+ , resource_allocation_manager_(params.resource_allocation_manager_)
+ , interior_data_cache_(params.interior_data_cache_)
+ , interior_data_manager_(params.interior_data_manager_) {}
+
+RCCommandRequest::~RCCommandRequest() {}
+
+bool RCCommandRequest::IsInterfaceAvailable(
+ const app_mngr::HmiInterfaces::InterfaceID interface) const {
+ app_mngr::HmiInterfaces& hmi_interfaces =
+ application_manager_.hmi_interfaces();
+ const app_mngr::HmiInterfaces::InterfaceState state =
+ hmi_interfaces.GetInterfaceState(interface);
+ return app_mngr::HmiInterfaces::STATE_NOT_AVAILABLE != state;
+}
+
+void RCCommandRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+ SetResourceState(module_type, ResourceState::FREE);
+ SendResponse(
+ false, mobile_apis::Result::GENERIC_ERROR, "Request timeout expired");
+}
+
+bool RCCommandRequest::CheckDriverConsent() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ const std::string module_type = ModuleType();
+ rc_rpc_plugin::TypeAccess access = CheckModule(module_type, app);
+
+ if (rc_rpc_plugin::kAllowed == access) {
+ set_auto_allowed(true);
+ return true;
+ }
+ SendDisallowed(access);
+ return false;
+}
+
+rc_rpc_plugin::TypeAccess RCCommandRequest::CheckModule(
+ const std::string& module_type,
+ application_manager::ApplicationSharedPtr app) {
+ return policy_handler_.CheckModule(app->policy_app_id(), module_type)
+ ? rc_rpc_plugin::TypeAccess::kAllowed
+ : rc_rpc_plugin::TypeAccess::kDisallowed;
+}
+
+void RCCommandRequest::SendDisallowed(rc_rpc_plugin::TypeAccess access) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string info;
+ if (rc_rpc_plugin::kDisallowed == access) {
+ info = disallowed_info_.empty()
+ ? "The RPC is disallowed by vehicle settings"
+ : disallowed_info_;
+ } else {
+ return;
+ }
+ LOG4CXX_ERROR(logger_, info);
+ SendResponse(false, mobile_apis::Result::DISALLOWED, info.c_str());
+}
+
+void RCCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!IsInterfaceAvailable(app_mngr::HmiInterfaces::HMI_INTERFACE_RC)) {
+ LOG4CXX_WARN(logger_, "HMI interface RC is not available");
+ SendResponse(false,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ "Remote control is not supported by system");
+ return;
+ }
+ LOG4CXX_TRACE(logger_, "RC interface is available!");
+ if (!policy_handler_.CheckHMIType(
+ app->policy_app_id(),
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ app->app_types())) {
+ LOG4CXX_WARN(logger_, "Application has no remote control functions");
+ SendResponse(false, mobile_apis::Result::DISALLOWED, "");
+ return;
+ }
+ if (!resource_allocation_manager_.is_rc_enabled()) {
+ LOG4CXX_WARN(logger_, "Remote control is disabled by user");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::USER_DISALLOWED,
+ "Remote control is disabled by user");
+ return;
+ }
+
+ if (CheckDriverConsent()) {
+ if (AcquireResources()) {
+ Execute(); // run child's logic
+ }
+ // If resource is not aqcuired, AcquireResources method will either
+ // send response to mobile or
+ // send additional request to HMI to ask driver consent
+ }
+}
+
+bool RCCommandRequest::AcquireResources() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+
+ if (!IsResourceFree(module_type)) {
+ LOG4CXX_WARN(logger_, "Resource is busy.");
+ SendResponse(false, mobile_apis::Result::IN_USE, "");
+ return false;
+ }
+
+ AcquireResult::eType acquire_result = AcquireResource(message_);
+ switch (acquire_result) {
+ case AcquireResult::ALLOWED: {
+ SetResourceState(module_type, ResourceState::BUSY);
+ return true;
+ }
+ case AcquireResult::IN_USE: {
+ SendResponse(false, mobile_apis::Result::IN_USE, "");
+ return false;
+ }
+ case AcquireResult::ASK_DRIVER: {
+ SendGetUserConsent(module_type);
+ return false;
+ }
+ case AcquireResult::REJECTED: {
+ SendResponse(false, mobile_apis::Result::REJECTED, "");
+ return false;
+ }
+ }
+ return false;
+}
+
+void RCCommandRequest::on_event(const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (event.id() == hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent) {
+ ProcessAccessResponse(event);
+ } else {
+ const std::string module_type = ModuleType();
+ SetResourceState(module_type, ResourceState::FREE);
+ }
+}
+
+void RCCommandRequest::ProcessAccessResponse(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ const std::string module_type = ModuleType();
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED, "");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ const bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ bool is_allowed = false;
+ if (result) {
+ if (message[app_mngr::strings::msg_params].keyExists(
+ message_params::kAllowed)) {
+ is_allowed =
+ message[app_mngr::strings::msg_params][message_params::kAllowed]
+ .asBool();
+ }
+ if (is_allowed) {
+ resource_allocation_manager_.ForceAcquireResource(module_type,
+ app->app_id());
+ SetResourceState(module_type, ResourceState::BUSY);
+ Execute(); // run child's logic
+ } else {
+ resource_allocation_manager_.OnDriverDisallowed(module_type,
+ app->app_id());
+ SendResponse(
+ false,
+ mobile_apis::Result::REJECTED,
+ "The resource is in use and the driver disallows this remote "
+ "control RPC");
+ }
+ } else {
+ std::string response_info;
+ GetInfo(message, response_info);
+ SendResponse(false, result_code, response_info.c_str());
+ }
+}
+
+void RCCommandRequest::SendGetUserConsent(const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ DCHECK(app);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[app_mngr::strings::app_id] = app->app_id();
+ msg_params[message_params::kModuleType] = module_type;
+ SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
+ &msg_params,
+ true);
+}
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
new file mode 100644
index 0000000000..780aab537b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
@@ -0,0 +1,192 @@
+/*
+ * 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 <iostream>
+#include <thread>
+#include <chrono>
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/date_time.h"
+#include "utils/logger.h"
+
+namespace rc_rpc_plugin {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+InteriorDataCacheImpl::InteriorDataCacheImpl() {}
+
+InteriorDataCacheImpl::~InteriorDataCacheImpl() {}
+
+/**
+ * @brief MergeModuleData all keys and values from first parameter and
+ * update and append keys and values from the second
+ * @param data1 - initial data
+ * @param data2 - updated data
+ * @return updated data1 with data2 keys and values
+ */
+smart_objects::SmartObject MergeModuleData(
+ const smart_objects::SmartObject& data1,
+ const smart_objects::SmartObject& data2);
+
+/**
+ * @brief MergeArray merge two arrays if their elements contain an `id`
+ * parameter
+ * @param data1 - initial data
+ * @param data2 - updated data
+ * @return updated data1 with any values in data2 if the arrays can be merged,
+ * otherwise data2
+ */
+smart_objects::SmartObject MergeArray(const smart_objects::SmartObject& data1,
+ const smart_objects::SmartObject& data2);
+
+smart_objects::SmartObject MergeModuleData(
+ const smart_objects::SmartObject& data1,
+ const smart_objects::SmartObject& data2) {
+ smart_objects::SmartObject result = data1;
+ auto it = data2.map_begin();
+ for (; it != data2.map_end(); ++it) {
+ const std::string& key = it->first;
+ smart_objects::SmartObject& value = it->second;
+ if (!result.keyExists(key) || value.getType() != result[key].getType()) {
+ result[key] = value;
+ continue;
+ }
+
+ // Merge maps and arrays with `id` param included, replace other types
+ if (value.getType() == smart_objects::SmartType::SmartType_Map) {
+ value = MergeModuleData(result[key], value);
+ } else if (value.getType() == smart_objects::SmartType::SmartType_Array) {
+ value = MergeArray(result[key], value);
+ }
+ result[key] = value;
+ }
+ return result;
+}
+
+smart_objects::SmartObject MergeArray(const smart_objects::SmartObject& data1,
+ const smart_objects::SmartObject& data2) {
+ // Merge data only in the case where each value in the array is an Object with
+ // an ID included, otherwise replace
+ bool array_contains_objects =
+ !data2.empty() &&
+ data2.getElement(0).getType() != smart_objects::SmartType::SmartType_Map;
+ bool can_merge_arrays =
+ array_contains_objects &&
+ data2.getElement(0).keyExists(application_manager::strings::id);
+ if (!can_merge_arrays) {
+ return data2;
+ }
+
+ smart_objects::SmartObject result = data1;
+ smart_objects::SmartArray* result_array = result.asArray();
+ smart_objects::SmartArray* data_array = data2.asArray();
+ auto data_it = data_array->begin();
+ auto find_by_id =
+ [](smart_objects::SmartArray* array, const smart_objects::SmartObject& id)
+ -> smart_objects::SmartArray::iterator {
+ auto it = std::find_if(
+ array->begin(),
+ array->end(),
+ [&id](smart_objects::SmartObject& obj) -> bool {
+ return obj[application_manager::strings::id] == id;
+ });
+ return it;
+ };
+
+ for (; data_it != data_array->end(); ++data_it) {
+ const smart_objects::SmartObject element_id =
+ (*data_it)[application_manager::strings::id];
+ auto result_it = find_by_id(result_array, element_id);
+
+ if (result_it != result_array->end()) {
+ *result_it = MergeModuleData(*result_it, *data_it);
+ } else {
+ result_array->push_back(*data_it);
+ }
+ }
+ return result;
+}
+
+void InteriorDataCacheImpl::Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (cached_data_.end() == it) {
+ cached_data_[module_type] = module_data;
+ return;
+ }
+ cached_data_[module_type] = MergeModuleData(it->second, module_data);
+}
+
+smart_objects::SmartObject InteriorDataCacheImpl::Retrieve(
+ const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (it == cached_data_.end()) {
+ LOG4CXX_WARN(logger_,
+ "Module type " << module_type << " was not found in cache");
+ return smart_objects::SmartObject(smart_objects::SmartType_Null);
+ }
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ return it->second;
+}
+
+bool InteriorDataCacheImpl::Contains(const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ const bool contains = it != cached_data_.end();
+ LOG4CXX_TRACE(logger_,
+ "module_type : " << module_type << " "
+ << (contains ? "true" : "false"));
+ return contains;
+}
+
+void InteriorDataCacheImpl::Remove(const std::string& module_type) {
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (cached_data_.end() == it) {
+ LOG4CXX_TRACE(logger_, "Not existing module_type : " << module_type);
+ return;
+ }
+ cached_data_.erase(it);
+}
+
+void InteriorDataCacheImpl::Clear() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ cached_data_.clear();
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
new file mode 100644
index 0000000000..0c42f6e3de
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
@@ -0,0 +1,158 @@
+#include "rc_rpc_plugin/interior_data_manager_impl.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+InteriorDataManagerImpl::InteriorDataManagerImpl(
+ RCRPCPlugin& rc_plugin,
+ InteriorDataCache& cache,
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service)
+ : rc_plugin_(rc_plugin)
+ , cache_(cache)
+ , app_mngr_(app_mngr)
+ , rpc_service_(rpc_service) {}
+
+void InteriorDataManagerImpl::OnPolicyEvent(plugins::PolicyEvent event) {
+ UpdateHMISubscriptionsOnPolicyUpdated();
+}
+
+void InteriorDataManagerImpl::OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) {
+ if (plugins::ApplicationEvent::kApplicationUnregistered == event ||
+ plugins::ApplicationEvent::kApplicationExit == event) {
+ UpdateHMISubscriptionsOnAppUnregistered(*application);
+ }
+}
+
+void InteriorDataManagerImpl::OnDisablingRC() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto existing_subscription = AppsSubscribedModules();
+ std::set<std::string> subscribed_modules;
+ for (auto& pair : existing_subscription) {
+ auto& app = pair.first;
+ auto rc_extension = RCHelpers::GetRCExtension(*app);
+ for (const auto& module : pair.second) {
+ subscribed_modules.insert(module);
+ rc_extension->UnsubscribeFromInteriorVehicleData(module);
+ }
+ }
+ for (auto& module : subscribed_modules) {
+ LOG4CXX_TRACE(logger_, "unsubscribe " << module);
+ UnsubscribeFromInteriorVehicleData(module);
+ }
+}
+
+void InteriorDataManagerImpl::StoreRequestToHMITime(
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_);
+ requests_to_hmi_history_[module_type].push_back(date_time::getCurrentTime());
+}
+
+bool InteriorDataManagerImpl::CheckRequestsToHMIFrequency(
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_);
+ ClearOldRequestsToHMIHistory();
+ const auto& history = requests_to_hmi_history_[module_type];
+ const auto limit =
+ app_mngr_.get_settings().get_interior_vehicle_data_frequency().first;
+ return history.size() < limit;
+}
+
+void InteriorDataManagerImpl::UpdateHMISubscriptionsOnPolicyUpdated() {
+ auto apps_allowed_modules =
+ RCHelpers::GetApplicationsAllowedModules(app_mngr_);
+ auto apps_subscribed_modules = AppsSubscribedModules();
+ InteriorDataManagerImpl::AppsModules apps_disallowed_modules;
+ for (auto& pair : apps_subscribed_modules) {
+ auto& allowed = apps_allowed_modules[pair.first];
+ auto& subscribed = pair.second;
+ std::vector<std::string> disallowed_modules;
+ std::set_difference(subscribed.begin(),
+ subscribed.end(),
+ allowed.begin(),
+ allowed.end(),
+ std::back_inserter(disallowed_modules));
+ apps_disallowed_modules[pair.first] = disallowed_modules;
+ }
+
+ for (auto& pair : apps_disallowed_modules) {
+ auto& app = pair.first;
+ auto rc_extension = RCHelpers::GetRCExtension(*app);
+ for (const auto& module : pair.second) {
+ rc_extension->UnsubscribeFromInteriorVehicleData(module);
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(app_mngr_, module);
+ if (apps_subscribed.empty()) {
+ UnsubscribeFromInteriorVehicleData(module);
+ }
+ }
+ }
+}
+
+void InteriorDataManagerImpl::UpdateHMISubscriptionsOnAppUnregistered(
+ application_manager::Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto rc_extension = RCHelpers::GetRCExtension(app);
+ auto subscribed_data = rc_extension->InteriorVehicleDataSubscriptions();
+ rc_extension->UnsubscribeFromInteriorVehicleData();
+ for (auto& data : subscribed_data) {
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(app_mngr_, data);
+ if (apps_subscribed.empty()) {
+ UnsubscribeFromInteriorVehicleData(data);
+ }
+ if (apps_subscribed.size() == 1 &&
+ apps_subscribed.front()->hmi_app_id() == app.hmi_app_id()) {
+ UnsubscribeFromInteriorVehicleData(data);
+ }
+ }
+}
+
+void InteriorDataManagerImpl::UnsubscribeFromInteriorVehicleData(
+ const std::string& module_type) {
+ cache_.Remove(module_type);
+ auto unsubscribe_request = RCHelpers::CreateUnsubscribeRequestToHMI(
+ module_type, app_mngr_.GetNextHMICorrelationID());
+ LOG4CXX_DEBUG(logger_, "Send Unsubscribe from " << module_type);
+ rpc_service_.ManageHMICommand(unsubscribe_request);
+}
+
+void InteriorDataManagerImpl::ClearOldRequestsToHMIHistory() {
+ auto limit =
+ app_mngr_.get_settings().get_interior_vehicle_data_frequency().second;
+ uint32_t time_frame = limit * date_time::MILLISECONDS_IN_SECOND;
+ auto lest_that_time_frame_ago = [time_frame](date_time::TimeDuration time) {
+ auto span = date_time::calculateTimeSpan(time);
+ return span < time_frame;
+ };
+ for (auto& it : requests_to_hmi_history_) {
+ auto& history = it.second;
+ auto first_actual =
+ std::find_if(history.begin(), history.end(), lest_that_time_frame_ago);
+ history.erase(history.begin(), first_actual);
+ }
+}
+
+InteriorDataManagerImpl::AppsModules
+InteriorDataManagerImpl::AppsSubscribedModules() {
+ auto apps_list = RCRPCPlugin::GetRCApplications(app_mngr_);
+ InteriorDataManagerImpl::AppsModules result;
+ for (auto& app_ptr : apps_list) {
+ const auto rc_extension = RCHelpers::GetRCExtension(*app_ptr);
+ auto app_subscriptions = rc_extension->InteriorVehicleDataSubscriptions();
+ result[app_ptr] = std::vector<std::string>(app_subscriptions.size());
+ std::copy(app_subscriptions.begin(),
+ app_subscriptions.end(),
+ result[app_ptr].begin());
+ }
+ return result;
+}
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
new file mode 100644
index 0000000000..5282da8d83
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
@@ -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.
+ */
+
+#include "rc_rpc_plugin/rc_app_extension.h"
+
+namespace rc_rpc_plugin {
+RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid)
+ : AppExtension(uid) {}
+
+void RCAppExtension::SubscribeToInteriorVehicleData(
+ const std::string& module_type) {
+ subscribed_interior_vehicle_data_.insert(module_type);
+}
+
+void RCAppExtension::UnsubscribeFromInteriorVehicleData(
+ const std::string& module_type) {
+ subscribed_interior_vehicle_data_.erase(module_type);
+}
+
+void RCAppExtension::UnsubscribeFromInteriorVehicleData() {
+ subscribed_interior_vehicle_data_.clear();
+}
+
+bool RCAppExtension::IsSubscibedToInteriorVehicleData(
+ const std::string& module_type) {
+ std::set<std::string>::iterator it =
+ subscribed_interior_vehicle_data_.find(module_type);
+
+ return (it != subscribed_interior_vehicle_data_.end());
+}
+
+void RCAppExtension::SaveResumptionData(
+ ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) {}
+
+void RCAppExtension::ProcessResumption(
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) {}
+
+std::set<std::string> RCAppExtension::InteriorVehicleDataSubscriptions() const {
+ return subscribed_interior_vehicle_data_;
+}
+
+RCAppExtension::~RCAppExtension() {}
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc
new file mode 100644
index 0000000000..ecfc1dcda4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc
@@ -0,0 +1,250 @@
+/*
+ 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 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 <iostream>
+
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_response.h"
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/commands/hmi/rc_button_press_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_button_press_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
+#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+namespace application_manager {
+using rc_rpc_plugin::ResourceAllocationManager;
+using rc_rpc_plugin::InteriorDataCache;
+using rc_rpc_plugin::RCCommandParams;
+
+template <typename RCCommandType>
+class RCCommandCreator : public CommandCreator {
+ public:
+ RCCommandCreator(const RCCommandParams& params) : params_(params) {}
+
+ private:
+ bool CanBeCreated() const override {
+ return true;
+ }
+
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ CommandSharedPtr command(new RCCommandType(message, params_));
+ return command;
+ }
+
+ RCCommandParams params_;
+};
+
+struct RCInvalidCommand {};
+
+template <>
+class RCCommandCreator<RCInvalidCommand> : public CommandCreator {
+ public:
+ RCCommandCreator(const RCCommandParams& params) {
+ UNUSED(params);
+ }
+
+ private:
+ bool CanBeCreated() const override {
+ return false;
+ }
+
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ UNUSED(message);
+ return CommandSharedPtr();
+ }
+};
+
+struct RCCommandCreatorFactory {
+ RCCommandCreatorFactory(const RCCommandParams& params) : params_(params) {}
+
+ template <typename RCCommandType>
+ CommandCreator& GetCreator() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ static RCCommandCreator<RCCommandType> res(params_);
+ return res;
+ }
+ const RCCommandParams params_;
+};
+}
+
+namespace rc_rpc_plugin {
+using namespace application_manager;
+
+RCCommandFactory::RCCommandFactory(const RCCommandParams& params)
+ : params_(params) {}
+
+CommandSharedPtr RCCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source) {
+ hmi_apis::messageType::eType message_type =
+ static_cast<hmi_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ return get_hmi_creator_factory(function_id, message_type).create(message);
+ } else {
+ mobile_apis::messageType::eType message_type =
+ static_cast<mobile_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ return get_mobile_creator_factory(function_id, message_type)
+ .create(message);
+ }
+}
+
+bool RCCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource message_source)
+ const {
+ using app_mngr::commands::Command;
+ if (Command::SOURCE_HMI == message_source) {
+ return get_hmi_creator_factory(
+ static_cast<hmi_apis::FunctionID::eType>(function_id),
+ hmi_apis::messageType::INVALID_ENUM).CanBeCreated();
+ } else {
+ return get_mobile_creator_factory(
+ static_cast<mobile_api::FunctionID::eType>(function_id),
+ mobile_api::messageType::INVALID_ENUM).CanBeCreated();
+ }
+}
+
+CommandCreator& RCCommandFactory::get_mobile_creator_factory(
+ mobile_api::FunctionID::eType id,
+ mobile_api::messageType::eType message_type) const {
+ LOG4CXX_DEBUG(logger_,
+ "CreateMobileCommand function_id: " << id << " message_type: "
+ << message_type);
+ RCCommandCreatorFactory rc_factory(params_);
+
+ switch (id) {
+ case mobile_apis::FunctionID::ButtonPressID: {
+ return mobile_api::messageType::request == message_type
+ ? rc_factory.GetCreator<commands::ButtonPressRequest>()
+ : rc_factory.GetCreator<commands::ButtonPressResponse>();
+ }
+ case mobile_apis::FunctionID::GetInteriorVehicleDataID: {
+ return mobile_api::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::GetInteriorVehicleDataRequest>()
+ : rc_factory
+ .GetCreator<commands::GetInteriorVehicleDataResponse>();
+ }
+ case mobile_apis::FunctionID::SetInteriorVehicleDataID: {
+ return mobile_api::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::SetInteriorVehicleDataRequest>()
+ : rc_factory
+ .GetCreator<commands::SetInteriorVehicleDataResponse>();
+ }
+ case mobile_apis::FunctionID::OnInteriorVehicleDataID: {
+ return rc_factory
+ .GetCreator<commands::OnInteriorVehicleDataNotification>();
+ }
+ default: { return rc_factory.GetCreator<RCInvalidCommand>(); }
+ }
+}
+
+CommandCreator& RCCommandFactory::get_hmi_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type) const {
+ LOG4CXX_DEBUG(logger_,
+ "CreateHMICommand function_id: " << id << " message_type: "
+ << message_type);
+
+ RCCommandCreatorFactory rc_factory(params_);
+
+ switch (id) {
+ case hmi_apis::FunctionID::Buttons_ButtonPress: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory.GetCreator<commands::RCButtonPressRequest>()
+ : rc_factory.GetCreator<commands::RCButtonPressResponse>();
+ }
+ case hmi_apis::FunctionID::RC_GetInteriorVehicleData: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::RCGetInteriorVehicleDataRequest>()
+ : rc_factory.GetCreator<
+ commands::RCGetInteriorVehicleDataResponse>();
+ }
+ case hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory.GetCreator<
+ commands::RCGetInteriorVehicleDataConsentRequest>()
+ : rc_factory.GetCreator<
+ commands::RCGetInteriorVehicleDataConsentResponse>();
+ }
+ case hmi_apis::FunctionID::RC_SetInteriorVehicleData: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::RCSetInteriorVehicleDataRequest>()
+ : rc_factory.GetCreator<
+ commands::RCSetInteriorVehicleDataResponse>();
+ }
+ case hmi_apis::FunctionID::RC_OnInteriorVehicleData: {
+ return rc_factory
+ .GetCreator<commands::RCOnInteriorVehicleDataNotification>();
+ }
+ case hmi_apis::FunctionID::RC_OnRemoteControlSettings: {
+ return rc_factory
+ .GetCreator<commands::RCOnRemoteControlSettingsNotification>();
+ }
+ default: { return rc_factory.GetCreator<RCInvalidCommand>(); }
+ }
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
new file mode 100644
index 0000000000..0bdec55733
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
@@ -0,0 +1,118 @@
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message.h"
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+const std::function<std::string(const std::string& module_type)>
+RCHelpers::GetModuleTypeToDataMapping() {
+ auto mapping_lambda = [](const std::string& module_type) -> std::string {
+ static std::map<std::string, std::string> mapping = {
+ {enums_value::kClimate, message_params::kClimateControlData},
+ {enums_value::kRadio, message_params::kRadioControlData},
+ {enums_value::kSeat, message_params::kSeatControlData},
+ {enums_value::kAudio, message_params::kAudioControlData},
+ {enums_value::kLight, message_params::kLightControlData},
+ {enums_value::kHmiSettings, message_params::kHmiSettingsControlData}};
+ auto it = mapping.find(module_type);
+ if (mapping.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown module type" << module_type);
+ return std::string();
+ }
+ return it->second;
+ };
+
+ return mapping_lambda;
+}
+
+const std::function<std::string(const std::string& module_type)>
+RCHelpers::GetModuleTypeToCapabilitiesMapping() {
+ auto mapping_lambda = [](const std::string& module_type) -> std::string {
+ static std::map<std::string, std::string> mapping = {
+ {enums_value::kClimate, strings::kclimateControlCapabilities},
+ {enums_value::kRadio, strings::kradioControlCapabilities},
+ {enums_value::kSeat, strings::kseatControlCapabilities},
+ {enums_value::kAudio, strings::kaudioControlCapabilities},
+ {enums_value::kLight, strings::klightControlCapabilities},
+ {enums_value::kHmiSettings, strings::khmiSettingsControlCapabilities}};
+ auto it = mapping.find(module_type);
+ if (mapping.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown module type" << module_type);
+ return std::string();
+ }
+ return it->second;
+ };
+
+ return mapping_lambda;
+}
+
+const std::vector<std::string> RCHelpers::GetModulesList() {
+ using namespace enums_value;
+ return {kClimate, kRadio, kSeat, kAudio, kLight, kHmiSettings};
+}
+
+RCAppExtensionPtr RCHelpers::GetRCExtension(
+ application_manager::Application& app) {
+ auto extension_interface = app.QueryInterface(RCRPCPlugin::kRCPluginID);
+ auto extension =
+ std::static_pointer_cast<RCAppExtension>(extension_interface);
+ return extension;
+}
+
+smart_objects::SmartObjectSPtr RCHelpers::CreateUnsubscribeRequestToHMI(
+ const std::string& module_type, const uint32_t correlation_id) {
+ using namespace smart_objects;
+ namespace commands = application_manager::commands;
+ namespace am_strings = application_manager::strings;
+
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
+ SmartObject& params = (*message)[am_strings::params];
+ SmartObject& msg_params = (*message)[am_strings::msg_params];
+
+ params[am_strings::message_type] =
+ static_cast<int>(application_manager::kRequest);
+ params[am_strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ params[am_strings::protocol_type] = commands::CommandImpl::hmi_protocol_type_;
+ params[am_strings::correlation_id] = correlation_id;
+ params[am_strings::function_id] =
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData;
+ msg_params[message_params::kSubscribe] = false;
+ msg_params[message_params::kModuleType] = module_type;
+ return message;
+}
+
+std::vector<application_manager::ApplicationSharedPtr>
+RCHelpers::AppsSubscribedToModuleType(
+ application_manager::ApplicationManager& app_mngr,
+ const std::string& module_type) {
+ std::vector<application_manager::ApplicationSharedPtr> result;
+ auto rc_apps = RCRPCPlugin::GetRCApplications(app_mngr);
+ for (auto& app : rc_apps) {
+ auto rc_ext = RCHelpers::GetRCExtension(*app);
+ DCHECK_OR_RETURN(rc_ext, result);
+ if (rc_ext->IsSubscibedToInteriorVehicleData(module_type)) {
+ result.push_back(app);
+ }
+ }
+ return result;
+}
+
+RCHelpers::AppsModules RCHelpers::GetApplicationsAllowedModules(
+ app_mngr::ApplicationManager& app_mngr) {
+ auto apps_list = RCRPCPlugin::GetRCApplications(app_mngr);
+ RCHelpers::AppsModules result;
+ for (auto& app_ptr : apps_list) {
+ std::vector<std::string> allowed_modules;
+ app_mngr.GetPolicyHandler().GetModuleTypes(app_ptr->policy_app_id(),
+ &allowed_modules);
+ std::sort(allowed_modules.begin(), allowed_modules.end());
+ result[app_ptr] = allowed_modules;
+ }
+ return result;
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
new file mode 100644
index 0000000000..fd6b4e86ac
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
@@ -0,0 +1,141 @@
+/*
+ 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 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 "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+#include "rc_rpc_plugin/interior_data_manager_impl.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "utils/helpers.h"
+#include <memory>
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+namespace plugins = application_manager::plugin_manager;
+
+bool RCRPCPlugin::Init(
+ application_manager::ApplicationManager& app_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) {
+ interior_data_cache_.reset(new InteriorDataCacheImpl());
+ interior_data_manager_.reset(new InteriorDataManagerImpl(
+ *this, *interior_data_cache_, app_manager, rpc_service));
+
+ resource_allocation_manager_.reset(
+ new ResourceAllocationManagerImpl(app_manager, rpc_service));
+ RCCommandParams params{app_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler,
+ *(resource_allocation_manager_.get()),
+ *(interior_data_cache_.get()),
+ *(interior_data_manager_.get())};
+ command_factory_.reset(new rc_rpc_plugin::RCCommandFactory(params));
+ rpc_service_ = &rpc_service;
+ app_mngr_ = &app_manager;
+ return true;
+}
+
+bool RCRPCPlugin::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource
+ message_source) {
+ return command_factory_->IsAbleToProcess(function_id, message_source);
+}
+
+std::string RCRPCPlugin::PluginName() {
+ return "RC RPC Plugin";
+}
+
+application_manager::CommandFactory& RCRPCPlugin::GetCommandFactory() {
+ return *command_factory_;
+}
+
+void RCRPCPlugin::OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) {
+ resource_allocation_manager_->OnPolicyEvent(event);
+ interior_data_manager_->OnPolicyEvent(event);
+}
+
+void RCRPCPlugin::OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {
+ if (!application->is_remote_control_supported()) {
+ return;
+ }
+ switch (event) {
+ case plugins::kApplicationRegistered: {
+ application->AddExtension(
+ std::shared_ptr<RCAppExtension>(new RCAppExtension(kRCPluginID)));
+ resource_allocation_manager_->SendOnRCStatusNotifications(
+ NotificationTrigger::APP_REGISTRATION, application);
+ break;
+ }
+ case plugins::kApplicationExit: {
+ resource_allocation_manager_->OnApplicationEvent(event, application);
+ interior_data_manager_->OnApplicationEvent(event, application);
+ break;
+ }
+ case plugins::kApplicationUnregistered: {
+ resource_allocation_manager_->OnApplicationEvent(event, application);
+ interior_data_manager_->OnApplicationEvent(event, application);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+RCRPCPlugin::Apps RCRPCPlugin::GetRCApplications(
+ application_manager::ApplicationManager& app_mngr) {
+ using application_manager::ApplicationSharedPtr;
+ using application_manager::ApplicationSet;
+ ApplicationSet accessor = app_mngr.applications().GetData();
+
+ std::vector<ApplicationSharedPtr> result;
+ for (const auto& it : accessor) {
+ if (it->is_remote_control_supported()) {
+ result.push_back(it);
+ }
+ }
+ return result;
+}
+
+} // namespace rc_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+ return new rc_rpc_plugin::RCRPCPlugin();
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
new file mode 100644
index 0000000000..ecd263b77a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
@@ -0,0 +1,507 @@
+/*
+ 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 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 "rc_rpc_plugin/resource_allocation_manager_impl.h"
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/enum_schema_item.h"
+#include "application_manager/message_helper.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+
+namespace rc_rpc_plugin {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+ResourceAllocationManagerImpl::ResourceAllocationManagerImpl(
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service)
+ : current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW)
+ , app_mngr_(app_mngr)
+ , rpc_service_(rpc_service)
+ , is_rc_enabled_(true) {}
+
+ResourceAllocationManagerImpl::~ResourceAllocationManagerImpl() {}
+
+AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const application_manager::ApplicationSharedPtr acquiring_app =
+ app_mngr_.application(app_id);
+ if (!acquiring_app) {
+ LOG4CXX_WARN(logger_, "App with app_id: " << app_id << "does not exist!");
+ return AcquireResult::IN_USE;
+ }
+
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const AllocatedResources::const_iterator allocated_it =
+ allocated_resources_.find(module_type);
+ if (allocated_resources_.end() == allocated_it) {
+ SetResourceAquired(module_type, app_id);
+ LOG4CXX_DEBUG(logger_,
+ "Resource is not acquired yet. "
+ << "App: " << app_id << " is allowed to acquire "
+ << module_type);
+ return AcquireResult::ALLOWED;
+ }
+
+ if (app_id == allocated_resources_[module_type]) {
+ LOG4CXX_DEBUG(logger_,
+ "App: " << app_id << " is already acquired resource "
+ << module_type);
+ return AcquireResult::ALLOWED;
+ }
+
+ if (IsModuleTypeRejected(module_type, app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "Driver disallowed app: " << app_id << " to acquire "
+ << module_type);
+ return AcquireResult::REJECTED;
+ }
+
+ const mobile_apis::HMILevel::eType acquiring_app_hmi_level =
+ acquiring_app->hmi_level();
+
+ if (mobile_apis::HMILevel::HMI_FULL != acquiring_app_hmi_level) {
+ LOG4CXX_DEBUG(logger_,
+ "Aquiring resources is not allowed in HMI level: "
+ << acquiring_app_hmi_level << ". App: " << app_id
+ << " is disallowed to acquire " << module_type);
+ return AcquireResult::REJECTED;
+ }
+
+ switch (current_access_mode_) {
+ case hmi_apis::Common_RCAccessMode::AUTO_DENY: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is AUTO_DENY. "
+ << "App: " << app_id << " is disallowed to acquire "
+ << module_type);
+ return AcquireResult::IN_USE;
+ }
+ case hmi_apis::Common_RCAccessMode::ASK_DRIVER: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is ASK_DRIVER. "
+ "Driver confirmation is required for app: "
+ << app_id << " to acquire " << module_type);
+ return AcquireResult::ASK_DRIVER;
+ }
+ case hmi_apis::Common_RCAccessMode::AUTO_ALLOW: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is AUTO_ALLOW. "
+ << "App: " << app_id << " is allowed to acquire "
+ << module_type);
+
+ SetResourceAquired(module_type, app_id);
+ return AcquireResult::ALLOWED;
+ }
+ default: { DCHECK_OR_RETURN(false, AcquireResult::IN_USE); }
+ }
+}
+
+void ResourceAllocationManagerImpl::ReleaseResource(
+ const std::string& module_type, const uint32_t application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Release " << module_type << " by " << application_id);
+ SetResourceFree(module_type, application_id);
+}
+
+void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Apps app_list = RCRPCPlugin::GetRCApplications(app_mngr_);
+
+ Apps::const_iterator app = app_list.begin();
+ for (; app_list.end() != app; ++app) {
+ application_manager::ApplicationSharedPtr app_ptr = *app;
+ const uint32_t application_id = app_ptr->app_id();
+ Resources acquired_modules = GetAcquiredResources(application_id);
+ std::sort(acquired_modules.begin(), acquired_modules.end());
+
+ Resources allowed_modules;
+ app_mngr_.GetPolicyHandler().GetModuleTypes((*app)->policy_app_id(),
+ &allowed_modules);
+ std::sort(allowed_modules.begin(), allowed_modules.end());
+
+ LOG4CXX_DEBUG(logger_,
+ "Acquired modules: " << acquired_modules.size()
+ << " , allowed modules: "
+ << allowed_modules.size());
+
+ Resources disallowed_modules;
+ std::set_difference(acquired_modules.begin(),
+ acquired_modules.end(),
+ allowed_modules.begin(),
+ allowed_modules.end(),
+ std::back_inserter(disallowed_modules));
+
+ auto rc_extention = RCHelpers::GetRCExtension(**app);
+ Resources::const_iterator module = disallowed_modules.begin();
+ for (; disallowed_modules.end() != module; ++module) {
+ ReleaseResource(*module, application_id);
+ }
+ if (!disallowed_modules.empty()) {
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+ }
+ }
+}
+
+template <typename EnumType>
+EnumType StringToEnum(const std::string& str) {
+ using smart_objects::EnumConversionHelper;
+ EnumType val;
+ EnumConversionHelper<EnumType>::StringToEnum(str, &val);
+ return val;
+}
+
+void ConstructOnRCStatusNotificationParams(
+ smart_objects::SmartObject& msg_params,
+ const std::map<std::string, uint32_t>& allocated_resources,
+ const std::vector<std::string>& supported_resources,
+ const uint32_t app_id) {
+ namespace strings = application_manager::strings;
+ namespace message_params = rc_rpc_plugin::message_params;
+ using smart_objects::SmartObject;
+ using smart_objects::SmartType_Map;
+ using smart_objects::SmartType_Array;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto modules_inserter = [](SmartObject& result_modules) {
+ return [&result_modules](const std::string& module_name) {
+ smart_objects::SmartObject module_data =
+ SmartObject(smart_objects::SmartType_Map);
+ auto module_type =
+ StringToEnum<mobile_apis::ModuleType::eType>(module_name);
+ module_data[message_params::kModuleType] = module_type;
+ result_modules.asArray()->push_back(module_data);
+ };
+ };
+ SmartObject allocated_modules = SmartObject(SmartType_Array);
+ for (const auto& module : allocated_resources) {
+ if (module.second == app_id) {
+ modules_inserter(allocated_modules)(module.first);
+ }
+ }
+ SmartObject free_modules = SmartObject(SmartType_Array);
+ for (auto& module : supported_resources) {
+ if (allocated_resources.find(module) == allocated_resources.end()) {
+ modules_inserter(free_modules)(module);
+ }
+ }
+
+ msg_params[message_params::kAllocatedModules] = allocated_modules;
+ msg_params[message_params::kFreeModules] = free_modules;
+}
+
+smart_objects::SmartObjectSPtr
+ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToMobile(
+ const application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using application_manager::MessageHelper;
+ auto msg_to_mobile = MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::OnRCStatusID, app->app_id());
+ auto& msg_params = (*msg_to_mobile)[application_manager::strings::msg_params];
+ if (is_rc_enabled()) {
+ ConstructOnRCStatusNotificationParams(msg_params,
+ allocated_resources_,
+ RCHelpers::GetModulesList(),
+ app->app_id());
+ } else {
+ msg_params[message_params::kAllocatedModules] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[message_params::kFreeModules] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+ return msg_to_mobile;
+}
+
+smart_objects::SmartObjectSPtr
+ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToHmi(
+ const application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using application_manager::MessageHelper;
+ auto msg_to_hmi =
+ MessageHelper::CreateHMINotification(hmi_apis::FunctionID::RC_OnRCStatus);
+ auto& msg_params = (*msg_to_hmi)[application_manager::strings::msg_params];
+ ConstructOnRCStatusNotificationParams(msg_params,
+ allocated_resources_,
+ RCHelpers::GetModulesList(),
+ app->app_id());
+ msg_params[application_manager::strings::app_id] = app->hmi_app_id();
+ return msg_to_hmi;
+}
+
+void ResourceAllocationManagerImpl::SetResourceAquired(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ allocated_resources_[module_type] = app_id;
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+}
+
+void ResourceAllocationManagerImpl::SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr msg_to_mobile;
+ smart_objects::SmartObjectSPtr msg_to_hmi;
+ if (NotificationTrigger::APP_REGISTRATION == event) {
+ DCHECK(application);
+ msg_to_mobile = CreateOnRCStatusNotificationToMobile(application);
+ (*msg_to_mobile)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = is_rc_enabled();
+ rpc_service_.SendMessageToMobile(msg_to_mobile);
+ } else {
+ auto rc_apps = RCRPCPlugin::GetRCApplications(app_mngr_);
+ for (const auto& rc_app : rc_apps) {
+ msg_to_mobile = CreateOnRCStatusNotificationToMobile(rc_app);
+ (*msg_to_mobile)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = is_rc_enabled();
+ rpc_service_.SendMessageToMobile(msg_to_mobile);
+ msg_to_hmi = CreateOnRCStatusNotificationToHmi(rc_app);
+ rpc_service_.SendMessageToHMI(msg_to_hmi);
+ }
+ }
+}
+
+bool ResourceAllocationManagerImpl::is_rc_enabled() const {
+ return is_rc_enabled_;
+}
+
+void ResourceAllocationManagerImpl::set_rc_enabled(const bool value) {
+ is_rc_enabled_ = value;
+ SendOnRCStatusNotifications(
+ NotificationTrigger::RC_STATE_CHANGING,
+ std::shared_ptr<application_manager::Application>());
+}
+
+void ResourceAllocationManagerImpl::SetResourceFree(
+ const std::string& module_type, const uint32_t app_id) {
+ AllocatedResources::const_iterator allocation =
+ allocated_resources_.find(module_type);
+ if (allocated_resources_.end() == allocation) {
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is not allocated.");
+ return;
+ }
+ if (app_id != allocation->second) {
+ LOG4CXX_ERROR(logger_,
+ "Resource " << module_type
+ << " is allocated by different application "
+ << allocation->second);
+ }
+ allocated_resources_.erase(allocation);
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is released.");
+}
+
+std::vector<std::string> ResourceAllocationManagerImpl::GetAcquiredResources(
+ const uint32_t application_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Resources allocated_resources;
+ AllocatedResources::const_iterator allocation = allocated_resources_.begin();
+ for (; allocated_resources_.end() != allocation; ++allocation) {
+ if (application_id == allocation->second) {
+ allocated_resources.push_back(allocation->first);
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application " << application_id << " acquired "
+ << allocated_resources.size()
+ << " resource(s).");
+
+ return allocated_resources;
+}
+
+void ResourceAllocationManagerImpl::SetResourceState(
+ const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Setting state for " << module_type << " by app_id " << app_id
+ << " to state " << state);
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const AllocatedResources::const_iterator allocated_it =
+ allocated_resources_.find(module_type);
+
+ const bool acquired = allocated_resources_.end() != allocated_it;
+ if (acquired) {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is already acquired."
+ << " Owner application id is "
+ << allocated_it->second
+ << " Changing application id is " << app_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is not acquired yet");
+ }
+ }
+
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ resources_state_[module_type] = state;
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " got state " << state);
+}
+
+bool ResourceAllocationManagerImpl::IsResourceFree(
+ const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ const ResourcesState::const_iterator resource =
+ resources_state_.find(module_type);
+
+ if (resources_state_.end() == resource) {
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is free.");
+ return true;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " state is " << resource->second);
+
+ return ResourceState::FREE == resource->second;
+}
+
+void ResourceAllocationManagerImpl::SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ if (hmi_apis::Common_RCAccessMode::ASK_DRIVER != access_mode) {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+ current_access_mode_ = access_mode;
+}
+
+hmi_apis::Common_RCAccessMode::eType
+ResourceAllocationManagerImpl::GetAccessMode() const {
+ return current_access_mode_;
+}
+
+void ResourceAllocationManagerImpl::ForceAcquireResource(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type);
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ SetResourceAquired(module_type, app_id);
+}
+
+bool ResourceAllocationManagerImpl::IsModuleTypeRejected(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ RejectedResources::iterator it =
+ rejected_resources_for_application_.find(app_id);
+
+ if (rejected_resources_for_application_.end() == it) {
+ return false;
+ }
+
+ const std::vector<std::string>& list_of_rejected_resources =
+ rejected_resources_for_application_[app_id];
+
+ return helpers::in_range(list_of_rejected_resources, module_type);
+}
+
+void ResourceAllocationManagerImpl::OnDriverDisallowed(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ auto it = rejected_resources_for_application_.find(app_id);
+
+ if (rejected_resources_for_application_.end() == it) {
+ rejected_resources_for_application_[app_id] = std::vector<std::string>();
+ }
+ std::vector<std::string>& list_of_rejected_resources =
+ rejected_resources_for_application_[app_id];
+ list_of_rejected_resources.push_back(module_type);
+}
+
+void ResourceAllocationManagerImpl::OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {
+ using application_manager::plugin_manager::ApplicationEvent;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Event " << event << " came for " << application->app_id());
+
+ if (ApplicationEvent::kApplicationExit == event ||
+ ApplicationEvent::kApplicationUnregistered == event) {
+ Resources acquired_modules = GetAcquiredResources(application->app_id());
+ Resources::const_iterator module = acquired_modules.begin();
+ for (; acquired_modules.end() != module; ++module) {
+ ReleaseResource(*module, application->app_id());
+ }
+ if (!acquired_modules.empty()) {
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+ }
+ }
+}
+
+void ResourceAllocationManagerImpl::OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) {
+ using application_manager::plugin_manager::PolicyEvent;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Event " << event);
+
+ if (PolicyEvent::kApplicationPolicyUpdated == event) {
+ ProcessApplicationPolicyUpdate();
+ return;
+ }
+
+ if (PolicyEvent::kApplicationsDisabled == event) {
+ ResetAllAllocations();
+ return;
+ }
+}
+
+void ResourceAllocationManagerImpl::ResetAllAllocations() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ resources_state_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ allocated_resources_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+}
+
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..c1c59d7e78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt
@@ -0,0 +1,77 @@
+# 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 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${COMPONENTS_DIR}/application_manager/test/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/rc_rpc_plugin/test/include/
+ ${COMPONENTS_DIR}/include/test/application_manager/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/test/include
+ )
+
+set (RC_TEST_SOURCES
+${CMAKE_CURRENT_SOURCE_DIR}/resource_allocation_manager_impl_test.cc
+${CMAKE_CURRENT_SOURCE_DIR}/interior_data_cache_test.cc
+)
+
+set(RC_COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${RC_COMMANDS_TEST_DIR}/*
+)
+
+set(LIBRARIES
+ RCRpcPluginStaticLib
+ ApplicationManager
+ connectionHandler
+ SmartObjects
+ ProtocolHandler
+ MessageHelper
+ connectionHandler
+ Utils
+ jsoncpp
+ gmock_main
+ dl
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
+endif()
+
+create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" )
+create_test("rc_plugin_test" "${RC_TEST_SOURCES}" "${LIBRARIES}")
+
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt
new file mode 100644
index 0000000000..9ea47dca38
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt
@@ -0,0 +1,62 @@
+# 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/rc_rpc_plugin/include/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/include/rc_rpc_plugin/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/include/rc_rpc_plugin/commands/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/test/include
+)
+
+set(RC_COMMANDS_TEST_DIR ${RC_TEST_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${RC_COMMANDS_TEST_DIR}/*
+)
+
+set(LIBRARIES
+ gmock
+ RemoteControlModule
+ Utils
+ SmartObjects
+ jsoncpp
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+ connectionHandler
+)
+
+create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" )
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
new file mode 100644
index 0000000000..59d038a790
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
@@ -0,0 +1,326 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+using test::components::application_manager_test::MockApplication;
+using test::components::commands_test::CommandRequestTest;
+using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::HMIResultCodeIs;
+using test::components::commands_test::MobileResultCodeIs;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using application_manager::commands::MessageSharedPtr;
+using ::protocol_handler::MessagePriority;
+
+namespace {
+const int kModuleId = 153u;
+const uint32_t kConnectionKey = 1u;
+const uint32_t kAppId = 0u;
+const std::string kPolicyAppId = "Test";
+}
+
+namespace rc_rpc_plugin_test {
+
+using namespace rc_rpc_plugin;
+
+class ButtonPressRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ButtonPressRequestTest()
+ : rc_capabilities_(smart_objects::SmartType_Map)
+ , mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(kModuleId)) {}
+
+ smart_objects::SmartObject ButtonCapability(
+ const mobile_apis::ButtonName::eType button_name) {
+ smart_objects::SmartObject button(smart_objects::SmartType_Map);
+ button["name"] = button_name;
+ return button;
+ }
+
+ void SetUp() OVERRIDE {
+ using namespace mobile_apis;
+
+ std::vector<ButtonName::eType> button_names = {ButtonName::AC_MAX,
+ ButtonName::AC,
+ ButtonName::RECIRCULATE,
+ ButtonName::FAN_UP,
+ ButtonName::FAN_DOWN,
+ ButtonName::TEMP_UP,
+ ButtonName::TEMP_DOWN,
+ ButtonName::DEFROST_MAX,
+ ButtonName::DEFROST,
+ ButtonName::DEFROST_REAR,
+ ButtonName::UPPER_VENT,
+ ButtonName::LOWER_VENT,
+ ButtonName::VOLUME_UP,
+ ButtonName::VOLUME_DOWN,
+ ButtonName::EJECT,
+ ButtonName::SOURCE,
+ ButtonName::SHUFFLE,
+ ButtonName::REPEAT};
+
+ smart_objects::SmartObject button_caps(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < button_names.size(); i++) {
+ button_caps[i] = ButtonCapability(button_names[i]);
+ }
+ rc_capabilities_[strings::kbuttonCapabilities] = button_caps;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(rc_app_extention_));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(&rc_capabilities_));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(kPolicyAppId,
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ nullptr)).WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::ButtonPressID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ smart_objects::SmartObject rc_capabilities_;
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<rc_rpc_plugin::RCAppExtension> rc_app_extention_;
+ test::components::policy_test::MockPolicyHandlerInterface
+ mock_policy_handler_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+};
+
+TEST_F(ButtonPressRequestTest,
+ Execute_ButtonNameMatchesModuleType_ExpectCorrectMessageSentToHMI) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+
+ // Expectations
+ const std::string resource = "CLIMATE";
+ ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::ALLOWED));
+ EXPECT_CALL(
+ mock_allocation_manager_,
+ SetResourceState(resource, kAppId, rc_rpc_plugin::ResourceState::BUSY));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress)))
+ .WillOnce(Return(true));
+
+ // Act
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(
+ ButtonPressRequestTest,
+ Execute_ButtonNameDoesNotMatchModuleType_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+ // Expectations
+
+ const std::string resource = "RADIO";
+ ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::ALLOWED));
+ EXPECT_CALL(mock_allocation_manager_, SetResourceState(resource, kAppId, _))
+ .Times(2);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_ButtonPress))).Times(0);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+
+ MessageSharedPtr hmi_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_message)[application_manager::strings::msg_params];
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ hmi_msg_params[application_manager::hmi_response::code] = response_code;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_,
+ SetResourceState(_, kAppId, rc_rpc_plugin::ResourceState::FREE))
+ .Times(2);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(true));
+
+ // Act
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::Buttons_ButtonPress);
+ event.set_smart_object(*hmi_message);
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ command->on_event(event);
+}
+
+TEST_F(ButtonPressRequestTest,
+ OnEvent_ReadOnlyParamFromHMI_ExpectFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+
+ MessageSharedPtr hmi_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_message)[application_manager::strings::params];
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::READ_ONLY;
+ hmi_msg_params[application_manager::hmi_response::code] = response_code;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_,
+ SetResourceState(_, kAppId, rc_rpc_plugin::ResourceState::FREE))
+ .Times(2);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
+ .WillOnce(Return(false));
+
+ // Act
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::Buttons_ButtonPress);
+ event.set_smart_object(*hmi_message);
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ command->on_event(event);
+}
+
+} // namespace rc_rpc_plugin_test
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
new file mode 100644
index 0000000000..25dad2dc04
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
@@ -0,0 +1,593 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
+#include "gtest/gtest.h"
+#include "application_manager/mock_application.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/message_helper.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/commands/command_request_test.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+
+#include <thread>
+#include <chrono>
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::MockApplicationManager;
+using test::components::commands_test::CommandRequestTest;
+using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::HMIResultCodeIs;
+using test::components::commands_test::MobileResultCodeIs;
+
+namespace {
+const int32_t kConnectionKey = 5u;
+const uint32_t kAppId = 0u;
+const uint32_t kAppId2 = 1u;
+const int kModuleId = 153u;
+const auto module_type = mobile_apis::ModuleType::RADIO;
+const int32_t time_frame_of_allowed_requests = 1;
+const uint32_t max_request_in_time_frame = 5u;
+}
+
+namespace rc_rpc_plugin_test {
+
+using namespace rc_rpc_plugin;
+class GetInteriorVehicleDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetInteriorVehicleDataRequestTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , mock_app2_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId))
+ , rc_app_extention2_(std::make_shared<RCAppExtension>(kModuleId))
+ , apps_lock_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app2_, app_id()).WillByDefault(Return(kAppId2));
+ ON_CALL(*mock_app_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app2_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention_));
+ ON_CALL(*mock_app2_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention2_));
+ }
+
+ /**
+ * @brief CreateBasicMessage creates message for
+ * GetInteriorVehicleData request for app1
+ * @return message shared ptr
+ */
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::GetInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ void SetUp() OVERRIDE {
+ std::pair<uint32_t, int32_t> frequency;
+ frequency.first = max_request_in_time_frame;
+ frequency.second = time_frame_of_allowed_requests;
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, get_interior_vehicle_data_frequency())
+ .WillByDefault(ReturnRef(frequency));
+
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceState(application_manager::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillByDefault(Return(application_manager::HmiInterfaces::
+ InterfaceState::STATE_AVAILABLE));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, application(kAppId2)).WillByDefault(Return(mock_app2_));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(nullptr));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(
+ _, mobile_apis::AppHMIType::eType::REMOTE_CONTROL, nullptr))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, CheckModule(_, _))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<MockApplication> mock_app2_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+ std::shared_ptr<RCAppExtension> rc_app_extention2_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ application_manager::ApplicationSet apps_;
+ const std::shared_ptr<sync_primitives::Lock> apps_lock_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
+};
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_NoSubscriptionNoCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ ON_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ // Act
+ command->Run();
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_SupscribeAppNoCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = true;
+ ON_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ // Act
+ command->Run();
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_ExpectMessageNotSentToHMI_SuccessSentToMobile_AppSubscribed_DataFromCache) {
+ // Arrange
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .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);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
+ command->Run();
+
+ // Assert
+ EXPECT_EQ((*command_result)[application_manager::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kRadioControlData],
+ radio_data);
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_LastAppSubscribedUnsubscibe_ClearCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ MessageSharedPtr hmi_response = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_response)[application_manager::strings::msg_params];
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ hmi_msg_params[application_manager::hmi_response::code] = response_code;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_interior_data_cache_, Remove(enums_value::kRadio));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_response);
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectMessageNotSentToHMI_TwoApps_OneUnsubscribed) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ apps_.insert(mock_app_);
+ apps_.insert(mock_app2_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ rc_app_extention2_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .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);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
+ command->Run();
+
+ // Assert
+ EXPECT_FALSE(
+ rc_app_extention_->IsSubscibedToInteriorVehicleData(enums_value::kRadio));
+ EXPECT_EQ((*command_result)[application_manager::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kRadioControlData],
+ radio_data);
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_CapabilitiesValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ smart_objects::SmartObject rc_capabilities;
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(&rc_capabilities));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE),
+ _)).WillOnce((Return(true)));
+ // Act
+ command->Run();
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_PolicyValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(false));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DISALLOWED), _))
+ .WillOnce((Return(true)));
+
+ // Act
+ command->Run();
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_ExpectSuccessfulResponseSentToMobile_NoCache) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params = (*mobile_message)[strings::msg_params];
+ msg_params[message_params::kModuleType] = module_type;
+
+ MessageSharedPtr hmi_response_message = CreateBasicMessage();
+ auto& hmi_response_params = (*hmi_response_message)[strings::msg_params];
+ hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ hmi_response_params[strings::connection_key] = kConnectionKey;
+
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+
+ // Act
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_response_message);
+ command->Run();
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = module_type;
+
+ MessageSharedPtr hmi_message = CreateBasicMessage();
+ auto& hmi_msg_params = (*hmi_message)[strings::params];
+ hmi_msg_params[hmi_response::code] = hmi_apis::Common_Result::READ_ONLY;
+ hmi_msg_params[strings::connection_key] = kConnectionKey;
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
+ .WillOnce(Return(true));
+
+ // Act
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_message);
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ command->Run();
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_InvalidHmiResponse_DontUnsubscibeLastApp_NoClearCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ MessageSharedPtr hmi_response = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_response)[application_manager::strings::params];
+ hmi_msg_params[application_manager::hmi_response::code] =
+ hmi_apis::Common_Result::READ_ONLY;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_interior_data_cache_, Clear()).Times(0);
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_response);
+ command->on_event(event);
+
+ // Assert
+ EXPECT_TRUE(
+ rc_app_extention_->IsSubscibedToInteriorVehicleData(enums_value::kRadio));
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectRejectDuToRequestLimitation_NoCahce) {
+ // Arrange
+ rc_app_extention_->UnsubscribeFromInteriorVehicleData(enums_value::kRadio);
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ size_t i = 0;
+ for (; i <= max_request_in_time_frame; ++i) {
+ // Expectations
+ EXPECT_CALL(mock_interior_data_manager_,
+ CheckRequestsToHMIFrequency(enums_value::kRadio))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_manager_,
+ 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));
+ // Act
+ command->Run();
+ }
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_manager_,
+ CheckRequestsToHMIFrequency(enums_value::kRadio))
+ .WillOnce(Return(false));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED), _))
+ .WillOnce(Return(false));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ // Act
+ command->Run();
+}
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
new file mode 100644
index 0000000000..b344471254
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/commands_test.h"
+#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+using ::testing::SaveArg;
+using ::testing::Mock;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::CommandsTest;
+using test::components::commands_test::CommandsTestMocks;
+
+namespace {
+const uint32_t kAppId = 0u;
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "Test";
+const int kModuleId = 153u;
+}
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+using application_manager::ApplicationSet;
+
+class OnInteriorVehicleDataNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnInteriorVehicleDataNotificationTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId))
+ , apps_lock_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention_));
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::OnInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::app_id] = kAppId;
+ smart_objects::SmartObject& msg_param =
+ (*message)[application_manager::strings::msg_params];
+ msg_param[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::CLIMATE;
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return ::std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
+ params);
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ application_manager::ApplicationSet apps_;
+ const std::shared_ptr<sync_primitives::Lock> apps_lock_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
+};
+
+TEST_F(OnInteriorVehicleDataNotificationTest,
+ Run_SendMessageToMobile_Notification) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kClimate);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Add(enums_value::kClimate, _));
+ MessageSharedPtr message;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message));
+ // Act
+ std::shared_ptr<rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>(
+ mobile_message);
+ command->Run();
+
+ // Assertions
+ ASSERT_TRUE(message.get());
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
new file mode 100644
index 0000000000..b95725e0b4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/commands_test.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+using ::testing::SaveArg;
+using ::testing::Mock;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::CommandsTest;
+using test::components::commands_test::CommandsTestMocks;
+
+namespace {
+const uint32_t kAppId = 0u;
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "Test";
+}
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+using application_manager::ApplicationSet;
+
+class RCOnRemoteControlSettingsNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCOnRemoteControlSettingsNotificationTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >()) {}
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::SetInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ smart_objects::SmartObject& msg_param =
+ (*message)[application_manager::strings::msg_params];
+ msg_param[message_params::kModuleType] = enums_value::kClimate;
+
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+};
+
+TEST_F(RCOnRemoteControlSettingsNotificationTest,
+ Run_Allowed_SetAccessMode) { // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = true;
+
+ // Expectations
+
+ ON_CALL(mock_allocation_manager_, GetAccessMode())
+ .WillByDefault(Return(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
+
+ EXPECT_CALL(mock_allocation_manager_,
+ SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
+ CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
+ mobile_message);
+
+ command->Run();
+}
+
+TEST_F(RCOnRemoteControlSettingsNotificationTest,
+ Run_NotAllowed_ResetAllAllocations) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = false;
+
+ EXPECT_CALL(mock_allocation_manager_, ResetAllAllocations());
+ EXPECT_CALL(mock_interior_data_manager_, OnDisablingRC());
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
+ CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
+ mobile_message);
+
+ command->Run();
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
new file mode 100644
index 0000000000..567d4b1e20
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/rpc_service_impl.h"
+#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/include/application_manager/command_holder_impl.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_rpc_plugin.h"
+#include "application_manager/mock_command_factory.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/message.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "hmi_message_handler/mock_hmi_message_handler.h"
+#include "interfaces/MOBILE_API.h"
+#include "include/test/protocol_handler/mock_protocol_handler.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::SaveArg;
+using ::testing::Mock;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+using am::ApplicationSet;
+using am::commands::MessageSharedPtr;
+using am::commands::CommandImpl;
+using am::plugin_manager::RPCPlugin;
+using ::smart_objects::SmartObject;
+using rc_rpc_plugin::commands::ButtonPressRequest;
+using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentResponse;
+using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentRequest;
+using rc_rpc_plugin::RCRPCPlugin;
+using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::CommandRequestTest;
+using am::plugin_manager::MockRPCPluginManager;
+using am::plugin_manager::MockRPCPlugin;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockRequestControlerSettings;
+using test::components::protocol_handler_test::MockProtocolHandler;
+using test::components::hmi_message_handler_test::MockHMIMessageHandler;
+using test::components::application_manager_test::MockHMICapabilities;
+using test::components::application_manager_test::MockCommandFactory;
+using test::components::policy_test::MockPolicyHandlerInterface;
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kAppId = 5u;
+const std::string kResource = "CLIMATE";
+const uint32_t kPluginID = RCRPCPlugin::kRCPluginID;
+} // namespace
+
+class RCGetInteriorVehicleDataConsentTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCGetInteriorVehicleDataConsentTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , command_holder(app_mngr_)
+ , request_controller(mock_request_controler)
+ , rpc_service_(app_mngr_,
+ request_controller,
+ &mock_protocol_handler,
+ &mock_hmi_handler,
+ command_holder)
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kPluginID))
+ , mock_rpc_plugin_manager(
+ std::make_shared<NiceMock<MockRPCPluginManager> >())
+ , rpc_plugin(mock_rpc_plugin)
+ , optional_mock_rpc_plugin(mock_rpc_plugin) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceState(application_manager::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillByDefault(Return(application_manager::HmiInterfaces::
+ InterfaceState::STATE_AVAILABLE));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(rc_app_extention_));
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(&rc_capabilities_));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(
+ _, mobile_apis::AppHMIType::eType::REMOTE_CONTROL, nullptr))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, CheckModule(_, _))
+ .WillByDefault(Return(true));
+ ON_CALL(app_mngr_, GetPluginManager())
+ .WillByDefault(ReturnRef(*mock_rpc_plugin_manager));
+ ON_CALL(*mock_rpc_plugin_manager, FindPluginToProcess(_, _))
+ .WillByDefault(Return(rpc_plugin));
+ ON_CALL(mock_allocation_manager_, IsResourceFree(kResource))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::ButtonPressID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ MockRequestControlerSettings mock_request_controler;
+ MockProtocolHandler mock_protocol_handler;
+ MockHMIMessageHandler mock_hmi_handler;
+ am::CommandHolderImpl command_holder;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ smart_objects::SmartObject rc_capabilities_;
+ MockRPCPlugin mock_rpc_plugin;
+ MockCommandFactory mock_command_factory;
+ am::request_controller::RequestController request_controller;
+ am::rpc_service::RPCServiceImpl rpc_service_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+ std::shared_ptr<am::plugin_manager::MockRPCPluginManager>
+ mock_rpc_plugin_manager;
+ utils::Optional<RPCPlugin> rpc_plugin;
+ utils::Optional<MockRPCPlugin> optional_mock_rpc_plugin;
+};
+
+TEST_F(RCGetInteriorVehicleDataConsentTest,
+ Run_MobileSendButtonPressMessage_HMISendASKDRIVERModeToMobile) {
+ // Arrange
+ auto mobile_message = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::ASK_DRIVER));
+ EXPECT_CALL(*optional_mock_rpc_plugin, GetCommandFactory())
+ .WillOnce(ReturnRef(mock_command_factory));
+ auto rc_consent_request =
+ CreateRCCommand<commands::RCGetInteriorVehicleDataConsentRequest>(
+ mobile_message);
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(rc_consent_request));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_RC));
+
+ // Act
+ auto command = CreateRCCommand<commands::ButtonPressRequest>(mobile_message);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(RCGetInteriorVehicleDataConsentTest,
+ Run_MobileSendButtonPressMessage_HMISendINUSEModeToMobile) {
+ // Arrange
+ auto mobile_message = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::IN_USE));
+
+ EXPECT_CALL(*optional_mock_rpc_plugin, GetCommandFactory())
+ .WillOnce(ReturnRef(mock_command_factory));
+ auto rc_consent_response =
+ CreateRCCommand<commands::RCGetInteriorVehicleDataConsentResponse>(
+ mobile_message);
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(rc_consent_response));
+ auto command = CreateRCCommand<commands::ButtonPressRequest>(mobile_message);
+
+ // Act
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
new file mode 100644
index 0000000000..b1cb8271f5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::CommandRequestTest;
+using test::components::commands_test::CommandsTestMocks;
+
+namespace {
+const uint32_t kAppId = 0u;
+const int kModuleId = 153u;
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "Test";
+}
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+
+class SetInteriorVehicleDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetInteriorVehicleDataRequestTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId)) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceState(application_manager::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillByDefault(Return(application_manager::HmiInterfaces::
+ InterfaceState::STATE_AVAILABLE));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(rc_app_extention_));
+
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ ON_CALL(mock_allocation_manager_, IsResourceFree(_))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillByDefault(Return(AcquireResult::ALLOWED));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(kPolicyAppId,
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ nullptr)).WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::SetInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+};
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithoutReadOnlyParams_ExpectResendToHMI) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kModuleData][message_params::kClimateControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
+ mobile_apis::Result::READ_ONLY),
+ application_manager::commands::Command::SOURCE_SDL));
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+}
+
+TEST_F(
+ SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithSettableAndReadOnlyParams_ExpectCutReadOnlyAndResendToHMI) {
+ // Arrange
+
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::RADIO;
+ smart_objects::SmartObject radio_control_data(smart_objects::SmartType_Map);
+ radio_control_data[message_params::kState] = true;
+ radio_control_data[message_params::kRadioEnable] = true;
+ msg_params[message_params::kModuleData][message_params::kRadioControlData] =
+ radio_control_data;
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ EXPECT_CALL(app_mngr_, RemoveHMIFakeParameters(_, _));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
+ mobile_apis::Result::OUT_OF_MEMORY),
+ application_manager::commands::Command::SOURCE_SDL));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+}
+
+TEST_F(
+ SetInteriorVehicleDataRequestTest,
+ Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::RADIO;
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
+ mobile_apis::Result::INVALID_DATA),
+ application_manager::commands::Command::SOURCE_SDL));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
new file mode 100644
index 0000000000..45465f96b0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+namespace rc_rpc_plugin_test {
+
+class MockInteriorDataCache : public rc_rpc_plugin::InteriorDataCache {
+ public:
+ MOCK_METHOD2(Add,
+ void(const std::string&, const smart_objects::SmartObject&));
+ MOCK_CONST_METHOD1(Retrieve, smart_objects::SmartObject(const std::string&));
+ MOCK_CONST_METHOD1(Contains, bool(const std::string&));
+ MOCK_METHOD1(Remove, void(const std::string&));
+ MOCK_METHOD0(Clear, void());
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h
new file mode 100644
index 0000000000..fc19c6a889
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
+namespace rc_rpc_plugin_test {
+
+class MockInteriorDataManager : public rc_rpc_plugin::InteriorDataManager {
+ public:
+ MOCK_METHOD1(OnPolicyEvent,
+ void(application_manager::plugin_manager::PolicyEvent));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(application_manager::plugin_manager::ApplicationEvent,
+ application_manager::ApplicationSharedPtr));
+ MOCK_METHOD0(OnDisablingRC, void());
+ MOCK_METHOD1(StoreRequestToHMITime, void(const std::string&));
+ MOCK_METHOD1(CheckRequestsToHMIFrequency, bool(const std::string&));
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
new file mode 100644
index 0000000000..72ace1432a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h"
+
+namespace rc_rpc_plugin_test {
+
+class MockResourceAllocationManager
+ : public rc_rpc_plugin::ResourceAllocationManager {
+ public:
+ MOCK_METHOD2(AcquireResource,
+ rc_rpc_plugin::AcquireResult::eType(
+ const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(ForceAcquireResource,
+ void(const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(OnDriverDisallowed,
+ void(const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD1(OnPolicyEvent,
+ void(application_manager::plugin_manager::PolicyEvent event));
+ MOCK_METHOD1(SetAccessMode,
+ void(const hmi_apis::Common_RCAccessMode::eType access_mode));
+ MOCK_CONST_METHOD0(GetAccessMode, hmi_apis::Common_RCAccessMode::eType());
+ MOCK_METHOD3(SetResourceState,
+ void(const std::string& module_type,
+ const uint32_t app_id,
+ const rc_rpc_plugin::ResourceState::eType state));
+ MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type));
+ MOCK_METHOD0(ResetAllAllocations, void());
+ MOCK_METHOD2(SendOnRCStatusNotifications,
+ void(rc_rpc_plugin::NotificationTrigger::eType,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_CONST_METHOD0(is_rc_enabled, bool());
+ MOCK_METHOD1(set_rc_enabled, void(const bool value));
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
new file mode 100644
index 0000000000..e6922a4c83
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
@@ -0,0 +1,160 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+
+namespace rc_rpc_plugin_test {
+
+class InteriorDataCacheTest : public ::testing::Test {};
+
+namespace {
+const uint32_t time_frame_alowed_requests = 1;
+} // namespace
+
+TEST_F(InteriorDataCacheTest,
+ InteriorDataCacheDoesNotContainRandomDataInitialy) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ std::string module_type_key = "random_module_type";
+ EXPECT_FALSE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(smart_objects::SmartType_Null, retrieved_data.getType());
+}
+
+TEST_F(InteriorDataCacheTest, CheckThatCacheContansDataAfterAdding) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(data, retrieved_data);
+}
+
+TEST_F(InteriorDataCacheTest, DataDoesNotExistAfterClear) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto Retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(Retrieved_data, data);
+ cache.Clear();
+ auto Retrieved_data_after_clear = cache.Retrieve(module_type_key);
+ EXPECT_EQ(smart_objects::SmartType_Null,
+ Retrieved_data_after_clear.getType());
+}
+
+TEST_F(InteriorDataCacheTest, MultipleDataCached) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type_key1 = "random_module_type";
+ smart_objects::SmartObject data1;
+ data1["key"] = "value1";
+ cache.Add(module_type_key1, data1);
+ EXPECT_TRUE(cache.Contains(module_type_key1));
+ auto retrieved_data1 = cache.Retrieve(module_type_key1);
+ EXPECT_EQ(data1, retrieved_data1);
+
+ std::string module_type_key2 = "random_module_type2";
+ smart_objects::SmartObject data2;
+ data2["key"] = "value2";
+ cache.Add(module_type_key2, data2);
+ EXPECT_TRUE(cache.Contains(module_type_key2));
+ auto retrieved_data2 = cache.Retrieve(module_type_key2);
+ EXPECT_EQ(retrieved_data2, data2);
+
+ ASSERT_TRUE(data1 != data2);
+ EXPECT_TRUE(data2 != retrieved_data1);
+ EXPECT_TRUE(data1 != retrieved_data2);
+}
+
+TEST_F(InteriorDataCacheTest, RemoveFromChacheSuccessful) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value1";
+ cache.Add(module_type, data);
+ EXPECT_TRUE(cache.Contains(module_type));
+ auto retrieved_data1 = cache.Retrieve(module_type);
+ EXPECT_EQ(data, retrieved_data1);
+
+ cache.Remove(module_type);
+ EXPECT_FALSE(cache.Contains(module_type));
+ auto retreived = cache.Retrieve(module_type);
+ EXPECT_EQ(smart_objects::SmartType_Null, retreived.getType());
+}
+
+TEST_F(InteriorDataCacheTest, RemoveNotExistingNoSideEffects) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ cache.Remove("some other module_type");
+
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(data, retrieved_data);
+}
+
+TEST_F(InteriorDataCacheTest, Exist2ModuleTypesRemoveOneAnotherOneLeft) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type_key1 = "random_module_type";
+ smart_objects::SmartObject data1;
+ data1["key"] = "value1";
+ cache.Add(module_type_key1, data1);
+
+ std::string module_type_key2 = "random_module_type2";
+ smart_objects::SmartObject data2;
+ data2["key"] = "value2";
+ cache.Add(module_type_key2, data2);
+
+ ASSERT_TRUE(data1 != data2);
+
+ cache.Remove(module_type_key1);
+ EXPECT_FALSE(cache.Contains(module_type_key1));
+ EXPECT_TRUE(cache.Contains(module_type_key2));
+
+ auto retrieved_data1 = cache.Retrieve(module_type_key1);
+ EXPECT_EQ(smart_objects::SmartType_Null, retrieved_data1.getType());
+ auto retrieved_data2 = cache.Retrieve(module_type_key2);
+ EXPECT_EQ(data2, retrieved_data2);
+}
+
+} // rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
new file mode 100644
index 0000000000..86c58b9d46
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
@@ -0,0 +1,668 @@
+/*
+ * 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 <algorithm>
+#include "gtest/gtest.h"
+
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_service.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::application_manager_test::MockRPCService;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::testing::Eq;
+using ::testing::DoAll;
+using ::testing::SetArgPointee;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+
+namespace {
+const bool kDeviceHandle = 1u;
+const std::string kModuleType1 = "CLIMATE";
+const std::string kModuleType2 = "RADIO";
+const int32_t kConnectionKey = 5;
+const int32_t kCorrelationId = 5;
+const uint32_t kAppId1 = 11u;
+const uint32_t kHMIAppId1 = 1u;
+const uint32_t kAppId2 = 22u;
+const std::string policy_app_id_1_ = "policy_id_1";
+const uint32_t kSizeOfModules = 6u;
+}
+
+namespace rc_rpc_plugin_test {
+
+using namespace rc_rpc_plugin;
+
+class RAManagerTest : public ::testing::Test {
+ public:
+ RAManagerTest()
+ : message_(std::make_shared<Message>(MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc)))
+ , mock_app_1_(std::make_shared<NiceMock<MockApplication> >())
+ , mock_app_2_(std::make_shared<NiceMock<MockApplication> >())
+ , apps_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_ptr_) {
+ ON_CALL(mock_app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ auto plugin_id = rc_rpc_plugin::RCRPCPlugin::kRCPluginID;
+ app_ext_ptr_ = std::make_shared<rc_rpc_plugin::RCAppExtension>(plugin_id);
+ ON_CALL(*mock_app_1_, app_id()).WillByDefault(Return(kAppId1));
+
+ OnRCStatusNotificationExpectations();
+ }
+
+ void CheckResultWithHMILevelAndAccessMode(
+ ResourceAllocationManagerImpl& ra_manager,
+ mobile_apis::HMILevel::eType app_level,
+ const rc_rpc_plugin::AcquireResult::eType expected_result,
+ const hmi_apis::Common_RCAccessMode::eType access_mode);
+
+ void OnRCStatusNotificationExpectations();
+
+ protected:
+ NiceMock<MockApplicationManager> mock_app_mngr_;
+ NiceMock<MockRPCService> mock_rpc_service_;
+ test::components::policy_test::MockPolicyHandlerInterface
+ mock_policy_handler_;
+ application_manager::MessagePtr message_;
+
+ application_manager::AppExtensionPtr app_ext_ptr_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_1_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_2_;
+ application_manager::ApplicationSet apps_;
+ std::shared_ptr<sync_primitives::Lock> apps_lock_ptr_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
+};
+
+void RAManagerTest::CheckResultWithHMILevelAndAccessMode(
+ ResourceAllocationManagerImpl& ra_manager,
+ mobile_apis::HMILevel::eType app_level,
+ const AcquireResult::eType expected_result,
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ // Arrange
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ ra_manager.SetAccessMode(access_mode);
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level()).WillOnce(Return(app_level));
+ // Second app tries to get already acquired resource by 1st app
+ EXPECT_EQ(expected_result, ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+void RAManagerTest::OnRCStatusNotificationExpectations() {
+ ON_CALL(mock_app_mngr_, application(kAppId1))
+ .WillByDefault(Return(mock_app_1_));
+ ON_CALL(*mock_app_1_, QueryInterface(rc_rpc_plugin::RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(app_ext_ptr_));
+ apps_.insert(mock_app_1_);
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(apps_da_));
+}
+
+TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) {
+ // Arrange
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ // Act & Assert
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(RAManagerTest,
+ AcquireResource_AppRegisteredAnyHmiLevelResourceFree_Expect_Allowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ // Act & Assert
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_AppInAnyHmiLevelWantsToAcquireSameResourceTwice_Expect_Allowed) {
+ // Arrange
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ // Same app tries to get already acquired resource
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_NotInFULLWantsToGetAcquiredResource_Expect_Rejected) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_BACKGROUND;
+ const AcquireResult::eType expected_result = AcquireResult::REJECTED;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_ALLOW;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_DENY_Expect_InUse) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::IN_USE;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_DENY;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_ALLOW_Expect_Allowed) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::ALLOWED;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_ALLOW;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_ASK_DRIVER_Expect_AskDriver) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::ASK_DRIVER;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::ASK_DRIVER;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(RAManagerTest,
+ AcquireResource_AcquiredModuleIsRejectedForApp2_ExpectApp2Rejected) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+ EXPECT_EQ(AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ ra_manager.OnDriverDisallowed(kModuleType1, kAppId2);
+
+ // Assert
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_EQ(AcquireResult::REJECTED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppExit_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationExit, mock_app_1_);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
+ EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationExit, app_ptr);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ RCAppExtensionPtr rc_extention_ptr =
+ std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
+ rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_1_);
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationUnregistered, app_ptr);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
+ EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
+
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationUnregistered, app_ptr);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ application_manager::ApplicationSet apps;
+ apps.insert(mock_app_1_);
+ std::shared_ptr<sync_primitives::Lock> apps_lock =
+ std::make_shared<sync_primitives::Lock>();
+ DataAccessor<application_manager::ApplicationSet> apps_da(apps, apps_lock);
+
+ EXPECT_CALL(mock_app_mngr_, applications()).WillRepeatedly(Return(apps_da));
+
+ RCAppExtensionPtr rc_extention_ptr =
+ std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
+ rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillRepeatedly(Return(rc_extention_ptr));
+
+ // Act
+ ra_manager.OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent::kApplicationsDisabled);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId2));
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
+}
+
+TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ RCAppExtensionPtr rc_extention_ptr =
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(
+ application_manager::AppExtensionUID(
+ rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillRepeatedly(Return(rc_extention_ptr));
+
+ ON_CALL(*mock_app_1_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ EXPECT_CALL(*mock_app_1_, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ application_manager::ApplicationSet apps;
+ apps.insert(mock_app_1_);
+ std::shared_ptr<sync_primitives::Lock> apps_lock =
+ std::make_shared<sync_primitives::Lock>();
+ DataAccessor<application_manager::ApplicationSet> apps_da(apps, apps_lock);
+
+ EXPECT_CALL(mock_app_mngr_, applications()).WillRepeatedly(Return(apps_da));
+
+ Resources allowed_modules;
+ allowed_modules.push_back(kModuleType1);
+
+ EXPECT_CALL(mock_policy_handler_, GetModuleTypes(policy_app_id_1_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(allowed_modules), Return(true)));
+
+ // Act
+ ra_manager.OnPolicyEvent(application_manager::plugin_manager::PolicyEvent::
+ kApplicationPolicyUpdated);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId2));
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
+}
+
+TEST_F(RAManagerTest, GetAccessMode_ExpectedSameAsHadSet) {
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_DENY);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_DENY,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::ASK_DRIVER,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_ALLOW);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_ALLOW,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::INVALID_ENUM);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::INVALID_ENUM,
+ ra_manager.GetAccessMode());
+}
+
+TEST_F(RAManagerTest, OnRCStatus_AppRegistation_RC_allowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(NotificationTrigger::APP_REGISTRATION,
+ mock_app_1_);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_AppRegistation_RC_disallowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.set_rc_enabled(false);
+
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(NotificationTrigger::APP_REGISTRATION,
+ mock_app_1_);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), false);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ 0u);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_RCStateChanging_RC_disabling) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.set_rc_enabled(false);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), false);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_RCStateChanging_RC_enabling) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.set_rc_enabled(true);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_ModuleAllocation) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 1u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules - 1u);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 1u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules - 1u);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+} // namespace rc_rpc_plugin
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
new file mode 100644
index 0000000000..11dd35d061
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt
@@ -0,0 +1,77 @@
+# 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 copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories(include)
+
+set (COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands
+)
+
+set (MOBILE_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/mobile
+)
+
+set (HMI_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/hmi
+)
+
+collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
+collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(RPC_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ Utils
+ Policy
+)
+
+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})
+target_link_libraries("sdl_rpc_plugin" ${LIBRARIES})
+
+set(INSTALL_DESTINATION bin)
+
+install(TARGETS sdl_rpc_plugin
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h
new file mode 100644
index 0000000000..7b0911fef9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ActivateAppRequest command class
+ **/
+class ActivateAppRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ActivateAppRequest(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 ActivateAppRequest class destructor
+ **/
+ virtual ~ActivateAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h
new file mode 100644
index 0000000000..f937b4f63b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ActivateAppResponse command class
+ **/
+class ActivateAppResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ActivateAppResponse(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 ActivateAppResponse class destructor
+ **/
+ virtual ~ActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h
new file mode 100644
index 0000000000..4e9e4d54d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddStatisticsInfoNotification command class
+ **/
+class AddStatisticsInfoNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief AddStatisticsInfoNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddStatisticsInfoNotification(
+ 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 AddStatisticsInfoNotification class destructor
+ **/
+ virtual ~AddStatisticsInfoNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddStatisticsInfoNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h
new file mode 100644
index 0000000000..45acb3a424
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsRequest command class
+ **/
+class AllowAllAppsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief AllowAllAppsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAllAppsRequest(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 AllowAllAppsRequest class destructor
+ **/
+ virtual ~AllowAllAppsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h
new file mode 100644
index 0000000000..41d1c9e752
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsResponse command class
+ **/
+class AllowAllAppsResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAllAppsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAllAppsResponse(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 AllowAllAppsResponse class destructor
+ **/
+ virtual ~AllowAllAppsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h
new file mode 100644
index 0000000000..b3a2d88d7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAppRequest command class
+ **/
+class AllowAppRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief AllowAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAppRequest(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 AllowAppRequest class destructor
+ **/
+ virtual ~AllowAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h
new file mode 100644
index 0000000000..55637e1756
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAppResponse command class
+ **/
+class AllowAppResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAppResponse(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 AllowAppResponse class destructor
+ **/
+ virtual ~AllowAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h
new file mode 100644
index 0000000000..2208671e0b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+/**
+ * @brief The BasicCommunicationGetSystemTimeRequest class sends the request
+ * to the HMI in order to receive current system time.
+ */
+class BasicCommunicationGetSystemTimeRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationGetSystemTimeRequest does nothing except of
+ * initializing base class with the passed parameters.
+ * @param message the message to send to HMI
+ * @param application_manager application manager. Location service which
+ * is provides neccessary api to send the request.
+ */
+ BasicCommunicationGetSystemTimeRequest(
+ 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 onTimeOut allows to handle case when
+ * system does not respond for certain request in
+ * appropriate time window.
+ */
+ void onTimeOut() FINAL;
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
new file mode 100644
index 0000000000..90160d9953
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+#include "utils/macro.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+/**
+ * @brief The BasicCommunicationGetSystemTimeResponse class represents the
+ * HMI response which is contains data obtained from HMI.
+ */
+class BasicCommunicationGetSystemTimeResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationGetSystemTimeResponse does nothing except of
+ * initializing base class with the passed parameters.
+ * @param message the message to send to HMI
+ * @param application_manager Location service which which is provides
+ * neccessary api to send the request.
+ */
+ BasicCommunicationGetSystemTimeResponse(
+ 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 Run takes the message obtained from the HMI and
+ * sends this data to the subscribed on certain event class
+ */
+ void Run() FINAL;
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h
new file mode 100644
index 0000000000..2ac1be2580
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAwakeSDLNotification command class
+ **/
+class OnAwakeSDLNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAwakeSDLNotification class constructor
+ * @param message Incoming SmartObject message
+ * @param application_manager reference to ApplicationManager instance
+ **/
+ OnAwakeSDLNotification(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 OnAwakeSDLNotification class destructor
+ **/
+ virtual ~OnAwakeSDLNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAwakeSDLNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h
new file mode 100644
index 0000000000..a7eb820146
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemRequest command class
+ **/
+class BasicCommunicationSystemRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationSystemRequest(
+ 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 BasicCommunicationSystemRequest class destructor
+ **/
+ virtual ~BasicCommunicationSystemRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h
new file mode 100644
index 0000000000..20483a45e3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemResponse command class
+ **/
+class BasicCommunicationSystemResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationSystemResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief BasicCommunicationSystemResponse class destructor
+ **/
+ virtual ~BasicCommunicationSystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h
new file mode 100644
index 0000000000..5c650fb8e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class ButtonGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ButtonGetCapabilitiesRequest(
+ 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 ButtonGetCapabilitiesRequest class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h
new file mode 100644
index 0000000000..bf2f15c18a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesResponse command class
+ **/
+class ButtonGetCapabilitiesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ButtonGetCapabilitiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ButtonGetCapabilitiesResponse class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h
new file mode 100644
index 0000000000..635b0579f4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ClosePopupRequest command class
+ **/
+class ClosePopupRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ClosePopupRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ClosePopupRequest(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 ClosePopupRequest class destructor
+ **/
+ virtual ~ClosePopupRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h
new file mode 100644
index 0000000000..199b40f070
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ClosePopupResponse command class
+ **/
+class ClosePopupResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ClosePopupResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ClosePopupResponse(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 ClosePopupResponse class destructor
+ **/
+ virtual ~ClosePopupResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h
new file mode 100644
index 0000000000..a70bff2553
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DecryptCertificateRequest command class
+ **/
+class DecryptCertificateRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief DecryptCertificateRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DecryptCertificateRequest(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 Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DecryptCertificateRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h
new file mode 100644
index 0000000000..88b216eeea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DecryptCertificateResponse command class
+ **/
+class DecryptCertificateResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief DecryptCertificateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DecryptCertificateResponse(
+ 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 DecryptCertificateResponse class destructor
+ **/
+ virtual ~DecryptCertificateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DecryptCertificateResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h
new file mode 100644
index 0000000000..fa0efb90e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+/**
+ * @brief DialNumberRequest command class
+ **/
+class DialNumberRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief DialNumberRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DialNumberRequest(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 DialNumberRequest class destructor
+ **/
+ virtual ~DialNumberRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h
new file mode 100644
index 0000000000..33d4788eca
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief DialNumberResponse command class
+ **/
+class DialNumberResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief DialNumberResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DialNumberResponse(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 DialNumberResponse class destructor
+ **/
+ virtual ~DialNumberResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h
new file mode 100644
index 0000000000..d771167798
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetSystemInfoRequest command class
+ **/
+class GetSystemInfoRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief GetSystemInfoRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetSystemInfoRequest(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 GetSystemInfoRequest class destructor
+ **/
+ virtual ~GetSystemInfoRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h
new file mode 100644
index 0000000000..5bf5f41b73
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+struct SystemInfo {
+ std::string ccpu_version;
+ std::string wers_country_code;
+ std::string language;
+};
+
+/**
+ * @brief GetSystemInfoResponse command class
+ **/
+class GetSystemInfoResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief GetSystemInfoResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetSystemInfoResponse(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 GetSystemInfoResponse class destructor
+ **/
+ virtual ~GetSystemInfoResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ const SystemInfo GetSystemInfo(
+ const hmi_apis::Common_Result::eType code) const;
+
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h
new file mode 100644
index 0000000000..93b414c8c4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+/**
+ * @brief GetUrls command class
+ **/
+class GetUrls : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief GetUrls class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetUrls(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 GetUrls class destructor
+ **/
+ virtual ~GetUrls();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+#ifdef PROPRIETARY_MODE
+ /**
+ * @brief Processes URLs collecting for policy service
+ * @param endpoints Endpoints section of policy table
+ */
+ void ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints);
+#endif // PROPRIETARY_MODE
+
+ /**
+ * @brief Process URLs collecting for service
+ * @param endpoints Endpoints section of policy table
+ */
+ void ProcessServiceURLs(const policy::EndpointUrls& endpoints);
+
+ /**
+ * @brief Sends response to HMI
+ * @param result Result code
+ */
+ void SendResponseToHMI(hmi_apis::Common_Result::eType result);
+
+ DISALLOW_COPY_AND_ASSIGN(GetUrls);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h
new file mode 100644
index 0000000000..1ff38194b8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class GetUrlsResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief GetUrlsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetUrlsResponse(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 GetUrlsResponse class destructor
+ **/
+ virtual ~GetUrlsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h
new file mode 100644
index 0000000000..34c10cedf1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedRequest command class
+ **/
+class MixingAudioSupportedRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ MixingAudioSupportedRequest(
+ 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 MixingAudioSupportedRequest class destructor
+ **/
+ virtual ~MixingAudioSupportedRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h
new file mode 100644
index 0000000000..5c67666225
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedResponse command class
+ **/
+class MixingAudioSupportedResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ MixingAudioSupportedResponse(
+ 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 MixingAudioSupportedResponse class destructor
+ **/
+ virtual ~MixingAudioSupportedResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h
new file mode 100644
index 0000000000..3f63ef883d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverRequest command class
+ **/
+class NaviAlertManeuverRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviAlertManeuverRequest(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 NaviAlertManeuverRequest class destructor
+ **/
+ virtual ~NaviAlertManeuverRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h
new file mode 100644
index 0000000000..7d7c4de85e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverResponse command class
+ **/
+class NaviAlertManeuverResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviAlertManeuverResponse(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 NaviAlertManeuverResponse class destructor
+ **/
+ virtual ~NaviAlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h
new file mode 100644
index 0000000000..80e948ad25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamRequest command class
+ **/
+class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief AudioStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStartStreamRequest(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 OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~AudioStartStreamRequest();
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief On event callback
+ **/
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief RetryStartSession resend HMI startSession request if needed.
+ * If limit expired, set audio_stream_retry_number counter to 0
+ */
+ void RetryStartSession();
+
+ private:
+ uint32_t retry_number_;
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h
new file mode 100644
index 0000000000..926cfc36ed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamResponse command class
+ **/
+class AudioStartStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStartStreamResponse(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 AudioStartStreamResponse class destructor
+ **/
+ virtual ~AudioStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h
new file mode 100644
index 0000000000..7c5fbbdd3d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AudioStopStreamRequest command class
+ **/
+class AudioStopStreamRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief AudioStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStopStreamRequest(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 NaviStopStreamRequest class destructor
+ **/
+ virtual ~AudioStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h
new file mode 100644
index 0000000000..8eb091dd92
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class AudioStopStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStopStreamResponse(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 OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~AudioStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h
new file mode 100644
index 0000000000..dab5fc1022
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviGetWayPointsRequest command class
+ **/
+class NaviGetWayPointsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviGetWayPointsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviGetWayPointsRequest(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 NaviGetWayPointsRequest class destructor
+ **/
+ virtual ~NaviGetWayPointsRequest();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h
new file mode 100644
index 0000000000..fb93c2c64a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviGetWaypoints command class
+ **/
+class NaviGetWayPointsResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviGetWaypoints class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviGetWayPointsResponse(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 NaviGetWaypoints class destructor
+ **/
+ virtual ~NaviGetWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h
new file mode 100644
index 0000000000..404ddc9f00
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.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_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyRequest command class
+ **/
+class NaviIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief NaviIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviIsReadyRequest(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 NaviIsReadyRequest class destructor
+ **/
+ virtual ~NaviIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h
new file mode 100644
index 0000000000..7f94312d04
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyResponse command class
+ **/
+class NaviIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviIsReadyResponse(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 NaviIsReadyResponse class destructor
+ **/
+ virtual ~NaviIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h
new file mode 100644
index 0000000000..7bdf0e4787
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationRequest command class
+ */
+class NaviSendLocationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviSendLocationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ NaviSendLocationRequest(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 NaviSendLocationRequest class destructor
+ */
+ virtual ~NaviSendLocationRequest();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h
new file mode 100644
index 0000000000..6a65eb00a1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationResponse command class
+ */
+class NaviSendLocationResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSendLocationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ NaviSendLocationResponse(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 NaviSendLocationResponse class destructor
+ */
+ virtual ~NaviSendLocationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h
new file mode 100644
index 0000000000..a981b8ff81
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSetVideoConfigRequest command class
+ **/
+class NaviSetVideoConfigRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief NaviSetVideoConfigRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ NaviSetVideoConfigRequest(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 NaviSetVideoConfigRequest class destructor
+ **/
+ virtual ~NaviSetVideoConfigRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut callback
+ */
+ void onTimeOut() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h
new file mode 100644
index 0000000000..f5f9e7a5ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSetVideoConfigResponse command class
+ **/
+class NaviSetVideoConfigResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSetVideoConfigResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ NaviSetVideoConfigResponse(
+ 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 NaviSetVideoConfigResponse class destructor
+ **/
+ virtual ~NaviSetVideoConfigResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h
new file mode 100644
index 0000000000..f64bdf6ce0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTRequest command class
+ **/
+class NaviShowConstantTBTRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviShowConstantTBTRequest(
+ 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 NaviShowConstantTBTRequest class destructor
+ **/
+ virtual ~NaviShowConstantTBTRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h
new file mode 100644
index 0000000000..fd4da08cf0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTResponse command class
+ **/
+class NaviShowConstantTBTResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviShowConstantTBTResponse(
+ 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 NaviShowConstantTBTResponse class destructor
+ **/
+ virtual ~NaviShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h
new file mode 100644
index 0000000000..d5aae67661
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamRequest command class
+ **/
+class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief NaviStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStartStreamRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~NaviStartStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief On event callback
+ **/
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief RetryStartSession resend HMI startSession request if needed.
+ * If limit expired, set video_stream_retry_number counter to 0
+ */
+ void RetryStartSession();
+
+ private:
+ uint32_t retry_number_;
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h
new file mode 100644
index 0000000000..b4770e82fe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamResponse command class
+ **/
+class NaviStartStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStartStreamResponse(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 NaviStartStreamResponse class destructor
+ **/
+ virtual ~NaviStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h
new file mode 100644
index 0000000000..400c61ba07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamRequest command class
+ **/
+class NaviStopStreamRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStopStreamRequest(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 NaviStopStreamRequest class destructor
+ **/
+ virtual ~NaviStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h
new file mode 100644
index 0000000000..39512ac2bb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class NaviStopStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStopStreamResponse(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 OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~NaviStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h
new file mode 100644
index 0000000000..052c3c7151
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSubscribeWayPointsRequest command class
+ **/
+class NaviSubscribeWayPointsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviSubscribeWayPointsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviSubscribeWayPointsRequest(
+ const app_mngr::commands::MessageSharedPtr& messag,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ /**
+ * @brief NaviSubscribeWayPointsRequest class destructor
+ **/
+ virtual ~NaviSubscribeWayPointsRequest();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h
new file mode 100644
index 0000000000..73aab4633f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSubscribeWaypoints command class
+ **/
+class NaviSubscribeWayPointsResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSubscribeWaypoints class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviSubscribeWayPointsResponse(
+ 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 NaviSubscribeWaypoints class destructor
+ **/
+ virtual ~NaviSubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
new file mode 100644
index 0000000000..f20386a246
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSubscribeWayPointsRequest command class
+ **/
+class NaviUnsubscribeWayPointsRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviUnsubscribeWayPointsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUnsubscribeWayPointsRequest(
+ 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 NaviUnsubscribeWayPointsRequest class destructor
+ **/
+ virtual ~NaviUnsubscribeWayPointsRequest();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
new file mode 100644
index 0000000000..ec4f4eb963
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviUnsubscribeWaypoints command class
+ **/
+class NaviUnsubscribeWayPointsResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviUnsubscribeWaypoints class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUnsubscribeWayPointsResponse(
+ 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 NaviUnsubscribeWaypoints class destructor
+ **/
+ virtual ~NaviUnsubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h
new file mode 100644
index 0000000000..db269a65d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListRequest command class
+ **/
+class NaviUpdateTurnListRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUpdateTurnListRequest(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 NaviUpdateTurnListRequest class destructor
+ **/
+ virtual ~NaviUpdateTurnListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h
new file mode 100644
index 0000000000..20295485a3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListResponse command class
+ **/
+class NaviUpdateTurnListResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUpdateTurnListResponse(
+ 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 NaviUpdateTurnListResponse class destructor
+ **/
+ virtual ~NaviUpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h
new file mode 100644
index 0000000000..42bf877f2d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAllowSDLFunctionalityNotification command class
+ **/
+class OnAllowSDLFunctionalityNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAllowSDLFunctionalityNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAllowSDLFunctionalityNotification(
+ 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 OnAllowSDLFunctionalityNotification class destructor
+ **/
+ virtual ~OnAllowSDLFunctionalityNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h
new file mode 100644
index 0000000000..cc21d699fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppActivatedNotification command class
+ **/
+class OnAppActivatedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppActivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppActivatedNotification(
+ 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 OnAppActivatedNotification class destructor
+ **/
+ virtual ~OnAppActivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h
new file mode 100644
index 0000000000..9b4a6ba5a0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppDeactivatedNotification command class
+ **/
+class OnAppDeactivatedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppDeactivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppDeactivatedNotification(
+ 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 OnAppDeactivatedNotification class destructor
+ **/
+ virtual ~OnAppDeactivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppDeactivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h
new file mode 100644
index 0000000000..6008a8ce51
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionChangedNotification command class
+ **/
+class OnAppPermissionChangedNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppPermissionChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppPermissionChangedNotification(
+ 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 OnAppPermissionChangedNotification class destructor
+ **/
+ virtual ~OnAppPermissionChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h
new file mode 100644
index 0000000000..a751b25d85
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionConsentNotification command class
+ **/
+class OnAppPermissionConsentNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppPermissionConsentNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppPermissionConsentNotification(
+ 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 OnAppPermissionConsentNotification class destructor
+ **/
+ virtual ~OnAppPermissionConsentNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h
new file mode 100644
index 0000000000..3548786d1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppRegisteredNotification command class
+ **/
+class OnAppRegisteredNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppRegisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppRegisteredNotification(
+ 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 OnAppRegisteredNotification class destructor
+ **/
+ virtual ~OnAppRegisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppRegisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h
new file mode 100644
index 0000000000..097eb1eb28
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppUnregisteredNotification command class
+ **/
+class OnAppUnregisteredNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppUnregisteredNotification(
+ 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 OnAppUnregisteredNotification class destructor
+ **/
+ ~OnAppUnregisteredNotification() FINAL;
+
+ /**
+ * @brief Init overrides and skips replacement of app id with hmi id since
+ * 1) at the moment this notification is being sent there is no application
+ * registered in application manager
+ * 2) hmi id is already used whenever this message is being constructed, so
+ * its already there
+ * @return True in any case
+ */
+ bool Init() FINAL;
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h
new file mode 100644
index 0000000000..cac306f760
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAudioDataStreamingNotification command class
+ **/
+class OnAudioDataStreamingNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAudioDataStreamingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAudioDataStreamingNotification(
+ 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 OnAudioDataStreamingNotification class destructor
+ **/
+ virtual ~OnAudioDataStreamingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAudioDataStreamingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h
new file mode 100644
index 0000000000..b83fe1bfe0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonEventNotification command class
+ **/
+class OnButtonEventNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonEventNotification(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 Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h
new file mode 100644
index 0000000000..e996c9952c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonPressNotification command class
+ **/
+class OnButtonPressNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonPressNotification(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 Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h
new file mode 100644
index 0000000000..4ed60f9a07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.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_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonSubscriptionNotification command class
+ **/
+class OnButtonSubscriptionNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnButtonSubscriptionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonSubscriptionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnButtonSubscriptionNotification class destructor
+ **/
+ virtual ~OnButtonSubscriptionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonSubscriptionNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h
new file mode 100644
index 0000000000..99c165c12f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnDeviceChosenNotification command class
+ **/
+class OnDeviceChosenNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceChosenNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDeviceChosenNotification(
+ 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 OnDeviceChosenNotification class destructor
+ **/
+ virtual ~OnDeviceChosenNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceChosenNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h
new file mode 100644
index 0000000000..7701e2a601
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnDeviceStateChangedNotification command class
+ **/
+class OnDeviceStateChangedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceStateChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDeviceStateChangedNotification(
+ 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 OnDeviceStateChangedNotification class destructor
+ **/
+ virtual ~OnDeviceStateChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..51fb49c6bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnDriverDistractionNotification command class
+ **/
+class OnDriverDistractionNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDriverDistractionNotification(
+ 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 OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h
new file mode 100644
index 0000000000..cff0a0e617
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnEventChangedNotification command class
+ **/
+class OnEventChangedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnEventChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnEventChangedNotification(
+ 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 OnEventChangedNotification class destructor
+ **/
+ virtual ~OnEventChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnEventChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h
new file mode 100644
index 0000000000..116932d87a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_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_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnExitAllApplicationsNotification command class
+ **/
+class OnExitAllApplicationsNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitAllApplicationsNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnExitAllApplicationsNotification(
+ 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 OnExitAllApplicationsNotification class destructor
+ **/
+ virtual ~OnExitAllApplicationsNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ private:
+ /**
+ * @brief Notify's HMI that SDL stored all data required for resumption
+ **/
+ void SendOnSDLPersistenceComplete();
+
+ DISALLOW_COPY_AND_ASSIGN(OnExitAllApplicationsNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h
new file mode 100644
index 0000000000..11c397bfe7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnExitApplicationNotification command class
+ **/
+class OnExitApplicationNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitApplicationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnExitApplicationNotification(
+ 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 OnExitApplicationNotification class destructor
+ **/
+ virtual ~OnExitApplicationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnExitApplicationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h
new file mode 100644
index 0000000000..38c5dcf535
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnFileRemovedNotification command class
+ **/
+class OnFileRemovedNotification : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnFileRemovedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnFileRemovedNotification(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 OnFileRemovedNotification class destructor
+ **/
+ virtual ~OnFileRemovedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFileRemovedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h
new file mode 100644
index 0000000000..672ded9dcf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnFindApplications command class
+ **/
+class OnFindApplications : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnFindApplications class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnFindApplications(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 OnFindApplications class destructor
+ **/
+ virtual ~OnFindApplications();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFindApplications);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h
new file mode 100644
index 0000000000..85b7ed356e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnIgnitionCycleOverNotification command class
+ **/
+class OnIgnitionCycleOverNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnIgnitionCycleOverNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnIgnitionCycleOverNotification(
+ 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 OnIgnitionCycleOverNotification class destructor
+ **/
+ virtual ~OnIgnitionCycleOverNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnIgnitionCycleOverNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h
new file mode 100644
index 0000000000..075dc2cb5c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnNaviTBTClientStateNotification command class
+ **/
+class OnNaviTBTClientStateNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnNaviTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnNaviTBTClientStateNotification(
+ 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 OnNaviTBTClientStateNotification class destructor
+ **/
+ virtual ~OnNaviTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnNaviTBTClientStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h
new file mode 100644
index 0000000000..3efde9c8c1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnNaviWayPointChangeNotification command class
+ **/
+class OnNaviWayPointChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnNaviWayPointChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnNaviWayPointChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& app_man,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviWayPointChangeNotification class destructor
+ **/
+ virtual ~OnNaviWayPointChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnNaviWayPointChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h
new file mode 100644
index 0000000000..331e352795
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class OnPolicyUpdate : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnPolicyUpdate(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 OnPolicyUpdate class destructor
+ **/
+ virtual ~OnPolicyUpdate();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate);
+};
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h
new file mode 100644
index 0000000000..503013ff58
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnPutFileNotification command class
+ **/
+class OnPutFileNotification : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnPutFileNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnPutFileNotification(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 OnPutFileNotification class destructor
+ **/
+ virtual ~OnPutFileNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPutFileNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h
new file mode 100644
index 0000000000..c4adc20090
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnReadyNotification command class
+ **/
+class OnReadyNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReadyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnReadyNotification(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 OnReadyNotification class destructor
+ **/
+ virtual ~OnReadyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReadyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h
new file mode 100644
index 0000000000..c1e1b01a18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class OnReceivedPolicyUpdate : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReceivedPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnReceivedPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnReceivedPolicyUpdate class destructor
+ **/
+ ~OnReceivedPolicyUpdate() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h
new file mode 100644
index 0000000000..c5755a364c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnRecordStartdNotification command class
+ **/
+class OnRecordStartdNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnRecordStartdNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnRecordStartdNotification(
+ 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 OnRecordStartdNotification class destructor
+ **/
+ virtual ~OnRecordStartdNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnRecordStartdNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h
new file mode 100644
index 0000000000..ef2b5a34eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnResumeAudioSourceNotification command class
+ **/
+class OnResumeAudioSourceNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnResumeAudioSourceNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnResumeAudioSourceNotification(
+ 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 OnResumeAudioSourceNotification class destructor
+ **/
+ virtual ~OnResumeAudioSourceNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnResumeAudioSourceNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h
new file mode 100644
index 0000000000..34fe41de81
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSDLCloseNotification command class
+ **/
+class OnSDLCloseNotification : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLCloseNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSDLCloseNotification(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 OnSdlCloseNotification class destructor
+ **/
+ virtual ~OnSDLCloseNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLCloseNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h
new file mode 100644
index 0000000000..9fe736a595
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSDLConsentNeededNotification command class
+ **/
+class OnSDLConsentNeededNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLConsentNeededNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSDLConsentNeededNotification(
+ 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 OnSDLConsentNeededNotification class destructor
+ **/
+ virtual ~OnSDLConsentNeededNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h
new file mode 100644
index 0000000000..96f63845e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSDLPersistenceCompleteNotification command class
+ **/
+class OnSDLPersistenceCompleteNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLPersistenceCompleteNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSDLPersistenceCompleteNotification(
+ 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 OnSDLPersistenceCompleteNotification class destructor
+ **/
+ virtual ~OnSDLPersistenceCompleteNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h
new file mode 100644
index 0000000000..da049b1dc4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnStartDeviceDiscovery command class
+ **/
+class OnStartDeviceDiscovery : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnStartDeviceDiscovery class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnStartDeviceDiscovery(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 OnStartDeviceDiscovery class destructor
+ **/
+ virtual ~OnStartDeviceDiscovery();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStartDeviceDiscovery);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h
new file mode 100644
index 0000000000..7c61fac041
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnGetStatusUpdateNotification command class
+ **/
+class OnStatusUpdateNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnGetStatusUpdateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnStatusUpdateNotification(
+ 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 OnGetStatusUpdateNotification class destructor
+ **/
+ virtual ~OnStatusUpdateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h
new file mode 100644
index 0000000000..d4c940bac7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile_api = mobile_apis;
+/**
+ * @brief OnSystemContextNotification command class
+ **/
+class OnSystemContextNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemContextNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemContextNotification(
+ 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 OnSystemContextNotification class destructor
+ **/
+ virtual ~OnSystemContextNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemContextNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h
new file mode 100644
index 0000000000..76325b078f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSystemErrorNotification command class
+ **/
+class OnSystemErrorNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemErrorNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemErrorNotification(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 OnSystemErrorNotification class destructor
+ **/
+ virtual ~OnSystemErrorNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemErrorNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h
new file mode 100644
index 0000000000..1e4046b83b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSystemInfoChangedNotification command class
+ **/
+class OnSystemInfoChangedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemInfoChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemInfoChangedNotification(
+ 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 OnSystemInfoChangedNotification class destructor
+ **/
+ virtual ~OnSystemInfoChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h
new file mode 100644
index 0000000000..1e1e1818b8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSystemRequestNotification command class
+ **/
+class OnSystemRequestNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemRequestNotification(
+ 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 OnSystemRequestNotification class destructor
+ **/
+ virtual ~OnSystemRequestNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
new file mode 100644
index 0000000000..0beba8dc6b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+/**
+ * @brief OnSystemTimeReadyNotification command class.
+ * Notifies SDL whenever system time module is ready.
+ * It could be GPS or any other module which is allows
+ * to obtain system time. Once SDL receive this notification
+ * it is allowed to use GetSystemTimeRequest to rerieve system time.
+ */
+class OnSystemTimeReadyNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemTimeReadyNotification create the command.
+ * @param message content of the command. Passed directy to base class.
+ */
+ OnSystemTimeReadyNotification(
+ 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 ~OnSystemTimeReadyNotification destroys the command object.
+ */
+ ~OnSystemTimeReadyNotification();
+
+ /**
+ * @brief Run creates SystemTimeReady event
+ * and notifies all the subscribers.
+ */
+ void Run() FINAL;
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h
new file mode 100644
index 0000000000..33c7d98b6f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTTSLanguageChangeNotification command class
+ **/
+class OnTTSLanguageChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTTSLanguageChangeNotification(
+ 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 OnTTSLanguageChangeNotification class destructor
+ **/
+ virtual ~OnTTSLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h
new file mode 100644
index 0000000000..70050a667e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.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_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnTTSResetTimeoutNotification command class
+ **/
+class OnTTSResetTimeoutNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTTSResetTimeoutNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnTTSResetTimeoutNotification class destructor
+ **/
+ virtual ~OnTTSResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h
new file mode 100644
index 0000000000..93dac3f292
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTTSStartedNotification command class
+ **/
+class OnTTSStartedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTTSStartedNotification(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 OnTTSStartedNotification class destructor
+ **/
+ virtual ~OnTTSStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h
new file mode 100644
index 0000000000..362e96f4be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTTSStoppedNotification command class
+ **/
+class OnTTSStoppedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject OnTTSStartedNotificationmessage
+ **/
+ OnTTSStoppedNotification(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 OnTTSStoppedNotification class destructor
+ **/
+ virtual ~OnTTSStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h
new file mode 100644
index 0000000000..0cc4e9e772
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnUICommandNotification command class
+ **/
+class OnUICommandNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUICommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUICommandNotification(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 OnUICommandNotification class destructor
+ **/
+ virtual ~OnUICommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUICommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h
new file mode 100644
index 0000000000..c487894770
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_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_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIKeyBoardInputNotification command class
+ **/
+class OnUIKeyBoardInputNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUIKeyBoardInputNotification(
+ 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 OnUIKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnUIKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIKeyBoardInputNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h
new file mode 100644
index 0000000000..f30b8573aa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnUILanguageChangeNotification command class
+ **/
+class OnUILanguageChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUILanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUILanguageChangeNotification(
+ 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 OnUILanguageChangeNotification class destructor
+ **/
+ virtual ~OnUILanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUILanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h
new file mode 100644
index 0000000000..bbdf4d04ef
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.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_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIResetTimeoutNotification command class
+ **/
+class OnUIResetTimeoutNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUIResetTimeoutNotification(
+ 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 OnUIResetTimeoutNotification class destructor
+ **/
+ virtual ~OnUIResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h
new file mode 100644
index 0000000000..5c7dd0128b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_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_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUITouchEventNotification command class
+ **/
+class OnUITouchEventNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUITouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUITouchEventNotification(
+ 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 OnUITouchEventNotification class destructor
+ **/
+ virtual ~OnUITouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUITouchEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h
new file mode 100644
index 0000000000..2942c36053
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnUpdateDeviceList command class
+ **/
+class OnUpdateDeviceList : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUpdateDeviceList class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUpdateDeviceList(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 OnUpdateDeviceList class destructor
+ **/
+ virtual ~OnUpdateDeviceList();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUpdateDeviceList);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h
new file mode 100644
index 0000000000..ed0b1572ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIAccPedalPositionNotification command class
+ **/
+class OnVIAccPedalPositionNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIAccPedalPositionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIAccPedalPositionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIAccPedalPositionNotification class destructor
+ **/
+ virtual ~OnVIAccPedalPositionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h
new file mode 100644
index 0000000000..cc81160ccb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIBeltStatusNotification command class
+ **/
+class OnVIBeltStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBeltStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIBeltStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIBeltStatusNotification class destructor
+ **/
+ virtual ~OnVIBeltStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h
new file mode 100644
index 0000000000..2b46b69f55
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIBodyInformationNotification command class
+ **/
+class OnVIBodyInformationNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBodyInformationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIBodyInformationNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIBodyInformationNotification class destructor
+ **/
+ virtual ~OnVIBodyInformationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h
new file mode 100644
index 0000000000..05da9a775d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIDeviceStatusNotification command class
+ **/
+class OnVIDeviceStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDeviceStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIDeviceStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIDeviceStatusNotification class destructor
+ **/
+ virtual ~OnVIDeviceStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h
new file mode 100644
index 0000000000..6640d7953a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIDriverBrakingNotification command class
+ **/
+class OnVIDriverBrakingNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDriverBrakingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIDriverBrakingNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIDriverBrakingNotification class destructor
+ **/
+ virtual ~OnVIDriverBrakingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h
new file mode 100644
index 0000000000..f8c0526f8c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIEngineTorqueNotification command class
+ **/
+class OnVIEngineTorqueNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIEngineTorqueNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIEngineTorqueNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIEngineTorqueNotification class destructor
+ **/
+ virtual ~OnVIEngineTorqueNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h
new file mode 100644
index 0000000000..900aecd845
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIExternalTemperatureNotification command class
+ **/
+class OnVIExternalTemperatureNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIExternalTemperatureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIExternalTemperatureNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIExternalTemperatureNotification class destructor
+ **/
+ virtual ~OnVIExternalTemperatureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h
new file mode 100644
index 0000000000..7374de9ad9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelNotification command class
+ **/
+class OnVIFuelLevelNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIFuelLevelNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIFuelLevelNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h
new file mode 100644
index 0000000000..a705fcbd04
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelStateNotification command class
+ **/
+class OnVIFuelLevelStateNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIFuelLevelStateNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIFuelLevelStateNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h
new file mode 100644
index 0000000000..984e1e4c0b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIGpsDataNotification command class
+ **/
+class OnVIGpsDataNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIGpsDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIGpsDataNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIGpsDataNotification class destructor
+ **/
+ virtual ~OnVIGpsDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h
new file mode 100644
index 0000000000..1dfda8a9e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIHeadLampStatusNotification command class
+ **/
+class OnVIHeadLampStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIHeadLampStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIHeadLampStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIHeadLampStatusNotification class destructor
+ **/
+ virtual ~OnVIHeadLampStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h
new file mode 100644
index 0000000000..fd8743907c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIInstantFuelConsumptionNotification command class
+ **/
+class OnVIInstantFuelConsumptionNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIInstantFuelConsumptionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class destructor
+ **/
+ virtual ~OnVIInstantFuelConsumptionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h
new file mode 100644
index 0000000000..25ace2821d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIMyKeyNotification command class
+ **/
+class OnVIMyKeyNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIMyKeyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIMyKeyNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIMyKeyNotification class destructor
+ **/
+ virtual ~OnVIMyKeyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h
new file mode 100644
index 0000000000..ad141e733c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIOdometerNotification command class
+ **/
+class OnVIOdometerNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIOdometerNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIOdometerNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIOdometerNotification class destructor
+ **/
+ virtual ~OnVIOdometerNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h
new file mode 100644
index 0000000000..95fb873957
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIPrndlNotification command class
+ **/
+class OnVIPrndlNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIPrndlNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIPrndlNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIPrndlNotification class destructor
+ **/
+ virtual ~OnVIPrndlNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h
new file mode 100644
index 0000000000..d4b121a96f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIRpmNotification command class
+ **/
+class OnVIRpmNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIRpmNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIRpmNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIRpmNotification class destructor
+ **/
+ virtual ~OnVIRpmNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h
new file mode 100644
index 0000000000..4afaafc9ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVISpeedNotification command class
+ **/
+class OnVISpeedNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISpeedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVISpeedNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVISpeedNotification class destructor
+ **/
+ virtual ~OnVISpeedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h
new file mode 100644
index 0000000000..0d0aeadad8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVISteeringWheelAngleNotification command class
+ **/
+class OnVISteeringWheelAngleNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISteeringWheelAngleNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVISteeringWheelAngleNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVISteeringWheelAngleNotification class destructor
+ **/
+ virtual ~OnVISteeringWheelAngleNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h
new file mode 100644
index 0000000000..c358ed37e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVITirePressureNotification command class
+ **/
+class OnVITirePressureNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVITirePressureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVITirePressureNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVITirePressureNotification class destructor
+ **/
+ virtual ~OnVITirePressureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h
new file mode 100644
index 0000000000..75062a51e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIVinNotification command class
+ **/
+class OnVIVinNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVinNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIVinNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIVinNotification class destructor
+ **/
+ virtual ~OnVIVinNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h
new file mode 100644
index 0000000000..de7a5dfc9e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIWiperStatusNotification command class
+ **/
+class OnVIWiperStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIWiperStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIWiperStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIWiperStatusNotification class destructor
+ **/
+ virtual ~OnVIWiperStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h
new file mode 100644
index 0000000000..7a7cf3cd96
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVideoDataStreamingNotification command class
+ **/
+class OnVideoDataStreamingNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnVideoDataStreamingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVideoDataStreamingNotification(
+ 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 OnVideoDataStreamingNotification class destructor
+ **/
+ virtual ~OnVideoDataStreamingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVideoDataStreamingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h
new file mode 100644
index 0000000000..3ef21fc568
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRCommandNotification command class
+ **/
+class OnVRCommandNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRCommandNotification(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 OnVRCommandNotification class destructor
+ **/
+ virtual ~OnVRCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRCommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h
new file mode 100644
index 0000000000..e6bd39d46e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRLanguageChangeNotification command class
+ **/
+class OnVRLanguageChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRLanguageChangeNotification(
+ 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 OnVRLanguageChangeNotification class destructor
+ **/
+ virtual ~OnVRLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h
new file mode 100644
index 0000000000..abca9db91d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRStartedNotification command class
+ **/
+class OnVRStartedNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRStartedNotification(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 OnVRStartedNotification class destructor
+ **/
+ virtual ~OnVRStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h
new file mode 100644
index 0000000000..9b53214f8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRStoppedNotification command class
+ **/
+class OnVRStoppedNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRStoppedNotification(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 OnVRStoppedNotification class destructor
+ **/
+ virtual ~OnVRStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h
new file mode 100644
index 0000000000..8f94d4876a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesRequest command class
+ **/
+class RCGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesRequest(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 RCGetCapabilitiesRequest class destructor
+ **/
+ virtual ~RCGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h
new file mode 100644
index 0000000000..dec31c9ea1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesResponse command class
+ **/
+class RCGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesResponse(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 RCGetCapabilitiesResponse class destructor
+ **/
+ virtual ~RCGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h
new file mode 100644
index 0000000000..3ba614f823
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyRequest command class
+ **/
+class RCIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief RCIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyRequest(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 RCIsReadyRequest class destructor
+ **/
+ virtual ~RCIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h
new file mode 100644
index 0000000000..93f30e795c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyResponse command class
+ **/
+class RCIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyResponse(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 RCIsReadyResponse class destructor
+ **/
+ virtual ~RCIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h
new file mode 100644
index 0000000000..e97312b881
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppRequest command class
+ **/
+class SDLActivateAppRequest : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief Applications registered over protocol v4
+ */
+ typedef std::vector<application_manager::ApplicationSharedPtr> V4ProtoApps;
+
+ /**
+ * @brief SDLActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLActivateAppRequest(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 SDLActivateAppRequest class destructor
+ **/
+ ~SDLActivateAppRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief onTimeOut allows to process case when timeout has appeared
+ * during request execution.
+ */
+ void onTimeOut() 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::Event& event) OVERRIDE;
+
+ private:
+ uint32_t app_id() const;
+ uint32_t hmi_app_id(const smart_objects::SmartObject& so) const;
+
+ /**
+ * @brief Retrieves all v4 protocol applications for particular device
+ * @param handle Device handle
+ * @return List of applications registered over v4 protocol
+ */
+ V4ProtoApps get_v4_proto_apps(
+ const connection_handler::DeviceHandle handle) const;
+
+ /**
+ * @brief Get v4 protocol application reported as forgrounded on device
+ * @param handle Device
+ * @return Pointer to application or empty pointer
+ */
+ app_mngr::ApplicationSharedPtr get_foreground_app(
+ const connection_handler::DeviceHandle handle) const;
+
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h
new file mode 100644
index 0000000000..7a3f5157da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppResponse command class
+ **/
+class SDLActivateAppResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLActivateAppResponse(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 SDLActivateAppResponse class destructor
+ **/
+ virtual ~SDLActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h
new file mode 100644
index 0000000000..61426e0af3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsRequest command class
+ **/
+class SDLGetListOfPermissionsRequest
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetListOfPermissionsRequest(
+ 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 SDLGetListOfPermissionsRequest class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h
new file mode 100644
index 0000000000..e2556bac3d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsResponse command class
+ **/
+class SDLGetListOfPermissionsResponse
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetListOfPermissionsResponse(
+ 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 SDLGetListOfPermissionsResponse class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h
new file mode 100644
index 0000000000..b6376bacc6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateRequest command class
+ **/
+class SDLGetStatusUpdateRequest : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetStatusUpdateRequest(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 SDLGetStatusUpdateRequest class destructor
+ **/
+ virtual ~SDLGetStatusUpdateRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h
new file mode 100644
index 0000000000..4e6da22370
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateResponse command class
+ **/
+class SDLGetStatusUpdateResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetStatusUpdateResponse(
+ 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 SDLGetStatusUpdateResponse class destructor
+ **/
+ virtual ~SDLGetStatusUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h
new file mode 100644
index 0000000000..75902e2733
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageRequest command class
+ **/
+class SDLGetUserFriendlyMessageRequest
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetUserFriendlyMessageRequest(
+ 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 SDLGetUserFriendlyMessageRequest class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h
new file mode 100644
index 0000000000..a02d6894e3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageResponse command class
+ **/
+class SDLGetUserFriendlyMessageResponse
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetUserFriendlyMessageResponse(
+ 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 SDLGetUserFriendlyMessageResponse class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h
new file mode 100644
index 0000000000..f164aed775
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class SDLPolicyUpdate : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ ~SDLPolicyUpdate() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h
new file mode 100644
index 0000000000..63f33477b6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class SDLPolicyUpdateResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLPolicyUpdateResponse(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 SDLPolicyUpdateResponse class destructor
+ **/
+ virtual ~SDLPolicyUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h
new file mode 100644
index 0000000000..229ed92947
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistrationRequest command class
+ **/
+class TTSChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSChangeRegistrationRequest(
+ 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 TTSChangeRegistrationRequest class destructor
+ **/
+ virtual ~TTSChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h
new file mode 100644
index 0000000000..8462178283
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistratioResponse command class
+ **/
+class TTSChangeRegistratioResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSChangeRegistratioResponse(
+ 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 TTSChangeRegistratioResponse class destructor
+ **/
+ virtual ~TTSChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h
new file mode 100644
index 0000000000..df6cf3b4a4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesRequest command class
+ **/
+class TTSGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetCapabilitiesRequest(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 TTSGetCapabilitiesRequest class destructor
+ **/
+ virtual ~TTSGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h
new file mode 100644
index 0000000000..7919f213a4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesResponse command class
+ **/
+class TTSGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetCapabilitiesResponse(
+ 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 TTSGetCapabilitiesResponse class destructor
+ **/
+ virtual ~TTSGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h
new file mode 100644
index 0000000000..09345c02d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageRequest command class
+ **/
+class TTSGetLanguageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetLanguageRequest(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 TTSGetLanguageRequest class destructor
+ **/
+ virtual ~TTSGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h
new file mode 100644
index 0000000000..e52dbf1ada
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageResponse command class
+ **/
+class TTSGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetLanguageResponse(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 TTSGetLanguageResponse class destructor
+ **/
+ virtual ~TTSGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h
new file mode 100644
index 0000000000..c42d0257d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesRequest command class
+ **/
+class TTSGetSupportedLanguagesRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetSupportedLanguagesRequest(
+ 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 TTSGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h
new file mode 100644
index 0000000000..cc24db22b9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesResponse command class
+ **/
+class TTSGetSupportedLanguagesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetSupportedLanguagesResponse(
+ 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 TTSGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h
new file mode 100644
index 0000000000..b7dffd5bde
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyRequest command class
+ **/
+class TTSIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief TTSIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSIsReadyRequest(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 TTSIsReadyRequest class destructor
+ **/
+ virtual ~TTSIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h
new file mode 100644
index 0000000000..268edd0eeb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyResponse command class
+ **/
+class TTSIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSIsReadyResponse(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 TTSIsReadyResponse class destructor
+ **/
+ virtual ~TTSIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h
new file mode 100644
index 0000000000..f416b3a787
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesRequest command class
+ **/
+class TTSSetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSetGlobalPropertiesRequest(
+ 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 TTSSetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h
new file mode 100644
index 0000000000..ff5622296c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesResponse command class
+ **/
+class TTSSetGlobalPropertiesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSetGlobalPropertiesResponse(
+ 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 TTSSetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h
new file mode 100644
index 0000000000..9e8915a440
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakRequest command class
+ **/
+class TTSSpeakRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSSpeakRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSpeakRequest(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 TTSSpeakRequest class destructor
+ **/
+ virtual ~TTSSpeakRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h
new file mode 100644
index 0000000000..e4b2c8adbd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakResponse command class
+ **/
+class TTSSpeakResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSpeakResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSpeakResponse(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 TTSSpeakResponse class destructor
+ **/
+ virtual ~TTSSpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h
new file mode 100644
index 0000000000..8eb6a66c95
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingRequest command class
+ **/
+class TTSStopSpeakingRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSStopSpeakingRequest(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 TTSStopSpeakingRequest class destructor
+ **/
+ virtual ~TTSStopSpeakingRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h
new file mode 100644
index 0000000000..d433fe2280
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingResponse command class
+ **/
+class TTSStopSpeakingResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSStopSpeakingResponse(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 TTSStopSpeakingResponse class destructor
+ **/
+ virtual ~TTSStopSpeakingResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h
new file mode 100644
index 0000000000..e5d2483576
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandRequest command class
+ **/
+class UIAddCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddCommandRequest(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 UIAddCommandRequest class destructor
+ **/
+ virtual ~UIAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h
new file mode 100644
index 0000000000..90a9666561
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandResponse command class
+ **/
+class UIAddCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddCommandResponse(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 UIAddCommandResponse class destructor
+ **/
+ virtual ~UIAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h
new file mode 100644
index 0000000000..5de5e41cd6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIAddSubmenuRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddSubmenuRequest(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 UIAddSubmenuRequest class destructor
+ **/
+ virtual ~UIAddSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h
new file mode 100644
index 0000000000..20f830be27
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuResponse command class
+ **/
+class UIAddSubmenuResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddSubmenuResponse(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 UIAddSubmenuResponse class destructor
+ **/
+ virtual ~UIAddSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h
new file mode 100644
index 0000000000..6235a51c7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAlertRequest command class
+ **/
+class UIAlertRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIAlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAlertRequest(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 UIAlertRequest class destructor
+ **/
+ virtual ~UIAlertRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h
new file mode 100644
index 0000000000..b43185af78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAlertResponse command class
+ **/
+class UIAlertResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAlertResponse(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 UIAlertResponse class destructor
+ **/
+ virtual ~UIAlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h
new file mode 100644
index 0000000000..c504c55727
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistrationRequest command class
+ **/
+class UIChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIChangeRegistrationRequest(
+ 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_handlel);
+
+ /**
+ * @brief UIChangeRegistrationRequest class destructor
+ **/
+ virtual ~UIChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h
new file mode 100644
index 0000000000..d7fca83d3e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistratioResponse command class
+ **/
+class UIChangeRegistratioResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIChangeRegistratioResponse(
+ 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 UIChangeRegistratioResponse class destructor
+ **/
+ virtual ~UIChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h
new file mode 100644
index 0000000000..ecc0b44495
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandRequest command class
+ **/
+class UIDeleteCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteCommandRequest(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 UIDeleteCommandRequest class destructor
+ **/
+ virtual ~UIDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h
new file mode 100644
index 0000000000..f9601b7491
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandResponse command class
+ **/
+class UIDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteCommandResponse(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 UIDeleteCommandResponse class destructor
+ **/
+ virtual ~UIDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h
new file mode 100644
index 0000000000..3161c84b7c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIDeleteSubmenuRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteSubmenuRequest(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 UIDeleteSubmenuRequest class destructor
+ **/
+ virtual ~UIDeleteSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h
new file mode 100644
index 0000000000..7c73a53c3e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIDeleteSubmenuResponse command class
+ **/
+class UIDeleteSubmenuResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteSubmenuResponse(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 UIDeleteSubmenuResponse class destructor
+ **/
+ virtual ~UIDeleteSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..8d34e1852b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruRequest command class
+ * When this request is invoked, the audio capture stops
+ **/
+class UIEndAudioPassThruRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIEndAudioPassThruRequest(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 UIEndAudioPassThruRequest class destructor
+ **/
+ virtual ~UIEndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..b1c3bfd87a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruResponse command class
+ **/
+class UIEndAudioPassThruResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIEndAudioPassThruResponse(
+ 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 UIEndAudioPassThruResponse class destructor
+ **/
+ virtual ~UIEndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h
new file mode 100644
index 0000000000..47782cc7a9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesRequest command class
+ **/
+class UIGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetCapabilitiesRequest(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 UIGetCapabilitiesRequest class destructor
+ **/
+ virtual ~UIGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h
new file mode 100644
index 0000000000..421844560d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesResponse command class
+ **/
+class UIGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetCapabilitiesResponse(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 UIGetCapabilitiesResponse class destructor
+ **/
+ virtual ~UIGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h
new file mode 100644
index 0000000000..7c82584178
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageRequest command class
+ **/
+class UIGetLanguageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetLanguageRequest(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 UIGetLanguageRequest class destructor
+ **/
+ virtual ~UIGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h
new file mode 100644
index 0000000000..7354e87ee4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageResponse command class
+ **/
+class UIGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetLanguageResponse(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 UIGetLanguageResponse class destructor
+ **/
+ virtual ~UIGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h
new file mode 100644
index 0000000000..7fd456b92b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesRequest command class
+ **/
+class UIGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetSupportedLanguagesRequest(
+ 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 UIGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h
new file mode 100644
index 0000000000..26d8e98892
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesResponse command class
+ **/
+class UIGetSupportedLanguagesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetSupportedLanguagesResponse(
+ 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 UIGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h
new file mode 100644
index 0000000000..2e7806cd2b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyRequest command class
+ **/
+class UIIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief UIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIIsReadyRequest(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 UIIsReadyRequest class destructor
+ **/
+ virtual ~UIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h
new file mode 100644
index 0000000000..f2b4f201f3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyResponse command class
+ **/
+class UIIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIIsReadyResponse(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 UIIsReadyResponse class destructor
+ **/
+ virtual ~UIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..6d4e870228
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruRequest command class
+ **/
+class UIPerformAudioPassThruRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformAudioPassThruRequest(
+ 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 UIPerformAudioPassThruRequest class destructor
+ **/
+ virtual ~UIPerformAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..e36a292573
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruResponse command class
+ **/
+class UIPerformAudioPassThruResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformAudioPassThruResponse(
+ 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 UIPerformAudioPassThruResponse class destructor
+ **/
+ virtual ~UIPerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h
new file mode 100644
index 0000000000..ff4540de23
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionRequest command class
+ **/
+class UIPerformInteractionRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformInteractionRequest(
+ 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 UIPerformInteractionRequest class destructor
+ **/
+ virtual ~UIPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h
new file mode 100644
index 0000000000..caf5716e18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionResponse command class
+ **/
+class UIPerformInteractionResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformInteractionResponse(
+ 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 UIPerformInteractionResponse class destructor
+ **/
+ virtual ~UIPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h
new file mode 100644
index 0000000000..f5acf41c8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageRequest command class
+ **/
+class UIScrollableMessageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIScrollableMessageRequest(
+ 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 UIScrollableMessageRequest class destructor
+ **/
+ virtual ~UIScrollableMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h
new file mode 100644
index 0000000000..e46265c0e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageResponse command class
+ **/
+class UIScrollableMessageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIScrollableMessageResponse(
+ 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 UIScrollableMessageResponse class destructor
+ **/
+ virtual ~UIScrollableMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h
new file mode 100644
index 0000000000..4e260a99ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISendHapticDataRequest command class
+ **/
+class UISendHapticDataRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISendHapticDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ UISendHapticDataRequest(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 UISendHapticDataRequest class destructor
+ **/
+ ~UISendHapticDataRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISendHapticDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h
new file mode 100644
index 0000000000..1bf38939be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISendHapticDataResponse command class
+ **/
+class UISendHapticDataResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISendHapticDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ UISendHapticDataResponse(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 UISendHapticDataResponse class destructor
+ **/
+ ~UISendHapticDataResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISendHapticDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h
new file mode 100644
index 0000000000..ea526df135
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetIconRequest command class
+ **/
+class UISetAppIconRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetAppIconRequest(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 UISetIconRequest class destructor
+ **/
+ virtual ~UISetAppIconRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetAppIconRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h
new file mode 100644
index 0000000000..af2c4fafea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetIconResponse command class
+ **/
+class UISetAppIconResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetAppIconResponse(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 UISetIconResponse class destructor
+ **/
+ virtual ~UISetAppIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetAppIconResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h
new file mode 100644
index 0000000000..f60f7325fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutRequest command class
+ **/
+class UiSetDisplayLayoutRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UiSetDisplayLayoutRequest(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 UiSetDisplayLayoutRequest class destructor
+ **/
+ virtual ~UiSetDisplayLayoutRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h
new file mode 100644
index 0000000000..ce404a4049
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutResponse command class
+ **/
+class UiSetDisplayLayoutResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UiSetDisplayLayoutResponse(
+ 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 UiSetDisplayLayoutResponse class destructor
+ **/
+ virtual ~UiSetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h
new file mode 100644
index 0000000000..44e8bba450
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesRequest command class
+ **/
+class UISetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetGlobalPropertiesRequest(
+ 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 UIShowRequest class destructor
+ **/
+ virtual ~UISetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h
new file mode 100644
index 0000000000..a9c27a423b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesResponse command class
+ **/
+class UISetGlobalPropertiesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetGlobalPropertiesResponse(
+ 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 UISetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~UISetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h
new file mode 100644
index 0000000000..24f4d76d89
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerRequest command class
+ **/
+class UISetMediaClockTimerRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetMediaClockTimerRequest(
+ 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 UISetMediaClockTimerRequest class destructor
+ **/
+ virtual ~UISetMediaClockTimerRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h
new file mode 100644
index 0000000000..c664bd04f9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerResponse command class
+ **/
+class UISetMediaClockTimerResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetMediaClockTimerResponse(
+ 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 UISetMediaClockTimerResponse class destructor
+ **/
+ virtual ~UISetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h
new file mode 100644
index 0000000000..7ba950d530
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIShowRequest command class
+ **/
+class UIShowRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIShowRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIShowRequest(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 UIShowRequest class destructor
+ **/
+ virtual ~UIShowRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h
new file mode 100644
index 0000000000..f9f7a61056
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIShowResponse command class
+ **/
+class UIShowResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIShowResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIShowResponse(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 UIShowResponse class destructor
+ **/
+ virtual ~UIShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h
new file mode 100644
index 0000000000..3de1b4e775
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class UISliderRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISliderRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISliderRequest(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 UISliderRequest class destructor
+ **/
+ virtual ~UISliderRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h
new file mode 100644
index 0000000000..17d1f8a8ed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISliderResponse command class
+ **/
+class UISliderResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISliderResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISliderResponse(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 UISliderResponse class destructor
+ **/
+ virtual ~UISliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h
new file mode 100644
index 0000000000..dc0166e33f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListRequest command class
+ **/
+class UpdateAppListRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UpdateAppListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateAppListRequest(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 UpdateAppListRequest class destructor
+ **/
+ virtual ~UpdateAppListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h
new file mode 100644
index 0000000000..2e3bb79233
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListResponse command class
+ **/
+class UpdateAppListResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateAppListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateAppListResponse(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 UpdateAppListResponse class destructor
+ **/
+ virtual ~UpdateAppListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h
new file mode 100644
index 0000000000..c4c9f11e06
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListRequest command class
+ **/
+class UpdateDeviceListRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief UpdateDeviceListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateDeviceListRequest(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 UpdateDeviceListRequest class destructor
+ **/
+ ~UpdateDeviceListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ * Need to observe OnHMIReady event, to send UpdateDeviceListRequest
+ * when HMI will be ready
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief Need to stop execution StopMethod if HMI did not started
+ */
+ virtual bool CleanUp();
+
+ private:
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::ConditionalVariable termination_condition_;
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h
new file mode 100644
index 0000000000..c33518a545
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListResponse command class
+ **/
+class UpdateDeviceListResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateDeviceListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateDeviceListResponse(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 UpdateDeviceListResponse class destructor
+ **/
+ virtual ~UpdateDeviceListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h
new file mode 100644
index 0000000000..e30b045fcb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLRequest command class
+ **/
+class UpdateSDLRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UpdateSDLRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateSDLRequest(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 UpdateSDLRequest class destructor
+ **/
+ virtual ~UpdateSDLRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h
new file mode 100644
index 0000000000..f71921ea3a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLResponse command class
+ **/
+class UpdateSDLResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateSDLResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateSDLResponse(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 UpdateSDLResponse class destructor
+ **/
+ virtual ~UpdateSDLResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h
new file mode 100644
index 0000000000..0abb37adbc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandRequest command class
+ **/
+class VRAddCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRAddCommandRequest(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 VRAddCommandRequest class destructor
+ **/
+ virtual ~VRAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h
new file mode 100644
index 0000000000..5f9c99a483
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandResponse command class
+ **/
+class VRAddCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRAddCommandResponse(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 VRAddCommandResponse class destructor
+ **/
+ virtual ~VRAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h
new file mode 100644
index 0000000000..4af28cb542
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationRequest command class
+ **/
+class VRChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRChangeRegistrationRequest(
+ 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 VRChangeRegistrationRequest class destructor
+ **/
+ virtual ~VRChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h
new file mode 100644
index 0000000000..a80df0968b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationResponse command class
+ **/
+class VRChangeRegistrationResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRChangeRegistrationResponse(
+ 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 VRChangeRegistrationResponse class destructor
+ **/
+ virtual ~VRChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h
new file mode 100644
index 0000000000..0ed9521ec5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandRequest command class
+ **/
+class VRDeleteCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRDeleteCommandRequest(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 VRDeleteCommandRequest class destructor
+ **/
+ virtual ~VRDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h
new file mode 100644
index 0000000000..63efcab355
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandResponse command class
+ **/
+class VRDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRDeleteCommandResponse(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 VRDeleteCommandResponse class destructor
+ **/
+ virtual ~VRDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h
new file mode 100644
index 0000000000..f8ac83af58
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesRequest command class
+ **/
+class VRGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetCapabilitiesRequest(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 VRGetCapabilitiesRequest class destructor
+ **/
+ virtual ~VRGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h
new file mode 100644
index 0000000000..9c9bb55b1b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesResponse command class
+ **/
+class VRGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetCapabilitiesResponse(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 VRGetCapabilitiesResponse class destructor
+ **/
+ virtual ~VRGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h
new file mode 100644
index 0000000000..e764cbef91
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageRequest command class
+ **/
+class VRGetLanguageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetLanguageRequest(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 VRGetLanguageRequest class destructor
+ **/
+ virtual ~VRGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h
new file mode 100644
index 0000000000..470fe3ebdc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageResponse command class
+ **/
+class VRGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetLanguageResponse(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 VRGetLanguageResponse class destructor
+ **/
+ virtual ~VRGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h
new file mode 100644
index 0000000000..8d9e9e2a61
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesRequest command class
+ **/
+class VRGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetSupportedLanguagesRequest(
+ 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 VRGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h
new file mode 100644
index 0000000000..735844cd99
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesResponse command class
+ **/
+class VRGetSupportedLanguagesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetSupportedLanguagesResponse(
+ 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 VRGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h
new file mode 100644
index 0000000000..0b580f6c1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyRequest command class
+ **/
+class VRIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief VRIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRIsReadyRequest(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 VRIsReadyRequest class destructor
+ **/
+ virtual ~VRIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h
new file mode 100644
index 0000000000..42c47f5077
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyResponse command class
+ **/
+class VRIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRIsReadyResponse(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 VRIsReadyResponse class destructor
+ **/
+ virtual ~VRIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h
new file mode 100644
index 0000000000..6f206c010f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRPerformInteractionRequest command class
+ **/
+class VRPerformInteractionRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRPerformInteractionRequest(
+ 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 VRPerformInteractionRequest class destructor
+ **/
+ virtual ~VRPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h
new file mode 100644
index 0000000000..9e8599419f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSPerformInteractionResponse command class
+ **/
+class VRPerformInteractionResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRPerformInteractionResponse(
+ 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 TTSPerformInteractionResponse class destructor
+ **/
+ virtual ~VRPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h
new file mode 100644
index 0000000000..745fb3ec18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h
@@ -0,0 +1,169 @@
+/*
+
+ 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_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddCommandRequest command class
+ **/
+class AddCommandRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddCommandRequest(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 AddCommandRequest class destructor
+ **/
+ ~AddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ */
+ void onTimeOut() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Check if command name doesn't exist in application
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandName(app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command VR synonyms doesn't exist in application commands
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandVRSynonym(app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command parent ID exists in submenu map
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandParentId(app_mngr::ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Removes command from list when HMI sends negative response or
+ * HMI does not answer on addCommand request.
+ */
+ void RemoveCommand();
+
+ DISALLOW_COPY_AND_ASSIGN(AddCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks add command param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if add command contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ inline bool BothSend() const;
+
+ /**
+ * @brief GenerateMobileResponseInfo generated info for mobile response
+ * depends from UI and VR responses
+ * @return info for mobile response
+ */
+ const std::string GenerateMobileResponseInfo();
+ bool send_ui_;
+ bool send_vr_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ std::string ui_info_;
+ std::string vr_info_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h
new file mode 100644
index 0000000000..fb3f172b0b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddCommandResponse command class
+ **/
+class AddCommandResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddCommandResponse(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 AddCommandResponse class destructor
+ **/
+ virtual ~AddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
new file mode 100644
index 0000000000..37ba9a5990
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
@@ -0,0 +1,97 @@
+/*
+
+ 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_ADD_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuRequest command class
+ **/
+class AddSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AddSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddSubMenuRequest(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 AddSubMenuRequest class destructor
+ **/
+ ~AddSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Check if submenu name is valid
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckSubMenuName();
+
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h
new file mode 100644
index 0000000000..253556f899
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_ADD_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuResponse command class
+ **/
+class AddSubMenuResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AddSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddSubMenuResponse(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 AddSubMenuResponse class destructor
+ **/
+ virtual ~AddSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h
new file mode 100644
index 0000000000..93f716cb65
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h
@@ -0,0 +1,110 @@
+/*
+
+ 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_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverRequest command class
+ **/
+class AlertManeuverRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertManeuverRequest(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 AlertManeuverRequest class destructor
+ **/
+ virtual ~AlertManeuverRequest();
+
+ /**
+ * @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);
+
+ private:
+ /**
+ * @brief Prepare parameters for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param return_info contains resulting info for sending to mobile
+ * application
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& return_info);
+ /**
+ * @brief Checks alert maneuver params(ttsChunks, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if alert maneuver contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ hmi_apis::Common_Result::eType tts_speak_result_code_;
+ hmi_apis::Common_Result::eType navi_alert_maneuver_result_code_;
+ std::string info_navi_;
+ std::string info_tts_;
+ app_mngr::commands::Pending pending_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h
new file mode 100644
index 0000000000..8b21aa64eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverResponse command class
+ **/
+class AlertManeuverResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertManeuverResponse(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 AlertManeuverResponse class destructor
+ **/
+ virtual ~AlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h
new file mode 100644
index 0000000000..e34653daf4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h
@@ -0,0 +1,154 @@
+/*
+
+ 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_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertRequest command class
+ **/
+class AlertRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertRequest(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 AlertRequest class destructor
+ **/
+ virtual ~AlertRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ protected:
+ private:
+ /*
+ * @brief Checks if request parameters are valid
+ * @param app_id Id of application requested this RPC
+ * @returns true if request is valid and should be processed
+ */
+ bool Validate(uint32_t app_id);
+ /*
+ * @brief Sends UI Alert request
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendAlertRequest(int32_t app_id);
+
+ /*
+ * @brief Sends TTS Speak request
+ *
+ * @param app_id Id of application requested this RPC
+ *
+ * @param tts_chunks_exists if tts chunks exists in
+ * message contains true, otherwise contains false
+ *
+ * @param length_tts_chunks contains length of array
+ * tts chunks.
+ */
+ void SendSpeakRequest(int32_t app_id,
+ bool tts_chunks_exists,
+ size_t length_tts_chunks);
+
+ /*
+ * @brief Tells if there are sent requests without responses
+ */
+ bool HasHmiResponsesToWait();
+
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfAlertRequest();
+
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for mobile app.
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
+ bool awaiting_ui_alert_response_;
+ bool awaiting_tts_speak_response_;
+ bool awaiting_tts_stop_speaking_response_;
+ bool is_alert_succeeded_;
+ bool is_ui_alert_sent_;
+ hmi_apis::Common_Result::eType alert_result_;
+ smart_objects::SmartObject alert_response_params_;
+ hmi_apis::Common_Result::eType tts_speak_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h
new file mode 100644
index 0000000000..4ae95fb979
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertResponse command class
+ **/
+class AlertResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertResponse(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 AlertResponse class destructor
+ **/
+ virtual ~AlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
new file mode 100644
index 0000000000..bd5c34ebd1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
@@ -0,0 +1,191 @@
+/*
+
+ 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_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+
+#include <strings.h>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "utils/macro.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+/**
+ * @brief ChangeRegistrationRequest command class
+ **/
+class ChangeRegistrationRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ChangeRegistrationRequest(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 ChangeRegistrationRequest class destructor
+ **/
+ virtual ~ChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Search for requested language in HMI UI supported languages
+ *
+ * @return true if language supported by UI, otherwise false
+ */
+ bool IsLanguageSupportedByUI(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI VR supported languages
+ *
+ * @return true if language supported by VR, otherwise false
+ */
+ bool IsLanguageSupportedByVR(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI TTS supported languages
+ *
+ * @return true if language supported by TTS, otherwise false
+ */
+ bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks change_registration params(ttsName, appname,
+ * ngnMediaScreenAppName, vrSynonyms) on invalid characters.
+ *
+ * @return true if command contains \t\n \\t \\n of whitespace otherwise
+ * returns false.
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Check parameters (name, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * @return SUCCESS if there is no coincidence of app.name/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /**
+ * @brief Checks if requested name is allowed by policy
+ * @param app_name Application name
+ * @return true, if allowed, otherwise - false
+ */
+ bool IsNicknameAllowed(const custom_str::CustomString& app_name) const;
+
+ /**
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param response_info contains info for sending to mobile application
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& ResponseInfo);
+
+ /**
+ * @brief Predicate for using with CheckCoincidence method to compare with VR
+ * synonym SO
+ *
+ * @return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ CoincidencePredicateVR(const custom_str::CustomString& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(const smart_objects::SmartObject& obj) const {
+ const custom_str::CustomString& vr_synonym = obj.asCustomString();
+ return newItem_.CompareIgnoreCase(vr_synonym);
+ };
+
+ const custom_str::CustomString& newItem_;
+ };
+
+ app_mngr::commands::Pending pending_requests_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string vr_response_info_;
+ std::string tts_response_info_;
+
+ void SendVRRequest(app_mngr::ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params);
+
+ void SendTTSRequest(app_mngr::ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params);
+
+ void SendUIRequest(app_mngr::ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params,
+ const int32_t hmi_language);
+
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h
new file mode 100644
index 0000000000..4cb8c394c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ChangeRegistrationResponse command class
+ **/
+class ChangeRegistrationResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ChangeRegistrationResponse(
+ 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 ChangeRegistrationResponse class destructor
+ **/
+ virtual ~ChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
new file mode 100644
index 0000000000..1ad1c07b2a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
@@ -0,0 +1,278 @@
+/*
+
+ 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_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#include <map>
+#include <string>
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetRequest command class
+ **/
+class CreateInteractionChoiceSetRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CreateInteractionChoiceSetRequest(
+ 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 CreateInteractionChoiceSetRequest class destructor
+ **/
+ ~CreateInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ */
+ void onTimeOut() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief DeleteChoices allows to walk through the sent commands collection
+ * in order to sent appropriate DeleteCommand request.
+ */
+ void DeleteChoices();
+
+ /**
+ * @brief Calls after all responses from HMI were received.
+ * Terminates request and sends successful response to mobile
+ * if all responses were SUCCESS or calls DeleteChoices in other case.
+ */
+ void OnAllHMIResponsesReceived();
+
+ /**
+ * @brief The VRCommand struct
+ * Collect minimum information about sent VR commands, for correctly
+ * processing deleting sent commands if error from HMI received
+ */
+ struct VRCommandInfo {
+ VRCommandInfo() : cmd_id_(0), succesful_response_received_(false) {}
+ VRCommandInfo(uint32_t cmd_id)
+ : cmd_id_(cmd_id), succesful_response_received_(false) {}
+ uint32_t cmd_id_;
+ bool succesful_response_received_;
+ };
+
+ typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap;
+ SentCommandsMap sent_commands_map_;
+
+ int32_t choice_set_id_;
+ size_t expected_chs_count_;
+ size_t received_chs_count_;
+ bool should_send_warnings_;
+
+ /**
+ * @brief Flag for stop sending VR commands to HMI, in case one of responses
+ * failed
+ */
+ volatile bool error_from_hmi_;
+ sync_primitives::Lock error_from_hmi_lock_;
+
+ /**
+ * @brief Flag shows if request already was expired by timeout
+ */
+ volatile bool is_timed_out_;
+ sync_primitives::Lock is_timed_out_lock_;
+
+ sync_primitives::RecursiveLock vr_commands_lock_;
+ /*
+ * @brief Sends VR AddCommand request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRAddCommandRequests(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks incoming choiseSet params.
+ * @param app Registred mobile application
+ *
+ * @return Mobile result code
+ */
+ mobile_apis::Result::eType CheckChoiceSet(
+ app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare choice ID
+ *param
+ *
+ * return TRUE if there is coincidence of choice ID, otherwise FALSE
+ */
+ struct CoincidencePredicateChoiceID {
+ CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[app_mngr::strings::choice_id].asUInt() == newItem_;
+ }
+
+ const uint32_t newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare menu name
+ *param
+ *
+ * return TRUE if there is coincidence of menu name, otherwise FALSE
+ */
+ struct CoincidencePredicateMenuName {
+ CoincidencePredicateMenuName(const std::string& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[app_mngr::strings::menu_name].asString() == newItem_;
+ }
+
+ const std::string& newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare VR commands
+ *param
+ *
+ * return TRUE if there is coincidence of VR commands, otherwise FALSE
+ */
+ struct CoincidencePredicateVRCommands {
+ CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return compareStr(obj, newItem_);
+ }
+
+ const smart_objects::SmartObject& newItem_;
+ };
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param choice1 Choice to compare
+ * @param choice2 Choice to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool compareSynonyms(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice2);
+
+ /*
+ * @brief Checks VR synonyms ignoring differences in case.
+ *
+ * @param str1 VR synonym to compare
+ * @param str2 VR synonym to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ static bool compareStr(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str2);
+
+ /**
+ * @brief Checks choice set params(menuName, tertiaryText, ...)
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @param choice_set which must check
+ * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set);
+
+ /**
+ * @brief ProcessHmiError process received error from HMI.
+ * This function id not thread safe. It should be protected with
+ * vr_commands_lock_
+ * @param vr_result ERROR type
+ */
+ void ProcessHmiError(const hmi_apis::Common_Result::eType vr_result);
+
+ /**
+ * @brief ProcessSuccesfulHMIResponse process succesful response from HMI\
+ * This function id not thread safe. It should be protected with
+ * vr_commands_lock_
+ * @param corr_id correlation id of received response
+ * @return true if resuest with corr_itd was sent on HMI, false otherwise
+ */
+ bool ProcessSuccesfulHMIResponse(const uint32_t corr_id);
+
+ /**
+ * @brief CountReceivedVRResponses counts received HMI responses. Updated
+ * request timeout if not all responses received
+ * Send response to mobile if all responses received.
+ */
+ void CountReceivedVRResponses();
+
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h
new file mode 100644
index 0000000000..76718bc2c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetResponse command class
+ **/
+class CreateInteractionChoiceSetResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CreateInteractionChoiceSetResponse(
+ 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 CreateInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~CreateInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h
new file mode 100644
index 0000000000..a21b1928d0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h
@@ -0,0 +1,119 @@
+/*
+
+ 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_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandRequest command class
+ **/
+class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteCommandRequest(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 DeleteCommandRequest class destructor
+ **/
+ ~DeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for mobile app.
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
+ bool is_ui_send_;
+ bool is_vr_send_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+ std::string ui_info_;
+ std::string vr_info_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h
new file mode 100644
index 0000000000..f81f119792
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandResponse command class
+ **/
+class DeleteCommandResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteCommandResponse(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 DeleteCommandResponse class destructor
+ **/
+ virtual ~DeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h
new file mode 100644
index 0000000000..02cd0086b6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.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_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+struct AppFile;
+
+namespace commands {
+
+/**
+ * @brief DeleteFileRequest command class
+ **/
+class DeleteFileRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteFileRequest(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 DeleteFileRequest class destructor
+ **/
+ virtual ~DeleteFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileRequest);
+
+ void SendFileRemovedNotification(
+ const application_manager::AppFile* file) const;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h
new file mode 100644
index 0000000000..fbdc70c9bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_DELETE_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteFileResponse command class
+ **/
+class DeleteFileResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteFileResponse(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 DeleteFileResponse class destructor
+ **/
+ virtual ~DeleteFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h
new file mode 100644
index 0000000000..4dec11a67b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h
@@ -0,0 +1,95 @@
+/*
+
+ 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_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetRequest command class
+ **/
+class DeleteInteractionChoiceSetRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteInteractionChoiceSetRequest(
+ 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 DeleteInteractionChoiceSetRequest class destructor
+ **/
+ ~DeleteInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Check if requested choice set ID in use by perform interaction
+ *
+ * @param app mobile application
+ */
+ bool ChoiceSetInUse(app_mngr::ApplicationConstSharedPtr app);
+
+ void SendVrDeleteCommand(app_mngr::ApplicationSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h
new file mode 100644
index 0000000000..0fce16ea9f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetResponse command class
+ **/
+class DeleteInteractionChoiceSetResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteInteractionChoiceSetResponse(
+ 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 DeleteInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~DeleteInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
new file mode 100644
index 0000000000..c947fda78a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
@@ -0,0 +1,109 @@
+/*
+
+ 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_DELETE_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteSubMenuRequest command class
+ **/
+class DeleteSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteSubMenuRequest(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 DeleteSubMenuRequest class destructor
+ **/
+ ~DeleteSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Deletes VR commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuVRCommands(app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Deletes UI commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuUICommands(app_mngr::ApplicationSharedPtr const app);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h
new file mode 100644
index 0000000000..e5b0c58a34
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_DELETE_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class DeleteSubMenuResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteSubMenuResponse(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 DeleteSubMenuResponse class destructor
+ **/
+ virtual ~DeleteSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h
new file mode 100644
index 0000000000..3e313602c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h
@@ -0,0 +1,95 @@
+/*
+ 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_DIAL_NUMBER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DialNumber request command class
+ **/
+class DialNumberRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief DialNumberRequest class constructor
+ **/
+ DialNumberRequest(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 DialNumberRequest class destructor
+ **/
+ ~DialNumberRequest() OVERRIDE;
+
+ /**
+ * @brief Initialize request params
+ **/
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Removes from number param all characters
+ * except the + character and digits.
+ *
+ */
+ void StripNumberParam(std::string& number);
+
+ DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h
new file mode 100644
index 0000000000..6181231458
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_DIAL_NUMBER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DialNumberResponse command class
+ **/
+class DialNumberResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DialNumberResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DialNumberResponse(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 DialNumberResponse class destructor
+ **/
+ virtual ~DialNumberResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..319a20958e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h
@@ -0,0 +1,85 @@
+/*
+
+ 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_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruRequest command class
+ **/
+class EndAudioPassThruRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ EndAudioPassThruRequest(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 EndAudioPassThruRequest class destructor
+ **/
+ virtual ~EndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..e2a667f272
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h
@@ -0,0 +1,79 @@
+/*
+
+ 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_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruResponse command class
+ **/
+class EndAudioPassThruResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ EndAudioPassThruResponse(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 EndAudioPassThruResponse class destructor
+ **/
+ virtual ~EndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h
new file mode 100644
index 0000000000..b780daaf03
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h
@@ -0,0 +1,77 @@
+/*
+ * 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_GENERIC_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class GenericResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief GenericResponse class constructor
+ **/
+ GenericResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manage,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manage,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief GenericResponse class destructor
+ **/
+ virtual ~GenericResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GenericResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h
new file mode 100644
index 0000000000..b8da061870
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h
@@ -0,0 +1,67 @@
+/*
+
+ 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_GET_SYSTEM_CAPABILITY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class GetSystemCapabilityRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ GetSystemCapabilityRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ virtual ~GetSystemCapabilityRequest();
+
+ virtual void Run() OVERRIDE;
+
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest);
+
+}; // GetSystemCapabilityRequest
+} // commands
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h
new file mode 100644
index 0000000000..9fa954c89f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h
@@ -0,0 +1,66 @@
+/*
+
+ 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_GET_SYSTEM_CAPABILITY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class GetSystemCapabilityResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ GetSystemCapabilityResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ virtual ~GetSystemCapabilityResponse();
+
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse);
+
+}; // GetSystemCapabilityResponse
+} // commands
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h
new file mode 100644
index 0000000000..7197874475
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetWayPointsRequest command class
+ **/
+class GetWayPointsRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief GetWayPointsRequest class constructor
+ **/
+ GetWayPointsRequest(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 GetWayPointsRequest class destructor
+ **/
+ virtual ~GetWayPointsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h
new file mode 100644
index 0000000000..bb480a7ac0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h
@@ -0,0 +1,76 @@
+/*
+ * 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_GET_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetWayPointsResponse command class
+ **/
+class GetWayPointsResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief GetWayPointsResponse class constructor
+ **/
+ GetWayPointsResponse(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 GetWayPointsResponse class destructor
+ **/
+ virtual ~GetWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h
new file mode 100644
index 0000000000..53d75819f8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_LIST_FILES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ListFilesRequest command class
+ **/
+class ListFilesRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ListFilesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ListFilesRequest(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 ListFilesRequest class destructor
+ **/
+ virtual ~ListFilesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h
new file mode 100644
index 0000000000..1b3cdf1b02
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_LIST_FILES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ListFilesResponse command class
+ **/
+class ListFilesResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ListFilesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ListFilesResponse(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 ListFilesResponse class destructor
+ **/
+ virtual ~ListFilesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h
new file mode 100644
index 0000000000..ba01d4bb28
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppInterfaceUnregisteredNotification class
+ **/
+class OnAppInterfaceUnregisteredNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAppInterfaceUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppInterfaceUnregisteredNotification(
+ 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 OnAppInterfaceUnregisteredNotification class destructor
+ **/
+ virtual ~OnAppInterfaceUnregisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppInterfaceUnregisteredNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h
new file mode 100644
index 0000000000..e3410bd873
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ 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_AUDIO_PASS_THRU_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAudioPassThruNotification class used to send notification with
+ *binary data written from
+ * microphone to mobile device while PerformAudioPassThru is active.
+ **/
+class OnAudioPassThruNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAudioPassThruNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAudioPassThruNotification(
+ 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 OnAudioPassThruNotification class destructor
+ **/
+ virtual ~OnAudioPassThruNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAudioPassThruNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h
new file mode 100644
index 0000000000..6afdc0e1cf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h
@@ -0,0 +1,92 @@
+/*
+
+ 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_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonEventNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonEventNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonEventNotification(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 OnButtonEventNotification class destructor
+ **/
+ virtual ~OnButtonEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button event notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonEvent(app_mngr::ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h
new file mode 100644
index 0000000000..fe9bc449be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h
@@ -0,0 +1,91 @@
+/*
+
+ 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_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonPressNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonPressNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonPressNotification(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 OnButtonEventCommand class destructor
+ **/
+ virtual ~OnButtonPressNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button press notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonPress(app_mngr::ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h
new file mode 100644
index 0000000000..367b280e73
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ 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_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief OnCommandNotification class is used to send notification
+ * to mobile device.
+ **/
+class OnCommandNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnCommandNotification(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 OnCommandNotification class destructor
+ **/
+ virtual ~OnCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnCommandNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..82e6097d84
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_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_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnDriverDistractionNotification class
+ **/
+class OnDriverDistractionNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDriverDistractionNotification(
+ 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 OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h
new file mode 100644
index 0000000000..76c9cf34c5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+namespace mobile {
+
+/**
+ * @brief OnHashChangeNotification class
+ **/
+class OnHashChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHashChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnHashChangeNotification(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 OnHashChangeNotification class destructor
+ **/
+ virtual ~OnHashChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h
new file mode 100644
index 0000000000..0e1919676b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h
@@ -0,0 +1,79 @@
+/*
+
+ 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_HMI_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnHMIStatusNotification class
+ **/
+class OnHMIStatusNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHMIStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnHMIStatusNotification(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 OnHMIStatusNotification class destructor
+ **/
+ virtual ~OnHMIStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h
new file mode 100644
index 0000000000..12e3b54be9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h
@@ -0,0 +1,82 @@
+/*
+
+ 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_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+
+#include "application_manager/commands/command_notification_from_mobile_impl.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnHMIStatusNotificationFromMobile class
+ **/
+class OnHMIStatusNotificationFromMobile
+ : public app_mngr::commands::CommandNotificationFromMobileImpl {
+ public:
+ /**
+ * @brief OnHMIStatusNotificationFromMobile class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnHMIStatusNotificationFromMobile(
+ 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 OnHMIStatusNotificationFromMobile class destructor
+ **/
+ virtual ~OnHMIStatusNotificationFromMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotificationFromMobile);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h
new file mode 100644
index 0000000000..d34815ff2f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.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_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnKeyBoardInputNotification class
+ **/
+class OnKeyBoardInputNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnKeyBoardInputNotification(
+ 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 OnKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnKeyBoardInputNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h
new file mode 100644
index 0000000000..b234b93796
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnLanguageChangeNotification class
+ **/
+class OnLanguageChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnLanguageChangeNotification(
+ 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 OnLanguageChangeNotification class destructor
+ **/
+ virtual ~OnLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnLanguageChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h
new file mode 100644
index 0000000000..f586a0d36c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_PERMISSIONS_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnPermissionsChangeNotification class
+ **/
+class OnPermissionsChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnPermissionsChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnPermissionsChangeNotification(
+ 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 OnPermissionsChangeNotification class destructor
+ **/
+ virtual ~OnPermissionsChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPermissionsChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h
new file mode 100644
index 0000000000..b369ad38f2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h
@@ -0,0 +1,93 @@
+/*
+ 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_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+#include "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 OnSystemRequestNotification class
+ **/
+class OnSystemRequestNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ typedef std::vector<uint8_t> BinaryMessage;
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemRequestNotification(
+ 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 OnSystemRequestNotification class destructor
+ **/
+ ~OnSystemRequestNotification() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+#ifdef PROPRIETARY_MODE
+ /**
+ * @brief Adds HTTP header to message
+ * @param message Message
+ */
+ void AddHeader(BinaryMessage& message) const;
+ size_t ParsePTString(std::string& pt_string) const;
+#endif // PROPRIETARY_MODE
+
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // 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_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h
new file mode 100644
index 0000000000..39b12fea15
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTBTClientStateNotification class
+ **/
+class OnTBTClientStateNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTBTClientStateNotification(
+ 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 OnTBTClientStateNotification class destructor
+ **/
+ virtual ~OnTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTBTClientStateNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h
new file mode 100644
index 0000000000..858759b793
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ 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_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnTouchEventNotification class
+ **/
+class OnTouchEventNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTouchEventNotification(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 OnTouchEventNotification class destructor
+ **/
+ virtual ~OnTouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTouchEventNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h
new file mode 100644
index 0000000000..c379fceb02
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class OnWayPointChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnWayPointChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnWayPointChangeNotification(
+ 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 OnWayPointChangeNotification class destructor
+ **/
+ virtual ~OnWayPointChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnWayPointChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..1a4c248a02
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
@@ -0,0 +1,189 @@
+/*
+
+ 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_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruRequest command class
+ **/
+class PerformAudioPassThruRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAudioPassThruRequest(
+ 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 PerformAudioPassThruRequest class destructor
+ **/
+ virtual ~PerformAudioPassThruRequest();
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Prepare result code, result and info for sending to mobile
+ * @brief Response params
+ * success for sending to mobile application
+ * result code for sending to mobile application
+ * info for sending to mobile application
+ */
+ struct ResponseParams {
+ bool success;
+ mobile_apis::Result::eType result_code;
+ std::string info;
+ ResponseParams()
+ : success(false), result_code(mobile_apis::Result::INVALID_ENUM) {}
+ };
+
+ ResponseParams response_params_;
+
+ /**
+ * @brief Prepare result code, 'success' result and info for sending
+ * to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @return result for sending to mobile application.
+ */
+ const ResponseParams& PrepareResponseParameters();
+
+ /**
+ * @brief Sends TTS Speak request
+ */
+ void SendSpeakRequest();
+
+ /**
+ * @brief Sends UI PerformAudioPassThru request
+ */
+ void SendPerformAudioPassThruRequest();
+
+ /**
+ * @brief Sends UI RecordStart notification after TTS Speak response received.
+ * Indicates that capturing mic data should be started
+ */
+ void SendRecordStartNotification();
+
+ /**
+ * @brief Starts microphone recording
+ */
+ void StartMicrophoneRecording();
+
+ /**
+ * @brief Checks perform audio pass thru params(initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform audio pass thru contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request
+ * TTS_StopSpeaking to HMI
+ */
+ void FinishTTSSpeak();
+
+ /*
+ * @brief Tells if there are sent requests without responses
+ */
+ bool IsWaitingHMIResponse();
+
+ /**
+ * @brief Pair of result_code and success for mobile app
+ */
+ typedef std::pair<mobile_apis::Result::eType, bool> AudioPassThruResults;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app in
+ * audioPassThru communication.
+ * @param ui_response contains result_code from UI
+ * @param tts_response contains result_code from TTS
+ * @return pair of result code (UI error code has precedence than TTS's,
+ * error_code from TTS is turned to WARNINGS) and
+ * result for mobile app
+ */
+ AudioPassThruResults PrepareAudioPassThruResultCodeForResponse(
+ const app_mngr::commands::ResponseInfo& ui_response,
+ const app_mngr::commands::ResponseInfo& tts_response);
+
+ hmi_apis::Common_Result::eType result_tts_speak_;
+ hmi_apis::Common_Result::eType result_ui_;
+ std::string ui_info_;
+ std::string tts_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..6654762067
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruResponse command class
+ **/
+class PerformAudioPassThruResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAudioPassThruResponse(
+ 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 PerformAudioPassThruResponse class destructor
+ **/
+ virtual ~PerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
new file mode 100644
index 0000000000..2d4cbc9afc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
@@ -0,0 +1,251 @@
+/*
+
+ 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_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionRequest command class
+ **/
+class PerformInteractionRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformInteractionRequest(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 PerformInteractionRequest class destructor
+ **/
+ virtual ~PerformInteractionRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @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);
+
+ /*
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ private:
+ /**
+ * @brief Function will be called when VR_OnCommand event
+ * comes
+ * @param message which should send to mobile side
+ * @return true if send response to mobile application otherwise
+ * return false.
+ */
+ bool ProcessVRResponse(const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params);
+
+ /**
+ * @brief Sends PerformInteraction response to mobile side
+ * @param message which should send to mobile side
+ */
+ void ProcessUIResponse(const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params);
+
+ /*
+ * @brief Sends UI PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendUIPerformInteractionRequest(
+ app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends TTS PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRPerformInteractionRequest(
+ app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends UI Show VR help request to HMI
+ *
+ * @param app_id Application ID
+ */
+ void SendUIShowVRHelpRequest(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar menu names.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar menu names in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetMenuNames(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetVRSynonyms(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if request with non-sequential positions of vrHelpItems
+ * SDLAQ-CRS-466
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE if vrHelpItems positions are sequential,
+ * otherwise FALSE
+ */
+ bool CheckVrHelpItemPositions(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Disable PerformInteraction state in application and
+ * delete VR commands from HMI
+ */
+ void DisablePerformInteraction();
+
+ /**
+ * @brief Checks perform interaction params(initialText, initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform interaction contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Send HMI close PopUp and call DisablePerformInteraction
+ */
+ void TerminatePerformInteraction();
+
+ /**
+ * @brief Checks parameter ChoiceID from response.
+ * @param app contains pointer to application
+ * @param choice_id contains ChoiceID from response.
+ * @return if ChoiceID from response is correct method returns TRUE
+ * otherwise returns FALSE.
+ */
+ bool CheckChoiceIDFromResponse(app_mngr::ApplicationSharedPtr app,
+ int32_t choice_id);
+
+ /**
+ * @brief Checks for a match of choice ID, in
+ * choice sets.
+ * @param app contains pointer to application.
+ * @param choice_set_id_list_length contains amount
+ * of choice set ids.
+ * @param choice_set_id_list array of choice set ids
+ * @return If request contains several choice sets with
+ * same choice id returns false, otherwise returns
+ * true.
+ */
+ bool CheckChoiceIDFromRequest(
+ app_mngr::ApplicationSharedPtr app,
+ const size_t choice_set_id_list_length,
+ const smart_objects::SmartObject& choice_set_id_list) const;
+
+ /**
+ * @brief Checks each choice in each set for having a VRcommands parameter
+ * @param app contains pointer to application.
+ * @return returns false if request has choice sets with no vrCommands
+ */
+ bool CheckChoiceSetListVRCommands(app_mngr::ApplicationSharedPtr app);
+
+ /**
+ * @brief Tells if there are sent requests without responses
+ * @return If there is request without response method returns TRUE
+ * otherwise returns FALSE
+ */
+ const bool HasHMIResponsesToWait() const;
+
+ /**
+ * @brief Check UI & VR result codes, send response to mobile
+ * @param msg_param Message params to send
+ */
+ void SendBothModeResponse(const smart_objects::SmartObject& msg_param);
+
+ mobile_apis::InteractionMode::eType interaction_mode_;
+ bool ui_response_received_;
+ bool vr_response_received_;
+ bool app_pi_was_active_before_;
+ static uint32_t pi_requests_count_;
+ hmi_apis::Common_Result::eType vr_result_code_;
+ hmi_apis::Common_Result::eType ui_result_code_;
+ std::string ui_info_;
+ std::string vr_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h
new file mode 100644
index 0000000000..6bb9135dcc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionResponse command class
+ **/
+class PerformInteractionResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformInteractionResponse(
+ 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 PerformInteractionResponse class destructor
+ **/
+ virtual ~PerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
new file mode 100644
index 0000000000..2783280f87
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
@@ -0,0 +1,86 @@
+/*
+
+ 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_PUT_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PutFileRequest command class
+ **/
+class PutFileRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PutFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PutFileRequest(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 PutFileRequest class destructor
+ **/
+ virtual ~PutFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ uint64_t offset_;
+ std::string sync_file_name_;
+ int64_t length_;
+ mobile_apis::FileType::eType file_type_;
+ bool is_persistent_file_;
+
+ void SendOnPutFileNotification();
+ DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h
new file mode 100644
index 0000000000..22dbf1b5d5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_PUT_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PutFileResponse command class
+ **/
+class PutFileResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PutFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PutFileResponse(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 PutFileResponse class destructor
+ **/
+ virtual ~PutFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PutFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
new file mode 100644
index 0000000000..542fdac5f8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
@@ -0,0 +1,224 @@
+/*
+
+ 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_REGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "utils/macro.h"
+#include "utils/custom_string.h"
+
+namespace policy {
+struct DeviceInfo;
+}
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceRequest class constructor
+ **/
+ RegisterAppInterfaceRequest(
+ 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 RegisterAppInterfaceRequest class destructor
+ **/
+ virtual ~RegisterAppInterfaceRequest();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /**
+ * @brief The AppicationType enum defines whether application is newly
+ * registered or existing and being switched over another transport
+ */
+ enum class ApplicationType {
+ kNewApplication,
+ kSwitchedApplicationHashOk,
+ kSwitchedApplicationWrongHashId
+ };
+
+ /**
+ * @brief Prepares and sends RegisterAppInterface response to mobile
+ * considering application type
+ * @param app_type Type of application
+ **/
+ void SendRegisterAppInterfaceResponseToMobile(ApplicationType app_type);
+
+ smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification(
+ const uint32_t connection_key, app_mngr::ApplicationSharedPtr app);
+
+ /**
+ * @brief SendChangeRegistration send ChangeRegistration on HMI
+ * @param function_id interface specific ChangeRegistration
+ * @param language language of registration
+ * @param app_id application to change registration
+ */
+ void SendChangeRegistration(const hmi_apis::FunctionID::eType function_id,
+ const int32_t language,
+ const uint32_t app_id);
+
+ /**
+ * @brief SendChangeRegistrationOnHMI send required SendChangeRegistration
+ * HMI
+ * @param app application to change registration
+ */
+ void SendChangeRegistrationOnHMI(app_mngr::ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Sends OnAppRegistered notification to HMI
+ *
+ *@param application_impl application with changed HMI status
+ *
+ **/
+ void SendOnAppRegisteredNotificationToHMI(
+ const app_mngr::Application& application_impl,
+ bool resumption = false,
+ bool need_restore_vr = false);
+ /*
+ * @brief Check new ID along with known mobile application ID
+ *
+ * return TRUE if ID is known already, otherwise - FALSE
+ */
+ bool IsApplicationWithSameAppIdRegistered();
+
+ /*
+ * @brief Check new application parameters (name, tts, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /*
+ * @brief Predicate for using with CheckCoincidence method to compare with VR
+ * synonym SO
+ *
+ * return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ CoincidencePredicateVR(const custom_str::CustomString& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(const smart_objects::SmartObject& obj) {
+ const custom_str::CustomString& vr_synonym = obj.asCustomString();
+ return newItem_.CompareIgnoreCase(vr_synonym);
+ }
+ const custom_str::CustomString& newItem_;
+ };
+
+ /**
+ * @brief Check request parameters against policy table data
+ * @return SUCCESS if check ok, otherwise return appropriate error code
+ */
+ mobile_apis::Result::eType CheckWithPolicyData();
+
+ /**
+ * @brief Fill DeviceInfo struct with data from request, if any
+ * @param device_info Struct for device params from request
+ */
+ void FillDeviceInfo(policy::DeviceInfo* device_info);
+
+ /**
+ * @brief Checks register app interface params(ttsName, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if register app interface contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Checks vehicle type params (model, year etc.) and in case of absense
+ * replaces with policy table backup values
+ * @param vehicle_type VehicleType struct
+ * @param param Vehicle param
+ * @param backup_value Backup value
+ */
+ void CheckResponseVehicleTypeParam(smart_objects::SmartObject& vehicle_type,
+ const std::string& param,
+ const std::string& backup_value);
+ /**
+ * @brief Sends ButtonSubscription notification at start up
+ * to notify HMI that app subscribed on the custom button by default.
+ */
+ void SendSubscribeCustomButtonNotification();
+
+ /**
+ * @brief IsApplicationSwitched checks whether application is switched from
+ * another transport. If application id is found, but not in reconnection
+ * list, returns 'already registered' code. Otherwise - proceed with
+ * switching.
+ * @return True if application is detected as switched, otherwise false.
+ */
+ bool IsApplicationSwitched();
+
+ private:
+ std::string response_info_;
+ mobile_apis::Result::eType result_code_;
+
+ policy::PolicyHandlerInterface& GetPolicyHandler();
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h
new file mode 100644
index 0000000000..d591d67794
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.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_REGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceResponse class constructor
+ **/
+ RegisterAppInterfaceResponse(
+ const app_mngr::commands::MessageSharedPtr& response,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(response,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief RegisterAppInterfaceResponse class destructor
+ **/
+ virtual ~RegisterAppInterfaceResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ void SetHeartBeatTimeout(uint32_t connection_key,
+ const std::string& mobile_app_id);
+
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h
new file mode 100644
index 0000000000..6f7e330bf5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h
@@ -0,0 +1,149 @@
+/*
+
+ 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_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesRequest command class
+ **/
+class ResetGlobalPropertiesRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ResetGlobalPropertiesRequest(
+ 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 ResetGlobalPropertiesRequest class destructor
+ **/
+ ~ResetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Sets default value of the HELPPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ * @param is_timeout_promp Flag indicating that timeout prompt
+ * should be reset
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetHelpPromt(app_mngr::ApplicationSharedPtr app);
+
+ /*
+ * @brief Sets default value of the TIMEOUTPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetTimeoutPromt(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sets default value of the VRHELPTITLE global property
+ * to the application name and value of the VRHELPITEMS global property
+ * to value equal to registered command -1(default command “Help / Cancel”.)
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetVrHelpTitleItems(
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Prepare result for sending to mobile application
+ * @param out_result_code contains result code for sending to mobile
+ * application
+ * @param out_response_info contains info for sending to mobile applicaion
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& out_result_code,
+ std::string& out_response_info);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h
new file mode 100644
index 0000000000..b33ef41426
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class ResetGlobalPropertiesResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ResetGlobalPropertiesResponse(
+ 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 ResetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~ResetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h
new file mode 100644
index 0000000000..a641fa0cd4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h
@@ -0,0 +1,90 @@
+/*
+
+ 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_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief scrollable message request command class
+ **/
+class ScrollableMessageRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ScrollableMessageRequest class constructor
+ **/
+ ScrollableMessageRequest(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 SliderCommand class destructor
+ **/
+ virtual ~ScrollableMessageRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @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);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h
new file mode 100644
index 0000000000..8bc8a36363
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.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_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class ScrollableMessageResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief ScrollableMessageResponse class constructor
+ **/
+ ScrollableMessageResponse(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 SpeakResponseCommand class destructor
+ **/
+ virtual ~ScrollableMessageResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h
new file mode 100644
index 0000000000..e3ed6ef28b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h
@@ -0,0 +1,88 @@
+/*
+ * 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_SEND_HAPTIC_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
+
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SendHapticDataRequest command class
+ **/
+class SendHapticDataRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SendHapticDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ SendHapticDataRequest(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 SendHapticDataRequest class destructor
+ **/
+ ~SendHapticDataRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendHapticDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h
new file mode 100644
index 0000000000..53e8766241
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h
@@ -0,0 +1,77 @@
+/*
+ * 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_SEND_HAPTIC_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SendHapticDataResponse command class
+ **/
+class SendHapticDataResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SendHapticDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ SendHapticDataResponse(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 SendHapticDataResponse class destructor
+ **/
+ ~SendHapticDataResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendHapticDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h
new file mode 100644
index 0000000000..6626da4c9d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h
@@ -0,0 +1,100 @@
+/*
+
+ 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_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+
+#include <list>
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief send location request command class
+ */
+class SendLocationRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SendLocationRquest class constructor
+ */
+ SendLocationRequest(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 SendLocationRquest class destructor
+ */
+ virtual ~SendLocationRequest();
+
+ /**
+ * @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);
+
+ private:
+ /**
+ * @brief CheckFieldsCompatibility checks if fields are compatible with each
+ * other.
+ * @return true if compatible, otherwise return false
+ */
+ bool CheckFieldsCompatibility();
+
+ /**
+ * @brief Checks sendlocation params(locationName, locationDescription, ...).
+ * Checks string if it contains \t\n \\t \\n or whitespace
+ * @return true if string contains invalid characters, otherwise returns false
+ */
+ bool IsWhiteSpaceExist();
+
+ bool CheckHMICapabilities(
+ std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names);
+ DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h
new file mode 100644
index 0000000000..cb461f9a60
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h
@@ -0,0 +1,71 @@
+/*
+ * 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_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SendLocationResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SendLocationResponse class constructor
+ */
+ SendLocationResponse(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 SendLocationResponse class destructor
+ */
+ virtual ~SendLocationResponse();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendLocationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h
new file mode 100644
index 0000000000..1075999af9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h
@@ -0,0 +1,116 @@
+/*
+
+ 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_SET_APP_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetIconRequest command class
+ **/
+class SetAppIconRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief Contains information about the type of image
+ */
+ typedef enum { STATIC = 0, DYNAMIC } ImageType;
+
+ /**
+ * @brief SetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetAppIconRequest(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 SetIconRequest class destructor
+ **/
+ virtual ~SetAppIconRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /**
+ * @brief Copies file to icon storage
+ * @param path_to_file Path to icon
+ */
+ void CopyToIconStorage(const std::string& path_to_file) const;
+
+ /**
+ * @brief Remove oldest icons
+ * @param storage Path to icons storage
+ * @param icons_amount Amount of icons to be deleted
+ */
+ void RemoveOldestIcons(const std::string& storage,
+ const uint32_t icons_amount) const;
+
+ /**
+ * @brief Checks, if there enough space in storage for icon copy
+ * @param file_size File size
+ * @return true, if enough, otherwise - false
+ */
+ bool IsEnoughSpaceForIcon(const uint64_t icon_size) const;
+ DISALLOW_COPY_AND_ASSIGN(SetAppIconRequest);
+
+ private:
+ /**
+ * @brief Checks, if icons saving to configured folder is enabled
+ */
+ bool is_icons_saving_enabled_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h
new file mode 100644
index 0000000000..e4ce0725dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_SET_APP_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetIconResponse command class
+ **/
+class SetAppIconResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetAppIconResponse(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 SetIconResponse class destructor
+ **/
+ virtual ~SetAppIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetAppIconResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h
new file mode 100644
index 0000000000..4bd800988c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h
@@ -0,0 +1,85 @@
+/*
+
+ 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_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutRequest command class
+ **/
+class SetDisplayLayoutRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetDisplayLayoutRequest(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 SetDisplayLayoutRequest class destructor
+ **/
+ virtual ~SetDisplayLayoutRequest();
+
+ /**
+ * @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);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h
new file mode 100644
index 0000000000..73f57fc187
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h
@@ -0,0 +1,79 @@
+/*
+
+ 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_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutResponse command class
+ **/
+class SetDisplayLayoutResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetDisplayLayoutResponse(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 SetDisplayLayoutResponse class destructor
+ **/
+ virtual ~SetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
new file mode 100644
index 0000000000..674de4731a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
@@ -0,0 +1,158 @@
+/*
+ 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_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "application_manager/application.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetGlobalPropertiesRequest(
+ 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 SetGlobalPropertiesRequest class destructor
+ **/
+ ~SetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ // prepare UI sending data (VrHelps, Menus, Keyboard) to SmartObject
+ static void PrepareUIRequestVRHelpData(
+ const app_mngr::ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params);
+
+ static void PrepareUIRequestMenuAndKeyboardData(
+ const app_mngr::ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params);
+
+ // Send TTS request to HMI
+ void SendTTSRequest(const smart_objects::SmartObject& params,
+ bool use_events);
+
+ // Send UI request to HMI
+ void SendUIRequest(const smart_objects::SmartObject& params, bool use_events);
+
+ // VRHelp shall contain sequential positions and start from 1
+ static bool CheckVrHelpItemsOrder(const smart_objects::SmartObject& vr_help);
+
+ /**
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks if request has at least one parameter
+ *
+ * @param params request parameters
+ *
+ * @returns true if at least one parameter is present in object
+ */
+ static bool ValidateConditionalMandatoryParameters(
+ const smart_objects::SmartObject& params);
+
+ /**
+ * @brief Checks set global properties params(helpPrompt, timeoutPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if set global properties contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for sending to mobile applicaion
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
+ bool is_ui_send_;
+ bool is_tts_send_;
+
+ bool is_ui_received_;
+ bool is_tts_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h
new file mode 100644
index 0000000000..778dc9b7d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetGlobalPropertiesResponse(
+ 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 SetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~SetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h
new file mode 100644
index 0000000000..ef674f1c38
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h
@@ -0,0 +1,86 @@
+/*
+
+ 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_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetMediaClockRequest request command class
+ **/
+class SetMediaClockRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SetMediaClockRequest class constructor
+ **/
+ SetMediaClockRequest(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 ShowCommand class destructor
+ **/
+ virtual ~SetMediaClockRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ bool isDataValid();
+
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h
new file mode 100644
index 0000000000..2fb3f25839
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SetMediaClockTimerResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SetMediaClockTimerResponse class constructor
+ **/
+ SetMediaClockTimerResponse(
+ 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 SetMediaClockTimerResponse class destructor
+ **/
+ virtual ~SetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockTimerResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h
new file mode 100644
index 0000000000..cadc87cef6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h
@@ -0,0 +1,94 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTRequest command class
+ **/
+class ShowConstantTBTRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ShowConstantTBTRequest(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 ShowConstantTBTRequest class destructor
+ **/
+ virtual ~ShowConstantTBTRequest();
+
+ /**
+ * @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);
+
+ private:
+ /**
+ * @brief Checks show constant TBT params(turnIcon, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if show constant TBT contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h
new file mode 100644
index 0000000000..4129a7640e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTResponse command class
+ **/
+class ShowConstantTBTResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ShowConstantTBTResponse(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 ShowConstantTBTResponse class destructor
+ **/
+ virtual ~ShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
new file mode 100644
index 0000000000..2277a38f11
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
@@ -0,0 +1,103 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief show request command class
+ **/
+class ShowRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief ShowRequest class constructor
+ **/
+ ShowRequest(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 ShowRequest class destructor
+ **/
+ virtual ~ShowRequest();
+
+ /**
+ * @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);
+
+ private:
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfShowRequest();
+
+ /**
+ * @brief Handle the conversion of metadata information from the incoming
+ * mobile json message format to the outgoing hmi json message format
+ */
+ void HandleMetadata(const char* field_id,
+ int32_t field_index,
+ smart_objects::SmartObject& msg_params);
+
+ mobile_apis::Result::eType core_result_code_;
+ std::string core_response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h
new file mode 100644
index 0000000000..c78820a26e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class ShowResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief ShowResponse class constructor
+ **/
+ ShowResponse(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 ShowResponse class destructor
+ **/
+ virtual ~ShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h
new file mode 100644
index 0000000000..f1e06e8d8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h
@@ -0,0 +1,96 @@
+/*
+
+ 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_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief slider request command class
+ **/
+class SliderRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SliderRequest class constructor
+ **/
+ SliderRequest(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 SliderRequest class destructor
+ **/
+ virtual ~SliderRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @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);
+
+ private:
+ /**
+ * @brief Checks slider params(sliderHeader, sliderFooter, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if slider contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h
new file mode 100644
index 0000000000..2a93103632
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h
@@ -0,0 +1,72 @@
+/*
+ * 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_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SliderResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SliderResponse class constructor
+ **/
+ SliderResponse(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 SpeakResponseCommand class destructor
+ **/
+ virtual ~SliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SliderResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h
new file mode 100644
index 0000000000..d6d47bb869
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h
@@ -0,0 +1,98 @@
+/*
+
+ 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_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief speak request command class
+ **/
+class SpeakRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SpeakRequest class constructor
+ **/
+ SpeakRequest(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 SpeakRequest class destructor
+ **/
+ virtual ~SpeakRequest();
+
+ /**
+ * @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);
+
+ private:
+ /*
+ * @brief Sends Speak response to mobile side
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessTTSSpeakResponse(const smart_objects::SmartObject& message);
+
+ /**
+ * @brief Checks speak param ttsChunks on the contents \t\n \\t \\n
+ * @return if speak contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h
new file mode 100644
index 0000000000..30eda07810
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h
@@ -0,0 +1,72 @@
+/*
+ * 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_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SpeakResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SpeakResponse class constructor
+ **/
+ SpeakResponse(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 SpeakResponse class destructor
+ **/
+ virtual ~SpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SpeakResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h
new file mode 100644
index 0000000000..011c0aa359
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h
@@ -0,0 +1,103 @@
+/*
+
+ 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_SUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonRequest command class
+ **/
+class SubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeButtonRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SubscribeButtonRequest class destructor
+ **/
+ ~SubscribeButtonRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Checks if button subscription allowed. In case non-media
+ * application trying to subscribe on buttons(tune, seek) negative result will
+ * be returned
+ *
+ * @param app Application requested subscription
+ * @param btn_id Button to be subscribe
+ *
+ * @return TRUE on success, otherwise false
+ **/
+ bool IsSubscriptionAllowed(app_mngr::ApplicationSharedPtr app,
+ const mobile_apis::ButtonName::eType btn_id);
+
+ /**
+ * @brief Sends ButtonSubscription notification
+ * to notify HMI that app subscribed on the button.
+ */
+ void SendSubscribeButtonNotification();
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h
new file mode 100644
index 0000000000..28e942ec17
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_SUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonResponse command class
+ **/
+class SubscribeButtonResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeButtonResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handlers);
+
+ /**
+ * @brief SubscribeButtonResponse class destructor
+ **/
+ virtual ~SubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h
new file mode 100644
index 0000000000..6105f08750
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h
@@ -0,0 +1,87 @@
+/*
+ * 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_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubsribeWayPointsRequest command class
+ **/
+class SubscribeWayPointsRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SubscribeWayPointsRequest class constructor
+ **/
+ SubscribeWayPointsRequest(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 SubscribeWayPointsRequest class destructor
+ **/
+ ~SubscribeWayPointsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h
new file mode 100644
index 0000000000..cd27e96d25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h
@@ -0,0 +1,78 @@
+/*
+ * 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_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeWayPointsResponse command class
+ **/
+class SubscribeWayPointsResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SubscribeWayPointsResponse class constructor
+ **/
+ SubscribeWayPointsResponse(
+ 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 SubscribeWayPointsResponse class destructor
+ **/
+ virtual ~SubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h
new file mode 100644
index 0000000000..c34db34506
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h
@@ -0,0 +1,98 @@
+/*
+
+ 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_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
+
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SystemRequest command class
+ **/
+class SystemRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SystemRequest(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 SystemRequest class destructor
+ **/
+ virtual ~SystemRequest();
+
+ /**
+ * @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);
+
+ private:
+ /**
+ * @brief Validates data coming within QueryApps response
+ * @param data Data
+ * @return true, if data is valid, otherwise - false
+ */
+ bool ValidateQueryAppData(smart_objects::SmartObject& data) const;
+
+ private:
+ static uint32_t index;
+ std::string processing_file_;
+ DISALLOW_COPY_AND_ASSIGN(SystemRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h
new file mode 100644
index 0000000000..afbd557d12
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h
@@ -0,0 +1,77 @@
+/*
+
+ 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_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SystemResponse command class
+ **/
+class SystemResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SystemResponse(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 SystemResponse class destructor
+ **/
+ virtual ~SystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SystemResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h
new file mode 100644
index 0000000000..172f934a15
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h
@@ -0,0 +1,85 @@
+/*
+
+ 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_UNREGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceRequest class constructor
+ **/
+ UnregisterAppInterfaceRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief UnregisterAppInterfaceRequest class destructor
+ **/
+ virtual ~UnregisterAppInterfaceRequest() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ // virtual void cleanUp() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h
new file mode 100644
index 0000000000..13d8b549e8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceResponse class constructor
+ **/
+ UnregisterAppInterfaceResponse(
+ const app_mngr::commands::MessageSharedPtr& response,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(response,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief UnregisterAppInterfaceResponse class destructor
+ **/
+ virtual ~UnregisterAppInterfaceResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h
new file mode 100644
index 0000000000..8cbaafbfe1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h
@@ -0,0 +1,89 @@
+/*
+
+ 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_UNSUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonRequest command class
+ **/
+class UnsubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeButtonRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UnsubscribeButtonRequest class destructor
+ **/
+ ~UnsubscribeButtonRequest() FINAL;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Sends ButtonSubscription notification
+ * to notify HMI that app unsubscribed from the button.
+ */
+ void SendUnsubscribeButtonNotification();
+
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h
new file mode 100644
index 0000000000..1db067acce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h
@@ -0,0 +1,79 @@
+/*
+
+ 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_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonResponse command class
+ **/
+class UnsubscribeButtonResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeButtonResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UnsubscribeButtonResponse class destructor
+ **/
+ virtual ~UnsubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
new file mode 100644
index 0000000000..fe14f5c7eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
@@ -0,0 +1,86 @@
+/*
+ * 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_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class UnsubscribeWayPointsRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief UnsubscribeWayPointsRequest class constructor
+ **/
+ UnsubscribeWayPointsRequest(
+ 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 UnsubscribeWayPointsRequest class destructor
+ **/
+ ~UnsubscribeWayPointsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsRequest);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h
new file mode 100644
index 0000000000..c578bf9f99
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h
@@ -0,0 +1,78 @@
+/*
+ * 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_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeWayPointsResponse command class
+ **/
+class UnsubscribeWayPointsResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief UnsubscribeWayPointsResponse class constructor
+ **/
+ UnsubscribeWayPointsResponse(
+ 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 UnsubscribeWayPointsResponse class destructor
+ **/
+ virtual ~UnsubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h
new file mode 100644
index 0000000000..8766339f96
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h
@@ -0,0 +1,102 @@
+/*
+
+ 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_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListRequest command class
+ **/
+class UpdateTurnListRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief UpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateTurnListRequest(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 UpdateTurnListRequest class destructor
+ **/
+ virtual ~UpdateTurnListRequest();
+
+ /**
+ * @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);
+
+ private:
+ /**
+ * @brief check correct parameter turnList
+ *
+ * @return TRUE if turnList is correct,
+ * otherwise FALSE
+ */
+ bool CheckTurnListArray();
+
+ /**
+ * @brief Checks update turn list param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if update turn list contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h
new file mode 100644
index 0000000000..59d3bf0b2c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListResponse command class
+ **/
+class UpdateTurnListResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief UpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateTurnListResponse(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 UpdateTurnListResponse class destructor
+ **/
+ virtual ~UpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h
new file mode 100644
index 0000000000..eee454fb00
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
+
+#include "application_manager/command_factory.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+/**
+ * @brief Factory class for HMI command creation
+ **/
+class HMICommandFactory : public app_mngr::CommandFactory {
+ public:
+ HMICommandFactory(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::CommandCreator& get_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type,
+ app_mngr::commands::Command::CommandSource source) const;
+
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h
new file mode 100644
index 0000000000..f0840dde41
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
+
+#include "application_manager/command_factory.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+/**
+ * @brief Factory class for mobile command creation
+ **/
+class MobileCommandFactory : public app_mngr::CommandFactory {
+ public:
+ MobileCommandFactory(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::CommandCreator& get_creator_factory(
+ mobile_apis::FunctionID::eType id,
+ mobile_apis::messageType::eType message_type,
+ app_mngr::commands::Command::CommandSource source) const;
+
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h
new file mode 100644
index 0000000000..5b5f0ae49f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.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_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
+
+#include <memory>
+#include "application_manager/application_manager.h"
+#include "application_manager/command_factory.h"
+#include "sdl_rpc_plugin/hmi_command_factory.h"
+#include "sdl_rpc_plugin/mobile_command_factory.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class SDLCommandFactory : public app_mngr::CommandFactory {
+ public:
+ SDLCommandFactory(app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& app_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ std::unique_ptr<HMICommandFactory> hmi_command_factory_;
+ std::unique_ptr<MobileCommandFactory> mobile_command_factory_;
+};
+}
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
new file mode 100644
index 0000000000..6ae3a0b6bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
@@ -0,0 +1,68 @@
+/*
+ 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_SDL_RPC_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "application_manager/command_factory.h"
+
+namespace sdl_rpc_plugin {
+namespace plugins = application_manager::plugin_manager;
+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,
+ policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::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;
+
+ private:
+ std::unique_ptr<application_manager::CommandFactory> command_factory_;
+};
+}
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc
new file mode 100644
index 0000000000..19d01b594f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h"
+
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ActivateAppRequest::ActivateAppRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ActivateAppRequest::~ActivateAppRequest() {
+ LOG4CXX_TRACE(logger_, "~ActivateAppRequest");
+}
+
+void ActivateAppRequest::Run() {
+ LOG4CXX_TRACE(logger_, "enter " << correlation_id());
+ uint32_t app_id = RequestToHMI::application_id();
+ application_manager_.set_application_id(correlation_id(), app_id);
+#ifdef ENABLE_LOG
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::activate_app_hmi_level)) {
+ mobile_apis::HMILevel::eType requested_hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::activate_app_hmi_level]
+ .asInt());
+ LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level);
+ }
+#endif
+ SendRequest();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc
new file mode 100644
index 0000000000..d7e38c5d5b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h"
+
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ActivateAppResponse::ActivateAppResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ActivateAppResponse::~ActivateAppResponse() {}
+
+void ActivateAppResponse::Run() {
+ LOG4CXX_TRACE(logger_, "enter");
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc
new file mode 100644
index 0000000000..3e46bd353a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h"
+#include "application_manager/policies/policy_handler.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddStatisticsInfoNotification::AddStatisticsInfoNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {}
+
+void AddStatisticsInfoNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ int type = (*message_)[strings::msg_params][hmi_notification::statistic_type]
+ .asInt();
+
+ policy_handler_.AddStatisticsInfo(type);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc
new file mode 100644
index 0000000000..b227dd79dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAllAppsRequest::AllowAllAppsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAllAppsRequest::~AllowAllAppsRequest() {}
+
+void AllowAllAppsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc
new file mode 100644
index 0000000000..2fdf29a7dd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAllAppsResponse::AllowAllAppsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAllAppsResponse::~AllowAllAppsResponse() {}
+
+void AllowAllAppsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.SetAllAppsAllowed(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc
new file mode 100644
index 0000000000..0c6e5145c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAppRequest::AllowAppRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAppRequest::~AllowAppRequest() {}
+
+void AllowAppRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc
new file mode 100644
index 0000000000..4853c3764a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc
@@ -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.
+ */
+#include "sdl_rpc_plugin/commands/hmi/allow_app_response.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAppResponse::AllowAppResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAppResponse::~AllowAppResponse() {}
+
+void AllowAppResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t connection_key =
+ (*message_)[strings::params][strings::connection_key].asInt();
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ app->set_app_allowed(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc
new file mode 100644
index 0000000000..fb87612e19
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc
@@ -0,0 +1,58 @@
+/*
+ * 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
+ * distribut wiion.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+BasicCommunicationGetSystemTimeRequest::BasicCommunicationGetSystemTimeRequest(
+ 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) {}
+
+void BasicCommunicationGetSystemTimeRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.protocol_handler().NotifyOnFailedHandshake();
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc
new file mode 100644
index 0000000000..c067debf36
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Commands")
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BasicCommunicationGetSystemTimeResponse::
+ BasicCommunicationGetSystemTimeResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+void BasicCommunicationGetSystemTimeResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_GetSystemTime);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc
new file mode 100644
index 0000000000..0c39389116
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAwakeSDLNotification::OnAwakeSDLNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAwakeSDLNotification::~OnAwakeSDLNotification() {}
+
+void OnAwakeSDLNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!application_manager_.resume_controller().is_suspended()) {
+ return;
+ }
+
+ {
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetIt itBegin = accessor.GetData().begin();
+ ApplicationSetIt itEnd = accessor.GetData().end();
+ for (; itBegin != itEnd; ++itBegin) {
+ const ApplicationSharedPtr app = *itBegin;
+ if (app && app->IsHashChangedDuringSuspend()) {
+ MessageHelper::SendHashUpdateNotification(app->app_id(),
+ application_manager_);
+ app->SetHashChangedDuringSuspend(false);
+ }
+ }
+ }
+
+ application_manager_.resume_controller().OnAwake();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc
new file mode 100644
index 0000000000..04e44a6979
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+BasicCommunicationSystemRequest::BasicCommunicationSystemRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {}
+
+void BasicCommunicationSystemRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc
new file mode 100644
index 0000000000..5f8221fdbe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+BasicCommunicationSystemResponse::BasicCommunicationSystemResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {}
+
+void BasicCommunicationSystemResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_SystemRequest);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
new file mode 100644
index 0000000000..cf2fbd9761
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "utils/logger.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {}
+
+void ButtonGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
new file mode 100644
index 0000000000..863e179040
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h"
+
+#include "utils/logger.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {}
+
+void ButtonGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS != code) {
+ LOG4CXX_ERROR(logger_, "Error is returned. Capabilities won't be updated.");
+ return;
+ }
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_button_capabilities(
+ (*message_)[strings::msg_params][hmi_response::capabilities]);
+
+ hmi_capabilities.set_preset_bank_capabilities(
+ (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc
new file mode 100644
index 0000000000..84a47b9deb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ClosePopupRequest::ClosePopupRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ClosePopupRequest::~ClosePopupRequest() {}
+
+void ClosePopupRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc
new file mode 100644
index 0000000000..25396af337
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ClosePopupResponse::ClosePopupResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ClosePopupResponse::~ClosePopupResponse() {}
+
+void ClosePopupResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(VS): Process response from HMI
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc
new file mode 100644
index 0000000000..0e09c14650
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DecryptCertificateRequest::DecryptCertificateRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+void DecryptCertificateRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t correlation_id = RequestToHMI::correlation_id();
+ const uint32_t app_id = RequestToHMI::application_id();
+ application_manager_.set_application_id(correlation_id, app_id);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc
new file mode 100644
index 0000000000..694298ed91
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h"
+
+#include "application_manager/policies/policy_handler.h"
+#ifdef EXTERNAL_PROPRIETARY_MODE
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DecryptCertificateResponse::DecryptCertificateResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+DecryptCertificateResponse::~DecryptCertificateResponse() {}
+
+void DecryptCertificateResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ const bool is_succeeded = hmi_apis::Common_Result::SUCCESS == code;
+
+ policy_handler_.OnCertificateDecrypted(is_succeeded);
+}
+
+} // namespace commands
+} // namespace application_manager
+#endif // EXTERNAL_PROPRIETARY_MODE
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc
new file mode 100644
index 0000000000..63f5c2e815
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+DialNumberRequest::DialNumberRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+DialNumberRequest::~DialNumberRequest() {}
+
+void DialNumberRequest::Run() {
+ SendRequest();
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc
new file mode 100644
index 0000000000..6d37ece2bf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+DialNumberResponse::DialNumberResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+DialNumberResponse::~DialNumberResponse() {}
+
+void DialNumberResponse::Run() {
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_DialNumber);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc
new file mode 100644
index 0000000000..c06c90973d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetSystemInfoRequest::GetSystemInfoRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetSystemInfoRequest::~GetSystemInfoRequest() {}
+
+void GetSystemInfoRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t correlation_id = RequestToHMI::correlation_id();
+ uint32_t app_id = RequestToHMI::application_id();
+ application_manager_.set_application_id(correlation_id, app_id);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc
new file mode 100644
index 0000000000..aef428b39f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetSystemInfoResponse::GetSystemInfoResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetSystemInfoResponse::~GetSystemInfoResponse() {}
+
+void GetSystemInfoResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ const SystemInfo& info = GetSystemInfo(code);
+
+ // We have to set preloaded flag as false in policy table on any response
+ // of GetSystemInfo (SDLAQ-CRS-2365)
+ policy_handler_.OnGetSystemInfo(
+ info.ccpu_version, info.wers_country_code, info.language);
+}
+
+const SystemInfo GetSystemInfoResponse::GetSystemInfo(
+ const hmi_apis::Common_Result::eType code) const {
+ SystemInfo info;
+
+ if (hmi_apis::Common_Result::SUCCESS != code) {
+ LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code);
+ return info;
+ }
+ info.ccpu_version =
+ (*message_)[strings::msg_params]["ccpu_version"].asString();
+
+ info.wers_country_code =
+ (*message_)[strings::msg_params]["wersCountryCode"].asString();
+
+ const uint32_t lang_code =
+ (*message_)[strings::msg_params]["language"].asUInt();
+ info.language = application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+
+ hmi_capabilities_.set_ccpu_version(info.ccpu_version);
+
+ return info;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
new file mode 100644
index 0000000000..ae375e4087
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/get_urls.h"
+#include "application_manager/message.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/policies/policy_handler.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetUrls::GetUrls(const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetUrls::~GetUrls() {}
+
+void GetUrls::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ namespace Common_Result = hmi_apis::Common_Result;
+ using policy::EndpointUrls;
+
+ if (!policy_handler_.PolicyEnabled()) {
+ SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+
+ const uint32_t service_to_check =
+ (*message_)[strings::msg_params][hmi_request::service].asUInt();
+
+ EndpointUrls endpoints;
+ policy_handler_.GetUpdateUrls(service_to_check, endpoints);
+
+ if (endpoints.empty()) {
+ LOG4CXX_ERROR(logger_, "No URLs for service " << service_to_check);
+ SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+
+#ifdef PROPRIETARY_MODE
+ const uint32_t policy_service = 7u;
+
+ if (policy_service == service_to_check) {
+ ProcessPolicyServiceURLs(endpoints);
+ return;
+ }
+#endif // PROPRIETARY_MODE
+
+ ProcessServiceURLs(endpoints);
+}
+
+void GetUrls::ProcessServiceURLs(const policy::EndpointUrls& endpoints) {
+ namespace Common_Result = hmi_apis::Common_Result;
+ using smart_objects::SmartObject;
+
+ (*message_)[strings::msg_params].erase(hmi_request::service);
+ SmartObject& urls = (*message_)[strings::msg_params][hmi_response::urls];
+
+ size_t index = 0;
+ for (size_t e = 0; e < endpoints.size(); ++e) {
+ ApplicationSharedPtr app =
+ application_manager_.application_by_policy_id(endpoints[e].app_id);
+
+#ifndef PROPRIETARY_MODE
+ bool registered_not_default = false;
+ if (policy::kDefaultId != endpoints[e].app_id) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find application with policy id "
+ << endpoints[e].app_id
+ << " URLs adding for this application is skipped.");
+ continue;
+ }
+ registered_not_default = true;
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE || HTTP
+ for (size_t u = 0; u < endpoints[e].url.size(); ++u, ++index) {
+ const std::string& app_url = endpoints[e].url[u];
+ SmartObject& service_info = urls[index];
+
+ service_info[strings::url] = app_url;
+#ifndef PROPRIETARY_MODE
+ if (registered_not_default) {
+ service_info[strings::app_id] = app->hmi_app_id();
+ }
+#else // EXTERNAL_PROPRIETARY_MODE || HTTP
+ service_info[hmi_response::policy_app_id] = endpoints[e].app_id;
+#endif
+ }
+ }
+ SendResponseToHMI(Common_Result::SUCCESS);
+}
+
+void GetUrls::SendResponseToHMI(hmi_apis::Common_Result::eType result) {
+ (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message_)[strings::params][hmi_response::code] = result;
+ rpc_service_.ManageHMICommand(message_);
+}
+
+#ifdef PROPRIETARY_MODE
+struct PolicyAppIdComparator {
+ PolicyAppIdComparator(const std::string& policy_app_id)
+ : policy_app_id_(policy_app_id) {}
+
+ bool operator()(const policy::EndpointData& data) {
+ return data.app_id == policy_app_id_;
+ }
+ std::string policy_app_id_;
+};
+
+void FillSODefaultUrls(smart_objects::SmartObject& urls,
+ const policy::EndpointUrls& endpoints) {
+ using smart_objects::SmartObject;
+ PolicyAppIdComparator comparator(policy::kDefaultId);
+ policy::EndpointUrls::const_iterator it =
+ std::find_if(endpoints.begin(), endpoints.end(), comparator);
+ if (it == endpoints.end()) {
+ return;
+ }
+ SmartObject service_info = SmartObject(smart_objects::SmartType_Map);
+ for (size_t i = 0; i < (*it).url.size(); ++i) {
+ service_info[strings::url] = (*it).url[i];
+ urls[i] = service_info;
+ }
+}
+
+void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace smart_objects;
+ using namespace application_manager;
+ using namespace strings;
+ using namespace hmi_apis;
+
+ const uint32_t app_id_to_send_to = policy_handler_.GetAppIdForSending();
+
+ if (!app_id_to_send_to) {
+ LOG4CXX_ERROR(logger_,
+ "There are no available applications for processing.");
+ SmartObject urls(SmartType_Array);
+ FillSODefaultUrls(urls, endpoints);
+ if (!urls.empty()) {
+ (*message_)[msg_params][hmi_response::urls] = urls;
+ }
+ (*message_).erase(hmi_request::service);
+ SendResponseToHMI(Common_Result::SUCCESS);
+ return;
+ }
+
+ ApplicationSharedPtr app =
+ application_manager_.application(app_id_to_send_to);
+
+ if (app.use_count() == 0) {
+ LOG4CXX_WARN(logger_,
+ "There is no registered application with "
+ "connection key '"
+ << app_id_to_send_to << "'");
+ SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+
+ SmartObject& object = *message_;
+ object[msg_params].erase(hmi_request::service);
+ object[msg_params][hmi_response::urls] = SmartObject(SmartType_Array);
+ SmartObject& urls = object[msg_params][hmi_response::urls];
+ const std::string mobile_app_id = app->policy_app_id();
+
+ size_t index = 0;
+ for (size_t i = 0; i < endpoints.size(); ++i) {
+ using namespace helpers;
+
+ const bool to_add = Compare<std::string, EQ, ONE>(
+ endpoints[i].app_id, mobile_app_id, policy::kDefaultId);
+ const bool is_default = policy::kDefaultId == endpoints[i].app_id;
+
+ if (to_add) {
+ for (size_t k = 0; k < endpoints[i].url.size(); ++k) {
+ if (!is_default) {
+ urls[index][strings::app_id] = app_id_to_send_to;
+ }
+ urls[index][strings::url] = endpoints[i].url[k];
+ ++index;
+ }
+ }
+ }
+ SendResponseToHMI(Common_Result::SUCCESS);
+ return;
+}
+#endif // PROPRIETARY_MODE
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc
new file mode 100644
index 0000000000..57c925e08f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetUrlsResponse::GetUrlsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetUrlsResponse::~GetUrlsResponse() {}
+
+void GetUrlsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc
new file mode 100644
index 0000000000..39f7e61c06
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+MixingAudioSupportedRequest::MixingAudioSupportedRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {}
+
+void MixingAudioSupportedRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc
new file mode 100644
index 0000000000..26fa967844
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+MixingAudioSupportedResponse::MixingAudioSupportedResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {}
+
+void MixingAudioSupportedResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ hmi_capabilities_.set_attenuated_supported(
+ (*message_)[strings::msg_params][hmi_response::attenuated_supported]
+ .asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc
new file mode 100644
index 0000000000..ae3695b68e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviAlertManeuverRequest::NaviAlertManeuverRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {}
+
+void NaviAlertManeuverRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc
new file mode 100644
index 0000000000..6a6307038a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviAlertManeuverResponse::NaviAlertManeuverResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {}
+
+void NaviAlertManeuverResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_AlertManeuver);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
new file mode 100644
index 0000000000..a9698d36ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h"
+
+#include "application_manager/message_helper.h"
+#include "protocol_handler/protocol_handler.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStartStreamRequest::AudioStartStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher())
+ , retry_number_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::pair<uint32_t, int32_t> stream_retry =
+ application_manager_.get_settings().start_stream_retry_amount();
+ default_timeout_ = stream_retry.second;
+ retry_number_ = stream_retry.first;
+ LOG4CXX_DEBUG(logger_,
+ "default_timeout_ = " << default_timeout_
+ << "; retry_number_ = " << retry_number_);
+}
+
+AudioStartStreamRequest::~AudioStartStreamRequest() {
+ // see comment in NaviStartStreamRequest
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_StartAudioStream);
+}
+
+void AudioStartStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Applcation with hmi_app_id " << application_id()
+ << " does not exist");
+ return;
+ }
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
+ correlation_id());
+ app->set_audio_streaming_allowed(true);
+ SendRequest();
+}
+
+void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "StartAudioStreamRequest aborted. Application not found");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_StartAudioStream: {
+ LOG4CXX_DEBUG(logger_, "Received StartStream event");
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ LOG4CXX_INFO(logger_, "StartAudioStream response SUCCESS");
+ if (application_manager_.HMILevelAllowsStreaming(app->app_id(),
+ ServiceType::kAudio)) {
+ app->set_audio_streaming_approved(true);
+ } else {
+ LOG4CXX_WARN(
+ logger_,
+ "StartAudioStreamRequest aborted. Application can not stream");
+ }
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+ break;
+ }
+ if (hmi_apis::Common_Result::REJECTED == code) {
+ LOG4CXX_INFO(logger_, "StartAudioStream response REJECTED");
+ RetryStartSession();
+ break;
+ }
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void AudioStartStreamRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RetryStartSession();
+}
+
+void AudioStartStreamRequest::RetryStartSession() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "StartAudioStreamRequest aborted. Application not found");
+ return;
+ }
+
+ if (!app->audio_streaming_allowed()) {
+ LOG4CXX_WARN(logger_, "Audio streaming not allowed");
+ return;
+ }
+
+ if (app->audio_streaming_approved()) {
+ LOG4CXX_INFO(logger_,
+ "AudioStartStream retry sequence stopped. "
+ << "SUCCESS received");
+ app->set_audio_stream_retry_number(0);
+ return;
+ }
+
+ uint32_t curr_retry_number = app->audio_stream_retry_number();
+ LOG4CXX_DEBUG(
+ logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
+
+ if (curr_retry_number < retry_number_) {
+ LOG4CXX_DEBUG(logger_, "Send AudioStartStream retry");
+ MessageHelper::SendAudioStartStream(app->app_id(), application_manager_);
+ app->set_audio_stream_retry_number(++curr_retry_number);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Audio start stream retry sequence stopped. "
+ << "Attempts expired.");
+
+ application_manager_.EndNaviServices(app->app_id());
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc
new file mode 100644
index 0000000000..362a46cc19
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStartStreamResponse::AudioStartStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AudioStartStreamResponse::~AudioStartStreamResponse() {}
+
+void AudioStartStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_StartAudioStream);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc
new file mode 100644
index 0000000000..ba2b8c8157
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStopStreamRequest::AudioStopStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AudioStopStreamRequest::~AudioStopStreamRequest() {}
+
+void AudioStopStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc
new file mode 100644
index 0000000000..87ddc81696
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStopStreamResponse::AudioStopStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AudioStopStreamResponse::~AudioStopStreamResponse() {}
+
+void AudioStopStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc
new file mode 100644
index 0000000000..77ef3e3369
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviGetWayPointsRequest::NaviGetWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviGetWayPointsRequest::~NaviGetWayPointsRequest() {}
+
+void NaviGetWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc
new file mode 100644
index 0000000000..0aad5e5724
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviGetWayPointsResponse::NaviGetWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviGetWayPointsResponse::~NaviGetWayPointsResponse() {}
+
+void NaviGetWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc
new file mode 100644
index 0000000000..781b8d3045
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviIsReadyRequest::NaviIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+NaviIsReadyRequest::~NaviIsReadyRequest() {}
+
+void NaviIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_IsReady,
+ correlation_id());
+ SendRequest();
+}
+
+void NaviIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received Navigation_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_,
+ message,
+ HmiInterfaces::HMI_INTERFACE_Navigation);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_navi_cooperating(is_available);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc
new file mode 100644
index 0000000000..b4e64e2a3e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviIsReadyResponse::NaviIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviIsReadyResponse::~NaviIsReadyResponse() {}
+
+void NaviIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc
new file mode 100644
index 0000000000..a10f61310d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSendLocationRequest::NaviSendLocationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSendLocationRequest::~NaviSendLocationRequest() {}
+
+void NaviSendLocationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc
new file mode 100644
index 0000000000..f93e2e17c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSendLocationResponse::NaviSendLocationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSendLocationResponse::~NaviSendLocationResponse() {}
+
+void NaviSendLocationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_SendLocation);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc
new file mode 100644
index 0000000000..5e4426bd20
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc
@@ -0,0 +1,156 @@
+/*
+ * 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 names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h"
+#include <string>
+#include <vector>
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSetVideoConfigRequest::NaviSetVideoConfigRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+NaviSetVideoConfigRequest::~NaviSetVideoConfigRequest() {}
+
+void NaviSetVideoConfigRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_WARN(logger_, "HMI interface Navigation is not supported");
+ return;
+ }
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application with hmi_app_id " << application_id()
+ << "does not exist");
+ return;
+ }
+
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_SetVideoConfig,
+ correlation_id());
+ SendRequest();
+}
+
+void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application is not found, abort NaviSetVideoConfigRequest");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ bool result = false;
+ std::vector<std::string> rejected_params;
+
+ if (code == hmi_apis::Common_Result::SUCCESS) {
+ LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response");
+ result = true;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Received SetVideoConfig failure response (" << event.id()
+ << ")");
+ result = false;
+ if (message[strings::msg_params].keyExists(strings::rejected_params)) {
+ const smart_objects::SmartArray* list =
+ message[strings::msg_params][strings::rejected_params].asArray();
+ if (list != NULL) {
+ for (unsigned int i = 0; i < list->size(); i++) {
+ const std::string& param = (*list)[i].asString();
+ // Make sure that we actually sent the parameter in the request
+ if ((*message_)[strings::msg_params].keyExists(strings::config) &&
+ (*message_)[strings::msg_params][strings::config].keyExists(
+ param)) {
+ rejected_params.push_back(param);
+ }
+ }
+ }
+ }
+ }
+ application_manager_.OnStreamingConfigured(
+ app->app_id(),
+ protocol_handler::ServiceType::kMobileNav,
+ result,
+ rejected_params);
+ break;
+ }
+ default:
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+}
+
+void NaviSetVideoConfigRequest::onTimeOut() {
+ LOG4CXX_WARN(logger_, "Timed out while waiting for SetVideoConfig response");
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not found");
+ return;
+ }
+
+ std::vector<std::string> empty;
+ application_manager_.OnStreamingConfigured(
+ app->app_id(), protocol_handler::ServiceType::kMobileNav, false, empty);
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc
new file mode 100644
index 0000000000..c5f1c5307f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc
@@ -0,0 +1,64 @@
+/*
+ * 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 names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSetVideoConfigResponse::NaviSetVideoConfigResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSetVideoConfigResponse::~NaviSetVideoConfigResponse() {}
+
+void NaviSetVideoConfigResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_SetVideoConfig);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc
new file mode 100644
index 0000000000..22d604ab0d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviShowConstantTBTRequest::NaviShowConstantTBTRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {}
+
+void NaviShowConstantTBTRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc
new file mode 100644
index 0000000000..d2ff26b645
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviShowConstantTBTResponse::NaviShowConstantTBTResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {}
+
+void NaviShowConstantTBTResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
new file mode 100644
index 0000000000..f3d971acba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h"
+
+#include "application_manager/message_helper.h"
+#include "protocol_handler/protocol_handler.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStartStreamRequest::NaviStartStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher())
+ , retry_number_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::pair<uint32_t, int32_t> stream_retry =
+ application_manager_.get_settings().start_stream_retry_amount();
+ default_timeout_ = stream_retry.second;
+ retry_number_ = stream_retry.first;
+ LOG4CXX_DEBUG(logger_,
+ "default_timeout_ = " << default_timeout_
+ << "; retry_number_ = " << retry_number_);
+}
+
+NaviStartStreamRequest::~NaviStartStreamRequest() {
+ // unsubscribe_from_all_events() in EventObserver's destructor isn't enough;
+ // we must unsubscribe before this NaviStartStreamRequest instance is removed
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_StartStream);
+}
+
+void NaviStartStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Applcation with hmi_app_id " << application_id()
+ << "does not exist");
+ return;
+ }
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
+ correlation_id());
+ app->set_video_streaming_allowed(true);
+ SendRequest();
+}
+
+void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "NaviStartStreamRequest aborted. Application not found");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_StartStream: {
+ LOG4CXX_DEBUG(logger_, "Received StartStream event");
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ LOG4CXX_INFO(logger_, "NaviStartStreamResponse SUCCESS");
+ if (application_manager_.HMILevelAllowsStreaming(
+ app->app_id(), ServiceType::kMobileNav)) {
+ app->set_video_streaming_approved(true);
+ } else {
+ LOG4CXX_DEBUG(
+ logger_,
+ "NaviStartStreamRequest aborted. Application can not stream");
+ }
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+ break;
+ }
+ if (hmi_apis::Common_Result::REJECTED == code) {
+ LOG4CXX_INFO(logger_, "StartStream response REJECTED ");
+ RetryStartSession();
+ break;
+ }
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void NaviStartStreamRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RetryStartSession();
+}
+
+void NaviStartStreamRequest::RetryStartSession() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "NaviStartStreamRequest aborted. Application not found");
+ return;
+ }
+
+ if (!app->video_streaming_allowed()) {
+ LOG4CXX_WARN(logger_, "Video streaming not allowed");
+ return;
+ }
+
+ if (app->video_streaming_approved()) {
+ LOG4CXX_INFO(logger_,
+ "NaviStartStream retry sequence stopped. "
+ << "SUCCESS received");
+ app->set_video_stream_retry_number(0);
+ return;
+ }
+
+ uint32_t curr_retry_number = app->video_stream_retry_number();
+ LOG4CXX_DEBUG(
+ logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
+
+ if (curr_retry_number < retry_number_) {
+ LOG4CXX_DEBUG(logger_, "Send NaviStartStream retry");
+ MessageHelper::SendNaviStartStream(app->app_id(), application_manager_);
+ app->set_video_stream_retry_number(++curr_retry_number);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "NaviStartStream retry sequence stopped. "
+ << "Attempts expired");
+
+ application_manager_.EndNaviServices(app->app_id());
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc
new file mode 100644
index 0000000000..f09a334f51
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStartStreamResponse::NaviStartStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviStartStreamResponse::~NaviStartStreamResponse() {}
+
+void NaviStartStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_StartStream);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc
new file mode 100644
index 0000000000..3e27692d62
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStopStreamRequest::NaviStopStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviStopStreamRequest::~NaviStopStreamRequest() {}
+
+void NaviStopStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc
new file mode 100644
index 0000000000..61b8d5a1e2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStopStreamResponse::NaviStopStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviStopStreamResponse::~NaviStopStreamResponse() {}
+
+void NaviStopStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc
new file mode 100644
index 0000000000..a4445ebce8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSubscribeWayPointsRequest::NaviSubscribeWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSubscribeWayPointsRequest::~NaviSubscribeWayPointsRequest() {}
+
+void NaviSubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc
new file mode 100644
index 0000000000..ae5f236f6f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSubscribeWayPointsResponse::NaviSubscribeWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSubscribeWayPointsResponse::~NaviSubscribeWayPointsResponse() {}
+
+void NaviSubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
new file mode 100644
index 0000000000..ec22c93d8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUnsubscribeWayPointsRequest::NaviUnsubscribeWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUnsubscribeWayPointsRequest::~NaviUnsubscribeWayPointsRequest() {}
+
+void NaviUnsubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc
new file mode 100644
index 0000000000..c084bd52d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUnsubscribeWayPointsResponse::NaviUnsubscribeWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUnsubscribeWayPointsResponse::~NaviUnsubscribeWayPointsResponse() {}
+
+void NaviUnsubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc
new file mode 100644
index 0000000000..9c507c3637
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUpdateTurnListRequest::NaviUpdateTurnListRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {}
+
+void NaviUpdateTurnListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc
new file mode 100644
index 0000000000..eb232e6d01
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUpdateTurnListResponse::NaviUpdateTurnListResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {}
+
+void NaviUpdateTurnListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc
new file mode 100644
index 0000000000..398c2dac30
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {}
+
+void OnAllowSDLFunctionalityNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string device_id;
+ if ((*message_)[strings::msg_params].keyExists("device")) {
+ device_id = (*message_)[strings::msg_params]["device"]["id"].asString();
+ }
+ policy_handler_.OnAllowSDLFunctionalityNotification(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool(),
+ device_id);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc
new file mode 100644
index 0000000000..189596c58a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
+
+#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppActivatedNotification::OnAppActivatedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppActivatedNotification::~OnAppActivatedNotification() {}
+
+void OnAppActivatedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc
new file mode 100644
index 0000000000..ee45f9bf1e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppDeactivatedNotification::OnAppDeactivatedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {}
+
+void OnAppDeactivatedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc
new file mode 100644
index 0000000000..e13299ece7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppPermissionChangedNotification::OnAppPermissionChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {}
+
+void OnAppPermissionChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
new file mode 100644
index 0000000000..cf83c48a5a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
@@ -0,0 +1,182 @@
+
+/**
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include <algorithm>
+#include <functional>
+#include <string>
+#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
+
+namespace {
+
+/**
+ * @brief Converts SmartObject data to group permission status and appends to
+ * collection
+ */
+struct PermissionsAppender
+ : public std::unary_function<void,
+ const smart_objects::SmartArray::value_type&> {
+ PermissionsAppender(policy::PermissionConsent& consents)
+ : allowed_key_(application_manager::hmi_response::allowed)
+ , consents_(consents) {}
+ void operator()(const smart_objects::SmartArray::value_type& item) const {
+ using namespace policy;
+ using namespace application_manager;
+
+ FunctionalGroupPermission permissions;
+
+ permissions.group_id = static_cast<int32_t>(item[strings::id].asInt());
+ permissions.group_alias = item[strings::name].asString();
+
+ if (item.keyExists(allowed_key_)) {
+ permissions.state =
+ item[allowed_key_].asBool() ? kGroupAllowed : kGroupDisallowed;
+ }
+
+ consents_.group_permissions.push_back(permissions);
+ }
+
+ private:
+ const std::string allowed_key_;
+ policy::PermissionConsent& consents_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+/**
+ * @brief Converts SmartObject data to customer connectivity status item and
+ * appends to collection
+ */
+struct ExternalConsentStatusAppender
+ : std::unary_function<void, const smart_objects::SmartArray::value_type&> {
+ ExternalConsentStatusAppender(
+ policy::ExternalConsentStatus& external_consent_status)
+ : external_consent_status_(external_consent_status) {}
+ void operator()(const smart_objects::SmartArray::value_type& item) const {
+ using namespace policy;
+ using namespace hmi_apis;
+ using namespace application_manager;
+
+ ExternalConsentStatusItem status_item(
+ static_cast<uint32_t>(item[strings::entity_type].asUInt()),
+ static_cast<uint32_t>(item[strings::entity_id].asUInt()),
+ static_cast<Common_EntityStatus::eType>(
+ item[strings::status].asUInt()) == Common_EntityStatus::ON
+ ? policy::kStatusOn
+ : policy::kStatusOff);
+
+ external_consent_status_.insert(status_item);
+ }
+
+ private:
+ policy::ExternalConsentStatus& external_consent_status_;
+};
+#endif
+} // namespace
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppPermissionConsentNotification::OnAppPermissionConsentNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {}
+
+void OnAppPermissionConsentNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ uint32_t connection_key = 0;
+
+ policy::PermissionConsent permission_consent;
+
+ // If user defined group permissions for specific app
+ if (msg_params.keyExists(strings::app_id)) {
+ connection_key = msg_params[strings::app_id].asUInt();
+ }
+
+ if (msg_params.keyExists(strings::consented_functions)) {
+ const smart_objects::SmartArray* user_consent =
+ msg_params[strings::consented_functions].asArray();
+
+ smart_objects::SmartArray::const_iterator it = user_consent->begin();
+ smart_objects::SmartArray::const_iterator it_end = user_consent->end();
+ for (; it != it_end; ++it) {
+ policy::FunctionalGroupPermission permissions;
+ permissions.group_id = (*it)["id"].asInt();
+ permissions.group_alias = (*it)["name"].asString();
+ if ((*it).keyExists("allowed")) {
+ permissions.state = (*it)["allowed"].asBool()
+ ? policy::kGroupAllowed
+ : policy::kGroupDisallowed;
+ } else {
+ permissions.state = policy::kGroupUndefined;
+ }
+
+ permission_consent.group_permissions.push_back(permissions);
+ }
+
+ permission_consent.consent_source = msg_params[strings::source].asString();
+ }
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status;
+ if (msg_params.keyExists(strings::external_consent_status)) {
+ const smart_objects::SmartArray* system_external_consent_status =
+ msg_params[strings::external_consent_status].asArray();
+ ExternalConsentStatusAppender status_appender(external_consent_status);
+ std::for_each(system_external_consent_status->begin(),
+ system_external_consent_status->end(),
+ status_appender);
+ }
+ policy_handler_.OnAppPermissionConsent(
+ connection_key, permission_consent, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(connection_key, permission_consent);
+#endif
+}
+} // commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc
new file mode 100644
index 0000000000..24c5a94272
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppRegisteredNotification::OnAppRegisteredNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppRegisteredNotification::~OnAppRegisteredNotification() {}
+
+void OnAppRegisteredNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // SDL must notify system about app registration before any dependent actions
+ // will be started
+ SendNotification();
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc
new file mode 100644
index 0000000000..001b9fa5e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppUnregisteredNotification::OnAppUnregisteredNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {}
+
+bool OnAppUnregisteredNotification::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Replacement of hmi id is skipped.");
+ return true;
+}
+
+void OnAppUnregisteredNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // sending event for delete VRCommand on PerformInteraction
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc
new file mode 100644
index 0000000000..e2cd6d2cbf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAudioDataStreamingNotification::OnAudioDataStreamingNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAudioDataStreamingNotification::~OnAudioDataStreamingNotification() {}
+
+void OnAudioDataStreamingNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc
new file mode 100644
index 0000000000..1f052b865b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "utils/logger.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonEventNotification::OnButtonEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+void OnButtonEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc
new file mode 100644
index 0000000000..6c5d8f5a43
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "utils/logger.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonPressNotification::OnButtonPressNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+void OnButtonPressNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::Buttons_OnButtonPress);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID);
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
new file mode 100644
index 0000000000..70ff1c3fad
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonSubscriptionNotification::OnButtonSubscriptionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() {}
+
+void OnButtonSubscriptionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc
new file mode 100644
index 0000000000..2c4f9a1ccc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnDeviceChosenNotification::OnDeviceChosenNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnDeviceChosenNotification::~OnDeviceChosenNotification() {}
+
+void OnDeviceChosenNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
+ application_manager_.ConnectToDevice(
+ (*message_)[strings::msg_params][strings::device_info][strings::id]
+ .asString());
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc
new file mode 100644
index 0000000000..307dccd09b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc
@@ -0,0 +1,124 @@
+/*
+ * 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 <algorithm>
+#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "encryption/hashing.h"
+
+namespace {
+// TODO(AOleynik) : replace this !!!
+void check_zero(const char& a, const char& b, std::string& bt_mac) {
+ if ('0' != a && '0' == b) {
+ bt_mac.push_back(a);
+ bt_mac.push_back(b);
+ } else if ('0' == a) {
+ bt_mac.push_back(b);
+ } else {
+ bt_mac.push_back(a);
+ bt_mac.push_back(b);
+ }
+}
+
+std::string convert_to_bt_mac(std::string& deviceInternalId) {
+ std::transform(deviceInternalId.begin(),
+ deviceInternalId.end(),
+ deviceInternalId.begin(),
+ ::tolower);
+
+ std::string bt_mac;
+ check_zero(deviceInternalId[10], deviceInternalId[11], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[8], deviceInternalId[9], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[6], deviceInternalId[7], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[4], deviceInternalId[5], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[2], deviceInternalId[3], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[0], deviceInternalId[1], bt_mac);
+
+ return bt_mac;
+}
+}
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnDeviceStateChangedNotification::OnDeviceStateChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {}
+
+void OnDeviceStateChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((*message_)[strings::msg_params]["deviceState"] ==
+ hmi_apis::Common_DeviceState::UNPAIRED) {
+ // It is expected, that "deviceInternalId" is the device MAC address in
+ // form XXXXXXXXXX
+ std::string device_id =
+ (*message_)[strings::msg_params]["deviceInternalId"].asString();
+ if (device_id.empty()) {
+ if ((*message_)[strings::msg_params].keyExists("deviceId")) {
+ device_id =
+ (*message_)[strings::msg_params]["deviceId"]["id"].asString();
+ }
+ } else {
+ // Policy uses hashed MAC address as device_id
+ LOG4CXX_DEBUG(logger_, "Device_id from HMI: " << device_id);
+ std::string bt_mac = convert_to_bt_mac(device_id);
+ LOG4CXX_DEBUG(logger_, "Device_id as BT MAC: " << bt_mac);
+ device_id = encryption::MakeHash(bt_mac);
+ LOG4CXX_DEBUG(logger_, "Device_id hashed as BT MAC : " << device_id);
+ }
+ policy_handler_.RemoveDevice(device_id);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
new file mode 100644
index 0000000000..a5fb9b206e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
@@ -0,0 +1,142 @@
+/*
+ * 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 <set>
+#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+namespace {
+struct OnDriverDistractionProcessor {
+ OnDriverDistractionProcessor(
+ OnDriverDistractionNotification& command,
+ smart_objects::SmartObjectSPtr on_driver_distraction_so,
+ ApplicationManager& application_manager)
+ : command_(command)
+ , on_driver_distraction_so_(on_driver_distraction_so)
+ , application_manager_(application_manager)
+ , stringified_function_id_(MessageHelper::StringifiedFunctionID(
+ mobile_api::FunctionID::OnDriverDistractionID)) {}
+
+ void operator()(ApplicationSharedPtr application) {
+ if (application) {
+ (*on_driver_distraction_so_)[strings::params][strings::connection_key] =
+ application->app_id();
+ const RPCParams params;
+ policy::CheckPermissionResult result;
+ application_manager_.GetPolicyHandler().CheckPermissions(
+ application, stringified_function_id_, params, result);
+ if (result.hmi_level_permitted != policy::kRpcAllowed) {
+ MobileMessageQueue messages;
+ application->SwapMobileMessageQueue(messages);
+ messages.erase(
+ std::remove_if(
+ messages.begin(),
+ messages.end(),
+ [this](smart_objects::SmartObjectSPtr message) {
+ return (*message)[strings::params][strings::function_id]
+ .asString() == stringified_function_id_;
+ }),
+ messages.end());
+ application->PushMobileMessage(on_driver_distraction_so_);
+ return;
+ }
+ command_.SendNotificationToMobile(on_driver_distraction_so_);
+ }
+ }
+
+ private:
+ OnDriverDistractionNotification& command_;
+ smart_objects::SmartObjectSPtr on_driver_distraction_so_;
+ ApplicationManager& application_manager_;
+ std::string stringified_function_id_;
+};
+}
+
+OnDriverDistractionNotification::OnDriverDistractionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
+
+void OnDriverDistractionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ static_cast<hmi_apis::Common_DriverDistractionState::eType>(
+ (*message_)[strings::msg_params][hmi_notification::state].asInt());
+ application_manager_.set_driver_distraction_state(state);
+
+ smart_objects::SmartObjectSPtr on_driver_distraction =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_driver_distraction) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ (*on_driver_distraction)[strings::params][strings::function_id] =
+ mobile_api::FunctionID::OnDriverDistractionID;
+ (*on_driver_distraction)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
+ state;
+
+ const ApplicationSet applications =
+ application_manager_.applications().GetData();
+
+ OnDriverDistractionProcessor processor(
+ *this, on_driver_distraction, application_manager_);
+ std::for_each(applications.begin(), applications.end(), processor);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc
new file mode 100644
index 0000000000..cd3f2c23e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnEventChangedNotification::OnEventChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnEventChangedNotification::~OnEventChangedNotification() {}
+
+void OnEventChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
new file mode 100644
index 0000000000..9d250d288e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnExitAllApplicationsNotification::OnExitAllApplicationsNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {}
+
+void OnExitAllApplicationsNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_ApplicationsCloseReason::eType reason =
+ static_cast<hmi_apis::Common_ApplicationsCloseReason::eType>(
+ (*message_)[strings::msg_params][hmi_request::reason].asInt());
+ LOG4CXX_DEBUG(logger_, "Reason " << reason);
+
+ mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
+ mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM;
+
+ switch (reason) {
+ case hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::SUSPEND: {
+ application_manager_.resume_controller().OnSuspend();
+ SendOnSDLPersistenceComplete();
+ return;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason);
+ return;
+ }
+ }
+
+ application_manager_.SetUnregisterAllApplicationsReason(mob_reason);
+
+ if (mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET == mob_reason ||
+ mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS ==
+ mob_reason) {
+ application_manager_.HeadUnitReset(mob_reason);
+ }
+ kill(getpid(), SIGINT);
+}
+
+void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kNotification;
+ (*message)[strings::params][strings::correlation_id] =
+ application_manager_.GetNextHMICorrelationID();
+
+ rpc_service_.ManageHMICommand(message);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
new file mode 100644
index 0000000000..681390fbf4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnExitApplicationNotification::OnExitApplicationNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnExitApplicationNotification::~OnExitApplicationNotification() {}
+
+void OnExitApplicationNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+
+ uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt();
+ ApplicationSharedPtr app_impl = application_manager_.application(app_id);
+
+ if (app_impl.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ return;
+ }
+
+ auto on_app_exit = [app_impl](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationExit, app_impl);
+ };
+
+ application_manager_.GetPluginManager().ForEachPlugin(on_app_exit);
+
+ Common_ApplicationExitReason::eType reason;
+ reason = static_cast<Common_ApplicationExitReason::eType>(
+ (*message_)[strings::msg_params][strings::reason].asInt());
+
+ switch (reason) {
+ case Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION: {
+ break;
+ }
+ case Common_ApplicationExitReason::USER_EXIT: {
+ break;
+ }
+ case Common_ApplicationExitReason::UNAUTHORIZED_TRANSPORT_REGISTRATION: {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
+ SOURCE_SDL);
+ // HMI rejects registration for navi application
+ application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
+ return;
+ }
+ case Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE: {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
+ return;
+ }
+ default: {
+ LOG4CXX_WARN(logger_, "Unhandled reason");
+ return;
+ }
+ }
+
+ application_manager_.state_controller().SetRegularState(
+ app_impl,
+ HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ false);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc
new file mode 100644
index 0000000000..ec680c667d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnFileRemovedNotification::OnFileRemovedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnFileRemovedNotification::~OnFileRemovedNotification() {}
+
+void OnFileRemovedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc
new file mode 100644
index 0000000000..c74dd70c84
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_find_applications.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnFindApplications::OnFindApplications(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnFindApplications::~OnFindApplications() {}
+
+void OnFindApplications::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(PV): add UpdateAppsOnDevice to ApplicationManager
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc
new file mode 100644
index 0000000000..9ff1851e3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {}
+
+void OnIgnitionCycleOverNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_handler_.OnIgnitionCycleOver();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc
new file mode 100644
index 0000000000..20f20ece08
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {}
+
+void OnNaviTBTClientStateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc
new file mode 100644
index 0000000000..fa8819ca5b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnNaviWayPointChangeNotification::OnNaviWayPointChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& app_man,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(
+ message, app_man, rpc_service, hmi_capabilities, policy_handle) {}
+
+OnNaviWayPointChangeNotification::~OnNaviWayPointChangeNotification() {}
+
+void OnNaviWayPointChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc
new file mode 100644
index 0000000000..e069bea740
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnPolicyUpdate::OnPolicyUpdate(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnPolicyUpdate::~OnPolicyUpdate() {}
+
+void OnPolicyUpdate::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_handler_.OnPTExchangeNeeded();
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc
new file mode 100644
index 0000000000..1524aa9ea2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnPutFileNotification::OnPutFileNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnPutFileNotification::~OnPutFileNotification() {}
+
+void OnPutFileNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc
new file mode 100644
index 0000000000..76c9115662
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnReadyNotification::OnReadyNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnReadyNotification::~OnReadyNotification() {}
+
+void OnReadyNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.OnHMIStartedCooperation();
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc
new file mode 100644
index 0000000000..1eaef0b5e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc
@@ -0,0 +1,77 @@
+/*
+ * 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 <string>
+#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
+#include "application_manager/application_manager.h"
+#include "utils/file_system.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnReceivedPolicyUpdate::OnReceivedPolicyUpdate(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {}
+
+void OnReceivedPolicyUpdate::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ const std::string& file_path =
+ (*message_)[strings::msg_params][hmi_notification::policyfile].asString();
+ policy::BinaryMessage file_content;
+ if (!file_system::ReadBinaryFile(file_path, file_content)) {
+ LOG4CXX_ERROR(logger_, "Failed to read Update file.");
+ return;
+ }
+ policy_handler_.ReceiveMessageFromSDK(file_path, file_content);
+#else
+ LOG4CXX_WARN(logger_,
+ "This RPC is part of extended policy flow."
+ "Please re-build with extended policy mode enabled.");
+#endif
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc
new file mode 100644
index 0000000000..60699e5b9c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnRecordStartdNotification::OnRecordStartdNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnRecordStartdNotification::~OnRecordStartdNotification() {}
+
+void OnRecordStartdNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc
new file mode 100644
index 0000000000..9f8a713ffe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnResumeAudioSourceNotification::OnResumeAudioSourceNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {}
+
+void OnResumeAudioSourceNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc
new file mode 100644
index 0000000000..65879edce6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSDLCloseNotification::OnSDLCloseNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSDLCloseNotification::~OnSDLCloseNotification() {}
+
+void OnSDLCloseNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc
new file mode 100644
index 0000000000..cf8feb4ca1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc
@@ -0,0 +1,62 @@
+
+/**
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSDLConsentNeededNotification::OnSDLConsentNeededNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {}
+
+void OnSDLConsentNeededNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc
new file mode 100644
index 0000000000..0ac4afd4d2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() {}
+
+void OnSDLPersistenceCompleteNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc
new file mode 100644
index 0000000000..2cee7926bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnStartDeviceDiscovery::OnStartDeviceDiscovery(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {}
+
+void OnStartDeviceDiscovery::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.StartDevicesDiscovery();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc
new file mode 100644
index 0000000000..4cb01e7e90
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnStatusUpdateNotification::OnStatusUpdateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnStatusUpdateNotification::~OnStatusUpdateNotification() {}
+
+void OnStatusUpdateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
new file mode 100644
index 0000000000..242fb1d8cd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnSystemContextNotification::OnSystemContextNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemContextNotification::~OnSystemContextNotification() {}
+
+void OnSystemContextNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ mobile_api::SystemContext::eType system_context =
+ static_cast<mobile_api::SystemContext::eType>(
+ (*message_)[strings::msg_params][hmi_notification::system_context]
+ .asInt());
+
+ ApplicationSharedPtr app;
+ if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_MENU == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED == system_context)) {
+ app = application_manager_.active_application();
+ } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) {
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+ }
+ }
+
+ if (app && mobile_api::SystemContext::INVALID_ENUM != system_context) {
+ application_manager_.state_controller().SetRegularState(app,
+ system_context);
+ } else {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc
new file mode 100644
index 0000000000..5591d59355
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemErrorNotification::OnSystemErrorNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemErrorNotification::~OnSystemErrorNotification() {}
+
+void OnSystemErrorNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const int code =
+ (*message_)[strings::msg_params][hmi_notification::error].asInt();
+
+ policy_handler_.OnSystemError(code);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc
new file mode 100644
index 0000000000..11b2471294
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemInfoChangedNotification::OnSystemInfoChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {}
+
+void OnSystemInfoChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t lang_code =
+ (*message_)[strings::msg_params][strings::language].asUInt();
+ const std::string language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+
+ policy_handler_.OnSystemInfoChanged(language);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
new file mode 100644
index 0000000000..d795896764
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_impl.h"
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+using policy::PolicyHandlerInterface;
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemRequestNotification::OnSystemRequestNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemRequestNotification::~OnSystemRequestNotification() {}
+
+void OnSystemRequestNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& params = (*message_)[strings::params];
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ params[strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
+
+ // According to HMI API, this should be HMI unique id, but during processing
+ // messages from HMI this param is replaced by connection key, so below it
+ // will be treated as connection key
+ ApplicationSharedPtr app;
+ if (msg_params.keyExists(strings::app_id)) {
+ const uint32_t app_id = msg_params[strings::app_id].asUInt();
+ LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for appID " << app_id);
+ LOG4CXX_DEBUG(logger_, "Searching app to send OnSystemRequest by appID.");
+ app = application_manager_.application(app_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Received OnSystemRequest without appID."
+ " One of registered apps will be used.");
+ LOG4CXX_DEBUG(logger_, "Searching registered app to send OnSystemRequest.");
+ const PolicyHandlerInterface& policy_handler = policy_handler_;
+ const uint32_t selected_app_id = policy_handler.GetAppIdForSending();
+ if (0 == selected_app_id) {
+ LOG4CXX_WARN(logger_,
+ "Can't select application to forward OnSystemRequest.");
+ return;
+ }
+ app = application_manager_.application(selected_app_id);
+ }
+
+ if (app.use_count() == 0) {
+ LOG4CXX_WARN(logger_,
+ "No valid application found to forward OnSystemRequest.");
+ return;
+ }
+
+ std::string device_mac;
+ application_manager_.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(app->device(), NULL, NULL, &device_mac, NULL);
+
+ if (policy::kDeviceAllowed !=
+ policy_handler_.GetUserConsentForDevice(device_mac)) {
+ LOG4CXX_WARN(logger_,
+ "Application "
+ << app->policy_app_id()
+ << " is registered from non-consented device."
+ "Can't forward notification to application.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Sending request with application id " << app->policy_app_id());
+
+ params[strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc
new file mode 100644
index 0000000000..b5fd1a007e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h"
+
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemTimeReadyNotification::OnSystemTimeReadyNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& app_man,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : NotificationFromHMI(
+ message, app_man, rpc_service, hmi_capabilities, policy_handler) {}
+
+OnSystemTimeReadyNotification::~OnSystemTimeReadyNotification() {}
+
+void OnSystemTimeReadyNotification::Run() {
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc
new file mode 100644
index 0000000000..5b5cfeefb1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.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 sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {}
+
+void OnTTSLanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_active_tts_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ /* need to clarify, because unchanged VR
+ cause WRONG_LANGUAGE on Register */
+ hmi_capabilities.set_active_vr_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+ ApplicationSetIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+
+ if (static_cast<int>(app->language()) !=
+ (*message_)[strings::msg_params][strings::language].asInt()) {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc
new file mode 100644
index 0000000000..701dbe0538
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {}
+
+void OnTTSResetTimeoutNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc
new file mode 100644
index 0000000000..34ba82df1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTTSStartedNotification::OnTTSStartedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSStartedNotification::~OnTTSStartedNotification() {}
+
+void OnTTSStartedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Started);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc
new file mode 100644
index 0000000000..0935a36848
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTTSStoppedNotification::OnTTSStoppedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSStoppedNotification::~OnTTSStoppedNotification() {}
+
+void OnTTSStoppedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Stopped);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc
new file mode 100644
index 0000000000..21cf0d9628
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnUICommandNotification::OnUICommandNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUICommandNotification::~OnUICommandNotification() {}
+
+void OnUICommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
+
+ (*message_)[strings::msg_params][strings::trigger_source] =
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU);
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc
new file mode 100644
index 0000000000..fbdd4fce2b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {}
+
+void OnUIKeyBoardInputNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnKeyboardInputID;
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc
new file mode 100644
index 0000000000..3bf5a5aed4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.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 sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnUILanguageChangeNotification::OnUILanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {}
+
+void OnUILanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_active_ui_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ (*message_)[strings::msg_params][strings::language];
+
+ (*message_)[strings::msg_params][strings::language] =
+ hmi_capabilities.active_vr_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+
+ if (app->ui_language() !=
+ (*message_)[strings::msg_params][strings::hmi_display_language]
+ .asInt()) {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc
new file mode 100644
index 0000000000..953932cdb6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnUIResetTimeoutNotification::OnUIResetTimeoutNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {}
+
+void OnUIResetTimeoutNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc
new file mode 100644
index 0000000000..e5b321e1ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnUITouchEventNotification::OnUITouchEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUITouchEventNotification::~OnUITouchEventNotification() {}
+
+void OnUITouchEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnTouchEventID;
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc
new file mode 100644
index 0000000000..2a5e6ba797
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnUpdateDeviceList::OnUpdateDeviceList(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUpdateDeviceList::~OnUpdateDeviceList() {}
+
+void OnUpdateDeviceList::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
new file mode 100644
index 0000000000..c8ecba458a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {}
+
+void OnVIAccPedalPositionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc
new file mode 100644
index 0000000000..ee909d19dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIBeltStatusNotification::OnVIBeltStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {}
+
+void OnVIBeltStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc
new file mode 100644
index 0000000000..f0386646ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIBodyInformationNotification::OnVIBodyInformationNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {}
+
+void OnVIBodyInformationNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc
new file mode 100644
index 0000000000..549c73065a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIDeviceStatusNotification::OnVIDeviceStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {}
+
+void OnVIDeviceStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc
new file mode 100644
index 0000000000..23f0d37068
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIDriverBrakingNotification::OnVIDriverBrakingNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {}
+
+void OnVIDriverBrakingNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc
new file mode 100644
index 0000000000..735a225225
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIEngineTorqueNotification::OnVIEngineTorqueNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {}
+
+void OnVIEngineTorqueNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc
new file mode 100644
index 0000000000..0b4bfa893f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {}
+
+void OnVIExternalTemperatureNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc
new file mode 100644
index 0000000000..a5e84f1108
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIFuelLevelNotification::OnVIFuelLevelNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {}
+
+void OnVIFuelLevelNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc
new file mode 100644
index 0000000000..950b5a36f1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {}
+
+void OnVIFuelLevelStateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc
new file mode 100644
index 0000000000..0d94194f76
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIGpsDataNotification::OnVIGpsDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIGpsDataNotification::~OnVIGpsDataNotification() {}
+
+void OnVIGpsDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc
new file mode 100644
index 0000000000..80edb88e38
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {}
+
+void OnVIHeadLampStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
new file mode 100644
index 0000000000..a2b0b1a8fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIInstantFuelConsumptionNotification::
+ ~OnVIInstantFuelConsumptionNotification() {}
+
+void OnVIInstantFuelConsumptionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc
new file mode 100644
index 0000000000..5e3555bbc4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIMyKeyNotification::OnVIMyKeyNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIMyKeyNotification::~OnVIMyKeyNotification() {}
+
+void OnVIMyKeyNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc
new file mode 100644
index 0000000000..1dbef77fa3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIOdometerNotification::OnVIOdometerNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIOdometerNotification::~OnVIOdometerNotification() {}
+
+void OnVIOdometerNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc
new file mode 100644
index 0000000000..d4ae93b324
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIPrndlNotification::OnVIPrndlNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIPrndlNotification::~OnVIPrndlNotification() {}
+
+void OnVIPrndlNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc
new file mode 100644
index 0000000000..77f694c92e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIRpmNotification::OnVIRpmNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIRpmNotification::~OnVIRpmNotification() {}
+
+void OnVIRpmNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc
new file mode 100644
index 0000000000..e5860c9eec
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVISpeedNotification::OnVISpeedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVISpeedNotification::~OnVISpeedNotification() {}
+
+void OnVISpeedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
new file mode 100644
index 0000000000..db591d9da3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {}
+
+void OnVISteeringWheelAngleNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc
new file mode 100644
index 0000000000..b5c7e18803
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVITirePressureNotification::OnVITirePressureNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVITirePressureNotification::~OnVITirePressureNotification() {}
+
+void OnVITirePressureNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc
new file mode 100644
index 0000000000..323fe5b885
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIVinNotification::OnVIVinNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIVinNotification::~OnVIVinNotification() {}
+
+void OnVIVinNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc
new file mode 100644
index 0000000000..6a3b863e7c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIWiperStatusNotification::OnVIWiperStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {}
+
+void OnVIWiperStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc
new file mode 100644
index 0000000000..701dee5385
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc
@@ -0,0 +1,62 @@
+
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVideoDataStreamingNotification::OnVideoDataStreamingNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVideoDataStreamingNotification::~OnVideoDataStreamingNotification() {}
+
+void OnVideoDataStreamingNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
new file mode 100644
index 0000000000..386ef1d1c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/state_controller.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRCommandNotification::OnVRCommandNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRCommandNotification::~OnVRCommandNotification() {}
+
+void OnVRCommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+ uint32_t max_cmd_id = application_manager_.get_settings().max_cmd_id();
+
+ // Check if this is one of standart VR commands (i.e. "Help")
+ if (cmd_id > max_cmd_id + 1) {
+ LOG4CXX_INFO(logger_, "Switched App");
+ const uint32_t app_id = cmd_id - max_cmd_id;
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (app) {
+ application_manager_.state_controller().SetRegularState(
+ app, mobile_apis::HMILevel::HMI_FULL, true);
+ } else {
+ LOG4CXX_ERROR(logger_, "Unable to find appication " << app_id);
+ }
+ return;
+ }
+
+ // Check if this is "Help"
+ if (cmd_id == max_cmd_id + 1) {
+ return;
+ }
+ const uint32_t app_id =
+ (*message_)[strings::msg_params][strings::app_id].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ /* check if perform interaction is active
+ * if it is active we should sent to HMI DeleteCommand request
+ * and PerformInterActionResponse to mobile
+ */
+ if (0 != app->is_perform_interaction_active()) {
+ event_engine::Event event(hmi_apis::FunctionID::VR_OnCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+ } else {
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
+
+ (*message_)[strings::msg_params][strings::trigger_source] =
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR);
+ SendNotificationToMobile(message_);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc
new file mode 100644
index 0000000000..6a58ab9ffa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRLanguageChangeNotification::OnVRLanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {}
+
+void OnVRLanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_active_vr_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+ if (static_cast<int32_t>(app->language()) !=
+ (*message_)[strings::msg_params][strings::language].asInt()) {
+ application_manager_.state_controller().SetRegularState(
+ app, mobile_api::HMILevel::HMI_NONE, false);
+
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc
new file mode 100644
index 0000000000..04eb9a9ed0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRStartedNotification::OnVRStartedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRStartedNotification::~OnVRStartedNotification() {}
+
+void OnVRStartedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_Started);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc
new file mode 100644
index 0000000000..8fea5ddd1c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRStoppedNotification::OnVRStoppedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRStoppedNotification::~OnVRStoppedNotification() {}
+
+void OnVRStoppedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_Stopped);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc
new file mode 100644
index 0000000000..5947454517
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCGetCapabilitiesRequest::RCGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+RCGetCapabilitiesRequest::~RCGetCapabilitiesRequest() {}
+
+void RCGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc
new file mode 100644
index 0000000000..b14c28426c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCGetCapabilitiesResponse::RCGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+RCGetCapabilitiesResponse::~RCGetCapabilitiesResponse() {}
+
+void RCGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ bool capability_exists =
+ (*message_)[strings::msg_params].keyExists(strings::rc_capability);
+
+ if (capability_exists) {
+ hmi_capabilities.set_rc_capability(
+ (*message_)[strings::msg_params][strings::rc_capability]);
+ }
+ hmi_capabilities.set_rc_supported(capability_exists);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
new file mode 100644
index 0000000000..d538878dc8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCIsReadyRequest::RCIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+RCIsReadyRequest::~RCIsReadyRequest() {}
+
+void RCIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::RC_IsReady, correlation_id());
+ SendRequest();
+}
+
+void RCIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::RC_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received RC_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::RC_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_RC);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_rc_cooperating(is_available);
+ if (!is_available) {
+ hmi_capabilities.set_rc_supported(false);
+ }
+
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_RC)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_RC isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void RCIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void RCIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::RC_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc
new file mode 100644
index 0000000000..7534567204
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCIsReadyResponse::RCIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+RCIsReadyResponse::~RCIsReadyResponse() {}
+
+void RCIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::RC_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc
new file mode 100644
index 0000000000..f89ae1f697
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace {
+struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> {
+ connection_handler::DeviceHandle handle_;
+ ProtoV4AppsOnDevice(const connection_handler::DeviceHandle handle)
+ : handle_(handle) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ return app
+ ? handle_ == app->device() &&
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::
+ PROTOCOL_VERSION_4,
+ app->protocol_version())
+ : false;
+ }
+};
+
+struct ForegroundApp
+ : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
+ bool> {
+ bool operator()(
+ const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
+ return ptr ? ptr->is_foreground() : false;
+ }
+};
+
+struct SendLaunchApp
+ : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
+ void> {
+ ApplicationConstSharedPtr app_to_launch_;
+ ApplicationManager& application_manager_;
+ SendLaunchApp(ApplicationConstSharedPtr app_to_launch, ApplicationManager& am)
+ : app_to_launch_(app_to_launch), application_manager_(am) {}
+ void operator()(
+ const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
+ MessageHelper::SendLaunchApp((*ptr).app_id(),
+ app_to_launch_->SchemaUrl(),
+ app_to_launch_->PackageName(),
+ application_manager_);
+ return;
+ }
+};
+}
+
+SDLActivateAppRequest::SDLActivateAppRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLActivateAppRequest::~SDLActivateAppRequest() {}
+
+uint32_t SDLActivateAppRequest::app_id() const {
+ using namespace strings;
+ if (!(*message_).keyExists(msg_params)) {
+ LOG4CXX_DEBUG(logger_, msg_params << " section is absent in the message.");
+ return 0;
+ }
+ if (!(*message_)[msg_params].keyExists(strings::app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ strings::app_id << " section is absent in the message.");
+ return 0;
+ }
+ return (*message_)[msg_params][strings::app_id].asUInt();
+}
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+void SDLActivateAppRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis::FunctionID;
+
+ if (application_manager_.state_controller().IsStateActive(
+ HmiState::STATE_ID_DEACTIVATE_HMI)) {
+ LOG4CXX_DEBUG(logger_,
+ "DeactivateHmi state is active. "
+ "Sends response with result code REJECTED");
+ SendErrorResponse(correlation_id(),
+ static_cast<eType>(function_id()),
+ hmi_apis::Common_Result::REJECTED,
+ "HMIDeactivate is active");
+ } else {
+ const uint32_t application_id = app_id();
+ policy_handler_.OnActivateApp(application_id, correlation_id());
+ }
+}
+
+#else // EXTERNAL_PROPRIETARY_MODE
+void SDLActivateAppRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis::FunctionID;
+ using namespace hmi_apis::Common_Result;
+
+ const uint32_t application_id = app_id();
+
+ ApplicationConstSharedPtr app_to_activate =
+ application_manager_.application(application_id);
+
+ if (!app_to_activate) {
+ LOG4CXX_WARN(
+ logger_,
+ "Can't find application within regular apps: " << application_id);
+
+ // Here is the hack - in fact SDL gets hmi_app_id in appID field and
+ // replaces it with connection_key only for normally registered apps, but
+ // for apps_to_be_registered (waiting) it keeps original value (hmi_app_id)
+ // so method does lookup for hmi_app_id
+ app_to_activate =
+ application_manager_.WaitingApplicationByID(application_id);
+
+ if (!app_to_activate) {
+ LOG4CXX_WARN(
+ logger_,
+ "Can't find application within waiting apps: " << application_id);
+ return;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Found application to activate. Application id is "
+ << app_to_activate->app_id());
+
+ if (application_manager_.state_controller().IsStateActive(
+ HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) {
+ LOG4CXX_WARN(logger_,
+ "DeactivateHmi state is active. "
+ "Sends response with result code REJECTED");
+ SendErrorResponse(correlation_id(),
+ static_cast<hmi_apis::FunctionID::eType>(function_id()),
+ hmi_apis::Common_Result::REJECTED,
+ "HMIDeactivate is active");
+ return;
+ }
+
+ if (app_to_activate->IsRegistered()) {
+ LOG4CXX_DEBUG(logger_, "Application is registered. Activating.");
+ policy_handler_.OnActivateApp(application_id, correlation_id());
+ return;
+ }
+
+ connection_handler::DeviceHandle device_handle = app_to_activate->device();
+ ApplicationSharedPtr foreground_v4_app = get_foreground_app(device_handle);
+ V4ProtoApps v4_proto_apps = get_v4_proto_apps(device_handle);
+
+ if (!foreground_v4_app && v4_proto_apps.empty()) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find regular foreground app with the same "
+ "connection id:"
+ << device_handle);
+ SendErrorResponse(
+ correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED, "");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application is not registered yet. "
+ "Sending launch request.");
+
+ if (foreground_v4_app) {
+ LOG4CXX_DEBUG(logger_, "Sending request to foreground application.");
+ MessageHelper::SendLaunchApp(foreground_v4_app->app_id(),
+ app_to_activate->SchemaUrl(),
+ app_to_activate->PackageName(),
+ application_manager_);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "No preffered (foreground) application is found. "
+ "Sending request to all v4 applications.");
+ std::for_each(v4_proto_apps.begin(),
+ v4_proto_apps.end(),
+ SendLaunchApp(app_to_activate, application_manager_));
+ }
+
+ subscribe_on_event(BasicCommunication_OnAppRegistered);
+}
+
+#endif // EXTERNAL_PROPRIETARY_MODE
+void SDLActivateAppRequest::onTimeOut() {
+ using namespace hmi_apis::FunctionID;
+ using namespace hmi_apis::Common_Result;
+ using namespace application_manager;
+ unsubscribe_from_event(BasicCommunication_OnAppRegistered);
+ SendErrorResponse(
+ correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED, "");
+}
+
+void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
+ using namespace hmi_apis::FunctionID;
+ if (event.id() != BasicCommunication_OnAppRegistered) {
+ return;
+ }
+ unsubscribe_from_event(BasicCommunication_OnAppRegistered);
+
+ // Have to use HMI app id from event, since HMI app id from original request
+ // message will be changed after app, initially requested for launch via
+ // SDL.ActivateApp, will be registered
+ const uint32_t hmi_application_id = hmi_app_id(event.smart_object());
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(hmi_application_id);
+ if (!app) {
+ LOG4CXX_ERROR(
+ logger_, "Application not found by HMI app id: " << hmi_application_id);
+ return;
+ }
+ policy_handler_.OnActivateApp(app->app_id(), correlation_id());
+}
+
+uint32_t SDLActivateAppRequest::hmi_app_id(
+ const smart_objects::SmartObject& so) const {
+ using namespace strings;
+ if (!so.keyExists(params)) {
+ LOG4CXX_DEBUG(logger_, params << " section is absent in the message.");
+ return 0;
+ }
+ if (!so[msg_params].keyExists(application)) {
+ LOG4CXX_DEBUG(logger_, application << " section is absent in the message.");
+ return 0;
+ }
+ if (so[msg_params][application].keyExists(strings::app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ strings::app_id << " section is absent in the message.");
+ return 0;
+ }
+ return so[msg_params][application][strings::app_id].asUInt();
+}
+
+SDLActivateAppRequest::V4ProtoApps SDLActivateAppRequest::get_v4_proto_apps(
+ const connection_handler::DeviceHandle handle) const {
+ const ApplicationSet app_list = application_manager_.applications().GetData();
+ V4ProtoApps v4_proto_apps;
+ std::copy_if(app_list.begin(),
+ app_list.end(),
+ std::back_inserter(v4_proto_apps),
+ ProtoV4AppsOnDevice(handle));
+ return v4_proto_apps;
+}
+
+ApplicationSharedPtr SDLActivateAppRequest::get_foreground_app(
+ const connection_handler::DeviceHandle handle) const {
+ V4ProtoApps v4_proto_apps = get_v4_proto_apps(handle);
+ V4ProtoApps::iterator foreground_app =
+ std::find_if(v4_proto_apps.begin(), v4_proto_apps.end(), ForegroundApp());
+ return foreground_app != v4_proto_apps.end() ? *foreground_app
+ : ApplicationSharedPtr();
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc
new file mode 100644
index 0000000000..3262b12759
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLActivateAppResponse::SDLActivateAppResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLActivateAppResponse::~SDLActivateAppResponse() {}
+
+void SDLActivateAppResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc
new file mode 100644
index 0000000000..6b983d566a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {}
+
+void SDLGetListOfPermissionsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t connection_key = 0;
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ connection_key = (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+ policy_handler_.OnGetListOfPermissions(
+ connection_key,
+ (*message_)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc
new file mode 100644
index 0000000000..784b4922d4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {}
+
+void SDLGetListOfPermissionsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc
new file mode 100644
index 0000000000..9a6c0fd520
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {}
+
+void SDLGetStatusUpdateRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_handler_.OnGetStatusUpdate(
+ (*message_)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc
new file mode 100644
index 0000000000..8fc85da481
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {}
+
+void SDLGetStatusUpdateResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc
new file mode 100644
index 0000000000..ab8ec4e3d9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {}
+
+void SDLGetUserFriendlyMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string messageCodes = "messageCodes";
+ if (!(*message_)[strings::msg_params].keyExists(messageCodes)) {
+ LOG4CXX_WARN(logger_,
+ "Mandatory parameter '" + messageCodes + "'' is missing");
+ return;
+ }
+ smart_objects::SmartArray* msg =
+ (*message_)[strings::msg_params][messageCodes].asArray();
+
+ std::vector<std::string> msg_codes;
+
+ smart_objects::SmartArray::const_iterator it = msg->begin();
+ smart_objects::SmartArray::const_iterator it_end = msg->end();
+ for (; it != it_end; ++it) {
+ msg_codes.push_back((*it).asString());
+ }
+
+ std::string required_language;
+ if ((*message_)[strings::msg_params].keyExists(strings::language)) {
+ uint32_t lang_code =
+ (*message_)[strings::msg_params][strings::language].asUInt();
+ required_language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+ } else {
+ hmi_apis::Common_Language::eType ui_language =
+ hmi_capabilities_.active_ui_language();
+
+ required_language =
+ application_manager::MessageHelper::CommonLanguageToString(ui_language);
+ }
+
+ policy_handler_.OnGetUserFriendlyMessage(
+ msg_codes,
+ required_language,
+ (*message_)[strings::params][strings::correlation_id].asInt());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc
new file mode 100644
index 0000000000..c5b3450723
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {}
+
+void SDLGetUserFriendlyMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc
new file mode 100644
index 0000000000..aef2e286d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLPolicyUpdate::SDLPolicyUpdate(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLPolicyUpdate::~SDLPolicyUpdate() {}
+
+void SDLPolicyUpdate::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ SendRequest();
+#else
+ LOG4CXX_WARN(logger_,
+ "This RPC is part of extended policy flow."
+ "Please re-build with extended policy mode enabled.");
+#endif
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc
new file mode 100644
index 0000000000..d16fc578ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+SDLPolicyUpdateResponse::SDLPolicyUpdateResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {}
+
+void SDLPolicyUpdateResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // TODO(PV): add some logic here
+}
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc
new file mode 100644
index 0000000000..163d749426
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSChangeRegistrationRequest::TTSChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {}
+
+void TTSChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc
new file mode 100644
index 0000000000..2c28d615d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSChangeRegistratioResponse::TTSChangeRegistratioResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {}
+
+void TTSChangeRegistratioResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc
new file mode 100644
index 0000000000..49623e01d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {}
+
+void TTSGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc
new file mode 100644
index 0000000000..1cef3daf15
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {}
+
+void TTSGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::speech_capabilities)) {
+ hmi_capabilities.set_speech_capabilities(
+ (*message_)[strings::msg_params][hmi_response::speech_capabilities]);
+ }
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::prerecorded_speech_capabilities)) {
+ hmi_capabilities.set_prerecorded_speech(
+ (*message_)[strings::msg_params]
+ [hmi_response::prerecorded_speech_capabilities]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc
new file mode 100644
index 0000000000..5533537b33
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetLanguageRequest::TTSGetLanguageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetLanguageRequest::~TTSGetLanguageRequest() {}
+
+void TTSGetLanguageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc
new file mode 100644
index 0000000000..ac423a2bf3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetLanguageResponse::TTSGetLanguageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetLanguageResponse::~TTSGetLanguageResponse() {}
+
+void TTSGetLanguageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+
+ Common_Language::eType language = Common_Language::INVALID_ENUM;
+
+ if ((*message_).keyExists(strings::msg_params) &&
+ (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
+ language = static_cast<Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt());
+ }
+
+ hmi_capabilities_.set_active_tts_language(language);
+
+ LOG4CXX_DEBUG(logger_,
+ "Raising event for function_id " << function_id()
+ << " and correlation_id "
+ << correlation_id());
+ event_engine::Event event(FunctionID::TTS_GetLanguage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc
new file mode 100644
index 0000000000..8b87b9c6ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {}
+
+void TTSGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc
new file mode 100644
index 0000000000..a4e97d9d70
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {}
+
+void TTSGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_tts_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
new file mode 100644
index 0000000000..c7e2c0c4cb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSIsReadyRequest::TTSIsReadyRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+TTSIsReadyRequest::~TTSIsReadyRequest() {}
+
+void TTSIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::TTS_IsReady, correlation_id());
+ SendRequest();
+}
+
+void TTSIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received TTS_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_TTS);
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_tts_cooperating(is_available);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_TTS)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_TTS isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void TTSIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void TTSIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_handle_response_for(*get_language);
+ rpc_service_.ManageHMICommand(get_language);
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetSupportedLanguages,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_all_languages);
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc
new file mode 100644
index 0000000000..c7d634bee2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSIsReadyResponse::TTSIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSIsReadyResponse::~TTSIsReadyResponse() {}
+
+void TTSIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::TTS_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc
new file mode 100644
index 0000000000..8c7443d465
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {}
+
+void TTSSetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc
new file mode 100644
index 0000000000..dae06d75f9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {}
+
+void TTSSetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc
new file mode 100644
index 0000000000..96b93b724f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSpeakRequest::TTSSpeakRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSSpeakRequest::~TTSSpeakRequest() {}
+
+void TTSSpeakRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc
new file mode 100644
index 0000000000..cb2346083b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSpeakResponse::TTSSpeakResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSSpeakResponse::~TTSSpeakResponse() {}
+
+void TTSSpeakResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc
new file mode 100644
index 0000000000..25a05f085b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSStopSpeakingRequest::TTSStopSpeakingRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {}
+
+void TTSStopSpeakingRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc
new file mode 100644
index 0000000000..a2620c1340
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSStopSpeakingResponse::TTSStopSpeakingResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {}
+
+void TTSStopSpeakingResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc
new file mode 100644
index 0000000000..749b3ad56b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddCommandRequest::UIAddCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddCommandRequest::~UIAddCommandRequest() {}
+
+void UIAddCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc
new file mode 100644
index 0000000000..266dffd225
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddCommandResponse::UIAddCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddCommandResponse::~UIAddCommandResponse() {}
+
+void UIAddCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc
new file mode 100644
index 0000000000..de338d4670
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddSubmenuRequest::UIAddSubmenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddSubmenuRequest::~UIAddSubmenuRequest() {}
+
+void UIAddSubmenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc
new file mode 100644
index 0000000000..85e600c87d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddSubmenuResponse::UIAddSubmenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddSubmenuResponse::~UIAddSubmenuResponse() {}
+
+void UIAddSubmenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_AddSubMenu);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc
new file mode 100644
index 0000000000..ae5f861ba6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAlertRequest::UIAlertRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAlertRequest::~UIAlertRequest() {}
+
+void UIAlertRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc
new file mode 100644
index 0000000000..3076eabc4c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAlertResponse::UIAlertResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAlertResponse::~UIAlertResponse() {}
+
+void UIAlertResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc
new file mode 100644
index 0000000000..d109987009
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIChangeRegistrationRequest::UIChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {}
+
+void UIChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc
new file mode 100644
index 0000000000..6557269e49
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIChangeRegistratioResponse::UIChangeRegistratioResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {}
+
+void UIChangeRegistratioResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc
new file mode 100644
index 0000000000..9e52f5fc18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteCommandRequest::UIDeleteCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteCommandRequest::~UIDeleteCommandRequest() {}
+
+void UIDeleteCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc
new file mode 100644
index 0000000000..a8f5b59d39
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteCommandResponse::UIDeleteCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteCommandResponse::~UIDeleteCommandResponse() {}
+
+void UIDeleteCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_DeleteCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc
new file mode 100644
index 0000000000..1b84df8bed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteSubmenuRequest::UIDeleteSubmenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {}
+
+void UIDeleteSubmenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc
new file mode 100644
index 0000000000..ec4025bea1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteSubmenuResponse::UIDeleteSubmenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {}
+
+void UIDeleteSubmenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..fe11185c62
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIEndAudioPassThruRequest::UIEndAudioPassThruRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {}
+
+void UIEndAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..3a6d4efbe4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIEndAudioPassThruResponse::UIEndAudioPassThruResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {}
+
+void UIEndAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc
new file mode 100644
index 0000000000..3bd56a0682
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetCapabilitiesRequest::UIGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {}
+
+void UIGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
new file mode 100644
index 0000000000..cd5f3c9a42
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetCapabilitiesResponse::UIGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {}
+
+void UIGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params.keyExists(hmi_response::display_capabilities)) {
+ hmi_capabilities.set_display_capabilities(
+ msg_params[hmi_response::display_capabilities]);
+ }
+
+ if (msg_params.keyExists(hmi_response::hmi_zone_capabilities)) {
+ hmi_capabilities.set_hmi_zone_capabilities(
+ msg_params[hmi_response::hmi_zone_capabilities]);
+ }
+
+ if (msg_params.keyExists(hmi_response::soft_button_capabilities)) {
+ hmi_capabilities.set_soft_button_capabilities(
+ msg_params[hmi_response::soft_button_capabilities]);
+ }
+
+ if (msg_params.keyExists(strings::audio_pass_thru_capabilities)) {
+ hmi_capabilities.set_audio_pass_thru_capabilities(
+ msg_params[strings::audio_pass_thru_capabilities]);
+ }
+
+ if (msg_params.keyExists(strings::hmi_capabilities)) {
+ if (msg_params[strings::hmi_capabilities].keyExists(strings::navigation)) {
+ hmi_capabilities.set_navigation_supported(
+ msg_params[strings::hmi_capabilities][strings::navigation].asBool());
+ }
+ if (msg_params[strings::hmi_capabilities].keyExists(strings::phone_call)) {
+ hmi_capabilities.set_phone_call_supported(
+ msg_params[strings::hmi_capabilities][strings::phone_call].asBool());
+ }
+ if (msg_params[strings::hmi_capabilities].keyExists(
+ strings::video_streaming)) {
+ hmi_capabilities.set_video_streaming_supported(
+ msg_params[strings::hmi_capabilities][strings::video_streaming]
+ .asBool());
+ }
+ }
+
+ if (msg_params.keyExists(strings::system_capabilities)) {
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::navigation_capability)) {
+ hmi_capabilities.set_navigation_capability(
+ msg_params[strings::system_capabilities]
+ [strings::navigation_capability]);
+ }
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::phone_capability)) {
+ hmi_capabilities.set_phone_capability(
+ msg_params[strings::system_capabilities][strings::phone_capability]);
+ }
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::video_streaming_capability)) {
+ hmi_capabilities.set_video_streaming_capability(
+ msg_params[strings::system_capabilities]
+ [strings::video_streaming_capability]);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc
new file mode 100644
index 0000000000..8acba42493
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetLanguageRequest::UIGetLanguageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetLanguageRequest::~UIGetLanguageRequest() {}
+
+void UIGetLanguageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc
new file mode 100644
index 0000000000..27e46e52b4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h"
+
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetLanguageResponse::UIGetLanguageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetLanguageResponse::~UIGetLanguageResponse() {}
+
+void UIGetLanguageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+
+ Common_Language::eType language = Common_Language::INVALID_ENUM;
+
+ if ((*message_).keyExists(strings::msg_params) &&
+ (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
+ language = static_cast<Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt());
+ }
+
+ hmi_capabilities_.set_active_ui_language(language);
+
+ LOG4CXX_DEBUG(logger_,
+ "Raising event for function_id " << function_id()
+ << " and correlation_id "
+ << correlation_id());
+ event_engine::Event event(FunctionID::UI_GetLanguage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc
new file mode 100644
index 0000000000..2f8ef12a25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {}
+
+void UIGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc
new file mode 100644
index 0000000000..d20dd8545f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {}
+
+void UIGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_ui_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
new file mode 100644
index 0000000000..2eab211690
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIIsReadyRequest::UIIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+UIIsReadyRequest::~UIIsReadyRequest() {}
+
+void UIIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::UI_IsReady, correlation_id());
+ SendRequest();
+}
+
+void UIIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received UI_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_UI);
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_ui_cooperating(is_available);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_UI)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_UI isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void UIIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void UIIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_handle_response_for(*get_language);
+ rpc_service_.ManageHMICommand(get_language);
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetSupportedLanguages,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_all_languages);
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc
new file mode 100644
index 0000000000..e25e8ee8ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIIsReadyResponse::UIIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIIsReadyResponse::~UIIsReadyResponse() {}
+
+void UIIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..cca89e3073
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {}
+
+void UIPerformAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..057448ab33
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {}
+
+void UIPerformAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc
new file mode 100644
index 0000000000..d5696a39e7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformInteractionRequest::UIPerformInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformInteractionRequest::~UIPerformInteractionRequest() {}
+
+void UIPerformInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc
new file mode 100644
index 0000000000..7629faa131
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformInteractionResponse::UIPerformInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformInteractionResponse::~UIPerformInteractionResponse() {}
+
+void UIPerformInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::UI_PerformInteraction);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc
new file mode 100644
index 0000000000..dbe0ceb529
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIScrollableMessageRequest::UIScrollableMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIScrollableMessageRequest::~UIScrollableMessageRequest() {}
+
+void UIScrollableMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc
new file mode 100644
index 0000000000..a96b9fa3ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIScrollableMessageResponse::UIScrollableMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIScrollableMessageResponse::~UIScrollableMessageResponse() {}
+
+void UIScrollableMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc
new file mode 100644
index 0000000000..f5f8f7bafd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISendHapticDataRequest::UISendHapticDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISendHapticDataRequest::~UISendHapticDataRequest() {}
+
+void UISendHapticDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc
new file mode 100644
index 0000000000..4555d81a0a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISendHapticDataResponse::UISendHapticDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISendHapticDataResponse::~UISendHapticDataResponse() {}
+
+void UISendHapticDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::UI_SendHapticData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc
new file mode 100644
index 0000000000..d25bbd1cd9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetAppIconRequest::UISetAppIconRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetAppIconRequest::~UISetAppIconRequest() {}
+
+void UISetAppIconRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc
new file mode 100644
index 0000000000..711b5767f2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetAppIconResponse::UISetAppIconResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetAppIconResponse::~UISetAppIconResponse() {}
+
+void UISetAppIconResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetAppIcon);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc
new file mode 100644
index 0000000000..73b813d0eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {}
+
+void UiSetDisplayLayoutRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc
new file mode 100644
index 0000000000..d5d2e02e33
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {}
+
+void UiSetDisplayLayoutResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc
new file mode 100644
index 0000000000..0664404361
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {}
+
+void UISetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc
new file mode 100644
index 0000000000..2e5fecf2af
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {}
+
+void UISetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc
new file mode 100644
index 0000000000..4e87b9ccc3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetMediaClockTimerRequest::UISetMediaClockTimerRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {}
+
+void UISetMediaClockTimerRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc
new file mode 100644
index 0000000000..39e7e1c232
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetMediaClockTimerResponse::UISetMediaClockTimerResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {}
+
+void UISetMediaClockTimerResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc
new file mode 100644
index 0000000000..5b7568abfe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIShowRequest::UIShowRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIShowRequest::~UIShowRequest() {}
+
+void UIShowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc
new file mode 100644
index 0000000000..3e3c0b79d8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIShowResponse::UIShowResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIShowResponse::~UIShowResponse() {}
+
+void UIShowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc
new file mode 100644
index 0000000000..4df3adbe14
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISliderRequest::UISliderRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISliderRequest::~UISliderRequest() {}
+
+void UISliderRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc
new file mode 100644
index 0000000000..2431c65ddf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISliderResponse::UISliderResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISliderResponse::~UISliderResponse() {}
+
+void UISliderResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc
new file mode 100644
index 0000000000..05b08cb723
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateAppListRequest::UpdateAppListRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateAppListRequest::~UpdateAppListRequest() {}
+
+void UpdateAppListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc
new file mode 100644
index 0000000000..3dd03993ef
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateAppListResponse::UpdateAppListResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateAppListResponse::~UpdateAppListResponse() {}
+
+void UpdateAppListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(PV): add check
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc
new file mode 100644
index 0000000000..7736f2b1e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h"
+
+#include "interfaces/HMI_API.h"
+
+#include <unistd.h>
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateDeviceListRequest::UpdateDeviceListRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager_.event_dispatcher()) {}
+
+UpdateDeviceListRequest::~UpdateDeviceListRequest() {}
+
+void UpdateDeviceListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
+ // Flag conditional compilation for specific customer is used in order to
+ // exclude
+ // hit code to RTC
+ if (true == application_manager_.get_settings().launch_hmi()) {
+ if (!application_manager_.IsHMICooperating()) {
+ LOG4CXX_INFO(logger_, "Wait for HMI Cooperation");
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ termination_condition_.Wait(auto_lock);
+ LOG4CXX_DEBUG(logger_, "HMI Cooperation OK");
+ }
+ }
+
+ SendRequest();
+}
+
+void UpdateDeviceListRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_OnReady: {
+ LOG4CXX_INFO(logger_, "received OnReady");
+ unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ termination_condition_.Broadcast();
+ break;
+ };
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown event ");
+ break;
+ };
+ }
+}
+
+bool UpdateDeviceListRequest::CleanUp() {
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ termination_condition_.Broadcast();
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc
new file mode 100644
index 0000000000..25dc9be5bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateDeviceListResponse::UpdateDeviceListResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateDeviceListResponse::~UpdateDeviceListResponse() {}
+
+void UpdateDeviceListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(PV): add check for correctness.
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc
new file mode 100644
index 0000000000..cafacea28f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc
@@ -0,0 +1,64 @@
+
+/**
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateSDLRequest::UpdateSDLRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateSDLRequest::~UpdateSDLRequest() {}
+
+void UpdateSDLRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ policy_handler_.PTExchangeAtUserRequest(
+ (*message_)[strings::params][strings::correlation_id].asInt());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc
new file mode 100644
index 0000000000..a35571ec26
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateSDLResponse::UpdateSDLResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateSDLResponse::~UpdateSDLResponse() {}
+
+void UpdateSDLResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc
new file mode 100644
index 0000000000..72ce387f77
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRAddCommandRequest::VRAddCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRAddCommandRequest::~VRAddCommandRequest() {}
+
+void VRAddCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc
new file mode 100644
index 0000000000..19d43616ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRAddCommandResponse::VRAddCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRAddCommandResponse::~VRAddCommandResponse() {}
+
+void VRAddCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc
new file mode 100644
index 0000000000..9ba5fa3571
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRChangeRegistrationRequest::VRChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {}
+
+void VRChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc
new file mode 100644
index 0000000000..42c5b6d65b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRChangeRegistrationResponse::VRChangeRegistrationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRChangeRegistrationResponse::~VRChangeRegistrationResponse() {}
+
+void VRChangeRegistrationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc
new file mode 100644
index 0000000000..efc09dc157
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRDeleteCommandRequest::VRDeleteCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRDeleteCommandRequest::~VRDeleteCommandRequest() {}
+
+void VRDeleteCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc
new file mode 100644
index 0000000000..f8f7535e68
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRDeleteCommandResponse::VRDeleteCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRDeleteCommandResponse::~VRDeleteCommandResponse() {}
+
+void VRDeleteCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_DeleteCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc
new file mode 100644
index 0000000000..7e9c846857
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetCapabilitiesRequest::VRGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {}
+
+void VRGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc
new file mode 100644
index 0000000000..47ffb3a675
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetCapabilitiesResponse::VRGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {}
+
+void VRGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_vr_capabilities(
+ (*message_)[strings::msg_params][strings::vr_capabilities]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc
new file mode 100644
index 0000000000..d57faa08fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetLanguageRequest::VRGetLanguageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetLanguageRequest::~VRGetLanguageRequest() {}
+
+void VRGetLanguageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc
new file mode 100644
index 0000000000..469452d108
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h"
+
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetLanguageResponse::VRGetLanguageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetLanguageResponse::~VRGetLanguageResponse() {}
+
+void VRGetLanguageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+
+ Common_Language::eType language = Common_Language::INVALID_ENUM;
+
+ if ((*message_).keyExists(strings::msg_params) &&
+ (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
+ language = static_cast<Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt());
+ }
+
+ hmi_capabilities_.set_active_vr_language(language);
+
+ LOG4CXX_DEBUG(logger_,
+ "Raising event for function_id " << function_id()
+ << " and correlation_id "
+ << correlation_id());
+ event_engine::Event event(FunctionID::VR_GetLanguage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc
new file mode 100644
index 0000000000..bb27168a77
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {}
+
+void VRGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc
new file mode 100644
index 0000000000..722040388d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {}
+
+void VRGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_vr_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
new file mode 100644
index 0000000000..22afb03945
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRIsReadyRequest::VRIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+VRIsReadyRequest::~VRIsReadyRequest() {}
+
+void VRIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::VR_IsReady, correlation_id());
+ SendRequest();
+}
+
+void VRIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VR_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received VR_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::VR_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_VR);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_vr_cooperating(is_available);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_VR)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_VR isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void VRIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void VRIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_handle_response_for(*get_language);
+ rpc_service_.ManageHMICommand(get_language);
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VR_GetSupportedLanguages,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_all_languages);
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VR_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc
new file mode 100644
index 0000000000..48d9c3e075
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRIsReadyResponse::VRIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRIsReadyResponse::~VRIsReadyResponse() {}
+
+void VRIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::VR_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc
new file mode 100644
index 0000000000..26e308a0bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRPerformInteractionRequest::VRPerformInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRPerformInteractionRequest::~VRPerformInteractionRequest() {}
+
+void VRPerformInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc
new file mode 100644
index 0000000000..dec371e889
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRPerformInteractionResponse::VRPerformInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRPerformInteractionResponse::~VRPerformInteractionResponse() {}
+
+void VRPerformInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::VR_PerformInteraction);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
new file mode 100644
index 0000000000..155f819761
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
@@ -0,0 +1,627 @@
+/*
+
+ 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 <string>
+#include "sdl_rpc_plugin/commands/mobile/add_command_request.h"
+
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+AddCommandRequest::AddCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , send_ui_(false)
+ , send_vr_(false)
+ , is_ui_received_(false)
+ , is_vr_received_(false)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+AddCommandRequest::~AddCommandRequest() {}
+
+void AddCommandRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RemoveCommand();
+ CommandRequestImpl::onTimeOut();
+}
+
+bool AddCommandRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void AddCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
+ mobile_apis::Result::eType verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::cmd_icon],
+ app,
+ application_manager_);
+
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(
+ logger_, "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if (!((*message_)[strings::msg_params].keyExists(strings::cmd_id))) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (app->FindCommand(
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt())) {
+ LOG4CXX_ERROR(logger_, "INVALID_ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ bool data_exist = false;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ if (!CheckCommandName(app)) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+ if (((*message_)[strings::msg_params][strings::menu_params].keyExists(
+ hmi_request::parent_id)) &&
+ (0 !=
+ (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id].asUInt())) {
+ if (!CheckCommandParentId(app)) {
+ SendResponse(
+ false, mobile_apis::Result::INVALID_ID, "Parent ID doesn't exist");
+ return;
+ }
+ }
+ data_exist = true;
+ }
+
+ if (((*message_)[strings::msg_params].keyExists(strings::vr_commands)) &&
+ ((*message_)[strings::msg_params][strings::vr_commands].length() > 0)) {
+ if (!CheckCommandVRSynonym(app)) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ data_exist = true;
+ }
+
+ if (!data_exist) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Incoming add command has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ app->AddCommand((*message_)[strings::msg_params][strings::cmd_id].asUInt(),
+ (*message_)[strings::msg_params]);
+
+ smart_objects::SmartObject ui_msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ ui_msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ ui_msg_params[strings::menu_params] =
+ (*message_)[strings::msg_params][strings::menu_params];
+
+ ui_msg_params[strings::app_id] = app->app_id();
+
+ if (((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) &&
+ ((*message_)[strings::msg_params][strings::cmd_icon].keyExists(
+ strings::value)) &&
+ (0 < (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
+ .length())) {
+ ui_msg_params[strings::cmd_icon] =
+ (*message_)[strings::msg_params][strings::cmd_icon];
+ }
+
+ send_ui_ = true;
+ }
+
+ smart_objects::SmartObject vr_msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
+ vr_msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ vr_msg_params[strings::vr_commands] =
+ (*message_)[strings::msg_params][strings::vr_commands];
+ vr_msg_params[strings::app_id] = app->app_id();
+
+ vr_msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ vr_msg_params[strings::grammar_id] = app->get_grammar_id();
+
+ send_vr_ = true;
+ }
+
+ if (send_ui_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
+ }
+
+ if (send_vr_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
+ }
+}
+
+bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator i = commands.begin();
+ uint32_t saved_parent_id = 0;
+ uint32_t parent_id = 0;
+ if ((*message_)[strings::msg_params][strings::menu_params].keyExists(
+ hmi_request::parent_id)) {
+ parent_id = (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id].asUInt();
+ }
+
+ for (; commands.end() != i; ++i) {
+ if (!(*i->second).keyExists(strings::menu_params)) {
+ continue;
+ }
+
+ saved_parent_id = 0;
+ if ((*i->second)[strings::menu_params].keyExists(hmi_request::parent_id)) {
+ saved_parent_id =
+ (*i->second)[strings::menu_params][hmi_request::parent_id].asUInt();
+ }
+ if (((*i->second)[strings::menu_params][strings::menu_name].asString() ==
+ (*message_)[strings::msg_params][strings::menu_params]
+ [strings::menu_name].asString()) &&
+ (saved_parent_id == parent_id)) {
+ LOG4CXX_INFO(logger_,
+ "AddCommandRequest::CheckCommandName received"
+ " command name already exist in same level menu");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+ if (!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ for (size_t i = 0; i < (*it->second)[strings::vr_commands].length(); ++i) {
+ for (size_t j = 0;
+ j < (*message_)[strings::msg_params][strings::vr_commands].length();
+ ++j) {
+ const custom_str::CustomString& vr_cmd_i =
+ (*it->second)[strings::vr_commands][i].asCustomString();
+ const custom_str::CustomString& vr_cmd_j =
+ (*message_)[strings::msg_params][strings::vr_commands][j]
+ .asCustomString();
+
+ if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
+ LOG4CXX_INFO(logger_,
+ "AddCommandRequest::CheckCommandVRSynonym"
+ " received command vr synonym already exist");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const int32_t parent_id =
+ (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id].asInt();
+ smart_objects::SmartObject* parent = app->FindSubMenu(parent_id);
+
+ if (!parent) {
+ LOG4CXX_INFO(logger_,
+ "AddCommandRequest::CheckCommandParentId received"
+ " submenu doesn't exist");
+ return false;
+ }
+ return true;
+}
+
+// TODO(AKUTSAN) APPLINK-26973: Refactor AddCommandRequest
+void AddCommandRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+ smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
+ msg_param[strings::cmd_id] = cmd_id;
+ msg_param[strings::app_id] = application->app_id();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_AddCommand: {
+ LOG4CXX_INFO(logger_, "Received UI_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_info_);
+ if (hmi_apis::Common_Result::SUCCESS != ui_result_) {
+ (*message_)[strings::msg_params].erase(strings::menu_params);
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_AddCommand: {
+ LOG4CXX_INFO(logger_, "Received VR_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ is_vr_received_ = true;
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, vr_info_);
+ if (hmi_apis::Common_Result::SUCCESS != vr_result_) {
+ (*message_)[strings::msg_params].erase(strings::vr_commands);
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ return;
+ }
+
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ const bool is_vr_invalid_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ vr_result_,
+ hmi_apis::Common_Result::INVALID_ENUM,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_ui_invalid_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_,
+ hmi_apis::Common_Result::INVALID_ENUM,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+ const bool is_vr_unsupported =
+ vr_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ const bool is_ui_unsupported =
+ ui_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+
+ const bool is_no_ui_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_no_vr_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ vr_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ bool result = (is_no_ui_error && is_no_vr_error) ||
+ (is_no_ui_error && is_vr_invalid_unsupported) ||
+ (is_no_vr_error && is_ui_invalid_unsupported);
+
+ LOG4CXX_DEBUG(logger_,
+ "calculated result " << ui_result_ << " " << is_no_ui_error
+ << " " << is_no_vr_error);
+ const bool is_vr_or_ui_warning =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
+
+ const bool is_vr_or_ui_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ ui_result_,
+ vr_result_);
+
+ const bool is_vr_and_ui_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ ui_result_,
+ vr_result_);
+
+ if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) {
+ result_code = MessageHelper::HMIToMobileResult(ui_result_);
+ } else if (result && is_vr_or_ui_unsupported) {
+ result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ } else if (is_vr_or_ui_warning) {
+ result_code = mobile_apis::Result::WARNINGS;
+ } else {
+ result_code =
+ MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_));
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_) {
+ result_code = MessageHelper::HMIToMobileResult(vr_result_);
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == vr_result_) {
+ result_code = MessageHelper::HMIToMobileResult(ui_result_);
+ }
+ LOG4CXX_DEBUG(logger_, "HMIToMobileResult " << result_code);
+ }
+
+ if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) {
+ const bool is_ui_not_ok = Compare<hmi_apis::Common_Result::eType, NEQ, ALL>(
+ ui_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ if (is_ui_not_ok) {
+ result_code = ui_result_ == hmi_apis::Common_Result::REJECTED
+ ? mobile_apis::Result::REJECTED
+ : mobile_apis::Result::GENERIC_ERROR;
+
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ application->RemoveCommand(cmd_id);
+ result = false;
+ LOG4CXX_DEBUG(logger_, "Result " << result);
+ }
+ }
+
+ if (BothSend() && hmi_apis::Common_Result::SUCCESS == ui_result_ &&
+ !is_no_vr_error &&
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
+ result_code = vr_result_ == hmi_apis::Common_Result::REJECTED
+ ? mobile_apis::Result::REJECTED
+ : mobile_apis::Result::GENERIC_ERROR;
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
+
+ application->RemoveCommand(cmd_id);
+ result = false;
+ LOG4CXX_DEBUG(logger_, "Result " << result);
+ }
+
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+ HmiInterfaces::InterfaceState vr_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VR);
+
+ if (!BothSend() &&
+ ((is_vr_unsupported &&
+ HmiInterfaces::STATE_NOT_AVAILABLE == vr_interface_state) ||
+ (is_ui_unsupported &&
+ HmiInterfaces::STATE_NOT_AVAILABLE == ui_interface_state))) {
+ LOG4CXX_DEBUG(logger_, "!BothSend() && is_vr_or_ui_unsupported");
+ result = false;
+ }
+
+ if (is_vr_and_ui_unsupported) {
+ LOG4CXX_DEBUG(logger_, "UI and VR interface both unsupported");
+ result = false;
+ }
+
+ if (result) {
+ application->help_prompt_manager().OnVrCommandAdded(
+ cmd_id, (*message_)[strings::msg_params], false);
+ } else {
+ RemoveCommand();
+ }
+
+ const std::string info = GenerateMobileResponseInfo();
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool AddCommandRequest::IsPendingResponseExist() {
+ return send_ui_ != is_ui_received_ || send_vr_ != is_vr_received_;
+}
+
+bool AddCommandRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ str = (*message_)[strings::msg_params][strings::menu_params]
+ [strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed.");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
+ const size_t len =
+ (*message_)[strings::msg_params][strings::vr_commands].length();
+
+ for (size_t i = 0; i < len; ++i) {
+ str = (*message_)[strings::msg_params][strings::vr_commands][i]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
+ str = (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid cmd_icon value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+bool AddCommandRequest::BothSend() const {
+ return send_vr_ && send_ui_;
+}
+
+const std::string AddCommandRequest::GenerateMobileResponseInfo() {
+ // In case if vr_result_ is UNSUPPORTED_RESOURCE vr_info should be on the
+ // first place
+ // In case if ui_result_ is UNSUPPORTED_RESOURCE ui_info should be on the
+ // first place
+ // Other way order is doesn't matter
+
+ HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ HmiInterfaces::InterfaceState ui_interface_state =
+ hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_UI);
+
+ HmiInterfaces::InterfaceState vr_interface_state =
+ hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_VR);
+
+ if ((ui_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (vr_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !vr_info_.empty()) {
+ return vr_info_;
+ }
+
+ if ((vr_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (ui_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !ui_info_.empty()) {
+ return ui_info_;
+ }
+
+ return app_mngr::commands::MergeInfos(ui_info_, vr_info_);
+}
+
+void AddCommandRequest::RemoveCommand() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ return;
+ }
+
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = cmd_id;
+ msg_params[strings::app_id] = app->app_id();
+
+ app->RemoveCommand(cmd_id);
+
+ if (BothSend() && !(is_vr_received_ || is_ui_received_)) {
+ // in case we have send bth UI and VR and no one respond
+ // we have nothing to remove from HMI so no DeleteCommand expected
+ return;
+ }
+
+ if (BothSend() && !is_vr_received_) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
+ }
+
+ if (BothSend() && !is_ui_received_) {
+ msg_params[strings::grammar_id] = app->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc
new file mode 100644
index 0000000000..ccb84cecbb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/add_command_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddCommandResponse::AddCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AddCommandResponse::~AddCommandResponse() {}
+
+void AddCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
new file mode 100644
index 0000000000..183b445326
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
@@ -0,0 +1,186 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddSubMenuRequest::AddSubMenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AddSubMenuRequest::~AddSubMenuRequest() {}
+
+void AddSubMenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject received_msg_params =
+ (*message_)[strings::msg_params];
+ mobile_apis::Result::eType verification_result =
+ mobile_apis::Result::INVALID_ENUM;
+
+ if (received_msg_params.keyExists(strings::menu_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ received_msg_params[strings::menu_icon], app, application_manager_);
+
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(
+ logger_, "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ const int32_t menu_id = received_msg_params[strings::menu_id].asInt();
+ if (app->FindSubMenu(menu_id)) {
+ LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ const std::string& menu_name =
+ received_msg_params[strings::menu_name].asString();
+
+ if (app->IsSubMenuNameAlreadyExist(menu_name)) {
+ LOG4CXX_ERROR(logger_, "Menu name " << menu_name << " is duplicated.");
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ if (!CheckSubMenuName()) {
+ LOG4CXX_ERROR(logger_, "Sub-menu name is not valid.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] = received_msg_params[strings::menu_id];
+ if (received_msg_params.keyExists(strings::position)) {
+ msg_params[strings::menu_params][strings::position] =
+ received_msg_params[strings::position];
+ }
+ msg_params[strings::menu_params][strings::menu_name] =
+ received_msg_params[strings::menu_name];
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
+}
+
+void AddSubMenuRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_AddSubMenu: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ application->AddSubMenu(
+ (*message_)[strings::msg_params][strings::menu_id].asInt(),
+ (*message_)[strings::msg_params]);
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool AddSubMenuRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool AddSubMenuRequest::CheckSubMenuName() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_INFO(logger_, "Invalid subMenu name.");
+ return false;
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc
new file mode 100644
index 0000000000..d0ec635dd0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddSubMenuResponse::AddSubMenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AddSubMenuResponse::~AddSubMenuResponse() {}
+
+void AddSubMenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc
new file mode 100644
index 0000000000..5dda34b743
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc
@@ -0,0 +1,291 @@
+/*
+ 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 <cstring>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertManeuverRequest::AlertManeuverRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , tts_speak_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
+ , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+AlertManeuverRequest::~AlertManeuverRequest() {}
+
+void AlertManeuverRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
+ (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) {
+ LOG4CXX_ERROR(logger_, "AlertManeuverRequest::Request without parameters!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (NULL == app.get()) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming alert maneuver has contains \\t\\n \\\\t \\\\n"
+ "text contains only whitespace in ttsChunks");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ // Checking parameters and how many HMI requests should be sent
+ bool tts_is_ok = false;
+
+ // check TTSChunk parameter
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ smart_objects::SmartObject& tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_chunks are not present");
+ return;
+ }
+
+ if (0 < (*message_)[strings::msg_params][strings::tts_chunks].length()) {
+ pending_requests_.Add(hmi_apis::FunctionID::TTS_Speak);
+ tts_is_ok = true;
+ }
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = app->app_id();
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[hmi_request::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+
+ pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_AlertManeuver, &msg_params, true);
+
+ if (tts_is_ok) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::tts_chunks] =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ msg_params[hmi_request::speak_type] =
+ hmi_apis::Common_MethodName::ALERT_MANEUVER;
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
+ }
+}
+
+void AlertManeuverRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ hmi_apis::FunctionID::eType event_id = event.id();
+ switch (event_id) {
+ case hmi_apis::FunctionID::Navigation_AlertManeuver: {
+ LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ pending_requests_.Remove(event_id);
+ navi_alert_maneuver_result_code_ =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, info_navi_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ pending_requests_.Remove(event_id);
+ tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, info_tts_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ SendResponse(
+ false, mobile_apis::Result::INVALID_ENUM, "Received unknown event");
+ return;
+ }
+ }
+
+ if (!pending_requests_.IsFinal(event_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "There are some pending responses from HMI."
+ "AlertManeuverRequest still waiting.");
+ return;
+ }
+ std::string return_info;
+ mobile_apis::Result::eType result_code;
+ const bool result = PrepareResponseParameters(result_code, return_info);
+ bool must_be_empty_info = false;
+ if (return_info.find("\n") != std::string::npos ||
+ return_info.find("\t") != std::string::npos) {
+ must_be_empty_info = true;
+ }
+ SendResponse(result,
+ result_code,
+ (must_be_empty_info) ? NULL : return_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool AlertManeuverRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& return_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ app_mngr::commands::ResponseInfo navigation_alert_info(
+ navi_alert_maneuver_result_code_,
+ HmiInterfaces::HMI_INTERFACE_Navigation,
+ application_manager_);
+
+ app_mngr::commands::ResponseInfo tts_alert_info(
+ tts_speak_result_code_,
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(navigation_alert_info, tts_alert_info);
+
+ if (result && (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
+ tts_speak_result_code_ &&
+ (HmiInterfaces::STATE_AVAILABLE ==
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS)))) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info = std::string("Unsupported phoneme type sent in a prompt");
+ return result;
+ }
+ result_code =
+ PrepareResultCodeForResponse(navigation_alert_info, tts_alert_info);
+ return_info = app_mngr::commands::MergeInfos(
+ navigation_alert_info, info_navi_, tts_alert_info, info_tts_);
+ return result;
+}
+
+bool AlertManeuverRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using smart_objects::SmartArray;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ const SmartArray* tts_chunks_arr =
+ (*message_)[strings::msg_params][strings::tts_chunks].asArray();
+
+ SmartArray::const_iterator it_tts_chunk = tts_chunks_arr->begin();
+
+ for (; it_tts_chunk != tts_chunks_arr->end(); ++it_tts_chunk) {
+ const char* tts_chunk_text = (*it_tts_chunk)[strings::text].asCharArray();
+ if (strlen(tts_chunk_text) && !CheckSyntax(tts_chunk_text)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
+ return true;
+ }
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ DCHECK_OR_RETURN(
+ (*message_)[strings::msg_params][strings::soft_buttons].getType() ==
+ smart_objects::SmartType_Array,
+ true);
+ const smart_objects::SmartArray* soft_button_array =
+ (*message_)[strings::msg_params][strings::soft_buttons].asArray();
+
+ SmartArray::const_iterator it_soft_button = soft_button_array->begin();
+
+ for (; it_soft_button != soft_button_array->end(); ++it_soft_button) {
+ const char* soft_button_text =
+ (*it_soft_button)[strings::text].asCharArray();
+ if (!CheckSyntax(soft_button_text)) {
+ LOG4CXX_ERROR(logger_, "Invalid soft_buttons syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc
new file mode 100644
index 0000000000..d3e527f6ae
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertManeuverResponse::AlertManeuverResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AlertManeuverResponse::~AlertManeuverResponse() {}
+
+void AlertManeuverResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
new file mode 100644
index 0000000000..2806ac1d93
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
@@ -0,0 +1,453 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/alert_request.h"
+
+#include <string.h>
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "utils/helpers.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertRequest::AlertRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , awaiting_ui_alert_response_(false)
+ , awaiting_tts_speak_response_(false)
+ , awaiting_tts_stop_speaking_response_(false)
+ , is_alert_succeeded_(false)
+ , is_ui_alert_sent_(false)
+ , alert_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+AlertRequest::~AlertRequest() {}
+
+bool AlertRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::duration)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::duration].asUInt();
+ } else {
+ const int32_t def_value = 5000;
+ default_timeout_ = def_value;
+ }
+
+ // If soft buttons are present, SDL will not use initiate timeout tracking for
+ // response.
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ LOG4CXX_INFO(logger_,
+ "Request contains soft buttons - request timeout "
+ "will be set to 0.");
+ default_timeout_ = 0;
+ }
+
+ return true;
+}
+
+void AlertRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asInt();
+
+ if (!Validate(app_id)) {
+ // Invalid command, abort execution
+ return;
+ }
+ bool tts_chunks_exists =
+ (*message_)[strings::msg_params].keyExists(strings::tts_chunks);
+ size_t length_tts_chunks = 0;
+
+ if (tts_chunks_exists) {
+ length_tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks].length();
+ }
+
+ if ((tts_chunks_exists && length_tts_chunks) ||
+ ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
+ (*message_)[strings::msg_params][strings::play_tone].asBool())) {
+ awaiting_tts_speak_response_ = true;
+ }
+
+ SendAlertRequest(app_id);
+ if (awaiting_tts_speak_response_) {
+ SendSpeakRequest(app_id, tts_chunks_exists, length_tts_chunks);
+ }
+}
+
+void AlertRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_OnResetTimeout:
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_,
+ "Received UI_OnResetTimeout event "
+ " or TTS_OnResetTimeout event"
+ << awaiting_tts_speak_response_ << " "
+ << awaiting_tts_stop_speaking_response_ << " "
+ << awaiting_ui_alert_response_);
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_Alert: {
+ LOG4CXX_INFO(logger_, "Received UI_Alert event");
+ // Unsubscribe from event to avoid unwanted messages
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert);
+ awaiting_ui_alert_response_ = false;
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+
+ if (awaiting_tts_speak_response_ &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state) {
+ awaiting_tts_stop_speaking_response_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true);
+ }
+ alert_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ // Mobile Alert request is successful when UI_Alert is successful
+ alert_response_params_ = message[strings::msg_params];
+ GetInfo(message, ui_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ // Unsubscribe from event to avoid unwanted messages
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak);
+ awaiting_tts_speak_response_ = false;
+ tts_speak_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_StopSpeaking: {
+ LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ // Unsubscribe from event to avoid unwanted messages
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ awaiting_tts_stop_speaking_response_ = false;
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (HasHmiResponsesToWait()) {
+ return;
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string info;
+ const bool result = PrepareResponseParameters(result_code, info);
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ &alert_response_params_);
+}
+
+bool AlertRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ app_mngr::commands::ResponseInfo ui_alert_info(
+ alert_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo tts_alert_info(
+ tts_speak_result_,
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
+
+ bool result = PrepareResultForMobileResponse(ui_alert_info, tts_alert_info);
+
+ /* result=false if UI interface is ok and TTS interface = UNSUPPORTED_RESOURCE
+ * and sdl receive TTS.IsReady=true or SDL doesn't receive responce for
+ * TTS.IsReady.
+ */
+ if (result && ui_alert_info.is_ok && tts_alert_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != tts_alert_info.interface_state) {
+ result = false;
+ }
+ result_code = mobile_apis::Result::WARNINGS;
+ if ((ui_alert_info.is_ok || ui_alert_info.is_not_used) &&
+ tts_alert_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_AVAILABLE == tts_alert_info.interface_state) {
+ tts_response_info_ = "Unsupported phoneme type sent in a prompt";
+ info = app_mngr::commands::MergeInfos(
+ ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
+ return result;
+ }
+ result_code = PrepareResultCodeForResponse(ui_alert_info, tts_alert_info);
+ info = app_mngr::commands::MergeInfos(
+ ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
+ // Mobile Alert request is successful when UI_Alert is successful
+ if (is_ui_alert_sent_ && !ui_alert_info.is_ok) {
+ return false;
+ }
+ return result;
+}
+
+bool AlertRequest::Validate(uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+
+ if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() &&
+ app->AreCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::POLICY_TABLE)) {
+ LOG4CXX_ERROR(logger_, "Alert frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return false;
+ }
+
+ if (!CheckStringsOfAlertRequest()) {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return false;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return false;
+ }
+
+ // check if mandatory params(alertText1 and TTSChunk) specified
+ if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1)) &&
+ (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) &&
+ (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks) &&
+ (1 > (*message_)[strings::msg_params][strings::tts_chunks].length()))) {
+ LOG4CXX_ERROR(logger_, "Mandatory parameters are missing");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Mandatory parameters are missing");
+ return false;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ smart_objects::SmartObject& tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_chunks are not present");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void AlertRequest::SendAlertRequest(int32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::alert_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText1;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text1];
+ index++;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText2;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text2];
+ index++;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText3;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text3];
+ }
+
+ // softButtons
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[hmi_request::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ // app_id
+ msg_params[strings::app_id] = app_id;
+ msg_params[strings::duration] = default_timeout_;
+
+ // NAVI platform progressIndicator
+ if ((*message_)[strings::msg_params].keyExists(strings::progress_indicator)) {
+ msg_params[strings::progress_indicator] =
+ (*message_)[strings::msg_params][strings::progress_indicator];
+ }
+
+ // PASA Alert type
+ msg_params[strings::alert_type] = hmi_apis::Common_AlertType::UI;
+ if (awaiting_tts_speak_response_) {
+ msg_params[strings::alert_type] = hmi_apis::Common_AlertType::BOTH;
+ }
+
+ // check out if there are alert strings or soft buttons
+ if (msg_params[hmi_request::alert_strings].length() > 0 ||
+ msg_params.keyExists(hmi_request::soft_buttons)) {
+ awaiting_ui_alert_response_ = true;
+ is_ui_alert_sent_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true);
+ }
+}
+
+void AlertRequest::SendSpeakRequest(int32_t app_id,
+ bool tts_chunks_exists,
+ size_t length_tts_chunks) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ // crate HMI speak request
+ SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
+ if (tts_chunks_exists && length_tts_chunks) {
+ msg_params[hmi_request::tts_chunks] =
+ smart_objects::SmartObject(SmartType_Array);
+ msg_params[hmi_request::tts_chunks] =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
+ (*message_)[strings::msg_params][strings::play_tone].asBool()) {
+ msg_params[strings::play_tone] = true;
+ }
+ msg_params[strings::app_id] = app_id;
+ msg_params[hmi_request::speak_type] = Common_MethodName::ALERT;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
+}
+
+bool AlertRequest::CheckStringsOfAlertRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
+ str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
+ str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
+ str = (*message_)[strings::msg_params][strings::alert_text3].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_3 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ smart_objects::SmartObject& tts_chunks_array =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ for (size_t i = 0; i < tts_chunks_array.length(); ++i) {
+ str = tts_chunks_array[i][strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks text syntax check failed");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+bool AlertRequest::HasHmiResponsesToWait() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ ||
+ awaiting_tts_stop_speaking_response_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc
new file mode 100644
index 0000000000..bab5e5a5d8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc
@@ -0,0 +1,67 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertResponse::AlertResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AlertResponse::~AlertResponse() {}
+
+void AlertResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc
new file mode 100644
index 0000000000..6af930ea53
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc
@@ -0,0 +1,684 @@
+/*
+
+ 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 <string.h>
+#include <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace {
+namespace custom_str = utils::custom_string;
+struct IsSameNickname {
+ IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
+ bool operator()(const policy::StringArray::value_type& nickname) const {
+ return app_id_.CompareIgnoreCase(nickname.c_str());
+ }
+
+ private:
+ const custom_str::CustomString& app_id_;
+};
+}
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ChangeRegistrationRequest::ChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , vr_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+ChangeRegistrationRequest::~ChangeRegistrationRequest() {}
+
+void ChangeRegistrationRequest::SendVRRequest(
+ ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::VR_ChangeRegistration;
+ pending_requests_.Add(function);
+ smart_objects::SmartObject vr_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ vr_params[strings::language] = msg_params[strings::language];
+
+ vr_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ vr_params[strings::vr_synonyms] = msg_params[strings::vr_synonyms];
+ app->set_vr_synonyms(msg_params[strings::vr_synonyms]);
+ }
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &vr_params, true);
+}
+
+void ChangeRegistrationRequest::SendTTSRequest(
+ ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::TTS_ChangeRegistration;
+ pending_requests_.Add(function);
+
+ smart_objects::SmartObject tts_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ tts_params[strings::language] = msg_params[strings::language];
+
+ tts_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::tts_name)) {
+ tts_params[strings::tts_name] = msg_params[strings::tts_name];
+ app->set_tts_name(msg_params[strings::tts_name]);
+ }
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &tts_params, true);
+}
+
+void ChangeRegistrationRequest::SendUIRequest(
+ ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params,
+ const int32_t hmi_language) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::UI_ChangeRegistration;
+ pending_requests_.Add(function);
+ // UI processing
+ smart_objects::SmartObject ui_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ ui_params[strings::language] = hmi_language;
+ ui_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::app_name)) {
+ ui_params[strings::app_name] = msg_params[strings::app_name];
+ app->set_name(msg_params[strings::app_name].asCustomString());
+ }
+ if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
+ ui_params[strings::ngn_media_screen_app_name] =
+ msg_params[strings::ngn_media_screen_app_name];
+ app->set_ngn_media_screen_name(
+ msg_params[strings::ngn_media_screen_app_name]);
+ }
+
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &ui_params, true);
+}
+
+void ChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace smart_objects;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming request contains \t\n \\t \\n or whitespace");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (mobile_apis::Result::SUCCESS != CheckCoincidence()) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ const int32_t hmi_language =
+ msg_params[strings::hmi_display_language].asInt();
+
+ const int32_t language = msg_params[strings::language].asInt();
+
+ if (false == (IsLanguageSupportedByUI(hmi_language) &&
+ IsLanguageSupportedByVR(language) &&
+ IsLanguageSupportedByTTS(language))) {
+ LOG4CXX_ERROR(logger_, "Language is not supported");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::app_name) &&
+ !IsNicknameAllowed(msg_params[strings::app_name].asCustomString())) {
+ LOG4CXX_ERROR(logger_, "Nickname is not allowed.");
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ smart_objects::SmartObject& tts_name =
+ (*message_)[strings::msg_params][strings::tts_name];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_name, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_name are not present");
+ return;
+ }
+ }
+
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+
+ const HmiInterfaces::InterfaceState vr_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
+ const HmiInterfaces::InterfaceState ui_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
+ const HmiInterfaces::InterfaceState tts_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
+
+ using helpers::Compare;
+ using helpers::EQ;
+ using helpers::ALL;
+
+ if (Compare<HmiInterfaces::InterfaceState, EQ, ALL>(
+ HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE,
+ vr_state,
+ tts_state,
+ ui_state)) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != vr_state) {
+ // VR processing
+ SendVRRequest(app, msg_params);
+ }
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != tts_state) {
+ // TTS processing
+ SendTTSRequest(app, msg_params);
+ }
+
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != ui_state) {
+ SendUIRequest(app, msg_params, hmi_language);
+ }
+}
+
+void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ hmi_apis::FunctionID::eType event_id = event.id();
+
+ switch (event_id) {
+ case hmi_apis::FunctionID::UI_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received UI_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ pending_requests_.Remove(event_id);
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::VR_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received VR_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ pending_requests_.Remove(event_id);
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, vr_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received TTS_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ pending_requests_.Remove(event_id);
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event_id);
+ return;
+ }
+ }
+
+ if (pending_requests_.IsFinal(event_id)) {
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (hmi_apis::Common_Result::SUCCESS == ui_result_) {
+ application->set_ui_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::hmi_display_language]
+ .asInt()));
+ }
+
+ if (hmi_apis::Common_Result::SUCCESS == vr_result_ ||
+ hmi_apis::Common_Result::SUCCESS == tts_result_) {
+ application->set_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
+
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::eType::ChangeRegistrationID;
+
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ } else {
+ LOG4CXX_INFO(logger_,
+ "There are some pending responses from HMI."
+ "ChangeRegistrationRequest still waiting.");
+ }
+}
+
+namespace {
+void CheckInfo(std::string& str) {
+ if (std::string::npos != str.find("is not supported by system")) {
+ str.clear();
+ }
+}
+} // namespace
+
+bool ChangeRegistrationRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& response_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ const bool is_tts_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ tts_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_ui_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_vr_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ vr_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_tts_ui_vr_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ tts_result_,
+ ui_result_,
+ vr_result_);
+
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceState tts_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
+ const HmiInterfaces::InterfaceState vr_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
+ const HmiInterfaces::InterfaceState ui_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
+
+ app_mngr::commands::ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+
+ app_mngr::commands::ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+
+ app_mngr::commands::ResponseInfo vr_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
+
+ bool result = ((!is_tts_ui_vr_unsupported) && is_tts_succeeded_unsupported &&
+ is_ui_succeeded_unsupported && is_vr_succeeded_unsupported);
+
+ const bool is_tts_or_ui_or_vr_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ tts_result_,
+ ui_result_,
+ vr_result_);
+
+ if ((result && is_tts_or_ui_or_vr_unsupported)) {
+ result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ result =
+ PrepareResultForMobileResponse(ui_properties_info,
+ tts_properties_info) &&
+ PrepareResultForMobileResponse(tts_properties_info, vr_properties_info);
+ } else {
+ // If response contains erroneous result code SDL need return erroneus
+ // result code.
+ hmi_apis::Common_Result::eType ui_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType vr_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType tts_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != ui_result_) {
+ ui_result = ui_result_;
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
+ vr_result = vr_result_;
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != tts_result_) {
+ tts_result = tts_result_;
+ }
+ result_code = MessageHelper::HMIToMobileResult(
+ std::max(std::max(ui_result, vr_result), tts_result));
+ if (mobile_api::Result::INVALID_ENUM == result_code) {
+ result_code = mobile_api::Result::UNSUPPORTED_RESOURCE;
+ }
+ }
+
+ const bool is_tts_state_available =
+ tts_state == HmiInterfaces::STATE_AVAILABLE;
+ const bool is_vr_state_available = vr_state == HmiInterfaces::STATE_AVAILABLE;
+ const bool is_ui_state_available = ui_state == HmiInterfaces::STATE_AVAILABLE;
+
+ const bool is_tts_hmi_info =
+ is_tts_state_available && !tts_response_info_.empty();
+ const bool is_vr_hmi_info =
+ is_vr_state_available && !vr_response_info_.empty();
+ const bool is_ui_hmi_info =
+ is_ui_state_available && !ui_response_info_.empty();
+
+ if (is_tts_hmi_info || is_vr_hmi_info || is_ui_hmi_info) {
+ if (!is_tts_hmi_info)
+ CheckInfo(tts_response_info_);
+ if (!is_vr_hmi_info)
+ CheckInfo(ui_response_info_);
+ if (!is_ui_hmi_info)
+ CheckInfo(vr_response_info_);
+ }
+
+ response_info = app_mngr::commands::MergeInfos(
+ ui_response_info_, vr_response_info_, tts_response_info_);
+ return result;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByUI(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ const smart_objects::SmartObject* ui_languages =
+ hmi_capabilities.ui_supported_languages();
+
+ if (!ui_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < ui_languages->length(); ++i) {
+ if (hmi_display_lang == ui_languages->getElement(i).asInt()) {
+ return true;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by UI");
+
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByVR(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ const smart_objects::SmartObject* vr_languages =
+ hmi_capabilities.vr_supported_languages();
+
+ if (!vr_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < vr_languages->length(); ++i) {
+ if (hmi_display_lang == vr_languages->getElement(i).asInt()) {
+ return true;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by VR");
+
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByTTS(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ const smart_objects::SmartObject* tts_languages =
+ hmi_capabilities.tts_supported_languages();
+
+ if (!tts_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < tts_languages->length(); ++i) {
+ if (hmi_display_lang == tts_languages->getElement(i).asInt()) {
+ return true;
+ break;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by TTS");
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsWhiteSpaceExist() {
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::app_name)) {
+ str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ const smart_objects::SmartArray* tn_array =
+ (*message_)[strings::msg_params][strings::tts_name].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
+ smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
+
+ for (; it_tn != it_tn_end; ++it_tn) {
+ str = (*it_tn)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::ngn_media_screen_app_name)) {
+ str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid ngn_media_screen_app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
+ const smart_objects::SmartArray* vs_array =
+ (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
+ smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
+
+ for (; it_vs != it_vs_end; ++it_vs) {
+ str = (*it_vs).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationSet accessor = application_manager_.applications().GetData();
+ custom_str::CustomString app_name;
+ uint32_t app_id = connection_key();
+ if (msg_params.keyExists(strings::app_name)) {
+ app_name = msg_params[strings::app_name].asCustomString();
+ }
+
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it; ++it) {
+ if (app_id == (*it)->app_id()) {
+ continue;
+ }
+
+ const custom_str::CustomString& cur_name = (*it)->name();
+ if (msg_params.keyExists(strings::app_name)) {
+ if (app_name.CompareIgnoreCase(cur_name)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+
+ const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
+ const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
+ if (NULL != vr) {
+ curr_vr = vr->asArray();
+ CoincidencePredicateVR v(app_name);
+
+ if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+ }
+
+ // vr check
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ const std::vector<smart_objects::SmartObject>* new_vr =
+ msg_params[strings::vr_synonyms].asArray();
+
+ CoincidencePredicateVR v(cur_name);
+ if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // end vr check
+ } // application for end
+ return mobile_apis::Result::SUCCESS;
+}
+
+bool ChangeRegistrationRequest::IsNicknameAllowed(
+ const custom_str::CustomString& app_name) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find appication with connection key "
+ << connection_key());
+ return false;
+ }
+
+ const std::string policy_app_id = app->policy_app_id();
+
+ policy::StringArray app_nicknames;
+ policy::StringArray app_hmi_types;
+
+ bool init_result = policy_handler_.GetInitialAppData(
+ policy_app_id, &app_nicknames, &app_hmi_types);
+
+ if (!init_result) {
+ LOG4CXX_ERROR(logger_,
+ "Error during getting of nickname list for application "
+ << policy_app_id);
+ return false;
+ }
+
+ if (!app_nicknames.empty()) {
+ IsSameNickname compare(app_name);
+ policy::StringArray::const_iterator it =
+ std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
+ if (app_nicknames.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Application name was not found in nicknames list.");
+
+ usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
+ policy_handler_.GetStatisticManager(),
+ policy_app_id,
+ usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
+ ++count_of_rejections_nickname_mismatch;
+
+ return false;
+ }
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc
new file mode 100644
index 0000000000..2dae92cd9b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/change_registration_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ChangeRegistrationResponse::ChangeRegistrationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ChangeRegistrationResponse::~ChangeRegistrationResponse() {}
+
+void ChangeRegistrationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
new file mode 100644
index 0000000000..416f4f2085
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
@@ -0,0 +1,483 @@
+/*
+
+ 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 <string>
+#include <cstring>
+#include <algorithm>
+#include <vector>
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/gen_hash.h"
+#include "utils/helpers.h"
+
+const char* kInvalidImageWarningInfo = "Requested image(s) not found.";
+
+namespace sdl_rpc_plugin {
+namespace commands {
+
+using namespace application_manager;
+
+CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , choice_set_id_(0)
+ , expected_chs_count_(0)
+ , received_chs_count_(0)
+ , should_send_warnings_(false)
+ , error_from_hmi_(false)
+ , is_timed_out_(false) {}
+
+CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+void CreateInteractionChoiceSetRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ for (uint32_t i = 0;
+ i < (*message_)[strings::msg_params][strings::choice_set].length();
+ ++i) {
+ Result::eType verification_result_image = Result::SUCCESS;
+ Result::eType verification_result_secondary_image = Result::SUCCESS;
+ if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
+ strings::image)) {
+ verification_result_image = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::choice_set][i]
+ [strings::image],
+ app,
+ application_manager_);
+ }
+ if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
+ strings::secondary_image)) {
+ verification_result_secondary_image = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::choice_set][i]
+ [strings::secondary_image],
+ app,
+ application_manager_);
+ }
+ if (verification_result_image == Result::INVALID_DATA ||
+ verification_result_secondary_image == Result::INVALID_DATA) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, Result::INVALID_DATA);
+ return;
+ } else if (verification_result_image == Result::WARNINGS ||
+ verification_result_secondary_image == Result::WARNINGS) {
+ should_send_warnings_ = true;
+ break;
+ }
+ }
+
+ choice_set_id_ =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asInt();
+
+ if (app->FindChoiceSet(choice_set_id_)) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id_ << " is not found.");
+ SendResponse(false, Result::INVALID_ID);
+ return;
+ }
+
+ Result::eType result = CheckChoiceSet(app);
+ if (Result::SUCCESS != result) {
+ SendResponse(false, result);
+ return;
+ }
+ auto vr_status = MessageHelper::CheckChoiceSetVRCommands(
+ (*message_)[strings::msg_params][strings::choice_set]);
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::MIXED) {
+ // this is an error
+ SendResponse(false,
+ Result::INVALID_DATA,
+ "Some choices don't contain VR commands. Either all or none "
+ "must have voice commands.");
+ return; // exit now, this is a bad set
+ } else if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ // everyone had a vr command, setup the grammar
+ uint32_t grammar_id = application_manager_.GenerateGrammarID();
+ (*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
+ }
+ // continue on as usual
+ app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]);
+
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ // we have VR commands
+ SendVRAddCommandRequests(app);
+ } else {
+ // we have none, just return with success
+ SendResponse(true, Result::SUCCESS);
+ }
+}
+
+mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
+ ApplicationConstSharedPtr app) {
+ using namespace smart_objects;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::set<uint32_t> choice_id_set;
+
+ const SmartArray* choice_set =
+ (*message_)[strings::msg_params][strings::choice_set].asArray();
+
+ SmartArray::const_iterator current_choice_set_it = choice_set->begin();
+ SmartArray::const_iterator next_choice_set_it;
+
+ for (; choice_set->end() != current_choice_set_it; ++current_choice_set_it) {
+ std::pair<std::set<uint32_t>::iterator, bool> ins_res =
+ choice_id_set.insert(
+ (*current_choice_set_it)[strings::choice_id].asInt());
+ if (!ins_res.second) {
+ LOG4CXX_ERROR(logger_,
+ "Choice with ID "
+ << (*current_choice_set_it)[strings::choice_id].asInt()
+ << " already exists");
+ return mobile_apis::Result::INVALID_ID;
+ }
+
+ if (IsWhiteSpaceExist(*current_choice_set_it)) {
+ LOG4CXX_ERROR(logger_, "Incoming choice set has contains \t\n \\t \\n");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ for (next_choice_set_it = current_choice_set_it + 1;
+ choice_set->end() != next_choice_set_it;
+ ++next_choice_set_it) {
+ if (compareSynonyms(*current_choice_set_it, *next_choice_set_it)) {
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+ }
+ return mobile_apis::Result::SUCCESS;
+}
+
+bool CreateInteractionChoiceSetRequest::compareSynonyms(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice2) {
+ // only compare if they both have vr commands
+ if (!(choice1.keyExists(strings::vr_commands) &&
+ choice2.keyExists(strings::vr_commands))) {
+ return false; // clearly there isn't a duplicate if one of them is null
+ }
+ smart_objects::SmartArray* vr_cmds_1 =
+ choice1[strings::vr_commands].asArray();
+ smart_objects::SmartArray* vr_cmds_2 =
+ choice2[strings::vr_commands].asArray();
+
+ smart_objects::SmartArray::iterator it;
+ it = std::find_first_of(vr_cmds_1->begin(),
+ vr_cmds_1->end(),
+ vr_cmds_2->begin(),
+ vr_cmds_2->end(),
+ CreateInteractionChoiceSetRequest::compareStr);
+
+ if (it != vr_cmds_1->end()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming choice set has duplicated VR synonyms "
+ << it->asString());
+ return true;
+ }
+
+ return false;
+}
+
+bool CreateInteractionChoiceSetRequest::compareStr(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str2) {
+ return 0 == strcasecmp(str1.asCharArray(), str2.asCharArray());
+}
+
+bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist(
+ const smart_objects::SmartObject& choice_set) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = choice_set[strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_name syntax check failed");
+ return true;
+ }
+
+ if (choice_set.keyExists(strings::secondary_text)) {
+ str = choice_set[strings::secondary_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid secondary_text syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::tertiary_text)) {
+ str = choice_set[strings::tertiary_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tertiary_text syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::vr_commands)) {
+ const size_t len = choice_set[strings::vr_commands].length();
+
+ for (size_t i = 0; i < len; ++i) {
+ str = choice_set[strings::vr_commands][i].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (choice_set.keyExists(strings::image)) {
+ str = choice_set[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid image value syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::secondary_image)) {
+ str = choice_set[strings::secondary_image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid secondary_image value. "
+ "Syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& choice_set = (*message_)[strings::msg_params];
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::grammar_id] = choice_set[strings::grammar_id];
+ const uint32_t choice_count = choice_set[strings::choice_set].length();
+ SetAllowedToTerminate(false);
+
+ expected_chs_count_ = choice_count;
+ size_t chs_num = 0;
+ for (; chs_num < choice_count; ++chs_num) {
+ {
+ sync_primitives::AutoLock error_lock(error_from_hmi_lock_);
+ if (error_from_hmi_) {
+ LOG4CXX_WARN(logger_,
+ "Error from HMI received. Stop sending VRCommands");
+ break;
+ }
+ }
+
+ msg_params[strings::cmd_id] =
+ choice_set[strings::choice_set][chs_num][strings::choice_id];
+ msg_params[strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands] =
+ choice_set[strings::choice_set][chs_num][strings::vr_commands];
+
+ sync_primitives::AutoLock commands_lock(vr_commands_lock_);
+ const uint32_t vr_cmd_id = msg_params[strings::cmd_id].asUInt();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ const uint32_t vr_corr_id =
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params, true);
+
+ VRCommandInfo vr_command(vr_cmd_id);
+ sent_commands_map_[vr_corr_id] = vr_command;
+ LOG4CXX_DEBUG(logger_,
+ "VR_command sent corr_id " << vr_corr_id << " cmd_id "
+ << vr_corr_id);
+ }
+ expected_chs_count_ = chs_num;
+ LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_);
+}
+
+void CreateInteractionChoiceSetRequest::ProcessHmiError(
+ const hmi_apis::Common_Result::eType vr_result) {
+ LOG4CXX_DEBUG(logger_,
+ "Hmi response is not Success: "
+ << vr_result << ". Stop sending VRAddCommand requests");
+ if (!error_from_hmi_) {
+ error_from_hmi_ = true;
+ std::string info =
+ vr_result == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE
+ ? "VR is not supported by system"
+ : "";
+ SendResponse(false, GetMobileResultCode(vr_result), info.c_str());
+ }
+}
+
+bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse(
+ const uint32_t corr_id) {
+ SentCommandsMap::iterator it = sent_commands_map_.find(corr_id);
+ if (sent_commands_map_.end() == it) {
+ LOG4CXX_WARN(logger_, "HMI response for unknown VR command received");
+ return false;
+ }
+ VRCommandInfo& vr_command = it->second;
+ vr_command.succesful_response_received_ = true;
+ return true;
+}
+
+void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() {
+ received_chs_count_++;
+ LOG4CXX_DEBUG(logger_,
+ "Got VR.AddCommand response, there are "
+ << expected_chs_count_ - received_chs_count_
+ << " more to wait.");
+ if (received_chs_count_ < expected_chs_count_) {
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ LOG4CXX_DEBUG(logger_, "Timeout for request was updated");
+ } else {
+ OnAllHMIResponsesReceived();
+ }
+}
+
+void CreateInteractionChoiceSetRequest::on_event(
+ const event_engine::Event& event) {
+ using namespace hmi_apis;
+ using namespace helpers;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ const Common_Result::eType result = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool is_no_error = Compare<Common_Result::eType, EQ, ONE>(
+ result, Common_Result::SUCCESS, Common_Result::WARNINGS);
+ uint32_t corr_id = static_cast<uint32_t>(
+ message[strings::params][strings::correlation_id].asUInt());
+ if (event.id() == hmi_apis::FunctionID::VR_AddCommand) {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ {
+ sync_primitives::AutoLock commands_lock(vr_commands_lock_);
+ if (is_no_error) {
+ if (!ProcessSuccesfulHMIResponse(corr_id)) {
+ return;
+ }
+ } else {
+ ProcessHmiError(result);
+ }
+ }
+ CountReceivedVRResponses();
+ }
+}
+
+void CreateInteractionChoiceSetRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!error_from_hmi_) {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ }
+ CommandRequestImpl::onTimeOut();
+ DeleteChoices();
+
+ // We have to keep request alive until receive all responses from HMI
+ // according to SDLAQ-CRS-2976
+ sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_);
+ is_timed_out_ = true;
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+}
+
+bool CreateInteractionChoiceSetRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void CreateInteractionChoiceSetRequest::DeleteChoices() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ application->RemoveChoiceSet(choice_set_id_);
+
+ smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
+ msg_param[strings::app_id] = application->app_id();
+
+ sync_primitives::AutoLock commands_lock(vr_commands_lock_);
+ SentCommandsMap::const_iterator it = sent_commands_map_.begin();
+ for (; it != sent_commands_map_.end(); ++it) {
+ const VRCommandInfo& vr_command_info = it->second;
+ if (vr_command_info.succesful_response_received_) {
+ msg_param[strings::cmd_id] = vr_command_info.cmd_id_;
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_param);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "succesful response has not been received for cmd_id = "
+ << vr_command_info.cmd_id_);
+ }
+ }
+ sent_commands_map_.clear();
+}
+
+void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!error_from_hmi_ && should_send_warnings_) {
+ SendResponse(true, mobile_apis::Result::WARNINGS, kInvalidImageWarningInfo);
+ } else if (!error_from_hmi_) {
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ } else {
+ DeleteChoices();
+ }
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc
new file mode 100644
index 0000000000..807770ed12
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {}
+
+void CreateInteractionChoiceSetResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
new file mode 100644
index 0000000000..38069c341e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
@@ -0,0 +1,235 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteCommandRequest::DeleteCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , is_ui_send_(false)
+ , is_vr_send_(false)
+ , is_ui_received_(false)
+ , is_vr_received_(false)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+DeleteCommandRequest::~DeleteCommandRequest() {}
+
+void DeleteCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const int32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asInt();
+
+ smart_objects::SmartObject* command = application->FindCommand(cmd_id);
+
+ if (!command) {
+ LOG4CXX_ERROR(logger_, "Command with id " << cmd_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ // we should specify amount of required responses in the 1st request
+ uint32_t chaining_counter = 0;
+ if ((*command).keyExists(strings::menu_params)) {
+ ++chaining_counter;
+ }
+
+ if ((*command).keyExists(strings::vr_commands)) {
+ ++chaining_counter;
+ }
+ /* Need to set all flags before sending request to HMI
+ * for correct processing this flags in method on_event */
+ if ((*command).keyExists(strings::menu_params)) {
+ is_ui_send_ = true;
+ }
+ // check vr params
+ if ((*command).keyExists(strings::vr_commands)) {
+ is_vr_send_ = true;
+ }
+ if (is_ui_send_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true);
+ }
+ if (is_vr_send_) {
+ // VR params
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true);
+ }
+}
+
+bool DeleteCommandRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ using namespace helpers;
+ app_mngr::commands::ResponseInfo ui_delete_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo vr_delete_info(
+ vr_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(ui_delete_info, vr_delete_info);
+
+ const bool is_vr_or_ui_warning =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
+ info = app_mngr::commands::MergeInfos(
+ ui_delete_info, ui_info_, vr_delete_info, vr_info_);
+ if (is_vr_or_ui_warning && !ui_delete_info.is_unsupported_resource &&
+ !vr_delete_info.is_unsupported_resource) {
+ LOG4CXX_DEBUG(logger_, "VR or UI result is warning");
+ result_code = mobile_apis::Result::WARNINGS;
+ return result;
+ }
+ result_code = PrepareResultCodeForResponse(ui_delete_info, vr_delete_info);
+ LOG4CXX_DEBUG(logger_, "Result is " << (result ? "true" : "false"));
+ return result;
+}
+
+void DeleteCommandRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_DeleteCommand: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ LOG4CXX_DEBUG(logger_,
+ "Received UI_DeleteCommand event with result "
+ << MessageHelper::HMIResultToString(ui_result_));
+ GetInfo(message, ui_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::VR_DeleteCommand: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ is_vr_received_ = true;
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ LOG4CXX_DEBUG(logger_,
+ "Received VR_DeleteCommand event with result "
+ << MessageHelper::HMIResultToString(vr_result_));
+ GetInfo(message, vr_info_);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ LOG4CXX_DEBUG(logger_, "Still awaiting for other responses.");
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ const uint32_t cmd_id = msg_params[strings::cmd_id].asUInt();
+
+ smart_objects::SmartObject* command = application->FindCommand(cmd_id);
+
+ if (!command) {
+ LOG4CXX_ERROR(logger_,
+ "Command id " << cmd_id << " not found for "
+ "application with connection key "
+ << connection_key());
+ return;
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string info;
+ const bool result = PrepareResponseParameters(result_code, info);
+ if (result) {
+ application->RemoveCommand(cmd_id);
+ application->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
+ }
+ SendResponse(
+ result, result_code, info.empty() ? NULL : info.c_str(), &msg_params);
+}
+
+bool DeleteCommandRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool DeleteCommandRequest::IsPendingResponseExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return is_ui_send_ != is_ui_received_ || is_vr_send_ != is_vr_received_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc
new file mode 100644
index 0000000000..8f85d50e28
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteCommandResponse::DeleteCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteCommandResponse::~DeleteCommandResponse() {}
+
+void DeleteCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc
new file mode 100644
index 0000000000..cf8a6d259f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc
@@ -0,0 +1,132 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_file_request.h"
+
+#include "application_manager/application_impl.h"
+
+#include "utils/file_system.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteFileRequest::DeleteFileRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteFileRequest::~DeleteFileRequest() {}
+
+void DeleteFileRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ (application_manager_.get_settings().delete_file_in_none() <=
+ application->delete_file_in_none_count())) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // DeleteFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_,
+ "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ const std::string& sync_file_name =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ if (!file_system::IsFileNameValid(sync_file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
+ std::string full_file_path =
+ application_manager_.get_settings().app_storage_folder() + "/";
+ full_file_path += application->folder_name();
+ full_file_path += "/";
+ full_file_path += sync_file_name;
+
+ if (file_system::FileExists(full_file_path)) {
+ if (file_system::DeleteFile(full_file_path)) {
+ const application_manager::AppFile* file =
+ application->GetFile(full_file_path);
+ if (file) {
+ SendFileRemovedNotification(file);
+ }
+
+ application->DeleteFile(full_file_path);
+ application->increment_delete_file_in_none_count();
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ } else {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ }
+ } else {
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ }
+}
+
+void DeleteFileRequest::SendFileRemovedNotification(
+ const application_manager::AppFile* file) const {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::file_name] = file->file_name;
+ msg_params[strings::file_type] = file->file_type;
+
+ CreateHMINotification(hmi_apis::FunctionID::BasicCommunication_OnFileRemoved,
+ msg_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc
new file mode 100644
index 0000000000..66c61c9e4a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_file_response.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteFileResponse::DeleteFileResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteFileResponse::~DeleteFileResponse() {}
+
+void DeleteFileResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ (*message_)[strings::msg_params][strings::space_available] =
+ static_cast<uint32_t>(app->GetAvailableDiskSpace());
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc
new file mode 100644
index 0000000000..a9db3975db
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc
@@ -0,0 +1,168 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {}
+
+void DeleteInteractionChoiceSetRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "No application associated with connection key "
+ << connection_key());
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const int32_t choice_set_id =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asInt();
+
+ if (!app->FindChoiceSet(choice_set_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ if (ChoiceSetInUse(app)) {
+ LOG4CXX_ERROR(logger_, "Choice set currently in use.");
+ SendResponse(false, mobile_apis::Result::IN_USE);
+ return;
+ }
+ SendVrDeleteCommand(app);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::interaction_choice_set_id] = choice_set_id;
+ msg_params[strings::app_id] = app->app_id();
+
+ app->RemoveChoiceSet(choice_set_id);
+
+ // Checking of HMI responses will be implemented with APPLINK-14600
+ const bool result = true;
+ SendResponse(result, mobile_apis::Result::SUCCESS);
+}
+
+bool DeleteInteractionChoiceSetRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(
+ ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app->is_perform_interaction_active()) {
+ return false;
+ }
+ const DataAccessor<PerformChoiceSetMap> accessor =
+ app->performinteraction_choice_set_map();
+ const PerformChoiceSetMap& choice_set_map = accessor.GetData();
+
+ const uint32_t choice_set_id =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asUInt();
+
+ PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
+ for (; choice_set_map.end() != it; ++it) {
+ const PerformChoice& choice = it->second;
+ PerformChoice::const_iterator choice_it = choice.begin();
+ for (; choice.end() != choice_it; ++choice_it) {
+ if (choice_it->first == choice_set_id) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id << " is in use.");
+ return true;
+ }
+ }
+ }
+ return true;
+}
+
+void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand(
+ application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const uint32_t choice_set_id =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asUInt();
+
+ smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_set_id);
+
+ if (!choice_set) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id << " is not found.");
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id];
+ choice_set = &((*choice_set)[strings::choice_set]);
+ for (uint32_t i = 0; i < (*choice_set).length(); ++i) {
+ msg_params[strings::cmd_id] = (*choice_set)[i][strings::choice_id];
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc
new file mode 100644
index 0000000000..18ca60f255
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc
@@ -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.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {}
+
+void DeleteInteractionChoiceSetResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ const int32_t code =
+ (*message_)[strings::msg_params][strings::result_code].asInt();
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ SendResponse(true);
+ } else {
+ // TODO(DK): Some logic
+ SendResponse(false);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
new file mode 100644
index 0000000000..9a01163702
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
@@ -0,0 +1,203 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteSubMenuRequest::DeleteSubMenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteSubMenuRequest::~DeleteSubMenuRequest() {}
+
+void DeleteSubMenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ const int32_t menu_id =
+ (*message_)[strings::msg_params][strings::menu_id].asInt();
+
+ if (!app->FindSubMenu(menu_id)) {
+ LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] =
+ (*message_)[strings::msg_params][strings::menu_id];
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
+}
+
+void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
+ ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+ if (!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
+ (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::grammar_id] = app->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+ }
+}
+
+void DeleteSubMenuRequest::DeleteSubMenuUICommands(
+ ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const DataAccessor<CommandsMap> accessor(app->commands_map());
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ while (commands.end() != it) {
+ if (!(*it->second).keyExists(strings::menu_params)) {
+ LOG4CXX_ERROR(logger_, "menu_params not exist");
+ ++it;
+ continue;
+ }
+
+ if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
+ (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ const uint32_t cmd_id = (*it->second)[strings::cmd_id].asUInt();
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::cmd_id] = cmd_id;
+ app->RemoveCommand(cmd_id);
+ app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
+ it = commands.begin(); // Can not relay on
+ // iterators after erase was called
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
+ } else {
+ ++it;
+ }
+ }
+}
+
+void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ // delete sub menu items from SDL and HMI
+ DeleteSubMenuVRCommands(application);
+ DeleteSubMenuUICommands(application);
+ application->RemoveSubMenu(
+ (*message_)[strings::msg_params][strings::menu_id].asInt());
+ }
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool DeleteSubMenuRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc
new file mode 100644
index 0000000000..6831a66e1e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteSubMenuResponse::DeleteSubMenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteSubMenuResponse::~DeleteSubMenuResponse() {}
+
+void DeleteSubMenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc
new file mode 100644
index 0000000000..ee0297ded6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc
@@ -0,0 +1,156 @@
+/*
+ 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 <algorithm>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DialNumberRequest::DialNumberRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DialNumberRequest::~DialNumberRequest() {}
+
+bool DialNumberRequest::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ default_timeout_ = 0;
+
+ return true;
+}
+
+void DialNumberRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ std::string number =
+ (*message_)[strings::msg_params][strings::number].asString();
+ if (!CheckSyntax(number)) {
+ LOG4CXX_ERROR(logger_, "Invalid incoming data");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ StripNumberParam(number);
+ if (number.empty()) {
+ LOG4CXX_ERROR(logger_,
+ "After strip number param is empty. Invalid incoming data");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::number] =
+ (*message_)[strings::msg_params][strings::number].asString();
+ msg_params[strings::app_id] = application->hmi_app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ SendHMIRequest(
+ hmi_apis::FunctionID::BasicCommunication_DialNumber, &msg_params, true);
+}
+
+void DialNumberRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
+ LOG4CXX_INFO(logger_, "Received DialNumber event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ result_code = CommandRequestImpl::GetMobileResultCode(
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt()));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ const bool is_success = mobile_apis::Result::SUCCESS == result_code;
+ const bool is_info_valid =
+ message[strings::msg_params].keyExists(strings::info);
+
+ if (is_info_valid) {
+ const char* info_char_array =
+ message[strings::msg_params][strings::info].asCharArray();
+ SendResponse(is_success, result_code, info_char_array);
+ return;
+ }
+
+ SendResponse(is_success, result_code);
+}
+
+void DialNumberRequest::StripNumberParam(std::string& number) {
+ std::size_t found = 0;
+ while (std::string::npos !=
+ (found = number.find_first_not_of("0123456789*#,;+"))) {
+ number.erase(number.begin() + found);
+ }
+ (*message_)[strings::msg_params][strings::number] = number;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc
new file mode 100644
index 0000000000..a264f96e0d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DialNumberResponse::DialNumberResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DialNumberResponse::~DialNumberResponse() {}
+
+void DialNumberResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..3650a8226c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc
@@ -0,0 +1,100 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+EndAudioPassThruRequest::EndAudioPassThruRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+EndAudioPassThruRequest::~EndAudioPassThruRequest() {}
+
+void EndAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true);
+}
+
+void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_EndAudioPassThru: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ if (result) {
+ uint32_t app_id = connection_key();
+ bool ended_successfully = application_manager_.EndAudioPassThru(app_id);
+ if (ended_successfully) {
+ application_manager_.StopAudioPassThru(app_id);
+ }
+ }
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..f9f9f89d11
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+EndAudioPassThruResponse::EndAudioPassThruResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+EndAudioPassThruResponse::~EndAudioPassThruResponse() {}
+
+void EndAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
new file mode 100644
index 0000000000..b0715225e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/generic_response.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void GenericResponse::Run() {
+ /*ns_smart_device_link::ns_smart_objects::SmartObject response;
+
+ response[strings::params][strings::correlation_id] =
+ (*message_)[strings::params][strings::correlation_id];
+ response[strings::params][strings::protocol_version] =
+ (*message_)[strings::params][strings::protocol_version];
+ response[strings::params][strings::connection_key] =
+ (*message_)[strings::params][strings::connection_key];
+
+ response[strings::msg_params][strings::success] = false;
+ */
+
+ (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message_)[strings::msg_params][strings::success] = false;
+ (*message_)[strings::msg_params][strings::result_code] =
+ mobile_apis::Result::INVALID_DATA;
+
+ SendResponse(false);
+}
+
+} // namespace commands
+
+} // namespace application_manager
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
new file mode 100644
index 0000000000..a6c627aad2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
@@ -0,0 +1,143 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetSystemCapabilityRequest::GetSystemCapabilityRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetSystemCapabilityRequest::~GetSystemCapabilityRequest() {}
+
+void GetSystemCapabilityRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ mobile_apis::SystemCapabilityType::eType response_type =
+ static_cast<mobile_apis::SystemCapabilityType::eType>(
+ (*message_)[strings::msg_params][strings::system_capability_type]
+ .asInt());
+ response_params[strings::system_capability][strings::system_capability_type] =
+ response_type;
+
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ switch (response_type) {
+ case mobile_apis::SystemCapabilityType::NAVIGATION: {
+ if (hmi_capabilities.navigation_capability()) {
+ response_params[strings::system_capability]
+ [strings::navigation_capability] =
+ *hmi_capabilities.navigation_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::PHONE_CALL: {
+ if (hmi_capabilities.phone_capability()) {
+ response_params[strings::system_capability][strings::phone_capability] =
+ *hmi_capabilities.phone_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: {
+ if (!app->is_remote_control_supported()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+ if (!hmi_capabilities.is_rc_cooperating()) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+ if (hmi_capabilities.rc_capability()) {
+ response_params[strings::system_capability][strings::rc_capability] =
+ *hmi_capabilities.rc_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::VIDEO_STREAMING:
+ if (hmi_capabilities.video_streaming_capability()) {
+ response_params[strings::system_capability]
+ [strings::video_streaming_capability] =
+ *hmi_capabilities.video_streaming_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ default: // Return unsupported resource
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+}
+
+void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest on_event");
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc
new file mode 100644
index 0000000000..dd5461081c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetSystemCapabilityResponse::GetSystemCapabilityResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetSystemCapabilityResponse::~GetSystemCapabilityResponse() {}
+
+void GetSystemCapabilityResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc
new file mode 100644
index 0000000000..7dc9eb9ad9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc
@@ -0,0 +1,116 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetWayPointsRequest::GetWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+GetWayPointsRequest::~GetWayPointsRequest() {}
+
+void GetWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(hmi_apis::FunctionID::Navigation_GetWayPoints,
+ msg_params.empty() ? NULL : &msg_params,
+ true);
+}
+
+void GetWayPointsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_GetWayPoints: {
+ LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc
new file mode 100644
index 0000000000..7581990273
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetWayPointsResponse::GetWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetWayPointsResponse::~GetWayPointsResponse() {}
+
+void GetWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc
new file mode 100644
index 0000000000..e671dab463
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc
@@ -0,0 +1,115 @@
+/*
+
+ 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 <string>
+#include "sdl_rpc_plugin/commands/mobile/list_files_request.h"
+
+#include "application_manager/application_impl.h"
+
+#include "sdl_rpc_plugin/mobile_command_factory.h"
+#include "utils/file_system.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ListFilesRequest::ListFilesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ListFilesRequest::~ListFilesRequest() {}
+
+void ListFilesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ (application_manager_.get_settings().list_files_in_none() <=
+ application->list_files_in_none_count())) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // DeleteFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_,
+ "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ application->increment_list_files_in_none_count();
+
+ (*message_)[strings::msg_params][strings::space_available] =
+ static_cast<int32_t>(application->GetAvailableDiskSpace());
+ // Enumarating through File system
+ uint32_t i = 0;
+ std::string directory_name =
+ application_manager_.get_settings().app_storage_folder();
+ directory_name += "/" + application->folder_name();
+ std::vector<std::string> persistent_files =
+ file_system::ListFiles(directory_name);
+ std::vector<std::string>::const_iterator it = persistent_files.begin();
+ for (; it != persistent_files.end(); ++it) {
+ if (i < application_manager_.get_settings().list_files_response_size()) {
+ LOG4CXX_DEBUG(logger_, "File " + *it + " added to ListFiles response");
+ (*message_)[strings::msg_params][strings::filenames][i++] = *it;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "File " + *it + " not added to ListFiles response");
+ }
+ }
+ (*message_)[strings::params][strings::message_type] =
+ application_manager::MessageType::kResponse;
+ SendResponse(true,
+ mobile_apis::Result::SUCCESS,
+ NULL,
+ &(*message_)[strings::msg_params]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc
new file mode 100644
index 0000000000..d025f05358
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/list_files_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ListFilesResponse::ListFilesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ListFilesResponse::~ListFilesResponse() {}
+
+void ListFilesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc
new file mode 100644
index 0000000000..128ce1e3bf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc
@@ -0,0 +1,63 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnAppInterfaceUnregisteredNotification::OnAppInterfaceUnregisteredNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnAppInterfaceUnregisteredNotification::
+ ~OnAppInterfaceUnregisteredNotification() {}
+
+void OnAppInterfaceUnregisteredNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc
new file mode 100644
index 0000000000..ff88ae96bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc
@@ -0,0 +1,60 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnAudioPassThruNotification::OnAudioPassThruNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnAudioPassThruNotification::~OnAudioPassThruNotification() {}
+
+void OnAudioPassThruNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
new file mode 100644
index 0000000000..79fb1f4272
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
@@ -0,0 +1,191 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_button_event_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnButtonEventNotification::OnButtonEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnButtonEventNotification::~OnButtonEventNotification() {}
+
+void OnButtonEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const uint32_t btn_id = static_cast<uint32_t>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ const bool is_app_id_exists =
+ (*message_)[strings::msg_params].keyExists(strings::app_id);
+ ApplicationSharedPtr app;
+
+ // CUSTOM_BUTTON notification
+ if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
+ // app_id is mandatory for CUSTOM_BUTTON notification
+ if (!is_app_id_exists) {
+ LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonEvent without app_id.");
+ return;
+ }
+
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
+ // custom_button_id is mandatory for CUSTOM_BUTTON notification
+ if (false ==
+ (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ LOG4CXX_ERROR(logger_,
+ "CUSTOM_BUTTON OnButtonEvent without custom_button_id.");
+ return;
+ }
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application doesn't exist.");
+ return;
+ }
+
+ uint32_t custom_btn_id = 0;
+ custom_btn_id =
+ (*message_)[strings::msg_params][hmi_response::custom_button_id]
+ .asUInt();
+
+ if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Application doesn't subscribed to this custom_button_id.");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "CUSTOM_BUTTON OnButtonEvent notification is allowed only "
+ << "in FULL or LIMITED hmi level");
+ return;
+ }
+
+ SendButtonEvent(app);
+ return;
+ }
+
+ const std::vector<ApplicationSharedPtr>& subscribed_apps =
+ application_manager_.applications_by_button(btn_id);
+
+ std::vector<ApplicationSharedPtr>::const_iterator it =
+ subscribed_apps.begin();
+ for (; subscribed_apps.end() != it; ++it) {
+ ApplicationSharedPtr subscribed_app = *it;
+ if (!subscribed_app) {
+ LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
+ continue;
+ }
+
+ // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "OnButtonEvent notification is allowed only"
+ << "in FULL or LIMITED hmi level");
+ continue;
+ }
+ // if "app_id" absent send notification only in HMI_FULL mode
+ if (is_app_id_exists || subscribed_app->IsFullscreen()) {
+ SendButtonEvent(subscribed_app);
+ }
+ }
+}
+
+void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
+ return;
+ }
+
+ smart_objects::SmartObjectSPtr on_btn_event =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_btn_event) {
+ LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
+ return;
+ }
+
+ (*on_btn_event)[strings::params][strings::connection_key] = app->app_id();
+
+ (*on_btn_event)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID);
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
+ app->msg_version() < utils::rpc_version_5) {
+ btn_id = mobile_apis::ButtonName::OK;
+ }
+
+ (*on_btn_event)[strings::msg_params][strings::button_name] = btn_id;
+ (*on_btn_event)[strings::msg_params][strings::button_event_mode] =
+ (*message_)[strings::msg_params][hmi_response::button_mode];
+
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ (*on_btn_event)[strings::msg_params][strings::custom_button_id] =
+ (*message_)[strings::msg_params][strings::custom_button_id];
+ }
+
+ message_ = on_btn_event;
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
new file mode 100644
index 0000000000..c73f2b4b98
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
@@ -0,0 +1,199 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_button_press_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/semantic_version.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnButtonPressNotification::OnButtonPressNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnButtonPressNotification::~OnButtonPressNotification() {}
+
+void OnButtonPressNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const uint32_t btn_id = static_cast<uint32_t>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ const bool is_app_id_exists =
+ (*message_)[strings::msg_params].keyExists(strings::app_id);
+ ApplicationSharedPtr app;
+
+ // CUSTOM_BUTTON notification
+ if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
+ // app_id is mandatory for CUSTOM_BUTTON notification
+ if (!is_app_id_exists) {
+ LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonPress without app_id.");
+ return;
+ }
+
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
+ // custom_button_id is mandatory for CUSTOM_BUTTON notification
+ if (false ==
+ (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ LOG4CXX_ERROR(logger_,
+ "CUSTOM_BUTTON OnButtonPress without custom_button_id.");
+ return;
+ }
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application doesn't exist.");
+ return;
+ }
+
+ uint32_t custom_btn_id = 0;
+ custom_btn_id =
+ (*message_)[strings::msg_params][hmi_response::custom_button_id]
+ .asUInt();
+
+ if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Application doesn't subscribed to this custom_button_id.");
+ return;
+ }
+
+ // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "CUSTOM_BUTTON OnButtonPress notification is allowed only "
+ << "in FULL or LIMITED hmi level");
+ return;
+ }
+
+ SendButtonPress(app);
+ return;
+ }
+
+ const std::vector<ApplicationSharedPtr>& subscribed_apps =
+ application_manager_.applications_by_button(btn_id);
+
+ std::vector<ApplicationSharedPtr>::const_iterator it =
+ subscribed_apps.begin();
+ for (; subscribed_apps.end() != it; ++it) {
+ ApplicationSharedPtr subscribed_app = *it;
+ if (!subscribed_app) {
+ LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
+ continue;
+ }
+
+ // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "OnButtonPress notification is allowed only"
+ << "in FULL or LIMITED hmi level");
+ continue;
+ }
+ // if "appID" is present, send it to named app only if its FULL or
+ // LIMITED
+ if (app.use_count() != 0) {
+ if (app->app_id() == subscribed_app->app_id()) {
+ SendButtonPress(subscribed_app);
+ }
+ } else if (subscribed_app->IsFullscreen()) {
+ // if No "appID" - send it FULL apps only.
+ SendButtonPress(subscribed_app);
+ }
+ }
+}
+
+void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
+ return;
+ }
+
+ smart_objects::SmartObjectSPtr on_btn_press =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_btn_press) {
+ LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
+ return;
+ }
+
+ (*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
+
+ (*on_btn_press)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonPressID);
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
+ app->msg_version() < utils::rpc_version_5) {
+ btn_id = mobile_apis::ButtonName::OK;
+ }
+
+ (*on_btn_press)[strings::msg_params][strings::button_name] = btn_id;
+ (*on_btn_press)[strings::msg_params][strings::button_press_mode] =
+ (*message_)[strings::msg_params][hmi_response::button_mode];
+
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ (*on_btn_press)[strings::msg_params][strings::custom_button_id] =
+ (*message_)[strings::msg_params][strings::custom_button_id];
+ }
+
+ message_ = on_btn_press;
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc
new file mode 100644
index 0000000000..dff3aa6808
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc
@@ -0,0 +1,87 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnCommandNotification::OnCommandNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnCommandNotification::~OnCommandNotification() {}
+
+void OnCommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ return;
+ }
+
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+
+ if (!app->FindCommand(cmd_id)) {
+ LOG4CXX_ERROR(logger_, " No applications found for the command " << cmd_id);
+ return;
+ }
+
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ // remove app_id from notification
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ (*message_)[strings::msg_params].erase(strings::app_id);
+ }
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc
new file mode 100644
index 0000000000..ca5d4bfed4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc
@@ -0,0 +1,70 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnDriverDistractionNotification::OnDriverDistractionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
+
+void OnDriverDistractionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc
new file mode 100644
index 0000000000..e252b031e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc
@@ -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.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include <string>
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnHashChangeNotification::OnHashChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnHashChangeNotification::~OnHashChangeNotification() {}
+
+void OnHashChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ int32_t app_id;
+ app_id = (*message_)[strings::params][strings::connection_key].asInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (app) {
+ (*message_)[strings::msg_params][strings::hash_id] = app->curHash();
+ SendNotification();
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Application with app_id " << app_id << " does not exist");
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
new file mode 100644
index 0000000000..6b5838e40a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
@@ -0,0 +1,95 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnHMIStatusNotification::OnHMIStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnHMIStatusNotification::~OnHMIStatusNotification() {}
+
+void OnHMIStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist");
+ return;
+ }
+
+ // If the response has no hmi level, return and don't send the notification
+ if (!(*message_)[strings::msg_params].keyExists(strings::hmi_level)) {
+ // our notification clearly isn't well-formed
+ LOG4CXX_ERROR(logger_, "OnHMIStatusNotification has no hmiLevel field");
+ return;
+ }
+
+ // NOTE c++ maps default-construct on the [] operator, so if there is no
+ // hmiLevel field this will create one that is invalid
+ mobile_apis::HMILevel::eType hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::hmi_level].asInt());
+ if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) ||
+ (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) {
+ if (!(app->tts_properties_in_full())) {
+ app->set_tts_properties_in_full(true);
+ LOG4CXX_INFO(logger_,
+ "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList");
+ application_manager_.AddAppToTTSGlobalPropertiesList(app->app_id());
+ }
+ }
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
new file mode 100644
index 0000000000..c4ee22afed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
@@ -0,0 +1,135 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/message.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnHMIStatusNotificationFromMobile::~OnHMIStatusNotificationFromMobile() {}
+
+void OnHMIStatusNotificationFromMobile::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(
+ logger_, "OnHMIStatusNotificationFromMobile application doesn't exist");
+ return;
+ }
+
+ mobile_apis::HMILevel::eType current_hmi_state =
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::hmi_level].asUInt());
+
+ bool is_current_state_foreground =
+ mobile_apis::HMILevel::HMI_FULL == current_hmi_state;
+
+ app->set_foreground(is_current_state_foreground);
+
+ connection_handler::DeviceHandle handle = app->device();
+ bool is_apps_requested_before =
+ application_manager_.IsAppsQueriedFrom(handle);
+
+ LOG4CXX_DEBUG(logger_,
+ "Mobile HMI state notication came for connection key:"
+ << connection_key() << " and handle: " << handle);
+
+ if (!is_apps_requested_before &&
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ app->protocol_version()) &&
+ app->is_foreground()) {
+ // In case this notification will be received from mobile side with
+ // foreground level for app on mobile, this should trigger remote
+ // apps list query for SDL 4.0+ app
+ MessageHelper::SendQueryApps(connection_key(), application_manager_);
+ return;
+ }
+
+ if (is_apps_requested_before) {
+ LOG4CXX_DEBUG(logger_,
+ "Remote apps list had been requested already "
+ " for handle: "
+ << handle);
+
+ if (Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ app->protocol_version())) {
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+
+ bool is_another_foreground_sdl4_app = false;
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it; ++it) {
+ if (connection_key() != (*it)->app_id() &&
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ (*it)->protocol_version()) &&
+ (*it)->is_foreground()) {
+ is_another_foreground_sdl4_app = true;
+ break;
+ }
+ }
+
+ if (!is_another_foreground_sdl4_app) {
+ application_manager_.MarkAppsGreyOut(handle,
+ !is_current_state_foreground);
+ application_manager_.SendUpdateAppList();
+ }
+ }
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
new file mode 100644
index 0000000000..04b52f29e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
@@ -0,0 +1,96 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnKeyBoardInputNotification::OnKeyBoardInputNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnKeyBoardInputNotification::~OnKeyBoardInputNotification() {}
+
+void OnKeyBoardInputNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app_to_notify;
+
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetIt it = accessor.GetData().begin();
+ for (; accessor.GetData().end() != it; ++it) {
+ // if there is app with active perform interaction use it for notification
+ ApplicationSharedPtr app = *it;
+ if (app->is_perform_interaction_active() &&
+ (*it)->perform_interaction_layout() ==
+ mobile_apis::LayoutMode::KEYBOARD) {
+ LOG4CXX_INFO(logger_,
+ "There is application with active PerformInteraction");
+ app_to_notify = app;
+ break;
+ }
+
+ if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level()) {
+ LOG4CXX_INFO(logger_, "There is application in HMI_FULL level");
+ app_to_notify = app;
+ }
+ }
+
+ if (app_to_notify.use_count() != 0) {
+ (*message_)[strings::params][strings::connection_key] =
+ app_to_notify->app_id();
+ SendNotification();
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc
new file mode 100644
index 0000000000..fdbdd910a0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc
@@ -0,0 +1,63 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_language_change_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnLanguageChangeNotification::OnLanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnLanguageChangeNotification::~OnLanguageChangeNotification() {}
+
+void OnLanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc
new file mode 100644
index 0000000000..32d940aca2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnPermissionsChangeNotification::OnPermissionsChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {}
+
+void OnPermissionsChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
new file mode 100644
index 0000000000..b78e541f17
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -0,0 +1,229 @@
+/*
+ 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 <cstring>
+#include <cstdio>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+#include "policy/policy_table/enums.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnSystemRequestNotification::OnSystemRequestNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnSystemRequestNotification::~OnSystemRequestNotification() {}
+
+void OnSystemRequestNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace application_manager;
+ using namespace mobile_apis;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_,
+ "Application with connection key " << connection_key()
+ << " is not registered.");
+ return;
+ }
+
+ const mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message_)[strings::msg_params][strings::request_type].asInt());
+ const policy::PolicyHandlerInterface& policy_handler = policy_handler_;
+ const std::string stringified_request_type =
+ rpc::policy_table_interface_base::EnumToJsonString(
+ static_cast<rpc::policy_table_interface_base::RequestType>(
+ request_type));
+
+ if (!policy_handler.IsRequestTypeAllowed(app->policy_app_id(),
+ request_type)) {
+ LOG4CXX_WARN(logger_,
+ "Request type " << stringified_request_type
+ << " is not allowed by policies");
+ return;
+ }
+
+ const bool request_subtype_present =
+ (*message_)[strings::msg_params].keyExists(strings::request_subtype);
+ if (request_subtype_present) {
+ const std::string request_subtype =
+ (*message_)[strings::msg_params][strings::request_subtype].asString();
+ if (!policy_handler.IsRequestSubTypeAllowed(app->policy_app_id(),
+ request_subtype)) {
+ LOG4CXX_ERROR(logger_,
+ "Request subtype: " << request_subtype
+ << " is DISALLOWED by policies");
+ return;
+ }
+ }
+
+ if (mobile_apis::RequestType::PROPRIETARY == request_type) {
+ /* According to requirements:
+ "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
+ If the requestType = HTTP, add to mobile API fileType = BINARY"
+ Also in Genivi SDL we don't save the PT to file - we put it directly in
+ binary_data */
+
+ const std::string filename =
+ (*message_)[strings::msg_params][strings::file_name].asString();
+ BinaryMessage binary_data;
+ file_system::ReadBinaryFile(filename, binary_data);
+#if defined(PROPRIETARY_MODE)
+ AddHeader(binary_data);
+#endif // PROPRIETARY_MODE
+
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ (*message_)[strings::params][strings::binary_data] = binary_data;
+#endif // PROPRIETARY_MODE
+
+ (*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
+ } else if (mobile_apis::RequestType::HTTP == request_type) {
+ (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
+ if ((*message_)[strings::msg_params].keyExists(strings::url)) {
+ (*message_)[strings::msg_params][strings::timeout] =
+ policy_handler.TimeoutExchangeSec();
+ }
+ }
+
+ SendNotification();
+}
+
+#ifdef PROPRIETARY_MODE
+void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t timeout = policy_handler_.TimeoutExchangeSec();
+
+ size_t content_length;
+ char size_str[24];
+
+ if (0 > sprintf(size_str, "%zu", static_cast<size_t>(message.size()))) {
+ memset(size_str, 0, sizeof(size_str));
+ }
+
+ char timeout_str[24];
+ if (0 > sprintf(timeout_str, "%d", timeout)) {
+ memset(timeout_str, 0, sizeof(timeout_str));
+ }
+
+ std::string policy_table_string = std::string(message.begin(), message.end());
+
+ /* The Content-Length to be sent in the HTTP Request header should be
+ calculated before additional escape characters are added to the
+ policy table string. The mobile proxy will remove the escape
+ characters after receiving this request. */
+
+ content_length = ParsePTString(policy_table_string);
+
+ if (0 > sprintf(size_str, "%zu", content_length)) {
+ memset(size_str, 0, sizeof(size_str));
+ }
+
+ const std::string header =
+
+ "{"
+ " \"HTTPRequest\": {"
+ "\"headers\": {"
+ "\"ContentType\": \"application/json\","
+ "\"ConnectTimeout\": " +
+ std::string(timeout_str) +
+ ","
+ "\"DoOutput\": true,"
+ "\"DoInput\": true,"
+ "\"UseCaches\": false,"
+ "\"RequestMethod\": \"POST\","
+ "\"ReadTimeout\":" +
+ std::string(timeout_str) +
+ ","
+ "\"InstanceFollowRedirects\": false,"
+ "\"charset\": \"utf-8\","
+ "\"Content-Length\": " +
+ std::string(size_str) +
+ "},"
+ "\"body\": \"" +
+ policy_table_string +
+ "\""
+ "}"
+ "}";
+
+ message.clear();
+ message.assign(header.begin(), header.end());
+
+ LOG4CXX_DEBUG(
+ logger_, "Header added: " << std::string(message.begin(), message.end()));
+}
+
+size_t OnSystemRequestNotification::ParsePTString(
+ std::string& pt_string) const {
+ std::string result;
+ size_t length = pt_string.length();
+ size_t result_length = length;
+ result.reserve(length * 2);
+ for (size_t i = 0; i < length; ++i) {
+ if (pt_string[i] == '\"' || pt_string[i] == '\\') {
+ result += '\\';
+ } else if (pt_string[i] == '\n') {
+ result_length--; // contentLength is adjusted when this character is
+ // not copied to result.
+ continue;
+ }
+ result += pt_string[i];
+ }
+ pt_string = result;
+ return result_length;
+}
+#endif // PROPRIETARY_MODE
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
new file mode 100644
index 0000000000..503f1b04d5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTBTClientStateNotification::OnTBTClientStateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnTBTClientStateNotification::~OnTBTClientStateNotification() {}
+
+void OnTBTClientStateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ application_manager_.applications_with_navi();
+
+ std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ for (; applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc
new file mode 100644
index 0000000000..502f0ae57d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc
@@ -0,0 +1,96 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnTouchEventNotification::OnTouchEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnTouchEventNotification::~OnTouchEventNotification() {}
+
+void OnTouchEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::vector<ApplicationSharedPtr>& applications_with_navi =
+ application_manager_.applications_with_navi();
+
+ const std::vector<ApplicationSharedPtr>& projection_applications =
+ application_manager_.applications_with_mobile_projection();
+
+ std::vector<ApplicationSharedPtr>::const_iterator nav_it =
+ applications_with_navi.begin();
+
+ for (; applications_with_navi.end() != nav_it; ++nav_it) {
+ ApplicationSharedPtr app = *nav_it;
+ if (app->IsFullscreen()) {
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+ }
+
+ std::vector<ApplicationSharedPtr>::const_iterator projection_it =
+ projection_applications.begin();
+
+ for (; projection_applications.end() != projection_it; ++projection_it) {
+ ApplicationSharedPtr projection_app = *projection_it;
+ if (projection_app->IsFullscreen()) {
+ (*message_)[strings::params][strings::connection_key] =
+ projection_app->app_id();
+ SendNotification();
+ }
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc
new file mode 100644
index 0000000000..2f666ffc03
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc
@@ -0,0 +1,70 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnWayPointChangeNotification::OnWayPointChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnWayPointChangeNotification::~OnWayPointChangeNotification() {}
+
+void OnWayPointChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::set<uint32_t> subscribed_for_way_points =
+ application_manager_.GetAppsSubscribedForWayPoints();
+
+ for (std::set<uint32_t>::const_iterator app_id =
+ subscribed_for_way_points.begin();
+ app_id != subscribed_for_way_points.end();
+ ++app_id) {
+ (*message_)[strings::params][strings::connection_key] = *app_id;
+ SendNotification();
+ }
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..c90038a8b7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
@@ -0,0 +1,453 @@
+/*
+
+ 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 <cstring>
+#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+PerformAudioPassThruRequest::PerformAudioPassThruRequest(
+ 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)
+ , result_tts_speak_(hmi_apis::Common_Result::INVALID_ENUM)
+ , result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {}
+
+void PerformAudioPassThruRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ FinishTTSSpeak();
+ CommandRequestImpl::onTimeOut();
+}
+
+bool PerformAudioPassThruRequest::Init() {
+ default_timeout_ +=
+ (((*message_)[str::msg_params][str::max_duration].asUInt()));
+ return true;
+}
+
+void PerformAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ LOG4CXX_ERROR(logger_, "application isn't activated");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming perform audio pass thru has contains "
+ "\\t\\n \\\\t \\\\n"
+ " text contains only whitespace in initialPrompt");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ // According with new implementation processing of UNSUPPORTE_RESOURCE
+ // need set flag before sending to hmi
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ if ((*message_)[str::msg_params].keyExists(str::initial_prompt)) {
+ smart_objects::SmartObject& initial_prompt =
+ (*message_)[strings::msg_params][strings::initial_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ initial_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(
+ false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for initial_prompt are not present");
+ return;
+ }
+
+ // In case TTS Speak, subscribe on notification
+ SendSpeakRequest();
+ SendPerformAudioPassThruRequest();
+ } else {
+ SendPerformAudioPassThruRequest();
+ SendRecordStartNotification();
+ StartMicrophoneRecording();
+ }
+}
+
+void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
+ LOG4CXX_TRACE(logger_, "Received UI_PerformAudioPassThru");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ result_ui_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, ui_info_);
+
+ // in case perform audio is started by other request skip stopping
+ if (hmi_apis::Common_Result::REJECTED == result_ui_) {
+ LOG4CXX_ERROR(logger_, "Request was rejected");
+ SendResponse(false,
+ MessageHelper::HMIToMobileResult(result_ui_),
+ NULL,
+ &(message[strings::msg_params]));
+ return;
+ }
+ FinishTTSSpeak();
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ result_tts_speak_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, tts_info_);
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ const bool is_tts_speak_success_unsuported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ result_tts_speak_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ if (is_tts_speak_success_unsuported) {
+ SendRecordStartNotification();
+ StartMicrophoneRecording();
+
+ // update request timeout to get time for perform audio recording
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+ if (IsWaitingHMIResponse()) {
+ return;
+ }
+
+ const ResponseParams response_params = PrepareResponseParameters();
+
+ SendResponse(
+ response_params.success,
+ response_params.result_code,
+ response_params.info.empty() ? NULL : response_params.info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+const PerformAudioPassThruRequest::ResponseParams&
+PerformAudioPassThruRequest::PrepareResponseParameters() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::commands::ResponseInfo ui_perform_info(
+ result_ui_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo tts_perform_info(
+ result_tts_speak_,
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
+
+ // Note(dtrunov): According to requirment "WARNINGS, success:true on getting
+ // UNSUPPORTED_RESOURCE for "ttsChunks"
+ if (ui_perform_info.is_ok && tts_perform_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_AVAILABLE == tts_perform_info.interface_state) {
+ response_params_.result_code = mobile_apis::Result::WARNINGS;
+ tts_info_ = "Unsupported phoneme type sent in a prompt";
+ response_params_.info = app_mngr::commands::MergeInfos(
+ ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+ response_params_.success = true;
+ return response_params_;
+ }
+
+ response_params_.success =
+ PrepareResultForMobileResponse(ui_perform_info, tts_perform_info);
+ if (IsResultCodeUnsupported(ui_perform_info, tts_perform_info)) {
+ response_params_.result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ } else {
+ AudioPassThruResults results = PrepareAudioPassThruResultCodeForResponse(
+ ui_perform_info, tts_perform_info);
+ response_params_.success = results.second;
+ response_params_.result_code = results.first;
+ }
+ response_params_.info = app_mngr::commands::MergeInfos(
+ ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+
+ return response_params_;
+}
+
+void PerformAudioPassThruRequest::SendSpeakRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ using namespace hmi_apis;
+ using namespace smart_objects;
+
+ SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
+ for (uint32_t i = 0;
+ i < (*message_)[str::msg_params][str::initial_prompt].length();
+ ++i) {
+ msg_params[hmi_request::tts_chunks][i][str::text] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::text];
+ msg_params[hmi_request::tts_chunks][i][str::type] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::type];
+ }
+ // app_id
+ msg_params[strings::app_id] = connection_key();
+ msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
+}
+
+void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[str::app_id] = connection_key();
+
+ msg_params[hmi_request::max_duration] =
+ (*message_)[str::msg_params][str::max_duration];
+
+ msg_params[hmi_request::audio_pass_display_texts] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text1)) {
+ msg_params[hmi_request::audio_pass_display_texts][0]
+ [hmi_request::field_name] = static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::audioPassThruDisplayText1);
+ msg_params[hmi_request::audio_pass_display_texts][0]
+ [hmi_request::field_text] =
+ (*message_)[str::msg_params][str::audio_pass_display_text1];
+ }
+
+ if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text2)) {
+ msg_params[hmi_request::audio_pass_display_texts][1]
+ [hmi_request::field_name] = static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::audioPassThruDisplayText2);
+ msg_params[hmi_request::audio_pass_display_texts][1]
+ [hmi_request::field_text] =
+ (*message_)[str::msg_params][str::audio_pass_display_text2];
+ }
+
+ if ((*message_)[str::msg_params].keyExists(str::mute_audio)) {
+ msg_params[str::mute_audio] =
+ (*message_)[str::msg_params][str::mute_audio].asBool();
+ } else {
+ // If omitted, the value is set to true
+ msg_params[str::mute_audio] = true;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true);
+}
+
+void PerformAudioPassThruRequest::SendRecordStartNotification() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+
+ CreateHMINotification(hmi_apis::FunctionID::UI_OnRecordStart, msg_params);
+}
+
+void PerformAudioPassThruRequest::StartMicrophoneRecording() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id = connection_key();
+ application_manager_.BeginAudioPassThru(app_id);
+
+ application_manager_.StartAudioPassThruThread(
+ connection_key(),
+ correlation_id(),
+ (*message_)[str::msg_params][str::max_duration].asInt(),
+ (*message_)[str::msg_params][str::sampling_rate].asInt(),
+ (*message_)[str::msg_params][str::bits_per_sample].asInt(),
+ (*message_)[str::msg_params][str::audio_type].asInt());
+}
+
+bool PerformAudioPassThruRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ const smart_objects::SmartArray* ip_array =
+ (*message_)[strings::msg_params][strings::initial_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
+ smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
+
+ for (; it_ip != it_ip_end; ++it_ip) {
+ str = (*it_ip)[strings::text].asCharArray();
+ if (std::strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::audio_pass_display_text1)) {
+ str = (*message_)[strings::msg_params][strings::audio_pass_display_text1]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Invalid audio_pass_display_text1 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::audio_pass_display_text2)) {
+ str = (*message_)[strings::msg_params][strings::audio_pass_display_text2]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Invalid audio_pass_display_text2 value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+void PerformAudioPassThruRequest::FinishTTSSpeak() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t app_id = connection_key();
+ if (application_manager_.EndAudioPassThru(app_id)) {
+ LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
+ application_manager_.StopAudioPassThru(app_id);
+ }
+ if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) {
+ LOG4CXX_WARN(logger_, "TTS Speak is inactive.");
+ return;
+ }
+ SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL);
+}
+
+PerformAudioPassThruRequest::AudioPassThruResults
+PerformAudioPassThruRequest::PrepareAudioPassThruResultCodeForResponse(
+ const app_mngr::commands::ResponseInfo& ui_response,
+ const app_mngr::commands::ResponseInfo& tts_response) {
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ hmi_apis::Common_Result::eType common_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ const hmi_apis::Common_Result::eType ui_result = ui_response.result_code;
+ const hmi_apis::Common_Result::eType tts_result = tts_response.result_code;
+ bool result = false;
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result == hmi_apis::Common_Result::SUCCESS)) {
+ result = true;
+ }
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result == hmi_apis::Common_Result::INVALID_ENUM)) {
+ result = true;
+ }
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result != hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result != hmi_apis::Common_Result::INVALID_ENUM)) {
+ common_result = hmi_apis::Common_Result::WARNINGS;
+ result = true;
+ } else if (ui_response.is_ok &&
+ tts_result == hmi_apis::Common_Result::WARNINGS) {
+ common_result = hmi_apis::Common_Result::WARNINGS;
+ result = true;
+ } else if (ui_result == hmi_apis::Common_Result::INVALID_ENUM) {
+ common_result = tts_result;
+ } else {
+ common_result = ui_result;
+ }
+ result_code = MessageHelper::HMIToMobileResult(common_result);
+ return std::make_pair(result_code, result);
+}
+
+bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..a5eb98f2ba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PerformAudioPassThruResponse::PerformAudioPassThruResponse(
+ 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) {}
+
+PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {}
+
+void PerformAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
new file mode 100644
index 0000000000..42489fd8bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
@@ -0,0 +1,1068 @@
+/*
+
+ 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 <numeric>
+#include <string.h>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+#include "utils/gen_hash.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+uint32_t PerformInteractionRequest::pi_requests_count_ = 0;
+
+PerformInteractionRequest::PerformInteractionRequest(
+ 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)
+ , interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM)
+ , ui_response_received_(false)
+ , vr_response_received_(false)
+ , app_pi_was_active_before_(false)
+ , vr_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
+ , ui_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
+ subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress);
+}
+
+PerformInteractionRequest::~PerformInteractionRequest() {}
+
+bool PerformInteractionRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ }
+
+ interaction_mode_ = static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::BOTH == interaction_mode_ ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ default_timeout_ *= 2;
+ }
+ return true;
+}
+
+void PerformInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->is_perform_interaction_active()) {
+ LOG4CXX_DEBUG(logger_, "Application has active PerformInteraction");
+ app_pi_was_active_before_ = true;
+ }
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ mobile_apis::LayoutMode::eType interaction_layout =
+ mobile_apis::LayoutMode::INVALID_ENUM;
+
+ if (msg_params.keyExists(hmi_request::interaction_layout)) {
+ interaction_layout = static_cast<mobile_apis::LayoutMode::eType>(
+ msg_params[hmi_request::interaction_layout].asInt());
+ }
+
+ if ((mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) &&
+ (mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) {
+ LOG4CXX_ERROR(logger_,
+ "PerformInteraction contains InteractionMode"
+ "=VR_ONLY and interactionLayout=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ const size_t choice_set_id_list_length =
+ msg_params[strings::interaction_choice_set_id_list].length();
+
+ if (0 == choice_set_id_list_length) {
+ if (mobile_apis::LayoutMode::KEYBOARD == interaction_layout) {
+ if (mobile_apis::InteractionMode::BOTH == interaction_mode_) {
+ LOG4CXX_ERROR(logger_,
+ "interactionChoiceSetIDList is empty,"
+ " InteractionMode=BOTH and"
+ " interactionLayout=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "interactionChoiceSetIDList is empty"
+ " and interactionLayout!=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ if (!CheckChoiceIDFromRequest(
+ app,
+ choice_set_id_list_length,
+ msg_params[strings::interaction_choice_set_id_list])) {
+ LOG4CXX_ERROR(logger_,
+ "PerformInteraction has choice sets with "
+ "duplicated IDs or application does not have choice sets");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::vr_help)) {
+ if (mobile_apis::Result::INVALID_DATA ==
+ MessageHelper::VerifyImageVrHelpItems(
+ msg_params[strings::vr_help], app, application_manager_)) {
+ LOG4CXX_ERROR(logger_,
+ "Verification of " << strings::vr_help << " failed.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming perform interaction has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ switch (interaction_mode_) {
+ case mobile_apis::InteractionMode::BOTH: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
+ if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
+ !CheckVrHelpItemPositions(app) ||
+ !CheckChoiceSetListVRCommands(app)) {
+ return;
+ }
+ break;
+ }
+ case mobile_apis::InteractionMode::MANUAL_ONLY: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: MANUAL_ONLY");
+ if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
+ !CheckVrHelpItemPositions(app)) {
+ return;
+ }
+ break;
+ }
+ case mobile_apis::InteractionMode::VR_ONLY: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
+ if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app) ||
+ !CheckChoiceSetListVRCommands(app)) {
+ return;
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown interaction mode");
+ return;
+ }
+ }
+
+ app->set_perform_interaction_mode(static_cast<int32_t>(interaction_mode_));
+ app->set_perform_interaction_active(true);
+ app->set_perform_interaction_layout(interaction_layout);
+ // increment amount of active requests
+ ++pi_requests_count_;
+ SendVRPerformInteractionRequest(app);
+ SendUIPerformInteractionRequest(app);
+}
+
+void PerformInteractionRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ smart_objects::SmartObject msg_param =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_DEBUG(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_PerformInteraction: {
+ LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ ui_response_received_ = true;
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, ui_info_);
+ ProcessUIResponse(event.smart_object(), msg_param);
+ break;
+ }
+ case hmi_apis::FunctionID::VR_PerformInteraction: {
+ LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ vr_response_received_ = true;
+ unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction);
+ vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, vr_info_);
+ if (ProcessVRResponse(event.smart_object(), msg_param)) {
+ return;
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+
+ if (!HasHMIResponsesToWait()) {
+ LOG4CXX_DEBUG(logger_, "Send response in BOTH iteraction mode");
+ SendBothModeResponse(msg_param);
+ }
+}
+
+void PerformInteractionRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ switch (interaction_mode_) {
+ case mobile_apis::InteractionMode::BOTH: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
+ if (true == vr_response_received_) {
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ } else {
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ }
+ break;
+ }
+ case mobile_apis::InteractionMode::VR_ONLY: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ break;
+ }
+ case mobile_apis::InteractionMode::MANUAL_ONLY: {
+ LOG4CXX_DEBUG(logger_, "InteractionMode: MANUAL_ONLY");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "INVALID ENUM");
+ return;
+ }
+ };
+}
+
+bool PerformInteractionRequest::ProcessVRResponse(
+ const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ using namespace mobile_apis;
+ using namespace smart_objects;
+ using namespace helpers;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ msg_params[strings::trigger_source] =
+ static_cast<int32_t>(TriggerSource::TS_VR);
+
+ const bool is_vr_aborted_timeout = Compare<Common_Result::eType, EQ, ONE>(
+ vr_result_code_, Common_Result::ABORTED, Common_Result::TIMED_OUT);
+
+ if (is_vr_aborted_timeout) {
+ LOG4CXX_DEBUG(logger_, "VR response aborted");
+ if (InteractionMode::VR_ONLY == interaction_mode_) {
+ LOG4CXX_DEBUG(logger_, "Aborted or Timeout Send Close Popup");
+ TerminatePerformInteraction();
+ SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_));
+ return true;
+ }
+ LOG4CXX_DEBUG(logger_, "Update timeout for UI");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ return false;
+ }
+
+ const SmartObject& hmi_msg_params = message[strings::msg_params];
+ if (hmi_msg_params.keyExists(strings::choice_id)) {
+ const int choice_id = hmi_msg_params[strings::choice_id].asInt();
+ if (!CheckChoiceIDFromResponse(app, choice_id)) {
+ LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
+ TerminatePerformInteraction();
+ SendResponse(
+ false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI");
+ return true;
+ }
+ msg_params[strings::choice_id] = choice_id;
+ }
+
+ const bool is_vr_result_success = Compare<Common_Result::eType, EQ, ONE>(
+ vr_result_code_, Common_Result::SUCCESS, Common_Result::WARNINGS);
+
+ if (is_vr_result_success &&
+ InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ LOG4CXX_DEBUG(logger_,
+ "VR response is successfull in MANUAL_ONLY mode "
+ << "Wait for UI response");
+ // in case MANUAL_ONLY mode VR.PI SUCCESS just return
+ return false;
+ }
+
+ return false;
+}
+
+void PerformInteractionRequest::ProcessUIResponse(
+ const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ using namespace smart_objects;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+ bool result = false;
+ result = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS);
+
+ result = result ||
+ (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_code_ &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state);
+
+ const bool is_pi_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_, hmi_apis::Common_Result::WARNINGS);
+
+ const bool is_pi_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ if (result) {
+ if (is_pi_unsupported) {
+ ui_result_code_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ ui_info_ = message[strings::msg_params][strings::info].asString();
+ } else {
+ if (message.keyExists(strings::msg_params)) {
+ msg_params = message[strings::msg_params];
+ }
+ if (is_pi_warning) {
+ ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
+ ui_info_ = message[strings::msg_params][strings::info].asString();
+ }
+ }
+
+ // result code must be GENERIC_ERROR in case wrong choice_id
+ if (msg_params.keyExists(strings::choice_id)) {
+ if (!CheckChoiceIDFromResponse(app,
+ msg_params[strings::choice_id].asInt())) {
+ ui_result_code_ = hmi_apis::Common_Result::GENERIC_ERROR;
+ ui_info_ = "Wrong choiceID was received from HMI";
+ } else {
+ msg_params[strings::trigger_source] =
+ mobile_apis::TriggerSource::TS_MENU;
+ }
+ } else if (msg_params.keyExists(strings::manual_text_entry)) {
+ msg_params[strings::trigger_source] =
+ mobile_apis::TriggerSource::TS_KEYBOARD;
+ if (msg_params[strings::manual_text_entry].empty()) {
+ msg_params.erase(strings::manual_text_entry);
+ }
+ }
+ }
+}
+
+void PerformInteractionRequest::SendUIPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject& choice_set_id_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ mobile_apis::InteractionMode::eType mode =
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[hmi_request::initial_text][hmi_request::field_name] =
+ static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::initialInteractionText);
+ msg_params[hmi_request::initial_text][hmi_request::field_text] =
+ (*message_)[strings::msg_params][hmi_request::initial_text];
+ }
+ bool is_vr_help_item = false;
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != mode) {
+ msg_params[strings::vr_help_title] =
+ (*message_)[strings::msg_params][strings::initial_text].asString();
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ is_vr_help_item = true;
+ msg_params[strings::vr_help] =
+ (*message_)[strings::msg_params][strings::vr_help];
+ }
+ }
+
+ if (mobile_apis::InteractionMode::BOTH == mode ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
+ msg_params[strings::timeout] = default_timeout_ / 2;
+ } else {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+ msg_params[strings::app_id] = app->app_id();
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[strings::choice_set] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+ int32_t index_array_of_vr_help = 0;
+ for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_set_id_list[i].asInt());
+ if (choice_set) {
+ // save perform interaction choice set
+ app->AddPerformInteractionChoiceSet(
+ correlation_id(), choice_set_id_list[i].asInt(), *choice_set);
+ for (size_t j = 0; j < (*choice_set)[strings::choice_set].length(); ++j) {
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ size_t index = msg_params[strings::choice_set].length();
+ msg_params[strings::choice_set][index] =
+ (*choice_set)[strings::choice_set][j];
+ // vrCommands should be added via VR.AddCommand only
+ msg_params[strings::choice_set][index].erase(strings::vr_commands);
+ }
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != mode &&
+ !is_vr_help_item) {
+ smart_objects::SmartObject& vr_commands =
+ (*choice_set)[strings::choice_set][j][strings::vr_commands];
+ if (0 < vr_commands.length()) {
+ // copy only first synonym
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = vr_commands[0].asString();
+ item[strings::position] = index_array_of_vr_help + 1;
+ msg_params[strings::vr_help][index_array_of_vr_help++] = item;
+ }
+ }
+ }
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_request::interaction_layout) &&
+ mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[hmi_request::interaction_layout] =
+ (*message_)[strings::msg_params][hmi_request::interaction_layout]
+ .asInt();
+ }
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_PerformInteraction, &msg_params, true);
+}
+
+void PerformInteractionRequest::SendVRPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != interaction_mode_) {
+ msg_params[strings::grammar_id] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t grammar_id_index = 0;
+ for (uint32_t i = 0; i < choice_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+ if (!choice_set) {
+ LOG4CXX_WARN(logger_, "Couldn't found choiceset");
+ continue;
+ }
+ msg_params[strings::grammar_id][grammar_id_index++] =
+ (*choice_set)[strings::grammar_id].asUInt();
+ }
+ }
+
+ std::vector<std::string> invalid_params;
+ if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
+ smart_objects::SmartObject& help_prompt =
+ (*message_)[strings::msg_params][strings::help_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("help_prompt");
+ } else {
+ msg_params[strings::help_prompt] = help_prompt;
+ }
+ } else {
+ if (choice_list.length() != 0) {
+ msg_params[strings::help_prompt] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+ int32_t index = 0;
+ for (uint32_t i = 0; i < choice_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+
+ if (choice_set) {
+ for (uint32_t j = 0; j < (*choice_set)[strings::choice_set].length();
+ ++j) {
+ smart_objects::SmartObject& vr_commands =
+ (*choice_set)[strings::choice_set][j][strings::vr_commands];
+ if (0 < vr_commands.length()) {
+ // copy only first synonym
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ // Since there is no custom data from application side, SDL should
+ // construct prompt and append delimiter to each item
+ item[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ item[strings::text] =
+ vr_commands[0].asString() +
+ application_manager_.get_settings().tts_delimiter();
+ msg_params[strings::help_prompt][index++] = item;
+ }
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Can't found choiceSet!");
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
+ smart_objects::SmartObject& timeout_prompt =
+ (*message_)[strings::msg_params][strings::timeout_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ timeout_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("timeout_prompt");
+ } else {
+ msg_params[strings::timeout_prompt] = timeout_prompt;
+ }
+ } else {
+ if (msg_params.keyExists(strings::help_prompt)) {
+ msg_params[strings::timeout_prompt] = msg_params[strings::help_prompt];
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ smart_objects::SmartObject& initial_prompt =
+ (*message_)[strings::msg_params][strings::initial_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ initial_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("initial_prompt");
+ } else {
+ msg_params[strings::initial_prompt] = initial_prompt;
+ }
+ }
+
+ if (!invalid_params.empty()) {
+ const std::string params_list =
+ std::accumulate(std::begin(invalid_params),
+ std::end(invalid_params),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ const std::string info =
+ "One or more files needed for " + params_list + " are not present";
+ SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, info.c_str());
+ return;
+ }
+
+ mobile_apis::InteractionMode::eType mode =
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::BOTH == mode ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
+ msg_params[strings::timeout] = default_timeout_ / 2;
+ } else {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ SendHMIRequest(
+ hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, true);
+}
+
+bool PerformInteractionRequest::CheckChoiceSetMenuNames(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ for (size_t i = 0; i < choice_list.length(); ++i) {
+ // choice_set contains SmartObject msg_params
+ smart_objects::SmartObject* i_choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+
+ for (size_t j = 0; j < choice_list.length(); ++j) {
+ smart_objects::SmartObject* j_choice_set =
+ app->FindChoiceSet(choice_list[j].asInt());
+
+ if (i == j) {
+ // skip check the same element
+ continue;
+ }
+
+ if (!i_choice_set || !j_choice_set) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ size_t ii = 0;
+ size_t jj = 0;
+ for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
+ for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
+ const std::string& ii_menu_name =
+ (*i_choice_set)[strings::choice_set][ii][strings::menu_name]
+ .asString();
+ const std::string& jj_menu_name =
+ (*j_choice_set)[strings::choice_set][jj][strings::menu_name]
+ .asString();
+
+ if (ii_menu_name == jj_menu_name) {
+ LOG4CXX_ERROR(logger_, "Choice set has duplicated menu name");
+ SendResponse(false,
+ mobile_apis::Result::DUPLICATE_NAME,
+ "Choice set has duplicated menu name");
+ return false;
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool PerformInteractionRequest::CheckChoiceSetVRSynonyms(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ for (size_t i = 0; i < choice_list.length(); ++i) {
+ // choice_set contains SmartObject msg_params
+ smart_objects::SmartObject* i_choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+
+ for (size_t j = 0; j < choice_list.length(); ++j) {
+ smart_objects::SmartObject* j_choice_set =
+ app->FindChoiceSet(choice_list[j].asInt());
+
+ if (i == j) {
+ // skip check the same element
+ continue;
+ }
+
+ if ((!i_choice_set) || (!j_choice_set)) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ size_t ii = 0;
+ size_t jj = 0;
+ for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
+ for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
+ if (!((*i_choice_set)[strings::choice_set][ii].keyExists(
+ strings::vr_commands) &&
+ (*j_choice_set)[strings::choice_set][jj].keyExists(
+ strings::vr_commands))) {
+ LOG4CXX_DEBUG(logger_,
+ "One or both sets has missing vr commands, skipping "
+ "synonym check");
+ return true;
+ }
+ // choice_set pointer contains SmartObject msg_params
+ smart_objects::SmartObject& ii_vr_commands =
+ (*i_choice_set)[strings::choice_set][ii][strings::vr_commands];
+
+ smart_objects::SmartObject& jj_vr_commands =
+ (*j_choice_set)[strings::choice_set][jj][strings::vr_commands];
+
+ for (size_t iii = 0; iii < ii_vr_commands.length(); ++iii) {
+ for (size_t jjj = 0; jjj < jj_vr_commands.length(); ++jjj) {
+ const custom_str::CustomString& vr_cmd_i =
+ ii_vr_commands[iii].asCustomString();
+ const custom_str::CustomString& vr_cmd_j =
+ jj_vr_commands[jjj].asCustomString();
+ if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
+ LOG4CXX_ERROR(logger_, "Choice set has duplicated VR synonym");
+ SendResponse(false,
+ mobile_apis::Result::DUPLICATE_NAME,
+ "Choice set has duplicated VR synonym");
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool PerformInteractionRequest::CheckVrHelpItemPositions(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ LOG4CXX_DEBUG(logger_, strings::vr_help << " is omitted.");
+ return true;
+ }
+
+ smart_objects::SmartObject& vr_help =
+ (*message_)[strings::msg_params][strings::vr_help];
+
+ int32_t position = 1;
+ for (size_t i = 0; i < vr_help.length(); ++i) {
+ if (position != vr_help[i][strings::position].asInt()) {
+ LOG4CXX_ERROR(logger_, "Non-sequential vrHelp item position");
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "Non-sequential vrHelp item position");
+ return false;
+ }
+ ++position;
+ }
+ return true;
+}
+
+void PerformInteractionRequest::DisablePerformInteraction() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (app->is_perform_interaction_active()) {
+ // decrease amount of active requests
+ --pi_requests_count_;
+ if (!pi_requests_count_) {
+ app->set_perform_interaction_active(false);
+ app->set_perform_interaction_mode(-1);
+ }
+ }
+ app->DeletePerformInteractionChoiceSet(correlation_id());
+}
+
+bool PerformInteractionRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::initial_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_text syntax check failed");
+ return true;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ const smart_objects::SmartArray* ip_array =
+ (*message_)[strings::msg_params][strings::initial_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
+ smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
+
+ for (; it_ip != it_ip_end; ++it_ip) {
+ str = (*it_ip)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
+ const smart_objects::SmartArray* hp_array =
+ (*message_)[strings::msg_params][strings::help_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
+ smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
+
+ for (; it_hp != it_hp_end; ++it_hp) {
+ str = (*it_hp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
+ const smart_objects::SmartArray* tp_array =
+ (*message_)[strings::msg_params][strings::timeout_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
+ smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
+
+ for (; it_tp != it_tp_end; ++it_tp) {
+ str = (*it_tp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ const smart_objects::SmartArray* vh_array =
+ (*message_)[strings::msg_params][strings::vr_help].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
+ smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
+
+ for (; it_vh != it_vh_end; ++it_vh) {
+ str = (*it_vh)[strings::text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help syntax check failed");
+ return true;
+ }
+
+ if ((*it_vh).keyExists(strings::image)) {
+ str = (*it_vh)[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid vr_help image value syntax check failed");
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+void PerformInteractionRequest::TerminatePerformInteraction() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[hmi_request::method_name] = "UI.PerformInteraction";
+ SendHMIRequest(hmi_apis::FunctionID::UI_ClosePopUp, &msg_params);
+ DisablePerformInteraction();
+}
+
+bool PerformInteractionRequest::CheckChoiceIDFromResponse(
+ ApplicationSharedPtr app, int32_t choice_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const DataAccessor<PerformChoiceSetMap> accessor =
+ app->performinteraction_choice_set_map();
+ const PerformChoiceSetMap& choice_set_map = accessor.GetData();
+
+ PerformChoiceSetMap::const_iterator choice_set_map_it =
+ choice_set_map.find(correlation_id());
+ if (choice_set_map.end() != choice_set_map_it) {
+ const PerformChoice& choice = choice_set_map_it->second;
+ PerformChoice::const_iterator it = choice.begin();
+ for (; choice.end() != it; ++it) {
+ const smart_objects::SmartObject& choice_set =
+ (*it->second).getElement(strings::choice_set);
+ for (size_t j = 0; j < choice_set.length(); ++j) {
+ if (choice_id ==
+ choice_set.getElement(j).getElement(strings::choice_id).asInt()) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+bool PerformInteractionRequest::CheckChoiceSetListVRCommands(
+ ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& choice_set_id_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ smart_objects::SmartObject* choice_set = nullptr;
+
+ for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
+ choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt());
+
+ // this should never ever happen since this was already checked
+ if (choice_set == nullptr) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt());
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ const smart_objects::SmartObject& choices_list =
+ (*choice_set)[strings::choice_set];
+ auto vr_status = MessageHelper::CheckChoiceSetVRCommands(choices_list);
+
+ // if not all choices have vr commands
+ if (vr_status != MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ LOG4CXX_ERROR(logger_,
+ "PerformInteraction has choice sets with "
+ "missing vrCommands, not in MANUAL_ONLY mode");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Some choices don't contain VR commands.");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool PerformInteractionRequest::CheckChoiceIDFromRequest(
+ ApplicationSharedPtr app,
+ const size_t choice_set_id_list_length,
+ const smart_objects::SmartObject& choice_set_id_list) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ size_t choice_list_length = 0;
+ std::set<uint32_t> choice_id_set;
+ smart_objects::SmartObject* choice_set = 0;
+ std::pair<std::set<uint32_t>::iterator, bool> ins_res;
+
+ for (size_t i = 0; i < choice_set_id_list_length; ++i) {
+ choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt());
+ if (!choice_set) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt());
+ return false;
+ }
+
+ choice_list_length = (*choice_set)[strings::choice_set].length();
+ const smart_objects::SmartObject& choices_list =
+ (*choice_set)[strings::choice_set];
+ for (size_t k = 0; k < choice_list_length; ++k) {
+ ins_res =
+ choice_id_set.insert(choices_list[k][strings::choice_id].asInt());
+ if (!ins_res.second) {
+ LOG4CXX_ERROR(logger_,
+ "choice with ID "
+ << choices_list[k][strings::choice_id].asInt()
+ << " already exists");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+const bool PerformInteractionRequest::HasHMIResponsesToWait() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return !ui_response_received_ || !vr_response_received_;
+}
+
+void PerformInteractionRequest::SendBothModeResponse(
+ const smart_objects::SmartObject& msg_param) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_apis::Result::eType perform_interaction_result_code =
+ mobile_apis::Result::INVALID_ENUM;
+ app_mngr::commands::ResponseInfo ui_perform_info(
+ ui_result_code_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo vr_perform_info(
+ vr_result_code_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(ui_perform_info, vr_perform_info);
+ perform_interaction_result_code =
+ PrepareResultCodeForResponse(ui_perform_info, vr_perform_info);
+ const smart_objects::SmartObject* response_params =
+ msg_param.empty() ? NULL : &msg_param;
+ std::string info = app_mngr::commands::MergeInfos(
+ ui_perform_info, ui_info_, vr_perform_info, vr_info_);
+ DisablePerformInteraction();
+ SendResponse(result,
+ perform_interaction_result_code,
+ info.empty() ? NULL : info.c_str(),
+ response_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc
new file mode 100644
index 0000000000..85bef9b2ad
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PerformInteractionResponse::PerformInteractionResponse(
+ 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) {}
+
+PerformInteractionResponse::~PerformInteractionResponse() {}
+
+void PerformInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
new file mode 100644
index 0000000000..b418f52fa3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
@@ -0,0 +1,324 @@
+/*
+
+ 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 <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/put_file_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+#include "utils/file_system.h"
+#include <boost/crc.hpp>
+
+namespace {
+/**
+* Calculates CRC32 checksum
+* @param binary_data - input data for which CRC32 should be calculated
+* @return calculated CRC32 checksum
+*/
+uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) {
+ const std::size_t file_size = binary_data.size();
+ boost::crc_32_type result;
+ result.process_bytes(&binary_data[0], file_size);
+ return result.checksum();
+}
+
+} // namespace
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PutFileRequest::PutFileRequest(
+ 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)
+ , offset_(0)
+ , sync_file_name_()
+ , length_(0)
+ , file_type_(mobile_apis::FileType::INVALID_ENUM)
+ , is_persistent_file_(false) {}
+
+PutFileRequest::~PutFileRequest() {}
+
+void PutFileRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == application->hmi_level() &&
+ application_manager_.get_settings().put_file_in_none() <=
+ application->put_file_in_none_count()) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // PutFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_,
+ "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "Too many requests from the app with HMILevel HMI_NONE",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::params].keyExists(strings::binary_data)) {
+ LOG4CXX_ERROR(logger_, "Binary data empty");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Binary data empty",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::sync_file_name)) {
+ LOG4CXX_ERROR(logger_, "No file name");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "No file name",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::file_type)) {
+ LOG4CXX_ERROR(logger_, "No file type");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "No file type",
+ &response_params);
+ return;
+ }
+ sync_file_name_ =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ if (!file_system::IsFileNameValid(sync_file_name_)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ err_msg.c_str(),
+ &response_params);
+ return;
+ }
+
+ file_type_ = static_cast<mobile_apis::FileType::eType>(
+ (*message_)[strings::msg_params][strings::file_type].asInt());
+ const std::vector<uint8_t> binary_data =
+ (*message_)[strings::params][strings::binary_data].asBinary();
+
+ // Policy table update in json format is currently to be received via PutFile
+ // TODO(PV): after latest discussion has to be changed
+ if (mobile_apis::FileType::JSON == file_type_) {
+ policy_handler_.ReceiveMessageFromSDK(sync_file_name_, binary_data);
+ }
+
+ offset_ = 0;
+ is_persistent_file_ = false;
+ bool is_system_file = false;
+ length_ = binary_data.size();
+ bool is_download_complete = true;
+ bool offset_exist =
+ (*message_)[strings::msg_params].keyExists(strings::offset);
+
+ if (offset_exist) {
+ offset_ = (*message_)[strings::msg_params][strings::offset].asInt();
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::persistent_file)) {
+ is_persistent_file_ =
+ (*message_)[strings::msg_params][strings::persistent_file].asBool();
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::system_file)) {
+ is_system_file =
+ (*message_)[strings::msg_params][strings::system_file].asBool();
+ }
+
+ std::string file_path;
+
+ if (is_system_file) {
+ response_params[strings::space_available] = 0;
+ file_path = application_manager_.get_settings().system_files_path();
+ } else {
+ file_path = application_manager_.get_settings().app_storage_folder();
+ file_path += "/" + application->folder_name();
+
+ uint32_t space_available = application->GetAvailableDiskSpace();
+
+ if (binary_data.size() > space_available) {
+ response_params[strings::space_available] =
+ static_cast<uint32_t>(space_available);
+
+ LOG4CXX_ERROR(logger_, "Out of memory");
+ SendResponse(false,
+ mobile_apis::Result::OUT_OF_MEMORY,
+ "Out of memory",
+ &response_params);
+ return;
+ }
+ }
+
+ if (!file_system::CreateDirectoryRecursively(file_path)) {
+ LOG4CXX_ERROR(logger_, "Can't create folder");
+ SendResponse(false,
+ mobile_apis::Result::GENERIC_ERROR,
+ "Can't create folder.",
+ &response_params);
+ return;
+ }
+ const std::string full_path = file_path + "/" + sync_file_name_;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::crc32_check_sum)) {
+ LOG4CXX_TRACE(logger_, "Binary Data Size: " << binary_data.size());
+ const uint32_t crc_received =
+ (*message_)[strings::msg_params][strings::crc32_check_sum].asUInt();
+ LOG4CXX_TRACE(logger_, "CRC32 SUM Received: " << crc_received);
+ const uint32_t crc_calculated = GetCrc32CheckSum(binary_data);
+ LOG4CXX_TRACE(logger_, "CRC32 SUM Calculated: " << crc_calculated);
+ if (crc_calculated != crc_received) {
+ SendResponse(false,
+ mobile_apis::Result::CORRUPTED_DATA,
+ "CRC Check on file failed. File upload has been cancelled, "
+ "please retry.",
+ &response_params);
+ return;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Writing " << binary_data.size() << " bytes to " << full_path
+ << " (current size is"
+ << file_system::FileSize(full_path) << ")");
+
+ mobile_apis::Result::eType save_result = application_manager_.SaveBinary(
+ binary_data, file_path, sync_file_name_, offset_);
+
+ LOG4CXX_DEBUG(logger_,
+ "New size of " << full_path << " is "
+ << file_system::FileSize(full_path) << " bytes");
+ if (!is_system_file) {
+ response_params[strings::space_available] =
+ static_cast<uint32_t>(application->GetAvailableDiskSpace());
+ }
+
+ sync_file_name_ = file_path + "/" + sync_file_name_;
+ switch (save_result) {
+ case mobile_apis::Result::SUCCESS: {
+ LOG4CXX_INFO(logger_, "PutFile is successful");
+ if (!is_system_file) {
+ AppFile file(sync_file_name_,
+ is_persistent_file_,
+ is_download_complete,
+ file_type_);
+
+ if (0 == offset_) {
+ LOG4CXX_INFO(logger_, "New file downloading");
+ if (!application->AddFile(file)) {
+ LOG4CXX_INFO(logger_,
+ "Couldn't add file to application (File already Exist"
+ << " in application and was rewritten on FS)");
+ /* It can be first part of new big file, so we need to update
+ information about it's downloading status and persistence */
+ if (!application->UpdateFile(file)) {
+ LOG4CXX_ERROR(logger_, "Couldn't update file");
+ /* If it is impossible to update file, application doesn't
+ know about existing this file */
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Couldn't update file",
+ &response_params);
+ return;
+ }
+ } else {
+ /* if file added - increment it's count
+ ( may be application->AddFile have to incapsulate it? )
+ Any way now this method evals not only in "none"*/
+ application->increment_put_file_in_none_count();
+ }
+ }
+ }
+
+ SendResponse(true, save_result, "File was downloaded", &response_params);
+ if (is_system_file) {
+ SendOnPutFileNotification();
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_,
+ "PutFile is unsuccessful. Result = " << save_result);
+ SendResponse(false, save_result, "Can't save file", &response_params);
+ break;
+ }
+}
+
+void PutFileRequest::SendOnPutFileNotification() {
+ LOG4CXX_INFO(logger_, "SendOnPutFileNotification");
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& message = *notification;
+ message[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnPutFile;
+ message[strings::params][strings::message_type] = MessageType::kNotification;
+ message[strings::msg_params][strings::app_id] = connection_key();
+ message[strings::msg_params][strings::sync_file_name] = sync_file_name_;
+ message[strings::msg_params][strings::offset] = offset_;
+ if (0 == offset_ &&
+ !(*message_)[strings::msg_params].keyExists(strings::length)) {
+ message[strings::msg_params][strings::file_size] = length_;
+ }
+ message[strings::msg_params][strings::length] = length_;
+ message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
+ message[strings::msg_params][strings::file_type] = file_type_;
+ rpc_service_.ManageHMICommand(notification);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc
new file mode 100644
index 0000000000..8c54970a5c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc
@@ -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.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/put_file_response.h"
+#include "utils/file_system.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PutFileResponse::PutFileResponse(
+ 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) {}
+
+PutFileResponse::~PutFileResponse() {}
+
+void PutFileResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
new file mode 100644
index 0000000000..7957d9e055
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
@@ -0,0 +1,1428 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_request.h"
+
+#include <unistd.h>
+#include <algorithm>
+#include <map>
+#include <string.h>
+
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/app_launch/app_launch_ctrl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/rpc_service.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/generated_msg_version.h"
+#include "utils/file_system.h"
+
+namespace {
+namespace custom_str = utils::custom_string;
+
+mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
+ if ("DEFAULT" == str) {
+ return mobile_apis::AppHMIType::DEFAULT;
+ } else if ("COMMUNICATION" == str) {
+ return mobile_apis::AppHMIType::COMMUNICATION;
+ } else if ("MEDIA" == str) {
+ return mobile_apis::AppHMIType::MEDIA;
+ } else if ("MESSAGING" == str) {
+ return mobile_apis::AppHMIType::MESSAGING;
+ } else if ("NAVIGATION" == str) {
+ return mobile_apis::AppHMIType::NAVIGATION;
+ } else if ("INFORMATION" == str) {
+ return mobile_apis::AppHMIType::INFORMATION;
+ } else if ("SOCIAL" == str) {
+ return mobile_apis::AppHMIType::SOCIAL;
+ } else if ("BACKGROUND_PROCESS" == str) {
+ return mobile_apis::AppHMIType::BACKGROUND_PROCESS;
+ } else if ("TESTING" == str) {
+ return mobile_apis::AppHMIType::TESTING;
+ } else if ("SYSTEM" == str) {
+ return mobile_apis::AppHMIType::SYSTEM;
+ } else if ("PROJECTION" == str) {
+ return mobile_apis::AppHMIType::PROJECTION;
+ } else if ("REMOTE_CONTROL" == str) {
+ return mobile_apis::AppHMIType::REMOTE_CONTROL;
+ } else {
+ return mobile_apis::AppHMIType::INVALID_ENUM;
+ }
+}
+
+std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) {
+ const std::map<mobile_apis::AppHMIType::eType, std::string> app_hmi_type_map =
+ {{mobile_apis::AppHMIType::DEFAULT, "DEFAULT"},
+ {mobile_apis::AppHMIType::REMOTE_CONTROL, "REMOTE_CONTROL"},
+ {mobile_apis::AppHMIType::COMMUNICATION, "COMMUNICATION"},
+ {mobile_apis::AppHMIType::MEDIA, "MEDIA"},
+ {mobile_apis::AppHMIType::MESSAGING, "MESSAGING"},
+ {mobile_apis::AppHMIType::NAVIGATION, "NAVIGATION"},
+ {mobile_apis::AppHMIType::INFORMATION, "INFORMATION"},
+ {mobile_apis::AppHMIType::SOCIAL, "SOCIAL"},
+ {mobile_apis::AppHMIType::BACKGROUND_PROCESS, "BACKGROUND_PROCESS"},
+ {mobile_apis::AppHMIType::TESTING, "TESTING"},
+ {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"},
+ {mobile_apis::AppHMIType::PROJECTION, "PROJECTION"}};
+
+ std::map<mobile_apis::AppHMIType::eType, std::string>::const_iterator iter =
+ app_hmi_type_map.find(type);
+
+ return app_hmi_type_map.end() != iter ? iter->second : std::string("");
+}
+
+struct AppHMITypeInserter {
+ AppHMITypeInserter(smart_objects::SmartObject& so_array)
+ : index_(0), so_array_(so_array) {}
+
+ bool operator()(const std::string& app_hmi_type) {
+ so_array_[index_] = StringToAppHMIType(app_hmi_type);
+ ++index_;
+ return true;
+ }
+
+ private:
+ uint32_t index_;
+ smart_objects::SmartObject& so_array_;
+};
+
+struct CheckMissedTypes {
+ CheckMissedTypes(const policy::StringArray& policy_app_types,
+ std::string& log)
+ : policy_app_types_(policy_app_types), log_(log) {}
+
+ bool operator()(const smart_objects::SmartArray::value_type& value) {
+ std::string app_type_str = AppHMITypeToString(
+ static_cast<mobile_apis::AppHMIType::eType>(value.asInt()));
+ if (!app_type_str.empty()) {
+ policy::StringArray::const_iterator it = policy_app_types_.begin();
+ policy::StringArray::const_iterator it_end = policy_app_types_.end();
+ for (; it != it_end; ++it) {
+ if (app_type_str == *it) {
+ return true;
+ }
+ }
+ }
+
+ log_ += app_type_str;
+ log_ += ",";
+
+ return true;
+ }
+
+ private:
+ const policy::StringArray& policy_app_types_;
+ std::string& log_;
+};
+
+class SmartArrayValueExtractor {
+ public:
+ AppHmiType operator()(const smart_objects::SmartObject& so) const {
+ return static_cast<AppHmiType>(so.asInt());
+ }
+};
+
+struct IsSameNickname {
+ IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
+ bool operator()(const policy::StringArray::value_type& nickname) const {
+ return app_id_.CompareIgnoreCase(nickname.c_str());
+ }
+
+ private:
+ const custom_str::CustomString& app_id_;
+};
+}
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
+ 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)
+ , result_code_(mobile_apis::Result::INVALID_ENUM) {}
+
+RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {}
+
+bool RegisterAppInterfaceRequest::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+void RegisterAppInterfaceRequest::Run() {
+ using namespace helpers;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Connection key is " << connection_key());
+
+ // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
+ // Flag conditional compilation specific to customer is used in order to
+ // exclude hit code
+ // to RTC
+ // FIXME(EZamakhov): on shutdown - get freez
+
+ // wait till HMI started
+ while (!application_manager_.IsStopping() &&
+ !application_manager_.IsHMICooperating()) {
+ LOG4CXX_DEBUG(logger_,
+ "Waiting for the HMI... conn_key="
+ << connection_key()
+ << ", correlation_id=" << correlation_id()
+ << ", default_timeout=" << default_timeout()
+ << ", thread=" << pthread_self());
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ sleep(1);
+ // TODO(DK): timer_->StartWait(1);
+ }
+
+ if (application_manager_.IsStopping()) {
+ LOG4CXX_WARN(logger_, "The ApplicationManager is stopping!");
+ return;
+ }
+
+ if (IsApplicationSwitched()) {
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
+ return;
+ }
+ // cache the original app ID (for legacy behavior)
+ const std::string policy_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ // transform app IDs to lowercase for usage in policy checks later
+ const std::string app_id_short = msg_params[strings::app_id].asString();
+ std::string new_app_id_short = app_id_short;
+ std::transform(app_id_short.begin(),
+ app_id_short.end(),
+ new_app_id_short.begin(),
+ ::tolower);
+ (*message_)[strings::msg_params][strings::app_id] = new_app_id_short;
+ // If full ID is present, shift that to lowercase too
+ if (msg_params.keyExists(strings::full_app_id)) {
+ const std::string app_id_full = msg_params[strings::full_app_id].asString();
+ std::string new_app_id_full = app_id_full;
+ std::transform(app_id_full.begin(),
+ app_id_full.end(),
+ new_app_id_full.begin(),
+ ::tolower);
+ (*message_)[strings::msg_params][strings::full_app_id] = new_app_id_full;
+ }
+ if (application_manager_.IsApplicationForbidden(connection_key(),
+ policy_app_id)) {
+ SendResponse(false, mobile_apis::Result::TOO_MANY_PENDING_REQUESTS);
+ return;
+ }
+
+ if (IsApplicationWithSameAppIdRegistered()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+
+ mobile_apis::Result::eType policy_result = CheckWithPolicyData();
+
+ if (Compare<mobile_apis::Result::eType, NEQ, ALL>(
+ policy_result,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS)) {
+ SendResponse(false, policy_result);
+ return;
+ }
+
+ mobile_apis::Result::eType coincidence_result = CheckCoincidence();
+
+ if (mobile_apis::Result::SUCCESS != coincidence_result) {
+ LOG4CXX_ERROR(logger_, "Coincidence check failed.");
+ if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) {
+ usage_statistics::AppCounter count_of_rejections_duplicate_name(
+ GetPolicyHandler().GetStatisticManager(),
+ policy_app_id,
+ usage_statistics::REJECTIONS_DUPLICATE_NAME);
+ ++count_of_rejections_duplicate_name;
+ }
+ SendResponse(false, coincidence_result);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming register app interface has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ uint16_t major =
+ msg_params[strings::sync_msg_version][strings::major_version].asUInt();
+ uint16_t minor =
+ msg_params[strings::sync_msg_version][strings::minor_version].asUInt();
+ uint16_t patch = 0;
+ // Check if patch exists since it is not mandatory.
+ if (msg_params[strings::sync_msg_version].keyExists(strings::patch_version)) {
+ patch =
+ msg_params[strings::sync_msg_version][strings::patch_version].asUInt();
+ }
+
+ utils::SemanticVersion mobile_version(major, minor, patch);
+ utils::SemanticVersion min_module_version(
+ minimum_major_version, minimum_minor_version, minimum_patch_version);
+
+ if (mobile_version < min_module_version) {
+ LOG4CXX_WARN(logger_,
+ "Application RPC Version does not meet minimum requirement");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ }
+
+ application = application_manager_.RegisterApplication(message_);
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application hasn't been registered!");
+ return;
+ }
+
+ // Version negotiation
+ utils::SemanticVersion module_version(
+ major_version, minor_version, patch_version);
+ if (mobile_version < utils::rpc_version_5) {
+ // Mobile versioning did not exist for
+ // versions before 5.0
+ application->set_msg_version(utils::base_rpc_version);
+ } else if (mobile_version < module_version) {
+ // Use mobile RPC version as negotiated version
+ application->set_msg_version(mobile_version);
+ } else {
+ // Use module version as negotiated version
+ application->set_msg_version(module_version);
+ }
+
+ // For resuming application need to restore hmi_app_id from resumeCtrl
+ resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
+ const std::string& device_mac = application->mac_address();
+
+ // there is side affect with 2 mobile app with the same mobile app_id
+ if (resumer.IsApplicationSaved(policy_app_id, device_mac)) {
+ application->set_hmi_application_id(
+ resumer.GetHMIApplicationID(policy_app_id, device_mac));
+ } else {
+ application->set_hmi_application_id(
+ application_manager_.GenerateNewHMIAppID());
+ }
+
+ application->set_is_media_application(
+ msg_params[strings::is_media_application].asBool());
+
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ application->set_vr_synonyms(msg_params[strings::vr_synonyms]);
+ }
+
+ if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
+ application->set_ngn_media_screen_name(
+ msg_params[strings::ngn_media_screen_app_name]);
+ }
+
+ if (msg_params.keyExists(strings::tts_name)) {
+ smart_objects::SmartObject& tts_name =
+ (*message_)[strings::msg_params][strings::tts_name];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ tts_name, application, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ response_info_ = "One or more files needed for tts_name are not present";
+ result_code_ = mobile_apis::Result::WARNINGS;
+ }
+ application->set_tts_name(tts_name);
+ }
+
+ if (msg_params.keyExists(strings::app_hmi_type)) {
+ application->set_app_types(msg_params[strings::app_hmi_type]);
+
+ // check app type
+ const smart_objects::SmartObject& app_type =
+ msg_params.getElement(strings::app_hmi_type);
+
+ for (size_t i = 0; i < app_type.length(); ++i) {
+ mobile_apis::AppHMIType::eType current_app_type =
+ static_cast<mobile_apis::AppHMIType::eType>(
+ app_type.getElement(i).asUInt());
+
+ switch (current_app_type) {
+ case mobile_apis::AppHMIType::NAVIGATION: {
+ application->set_is_navi(true);
+ break;
+ }
+ case mobile_apis::AppHMIType::COMMUNICATION: {
+ application->set_voice_communication_supported(true);
+ break;
+ }
+ case mobile_apis::AppHMIType::PROJECTION: {
+ application->set_mobile_projection_enabled(true);
+ break;
+ }
+ case mobile_apis::AppHMIType::REMOTE_CONTROL: {
+ application->set_remote_control_supported(true);
+ break;
+ }
+ default: {}
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::day_color_scheme)) {
+ application->set_day_color_scheme(msg_params[strings::day_color_scheme]);
+ }
+
+ if (msg_params.keyExists(strings::night_color_scheme)) {
+ application->set_night_color_scheme(
+ msg_params[strings::night_color_scheme]);
+ }
+
+ // Add device to policy table and set device info, if any
+ policy::DeviceParams dev_params;
+ if (-1 ==
+ application_manager_.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(application->device(),
+ &dev_params.device_name,
+ NULL,
+ &dev_params.device_mac_address,
+ &dev_params.device_connection_type)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to extract information for device "
+ << application->device());
+ }
+ policy::DeviceInfo device_info;
+ device_info.AdoptDeviceType(dev_params.device_connection_type);
+ if (msg_params.keyExists(strings::device_info)) {
+ FillDeviceInfo(&device_info);
+ }
+
+ GetPolicyHandler().SetDeviceInfo(device_mac, device_info);
+
+ SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
+ smart_objects::SmartObjectSPtr so =
+ GetLockScreenIconUrlNotification(connection_key(), application);
+ rpc_service_.ManageMobileCommand(so, SOURCE_SDL);
+ application_manager_.SendDriverDistractionState(application);
+}
+
+smart_objects::SmartObjectSPtr
+RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification(
+ const uint32_t connection_key, ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app.get(), smart_objects::SmartObjectSPtr());
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnSystemRequestID;
+ (*message)[strings::params][strings::connection_key] = connection_key;
+ (*message)[strings::params][strings::message_type] =
+ mobile_apis::messageType::notification;
+ (*message)[strings::params][strings::protocol_type] = mobile_protocol_type_;
+ (*message)[strings::params][strings::protocol_version] = protocol_version_;
+ (*message)[strings::msg_params][strings::request_type] =
+ mobile_apis::RequestType::LOCK_SCREEN_ICON_URL;
+ (*message)[strings::msg_params][strings::url] =
+ GetPolicyHandler().GetLockScreenIconUrl();
+ return message;
+}
+
+void FillVRRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::language] = hmi_capabilities.active_vr_language();
+ if (hmi_capabilities.vr_capabilities()) {
+ response_params[strings::vr_capabilities] =
+ *hmi_capabilities.vr_capabilities();
+ }
+}
+
+void FillVIRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ if (hmi_capabilities.vehicle_type()) {
+ response_params[hmi_response::vehicle_type] =
+ *hmi_capabilities.vehicle_type();
+ }
+}
+
+void FillTTSRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::language] = hmi_capabilities.active_tts_language();
+ if (hmi_capabilities.speech_capabilities()) {
+ response_params[strings::speech_capabilities] =
+ *hmi_capabilities.speech_capabilities();
+ }
+ if (hmi_capabilities.prerecorded_speech()) {
+ response_params[strings::prerecorded_speech] =
+ *(hmi_capabilities.prerecorded_speech());
+ }
+}
+
+void FillUIRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+ if (hmi_capabilities.display_capabilities()) {
+ response_params[hmi_response::display_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& display_caps =
+ response_params[hmi_response::display_capabilities];
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::display_type)) {
+ display_caps[hmi_response::display_type] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::display_type);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::display_name)) {
+ display_caps[hmi_response::display_name] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::display_name);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::text_fields)) {
+ display_caps[hmi_response::text_fields] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::text_fields);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::image_fields)) {
+ display_caps[hmi_response::image_fields] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::image_fields);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::media_clock_formats)) {
+ display_caps[hmi_response::media_clock_formats] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::media_clock_formats);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::templates_available)) {
+ display_caps[hmi_response::templates_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::templates_available);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::screen_params)) {
+ display_caps[hmi_response::screen_params] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::screen_params);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::num_custom_presets_available)) {
+ display_caps[hmi_response::num_custom_presets_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::num_custom_presets_available);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::image_capabilities)) {
+ display_caps[hmi_response::graphic_supported] =
+ (hmi_capabilities.display_capabilities()
+ ->getElement(hmi_response::image_capabilities)
+ .length() > 0);
+ }
+ }
+
+ if (hmi_capabilities.audio_pass_thru_capabilities()) {
+ if (smart_objects::SmartType_Array ==
+ hmi_capabilities.audio_pass_thru_capabilities()->getType()) {
+ // hmi_capabilities json contains array and HMI response object
+ response_params[strings::audio_pass_thru_capabilities] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
+ } else {
+ response_params[strings::audio_pass_thru_capabilities][0] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
+ }
+ }
+ response_params[strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ response_params[strings::hmi_capabilities][strings::navigation] =
+ hmi_capabilities.navigation_supported();
+ response_params[strings::hmi_capabilities][strings::phone_call] =
+ hmi_capabilities.phone_call_supported();
+ response_params[strings::hmi_capabilities][strings::video_streaming] =
+ hmi_capabilities.video_streaming_supported();
+ response_params[strings::hmi_capabilities][strings::remote_control] =
+ hmi_capabilities.rc_supported();
+}
+
+void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
+ ApplicationType app_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
+
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ const uint32_t key = connection_key();
+ ApplicationSharedPtr application = application_manager_.application(key);
+
+ resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_,
+ "There is no application for such connection key" << key);
+ LOG4CXX_DEBUG(logger_, "Need to start resume data persistent timer");
+ resumer.OnAppRegistrationEnd();
+ return;
+ }
+
+ utils::SemanticVersion negotiated_version = application->msg_version();
+
+ response_params[strings::sync_msg_version][strings::major_version] =
+ negotiated_version.major_version_;
+ response_params[strings::sync_msg_version][strings::minor_version] =
+ negotiated_version.minor_version_;
+ response_params[strings::sync_msg_version][strings::patch_version] =
+ negotiated_version.patch_version_;
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params[strings::language_desired].asInt() !=
+ hmi_capabilities.active_vr_language() ||
+ msg_params[strings::hmi_display_language_desired].asInt() !=
+ hmi_capabilities.active_ui_language()) {
+ LOG4CXX_WARN(logger_,
+ "Wrong language on registering application "
+ << application->name().c_str());
+
+ LOG4CXX_ERROR(
+ logger_,
+ "VR language desired code is "
+ << msg_params[strings::language_desired].asInt()
+ << " , active VR language code is "
+ << hmi_capabilities.active_vr_language() << ", UI language code is "
+ << msg_params[strings::hmi_display_language_desired].asInt()
+ << " , active UI language code is "
+ << hmi_capabilities.active_ui_language());
+
+ result_code = mobile_apis::Result::WRONG_LANGUAGE;
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS)) {
+ FillTTSRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VR)) {
+ FillVRRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI)) {
+ FillUIRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
+ FillVIRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (hmi_capabilities.button_capabilities()) {
+ response_params[hmi_response::button_capabilities] =
+ *hmi_capabilities.button_capabilities();
+ }
+
+ if (hmi_capabilities.soft_button_capabilities()) {
+ response_params[hmi_response::soft_button_capabilities] =
+ *hmi_capabilities.soft_button_capabilities();
+ }
+
+ if (hmi_capabilities.preset_bank_capabilities()) {
+ response_params[hmi_response::preset_bank_capabilities] =
+ *hmi_capabilities.preset_bank_capabilities();
+ }
+
+ if (hmi_capabilities.hmi_zone_capabilities()) {
+ if (smart_objects::SmartType_Array ==
+ hmi_capabilities.hmi_zone_capabilities()->getType()) {
+ // hmi_capabilities json contains array and HMI response object
+ response_params[hmi_response::hmi_zone_capabilities] =
+ *hmi_capabilities.hmi_zone_capabilities();
+ } else {
+ response_params[hmi_response::hmi_zone_capabilities][0] =
+ *hmi_capabilities.hmi_zone_capabilities();
+ }
+ }
+
+ if (hmi_capabilities.pcm_stream_capabilities()) {
+ response_params[strings::pcm_stream_capabilities] =
+ *hmi_capabilities.pcm_stream_capabilities();
+ }
+
+ const std::vector<uint32_t>& diag_modes =
+ application_manager_.get_settings().supported_diag_modes();
+ if (!diag_modes.empty()) {
+ std::vector<uint32_t>::const_iterator it = diag_modes.begin();
+ uint32_t index = 0;
+ for (; it != diag_modes.end(); ++it) {
+ response_params[strings::supported_diag_modes][index] = *it;
+ ++index;
+ }
+ }
+
+ response_params[strings::sdl_version] =
+ application_manager_.get_settings().sdl_version();
+ const std::string ccpu_version = hmi_capabilities_.ccpu_version();
+ if (!ccpu_version.empty()) {
+ response_params[strings::system_software_version] = ccpu_version;
+ }
+
+ if (ApplicationType::kSwitchedApplicationWrongHashId == app_type) {
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport, "
+ "but doesn't have correct hashID.");
+
+ application_manager::DeleteApplicationData(application,
+ application_manager_);
+
+ SendResponse(
+ true, mobile_apis::Result::RESUME_FAILED, NULL, &response_params);
+ return;
+ }
+
+ if (ApplicationType::kSwitchedApplicationHashOk == app_type) {
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport "
+ "and has correct hashID.");
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ return;
+ }
+
+ bool resumption =
+ (*message_)[strings::msg_params].keyExists(strings::hash_id);
+
+ bool need_restore_vr = resumption;
+
+ std::string hash_id;
+ std::string add_info;
+ if (resumption) {
+ hash_id = (*message_)[strings::msg_params][strings::hash_id].asString();
+ if (!resumer.CheckApplicationHash(application, hash_id)) {
+ LOG4CXX_WARN(logger_,
+ "Hash from RAI does not match to saved resume data.");
+ result_code = mobile_apis::Result::RESUME_FAILED;
+ add_info = "Hash from RAI does not match to saved resume data.";
+ need_restore_vr = false;
+ } else if (!resumer.CheckPersistenceFilesForResumption(application)) {
+ LOG4CXX_WARN(logger_, "Persistent data is missing.");
+ result_code = mobile_apis::Result::RESUME_FAILED;
+ add_info = "Persistent data is missing.";
+ need_restore_vr = false;
+ } else {
+ add_info = "Resume succeeded.";
+ }
+ }
+ if ((mobile_apis::Result::SUCCESS == result_code) &&
+ (mobile_apis::Result::INVALID_ENUM != result_code_)) {
+ add_info += response_info_;
+ result_code = result_code_;
+ }
+
+ // in case application exist in resumption we need to send resumeVrgrammars
+ if (false == resumption) {
+ resumption = resumer.IsApplicationSaved(application->policy_app_id(),
+ application->mac_address());
+ }
+
+ AppHmiTypes hmi_types;
+ if ((*message_)[strings::msg_params].keyExists(strings::app_hmi_type)) {
+ smart_objects::SmartArray* hmi_types_ptr =
+ (*message_)[strings::msg_params][strings::app_hmi_type].asArray();
+ DCHECK_OR_RETURN_VOID(hmi_types_ptr);
+ SmartArrayValueExtractor extractor;
+ if (hmi_types_ptr && 0 < hmi_types_ptr->size()) {
+ std::transform(hmi_types_ptr->begin(),
+ hmi_types_ptr->end(),
+ std::back_inserter(hmi_types),
+ extractor);
+ }
+ }
+ policy::StatusNotifier notify_upd_manager = GetPolicyHandler().AddApplication(
+ application->policy_app_id(), hmi_types);
+
+ response_params[strings::icon_resumed] =
+ file_system::FileExists(application->app_icon_path());
+
+ SendResponse(true, result_code, add_info.c_str(), &response_params);
+ SendOnAppRegisteredNotificationToHMI(
+ *(application.get()), resumption, need_restore_vr);
+ if (msg_params.keyExists(strings::app_hmi_type)) {
+ GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(),
+ &(msg_params[strings::app_hmi_type]));
+ }
+
+ // Default HMI level should be set before any permissions validation, since it
+ // relies on HMI level.
+ application_manager_.OnApplicationRegistered(application);
+ (*notify_upd_manager)();
+
+ // Start PTU after successfull registration
+ // Sends OnPermissionChange notification to mobile right after RAI response
+ // and HMI level set-up
+ GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id());
+
+ if (result_code != mobile_apis::Result::RESUME_FAILED) {
+ resumer.StartResumption(application, hash_id);
+ } else {
+ resumer.StartResumptionOnlyHMILevel(application);
+ }
+
+ // By default app subscribed to CUSTOM_BUTTON
+ SendSubscribeCustomButtonNotification();
+ SendChangeRegistrationOnHMI(application);
+}
+
+void RegisterAppInterfaceRequest::SendChangeRegistration(
+ const hmi_apis::FunctionID::eType function_id,
+ const int32_t language,
+ const uint32_t app_id) {
+ using helpers::Compare;
+ using helpers::EQ;
+ using helpers::ONE;
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceID interface =
+ hmi_interfaces.GetInterfaceFromFunction(function_id);
+ if (hmi_interfaces.GetInterfaceState(interface) !=
+ HmiInterfaces::STATE_NOT_AVAILABLE) {
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::language] = language;
+ msg_params[strings::app_id] = app_id;
+ SendHMIRequest(function_id, &msg_params);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Interface " << interface << "is not avaliable");
+ }
+}
+
+void RegisterAppInterfaceRequest::SendChangeRegistrationOnHMI(
+ ApplicationConstSharedPtr app) {
+ using namespace hmi_apis::FunctionID;
+ DCHECK_OR_RETURN_VOID(app);
+ DCHECK_OR_RETURN_VOID(mobile_apis::Language::INVALID_ENUM != app->language());
+ SendChangeRegistration(VR_ChangeRegistration, app->language(), app->app_id());
+ SendChangeRegistration(
+ TTS_ChangeRegistration, app->language(), app->app_id());
+ SendChangeRegistration(UI_ChangeRegistration, app->language(), app->app_id());
+}
+
+void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
+ const app_mngr::Application& application_impl,
+ bool resumption,
+ bool need_restore_vr) {
+ using namespace smart_objects;
+ SmartObjectSPtr notification = std::make_shared<SmartObject>(SmartType_Map);
+ if (!notification) {
+ LOG4CXX_ERROR(logger_, "Failed to create smart object");
+ return;
+ }
+
+ (*notification)[strings::params] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& params = (*notification)[strings::params];
+ params[strings::function_id] = static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ params[strings::message_type] = static_cast<int32_t>(kNotification);
+ params[strings::protocol_version] = protocol_version_;
+ params[strings::protocol_type] = hmi_protocol_type_;
+
+ (*notification)[strings::msg_params] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& msg_params = (*notification)[strings::msg_params];
+ // Due to current requirements in case when we're in resumption mode
+ // we have to always send resumeVRGrammar field.
+ if (resumption) {
+ msg_params[strings::resume_vr_grammars] = need_restore_vr;
+ }
+
+ if (application_impl.vr_synonyms()) {
+ msg_params[strings::vr_synonyms] = *(application_impl.vr_synonyms());
+ }
+
+ if (application_impl.tts_name()) {
+ msg_params[strings::tts_name] = *(application_impl.tts_name());
+ }
+
+ const std::string policy_app_id = application_impl.policy_app_id();
+ std::string priority;
+ GetPolicyHandler().GetPriority(policy_app_id, &priority);
+
+ if (!priority.empty()) {
+ msg_params[strings::priority] = MessageHelper::GetPriorityCode(priority);
+ }
+
+ msg_params[strings::msg_params] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& application = msg_params[strings::application];
+ application[strings::app_name] = application_impl.name();
+ application[strings::app_id] = application_impl.app_id();
+ application[hmi_response::policy_app_id] = policy_app_id;
+ if (file_system::FileExists(application_impl.app_icon_path())) {
+ application[strings::icon] = application_impl.app_icon_path();
+ }
+
+ const smart_objects::SmartObject* ngn_media_screen_name =
+ application_impl.ngn_media_screen_name();
+ if (ngn_media_screen_name) {
+ application[strings::ngn_media_screen_app_name] = *ngn_media_screen_name;
+ }
+
+ application[strings::hmi_display_language_desired] =
+ static_cast<int32_t>(application_impl.ui_language());
+
+ application[strings::is_media_application] =
+ application_impl.is_media_application();
+
+ const smart_objects::SmartObject* app_type = application_impl.app_types();
+ if (app_type) {
+ application[strings::app_type] = *app_type;
+ }
+
+ const policy::RequestType::State app_request_types_state =
+ GetPolicyHandler().GetAppRequestTypeState(policy_app_id);
+ if (policy::RequestType::State::AVAILABLE == app_request_types_state) {
+ const auto request_types =
+ GetPolicyHandler().GetAppRequestTypes(policy_app_id);
+ application[strings::request_type] = SmartObject(SmartType_Array);
+ smart_objects::SmartObject& request_types_array =
+ application[strings::request_type];
+
+ size_t index = 0;
+ for (auto it : request_types) {
+ request_types_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestType::State::EMPTY == app_request_types_state) {
+ application[strings::request_type] = SmartObject(SmartType_Array);
+ }
+
+ const policy::RequestSubType::State app_request_subtypes_state =
+ GetPolicyHandler().GetAppRequestSubTypeState(policy_app_id);
+ if (policy::RequestSubType::State::AVAILABLE == app_request_subtypes_state) {
+ const auto request_subtypes =
+ GetPolicyHandler().GetAppRequestSubTypes(policy_app_id);
+ application[strings::request_subtype] = SmartObject(SmartType_Array);
+ smart_objects::SmartObject& request_subtypes_array =
+ application[strings::request_subtype];
+
+ size_t index = 0;
+ for (auto it : request_subtypes) {
+ request_subtypes_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestSubType::State::EMPTY ==
+ app_request_subtypes_state) {
+ application[strings::request_subtype] = SmartObject(SmartType_Array);
+ }
+
+ const protocol_handler::SessionObserver& session_observer =
+ application_manager_.connection_handler().get_session_observer();
+
+ application[strings::device_info] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& device_info = application[strings::device_info];
+ MessageHelper::CreateDeviceInfo(application_impl.device(),
+ session_observer,
+ GetPolicyHandler(),
+ application_manager_,
+ &device_info);
+
+ if (application_impl.secondary_device() != 0) {
+ application[strings::secondary_device_info] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& secondary_device_info =
+ application[strings::secondary_device_info];
+ MessageHelper::CreateDeviceInfo(application_impl.secondary_device(),
+ session_observer,
+ GetPolicyHandler(),
+ application_manager_,
+ &secondary_device_info);
+ }
+
+ const smart_objects::SmartObject* day_color_scheme =
+ application_impl.day_color_scheme();
+ if (day_color_scheme) {
+ application[strings::day_color_scheme] = *day_color_scheme;
+ }
+
+ const smart_objects::SmartObject* night_color_scheme =
+ application_impl.night_color_scheme();
+ if (night_color_scheme) {
+ application[strings::night_color_scheme] = *night_color_scheme;
+ }
+
+ DCHECK(rpc_service_.ManageHMICommand(notification));
+}
+
+mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationSet accessor = application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = accessor.begin();
+ const custom_str::CustomString& app_name =
+ msg_params[strings::app_name].asCustomString();
+
+ for (; accessor.end() != it; ++it) {
+ // name check
+ const custom_str::CustomString& cur_name = (*it)->name();
+ if (app_name.CompareIgnoreCase(cur_name)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+
+ const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
+ const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
+ if (NULL != vr) {
+ curr_vr = vr->asArray();
+ CoincidencePredicateVR v(app_name);
+
+ if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+
+ // vr check
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ const std::vector<smart_objects::SmartObject>* new_vr =
+ msg_params[strings::vr_synonyms].asArray();
+
+ CoincidencePredicateVR v(cur_name);
+ if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // end vr check
+
+ } // application for end
+
+ return mobile_apis::Result::SUCCESS;
+} // method end
+
+mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // TODO(AOleynik): Check is necessary to allow register application in case
+ // of disabled policy
+ // Remove this check, when HMI will support policy
+ if (!GetPolicyHandler().PolicyEnabled()) {
+ return mobile_apis::Result::WARNINGS;
+ }
+
+ smart_objects::SmartObject& message = *message_;
+ policy::StringArray app_nicknames;
+ policy::StringArray app_hmi_types;
+
+ const std::string mobile_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
+ const bool init_result = GetPolicyHandler().GetInitialAppData(
+ mobile_app_id, &app_nicknames, &app_hmi_types);
+
+ if (!init_result) {
+ LOG4CXX_ERROR(logger_, "Error during initial application data check.");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ if (!app_nicknames.empty()) {
+ IsSameNickname compare(
+ message[strings::msg_params][strings::app_name].asCustomString());
+ policy::StringArray::const_iterator it =
+ std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
+ if (app_nicknames.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Application name was not found in nicknames list.");
+ // App should be unregistered, if its name is not present in nicknames
+ // list
+ usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
+ GetPolicyHandler().GetStatisticManager(),
+ mobile_app_id,
+ usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
+ ++count_of_rejections_nickname_mismatch;
+ return mobile_apis::Result::DISALLOWED;
+ }
+ }
+
+ mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS;
+
+ // If AppHMIType is not included in policy - allow any type
+ if (!app_hmi_types.empty()) {
+ if (message[strings::msg_params].keyExists(strings::app_hmi_type)) {
+ // If AppHmiTypes are partially same, the system should allow those listed
+ // in the policy table and send warning info on missed values
+ smart_objects::SmartArray app_types =
+ *(message[strings::msg_params][strings::app_hmi_type].asArray());
+
+ std::string log;
+ CheckMissedTypes checker(app_hmi_types, log);
+ std::for_each(app_types.begin(), app_types.end(), checker);
+ if (!log.empty()) {
+ response_info_ =
+ "Following AppHmiTypes are not present in policy "
+ "table:" +
+ log;
+ result_code_ = mobile_apis::Result::WARNINGS;
+ }
+ }
+ // Replace AppHmiTypes in request with values allowed by policy table
+ message[strings::msg_params][strings::app_hmi_type] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& app_hmi_type =
+ message[strings::msg_params][strings::app_hmi_type];
+
+ AppHMITypeInserter inserter(app_hmi_type);
+ std::for_each(app_hmi_types.begin(), app_hmi_types.end(), inserter);
+ }
+
+ return result;
+}
+
+void RegisterAppInterfaceRequest::FillDeviceInfo(
+ policy::DeviceInfo* device_info) {
+ const std::string hardware = "hardware";
+ const std::string firmware_rev = "firmwareRev";
+ const std::string os = "os";
+ const std::string os_ver = "osVersion";
+ const std::string carrier = "carrier";
+ const std::string max_number_rfcom_ports = "maxNumberRFCOMMPorts";
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ const smart_objects::SmartObject& device_info_so =
+ msg_params[strings::device_info];
+
+ if (device_info_so.keyExists(hardware)) {
+ device_info->hardware =
+ msg_params[strings::device_info][hardware].asString();
+ }
+ if (device_info_so.keyExists(firmware_rev)) {
+ device_info->firmware_rev =
+ msg_params[strings::device_info][firmware_rev].asString();
+ }
+ if (device_info_so.keyExists(os)) {
+ device_info->os = device_info_so[os].asString();
+ }
+ if (device_info_so.keyExists(os_ver)) {
+ device_info->os_ver = device_info_so[os_ver].asString();
+ }
+ if (device_info_so.keyExists(carrier)) {
+ device_info->carrier = device_info_so[carrier].asString();
+ }
+ if (device_info_so.keyExists(max_number_rfcom_ports)) {
+ device_info->max_number_rfcom_ports =
+ device_info_so[max_number_rfcom_ports].asInt();
+ }
+}
+
+bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const custom_string::CustomString mobile_app_id(
+ application_manager_.GetCorrectMobileIDFromMessage(message_));
+
+ const ApplicationSet& applications =
+ application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = applications.begin();
+ ApplicationSetConstIt it_end = applications.end();
+
+ for (; it != it_end; ++it) {
+ if (mobile_app_id.CompareIgnoreCase((*it)->policy_app_id().c_str())) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
+ return true;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ const smart_objects::SmartArray* tn_array =
+ (*message_)[strings::msg_params][strings::tts_name].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
+ smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
+
+ for (; it_tn != it_tn_end; ++it_tn) {
+ str = (*it_tn)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::ngn_media_screen_app_name)) {
+ str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid ngn_media_screen_app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
+ const smart_objects::SmartArray* vs_array =
+ (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
+ smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
+
+ for (; it_vs != it_vs_end; ++it_vs) {
+ str = (*it_vs).asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
+ str = (*message_)[strings::msg_params][strings::hash_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid hash_id syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::hardware)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::hardware].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info hardware syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::firmware_rev)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::firmware_rev].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info firmware_rev syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::os)) {
+ str = (*message_)[strings::msg_params][strings::device_info][strings::os]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid device_info os syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::os_version)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::os_version].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info os_version syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::carrier)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::carrier].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info carrier syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ str = (*message_)[strings::msg_params][strings::app_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
+ return true;
+ }
+ }
+
+ if (application_manager_.get_settings().use_full_app_id()) {
+ if ((*message_)[strings::msg_params].keyExists(strings::full_app_id)) {
+ str =
+ (*message_)[strings::msg_params][strings::full_app_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam(
+ smart_objects::SmartObject& vehicle_type,
+ const std::string& param,
+ const std::string& backup_value) {
+ using namespace hmi_response;
+ if (!vehicle_type.keyExists(param) || vehicle_type[param].empty()) {
+ if (!backup_value.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ param << " is missing."
+ "Will be replaced with policy table value.");
+ vehicle_type[param] = backup_value;
+ } else {
+ vehicle_type.erase(param);
+ }
+ }
+}
+
+void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::name] = Common_ButtonName::CUSTOM_BUTTON;
+ msg_params[strings::is_suscribed] = true;
+ CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
+}
+
+bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
+ const std::string& policy_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
+
+ LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id);
+
+ auto app = application_manager_.application_by_policy_id(policy_app_id);
+
+ if (!app) {
+ LOG4CXX_DEBUG(logger_,
+ "Application with policy id " << policy_app_id
+ << " is not found.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application with policy id " << policy_app_id << " is found.");
+ if (!application_manager_.IsAppInReconnectMode(policy_app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "Policy id " << policy_app_id
+ << " is not found in reconnection list.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Application is found in reconnection list.");
+
+ auto app_type = ApplicationType::kSwitchedApplicationWrongHashId;
+ if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
+ const auto hash_id =
+ (*message_)[strings::msg_params][strings::hash_id].asString();
+
+ auto& resume_ctrl = application_manager_.resume_controller();
+ if (resume_ctrl.CheckApplicationHash(app, hash_id)) {
+ app_type = ApplicationType::kSwitchedApplicationHashOk;
+ }
+ }
+
+ application_manager_.ProcessReconnection(app, connection_key());
+ SendRegisterAppInterfaceResponseToMobile(app_type);
+
+ application_manager_.SendHMIStatusNotification(app);
+
+ application_manager_.OnApplicationSwitched(app);
+
+ return true;
+}
+
+policy::PolicyHandlerInterface&
+RegisterAppInterfaceRequest::GetPolicyHandler() {
+ return policy_handler_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
new file mode 100644
index 0000000000..584d7db075
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
@@ -0,0 +1,131 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_response.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "connection_handler/connection_handler.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void RegisterAppInterfaceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
+ bool success = (*message_)[strings::msg_params][strings::success].asBool();
+ bool last_message = !success;
+ // Do not close connection in case of APPLICATION_NOT_REGISTERED despite it is
+ // an error
+ if (!success &&
+ (*message_)[strings::msg_params].keyExists(strings::result_code)) {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ (*message_)[strings::msg_params][strings::result_code].asInt());
+ if (result_code == mobile_apis::Result::APPLICATION_REGISTERED_ALREADY) {
+ last_message = false;
+ }
+ }
+
+ application_manager::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (app && app->msg_version() < utils::rpc_version_5 &&
+ app->is_media_application() &&
+ (*message_)[strings::msg_params].keyExists(
+ hmi_response::button_capabilities)) {
+ const smart_objects::SmartObject& button_caps =
+ (*message_)[strings::msg_params][hmi_response::button_capabilities];
+ auto it = button_caps.asArray()->begin();
+ auto ok_btn_it = it;
+ bool ok_btn_exists = false;
+ bool play_pause_btn_exists = false;
+ for (; it != button_caps.asArray()->end(); ++it) {
+ smart_objects::SmartObject& so = *it;
+ int64_t current_id = so[strings::name].asInt();
+ if (current_id == -1) {
+ continue;
+ }
+ const mobile_apis::ButtonName::eType current_button =
+ static_cast<mobile_apis::ButtonName::eType>(current_id);
+ if (current_button == mobile_apis::ButtonName::PLAY_PAUSE) {
+ play_pause_btn_exists = true;
+ so[strings::name] = mobile_apis::ButtonName::OK;
+ } else if (current_button == mobile_apis::ButtonName::OK) {
+ ok_btn_exists = true;
+ ok_btn_it = it;
+ }
+ }
+ if (ok_btn_exists && play_pause_btn_exists) {
+ button_caps.asArray()->erase(ok_btn_it);
+ }
+ }
+
+ SendResponse(success, result_code, last_message);
+
+ if (mobile_apis::Result::SUCCESS != result_code) {
+ return;
+ }
+
+ // Add registered application to the policy db right after response sent to
+ // mobile to be able to check all other API according to app permissions
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application with connection key " << connection_key()
+ << " is not registered.");
+ return;
+ }
+
+ SetHeartBeatTimeout(connection_key(), app->policy_app_id());
+}
+
+void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
+ uint32_t connection_key, const std::string& mobile_app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy::PolicyHandlerInterface& policy_handler = policy_handler_;
+ if (policy_handler.PolicyEnabled()) {
+ const uint32_t timeout = policy_handler.HeartBeatTimeout(mobile_app_id);
+ if (timeout > 0) {
+ application_manager_.connection_handler().SetHeartBeatTimeout(
+ connection_key, timeout);
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Policy is turn off");
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
new file mode 100644
index 0000000000..ab6e1cc143
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
@@ -0,0 +1,336 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest(
+ 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)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {}
+
+void ResetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ size_t obj_length =
+ (*message_)[strings::msg_params][strings::properties].length();
+ // if application waits for sending ttsGlobalProperties need to remove this
+ // application from tts_global_properties_app_list_
+ LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList");
+ application_manager_.RemoveAppFromTTSGlobalPropertiesList(app_id);
+
+ bool helpt_promt = false;
+ bool timeout_prompt = false;
+ bool vr_help_title_items = false;
+ bool menu_name = false;
+ bool menu_icon = false;
+ bool is_key_board_properties = false;
+ int number_of_reset_vr = 0;
+ mobile_apis::GlobalProperty::eType global_property =
+ mobile_apis::GlobalProperty::INVALID_ENUM;
+
+ for (size_t i = 0; i < obj_length; ++i) {
+ global_property = static_cast<mobile_apis::GlobalProperty::eType>(
+ (*message_)[strings::msg_params][strings::properties][i].asInt());
+
+ if (mobile_apis::GlobalProperty::HELPPROMPT == global_property) {
+ helpt_promt = ResetHelpPromt(app);
+ } else if (mobile_apis::GlobalProperty::TIMEOUTPROMPT == global_property) {
+ timeout_prompt = ResetTimeoutPromt(app);
+ } else if (((mobile_apis::GlobalProperty::VRHELPTITLE == global_property) ||
+ (mobile_apis::GlobalProperty::VRHELPITEMS ==
+ global_property)) &&
+ (0 == number_of_reset_vr)) {
+ ++number_of_reset_vr;
+ vr_help_title_items = ResetVrHelpTitleItems(app);
+ } else if (mobile_apis::GlobalProperty::MENUNAME == global_property) {
+ menu_name = true;
+ } else if (mobile_apis::GlobalProperty::MENUICON == global_property) {
+ menu_icon = true;
+ } else if (mobile_apis::GlobalProperty::KEYBOARDPROPERTIES ==
+ global_property) {
+ is_key_board_properties = true;
+ }
+ }
+
+ if (vr_help_title_items || menu_name || menu_icon ||
+ is_key_board_properties) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ }
+
+ if (timeout_prompt || helpt_promt) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ }
+
+ app->set_reset_global_properties_active(true);
+
+ if (vr_help_title_items || menu_name || menu_icon ||
+ is_key_board_properties) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (vr_help_title_items) {
+ smart_objects::SmartObjectSPtr vr_help =
+ MessageHelper::CreateAppVrHelp(app);
+ if (!vr_help) {
+ return;
+ }
+ msg_params = *vr_help;
+ }
+ if (menu_name) {
+ msg_params[hmi_request::menu_title] = "";
+ app->set_menu_title(msg_params[hmi_request::menu_title]);
+ }
+ // TODO(DT): clarify the sending parameter menuIcon
+ // if (menu_icon) {
+ //}
+ if (is_key_board_properties) {
+ smart_objects::SmartObject key_board_properties =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ key_board_properties[strings::language] =
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
+ key_board_properties[hmi_request::keyboard_layout] =
+ static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
+
+ // Look for APPLINK-4432 for details.
+ /*smart_objects::SmartObject limited_character_list =
+ smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ limited_character_list[0] = "";
+ key_board_properties[hmi_request::limited_character_list] =
+ limited_character_list;*/
+
+ key_board_properties[hmi_request::auto_complete_text] = "";
+ msg_params[hmi_request::keyboard_properties] = key_board_properties;
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_SetGlobalProperties, &msg_params, true);
+ }
+
+ if (timeout_prompt || helpt_promt) {
+ // create ui request
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (helpt_promt) {
+ msg_params[strings::help_prompt] = (*app->help_prompt());
+ }
+
+ if (timeout_prompt) {
+ msg_params[strings::timeout_prompt] = (*app->timeout_prompt());
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties, &msg_params, true);
+ }
+}
+
+bool ResetGlobalPropertiesRequest::ResetHelpPromt(
+ application_manager::ApplicationSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+ smart_objects::SmartObject so_help_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ app->set_help_prompt(so_help_prompt);
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::ResetTimeoutPromt(
+ application_manager::ApplicationSharedPtr const app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+
+ const std::vector<std::string>& time_out_promt =
+ application_manager_.get_settings().time_out_promt();
+
+ smart_objects::SmartObject so_time_out_promt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ for (uint32_t i = 0; i < time_out_promt.size(); ++i) {
+ smart_objects::SmartObject timeoutPrompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeoutPrompt[strings::text] = time_out_promt[i];
+ timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ so_time_out_promt[i] = timeoutPrompt;
+ }
+
+ app->set_timeout_prompt(so_time_out_promt);
+
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems(
+ application_manager::ApplicationSharedPtr const app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+ app->reset_vr_help_title();
+ app->reset_vr_help();
+
+ return true;
+}
+
+void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ LOG4CXX_DEBUG(logger_, "Waiting for remaining responses");
+ return;
+ }
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
+
+ SendResponse(result,
+ static_cast<mobile_apis::Result::eType>(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool ResetGlobalPropertiesRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& out_result_code,
+ std::string& out_response_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ bool result = false;
+ app_mngr::commands::ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+
+ HmiInterfaces::InterfaceState tts_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS);
+
+ if (hmi_apis::Common_Result::SUCCESS == ui_result_ &&
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_ &&
+ HmiInterfaces::STATE_AVAILABLE == tts_interface_state) {
+ result = true;
+ out_result_code = mobile_apis::Result::WARNINGS;
+ out_response_info = "Unsupported phoneme type sent in a prompt";
+ } else {
+ result =
+ PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
+ out_result_code =
+ PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
+ out_response_info = app_mngr::commands::MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ }
+
+ return result;
+}
+
+bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc
new file mode 100644
index 0000000000..f5542ab26b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse(
+ 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) {}
+
+ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {}
+
+void ResetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc
new file mode 100644
index 0000000000..0b28e09210
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc
@@ -0,0 +1,163 @@
+/*
+
+ 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 <string.h>
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ScrollableMessageRequest::ScrollableMessageRequest(
+ 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) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+ScrollableMessageRequest::~ScrollableMessageRequest() {}
+
+bool ScrollableMessageRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ } else {
+ const int32_t def_value = 30000;
+ default_timeout_ = def_value;
+ }
+
+ return true;
+}
+
+void ScrollableMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::message_text][hmi_request::field_name] =
+ static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::scrollableMessageBody);
+ msg_params[hmi_request::message_text][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::scroll_message_body];
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::timeout] = default_timeout_;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[strings::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_ScrollableMessage, &msg_params, true);
+}
+
+void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_ScrollableMessage: {
+ LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc
new file mode 100644
index 0000000000..4eee819497
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ScrollableMessageResponse::ScrollableMessageResponse(
+ 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) {}
+
+void ScrollableMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ (*message_)[strings::msg_params][strings::result_code].asInt());
+ ApplicationSharedPtr application = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asInt());
+ if ((mobile_apis::Result::REJECTED != result_code) && application) {
+ application->UnsubscribeFromSoftButtons(
+ (*message_)[strings::params][strings::function_id].asInt());
+ }
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc
new file mode 100644
index 0000000000..a09434ebb6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+SendHapticDataRequest::SendHapticDataRequest(
+ 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) {}
+
+SendHapticDataRequest::~SendHapticDataRequest() {}
+
+void SendHapticDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->is_navi() || app->mobile_projection_enabled()) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true);
+ } else {
+ SendResponse(false,
+ mobile_apis::Result::DISALLOWED,
+ "Application is not of type Navigation or Mobile Projection");
+ }
+}
+
+void SendHapticDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SendHapticData: {
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
+ result_code,
+ mobile_api::Result::SUCCESS,
+ mobile_api::Result::WARNINGS);
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc
new file mode 100644
index 0000000000..f4515472a4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SendHapticDataResponse::SendHapticDataResponse(
+ 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) {}
+
+SendHapticDataResponse::~SendHapticDataResponse() {}
+
+void SendHapticDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
new file mode 100644
index 0000000000..2719d0674d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
@@ -0,0 +1,284 @@
+/*
+
+ 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 <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/send_location_request.h"
+#include "application_manager/message_helper.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SendLocationRequest::SendLocationRequest(
+ 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) {}
+
+SendLocationRequest::~SendLocationRequest() {}
+
+void SendLocationRequest::Run() {
+ using namespace hmi_apis;
+ using smart_objects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ if (msg_params.keyExists(strings::delivery_mode)) {
+ const RPCParams& allowed_params = parameters_permissions().allowed_params;
+
+ if (helpers::in_range(allowed_params, strings::delivery_mode)) {
+ msg_params.erase(strings::delivery_mode);
+ }
+ }
+
+ std::vector<Common_TextFieldName::eType> fields_to_check;
+ if (msg_params.keyExists(strings::location_name)) {
+ fields_to_check.push_back(Common_TextFieldName::locationName);
+ }
+ if (msg_params.keyExists(strings::location_description)) {
+ fields_to_check.push_back(Common_TextFieldName::locationDescription);
+ }
+ if (msg_params.keyExists(strings::address_lines)) {
+ fields_to_check.push_back(Common_TextFieldName::addressLines);
+ }
+ if (msg_params.keyExists(strings::phone_number)) {
+ fields_to_check.push_back(Common_TextFieldName::phoneNumber);
+ }
+
+ if (!CheckHMICapabilities(fields_to_check)) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Strings contain invalid characters");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::address)) {
+ const utils::custom_string::CustomString& address =
+ msg_params[strings::address].asCustomString();
+ if (address.empty()) {
+ msg_params.erase(strings::address);
+ }
+ }
+
+ if (!CheckFieldsCompatibility()) {
+ LOG4CXX_ERROR(logger_, "CheckFieldsCompatibility failed");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::location_image)) {
+ mobile_apis::Result::eType verification_result =
+ mobile_apis::Result::SUCCESS;
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map);
+ request_msg_params = msg_params;
+ request_msg_params[strings::app_id] = app->hmi_app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_SendLocation, &request_msg_params, true);
+}
+
+void SendLocationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ const smart_objects::SmartObject& message = event.smart_object();
+ if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) {
+ LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const Common_Result::eType result_code = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::params]));
+ return;
+ }
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+}
+
+bool SendLocationRequest::CheckFieldsCompatibility() {
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+ MessageHelper::PrintSmartObject(msg_params);
+ const bool longitude_degrees_exist =
+ msg_params.keyExists(strings::longitude_degrees);
+ const bool latitude_degrees_exist =
+ msg_params.keyExists(strings::latitude_degrees);
+ const bool address_exist = msg_params.keyExists(strings::address);
+
+ if (latitude_degrees_exist ^ longitude_degrees_exist) {
+ LOG4CXX_DEBUG(logger_,
+ "latitude and longitude should be provided only in pair");
+ return false;
+ }
+
+ if (!address_exist && !longitude_degrees_exist && !latitude_degrees_exist) {
+ LOG4CXX_DEBUG(logger_,
+ "address or latitude/longtitude should should be provided");
+ return false;
+ }
+ return true;
+}
+void insert_if_contains(
+ const smart_objects::SmartObject& msg_params,
+ const std::string& param_key,
+ std::vector<utils::custom_string::CustomString>& output_vector) {
+ if (msg_params.keyExists(param_key)) {
+ output_vector.push_back(msg_params[param_key].asCustomString());
+ }
+}
+
+bool SendLocationRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<utils::custom_string::CustomString> fields_to_check;
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+ insert_if_contains(msg_params, strings::location_name, fields_to_check);
+ insert_if_contains(
+ msg_params, strings::location_description, fields_to_check);
+ insert_if_contains(msg_params, strings::phone_number, fields_to_check);
+
+ if (msg_params.keyExists(strings::address_lines)) {
+ const smart_objects::SmartArray* al_array =
+ msg_params[strings::address_lines].asArray();
+ smart_objects::SmartArray::const_iterator it_al = al_array->begin();
+ smart_objects::SmartArray::const_iterator it_al_end = al_array->end();
+ for (; it_al != it_al_end; ++it_al) {
+ const utils::custom_string::CustomString& val = (*it_al).asCustomString();
+ fields_to_check.push_back(val);
+ }
+ }
+
+ if (msg_params.keyExists(strings::address)) {
+ const smart_objects::SmartObject& address_so = msg_params[strings::address];
+ insert_if_contains(address_so, strings::country_name, fields_to_check);
+ insert_if_contains(address_so, strings::country_code, fields_to_check);
+ insert_if_contains(address_so, strings::postal_code, fields_to_check);
+ insert_if_contains(
+ address_so, strings::administrative_area, fields_to_check);
+ insert_if_contains(address_so, strings::locality, fields_to_check);
+ insert_if_contains(address_so, strings::sub_locality, fields_to_check);
+ insert_if_contains(address_so, strings::thoroughfare, fields_to_check);
+ insert_if_contains(address_so, strings::sub_thoroughfare, fields_to_check);
+ }
+
+ std::vector<utils::custom_string::CustomString>::iterator it =
+ fields_to_check.begin();
+ for (; it != fields_to_check.end(); ++it) {
+ const std::string& str = it->AsMBString();
+ if (!CheckSyntax(str, false)) {
+ LOG4CXX_ERROR(logger_,
+ "string '" << str << "'' contains invalid characters");
+ return true;
+ }
+ }
+ return false;
+}
+
+bool SendLocationRequest::CheckHMICapabilities(
+ std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+ if (fields_names.empty()) {
+ return true;
+ }
+
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ if (!hmi_capabilities.is_ui_cooperating()) {
+ LOG4CXX_ERROR(logger_, "UI is not supported.");
+ return false;
+ }
+
+ if (hmi_capabilities.display_capabilities()) {
+ const SmartObject disp_cap = (*hmi_capabilities.display_capabilities());
+ const SmartObject& text_fields =
+ disp_cap.getElement(hmi_response::text_fields);
+ const size_t len = text_fields.length();
+ for (size_t i = 0; i < len; ++i) {
+ const SmartObject& text_field = text_fields[i];
+ const Common_TextFieldName::eType filed_name =
+ static_cast<Common_TextFieldName::eType>(
+ text_field.getElement(strings::name).asInt());
+ const std::vector<Common_TextFieldName::eType>::iterator it =
+ std::find(fields_names.begin(), fields_names.end(), filed_name);
+ if (it != fields_names.end()) {
+ fields_names.erase(it);
+ }
+ }
+ }
+
+ if (!fields_names.empty()) {
+ LOG4CXX_ERROR(logger_, "Some fields are not supported by capabilities");
+ return false;
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc
new file mode 100644
index 0000000000..59dab4a9a7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/send_location_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SendLocationResponse::SendLocationResponse(
+ 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) {}
+
+SendLocationResponse::~SendLocationResponse() {}
+
+void SendLocationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
new file mode 100644
index 0000000000..e79fb315ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
@@ -0,0 +1,301 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h"
+#include <algorithm>
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetAppIconRequest::SetAppIconRequest(
+ 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)
+ , is_icons_saving_enabled_(false) {
+ const std::string path =
+ application_manager_.get_settings().app_icons_folder();
+ is_icons_saving_enabled_ = file_system::IsWritingAllowed(path) &&
+ file_system::IsReadingAllowed(path);
+}
+
+SetAppIconRequest::~SetAppIconRequest() {}
+
+void SetAppIconRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const std::string& sync_file_name =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ if (!file_system::IsFileNameValid(sync_file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
+ std::string full_file_path =
+ application_manager_.get_settings().app_storage_folder() + "/";
+ full_file_path += app->folder_name();
+ full_file_path += "/";
+ full_file_path += sync_file_name;
+
+ if (!file_system::FileExists(full_file_path)) {
+ LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::sync_file_name] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ // Panasonic requres unchanged path value without encoded special characters
+ const std::string full_file_path_for_hmi =
+ file_system::ConvertPathForURL(full_file_path);
+
+ msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
+
+ // TODO(VS): research why is image_type hardcoded
+ msg_params[strings::sync_file_name][strings::image_type] =
+ static_cast<int32_t>(SetAppIconRequest::ImageType::DYNAMIC);
+
+ // for further use in on_event function
+ (*message_)[strings::msg_params][strings::sync_file_name] =
+ msg_params[strings::sync_file_name];
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
+}
+
+void SetAppIconRequest::CopyToIconStorage(
+ const std::string& path_to_file) const {
+ if (!(application_manager_.protocol_handler()
+ .get_settings()
+ .max_supported_protocol_version() >=
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)) {
+ LOG4CXX_WARN(logger_,
+ "Icon copying skipped, since protocol ver. 4 is not enabled.");
+ return;
+ }
+
+ std::vector<uint8_t> file_content;
+ if (!file_system::ReadBinaryFile(path_to_file, file_content)) {
+ LOG4CXX_ERROR(logger_, "Can't read icon file: " << path_to_file);
+ return;
+ }
+
+ const std::string icon_storage =
+ application_manager_.get_settings().app_icons_folder();
+ const uint64_t storage_max_size = static_cast<uint64_t>(
+ application_manager_.get_settings().app_icons_folder_max_size());
+ const uint64_t file_size = file_system::FileSize(path_to_file);
+
+ if (storage_max_size < file_size) {
+ LOG4CXX_ERROR(logger_,
+ "Icon size (" << file_size << ") is bigger, than "
+ " icons storage maximum size ("
+ << storage_max_size << ")."
+ "Copying skipped.");
+ return;
+ }
+
+ const uint64_t storage_size =
+ static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
+ if (storage_max_size < (file_size + storage_size)) {
+ const uint32_t icons_amount =
+ application_manager_.get_settings().app_icons_amount_to_remove();
+
+ if (!icons_amount) {
+ LOG4CXX_DEBUG(logger_,
+ "No icons will be deleted, since amount icons to remove "
+ "is zero. Icon saving skipped.");
+ return;
+ }
+
+ while (!IsEnoughSpaceForIcon(file_size)) {
+ RemoveOldestIcons(icon_storage, icons_amount);
+ }
+ }
+ ApplicationConstSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Can't get application for connection key: " << connection_key());
+ return;
+ }
+
+ const std::string icon_path = icon_storage + "/" + app->policy_app_id();
+ if (!file_system::CreateFile(icon_path)) {
+ LOG4CXX_ERROR(logger_, "Can't create icon: " << icon_path);
+ return;
+ }
+
+ if (!file_system::Write(icon_path, file_content)) {
+ LOG4CXX_ERROR(logger_, "Can't write icon: " << icon_path);
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Icon was successfully copied from :" << path_to_file << " to "
+ << icon_path);
+
+ return;
+}
+
+void SetAppIconRequest::RemoveOldestIcons(const std::string& storage,
+ const uint32_t icons_amount) const {
+ const std::vector<std::string> icons_list = file_system::ListFiles(storage);
+ auto compareTime = [](const time_t t1, const time_t t2)
+ -> bool { return difftime(t1, t2) > 0; };
+ std::map<time_t,
+ std::string,
+ std::function<bool(const time_t, const time_t)> >
+ icon_modification_time(compareTime);
+ std::vector<std::string>::const_iterator it = icons_list.begin();
+ for (; it != icons_list.end(); ++it) {
+ const std::string file_name = *it;
+ const std::string file_path = storage + "/" + file_name;
+ if (!file_system::FileExists(file_path)) {
+ continue;
+ }
+ const time_t time = file_system::GetFileModificationTime(file_path);
+ icon_modification_time[time] = file_name;
+ }
+
+ for (size_t counter = 0; counter < icons_amount; ++counter) {
+ if (!icon_modification_time.size()) {
+ LOG4CXX_ERROR(logger_, "No more icons left for deletion.");
+ return;
+ }
+ const std::string file_name = icon_modification_time.begin()->second;
+ const std::string file_path = storage + "/" + file_name;
+ if (!file_system::DeleteFile(file_path)) {
+ LOG4CXX_DEBUG(logger_, "Error while deleting icon " << file_path);
+ }
+ icon_modification_time.erase(icon_modification_time.begin());
+ LOG4CXX_DEBUG(logger_,
+ "Old icon " << file_path << " was deleted successfully.");
+ }
+}
+
+bool SetAppIconRequest::IsEnoughSpaceForIcon(const uint64_t icon_size) const {
+ const std::string icon_storage =
+ application_manager_.get_settings().app_icons_folder();
+ const uint64_t storage_max_size = static_cast<uint64_t>(
+ application_manager_.get_settings().app_icons_folder_max_size());
+ const uint64_t storage_size =
+ static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
+ return storage_max_size >= (icon_size + storage_size);
+}
+
+void SetAppIconRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetAppIcon: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ GetInfo(message, response_info);
+ if (result) {
+ ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if ((message_.use_count() == 0) || (app.use_count() == 0)) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
+ }
+
+ const std::string& path =
+ (*message_)[strings::msg_params][strings::sync_file_name]
+ [strings::value].asString();
+
+ if (is_icons_saving_enabled_) {
+ CopyToIconStorage(path);
+ }
+
+ app->set_app_icon_path(path);
+
+ LOG4CXX_INFO(logger_,
+ "Icon path was set to '" << app->app_icon_path() << "'");
+ }
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc
new file mode 100644
index 0000000000..aa8731f062
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetAppIconResponse::SetAppIconResponse(
+ 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) {}
+
+SetAppIconResponse::~SetAppIconResponse() {}
+
+void SetAppIconResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
new file mode 100644
index 0000000000..32164b8f0e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
@@ -0,0 +1,173 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetDisplayLayoutRequest::SetDisplayLayoutRequest(
+ 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) {}
+
+SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {}
+
+void SetDisplayLayoutRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ std::string old_layout = app->display_layout();
+ std::string new_layout = "";
+
+ if (msg_params.keyExists(strings::display_layout)) {
+ new_layout = msg_params[strings::display_layout].asString();
+ }
+
+ if (new_layout != old_layout &&
+ !new_layout.empty()) { // Template switched, allow any color change
+ LOG4CXX_DEBUG(logger_,
+ "SetDisplayLayoutRequest New Layout: " << new_layout);
+ app->set_display_layout(new_layout);
+ } else {
+ LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest No Layout Change");
+ // Template layout is the same as previous layout
+ // Reject message if colors are set
+ if (msg_params.keyExists(strings::day_color_scheme) &&
+ app->day_color_scheme() != NULL &&
+ !(msg_params[strings::day_color_scheme] ==
+ *(app->day_color_scheme()))) {
+ // Color scheme param exists and has been previously set, do not allow
+ // color change
+ LOG4CXX_DEBUG(logger_, "Reject Day Color Scheme Change");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::night_color_scheme) &&
+ app->night_color_scheme() != NULL &&
+ !(msg_params[strings::night_color_scheme] ==
+ *(app->night_color_scheme()))) {
+ // Color scheme param exists and has been previously set, do not allow
+ // color change
+ LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ }
+
+ if (msg_params.keyExists(strings::day_color_scheme)) {
+ LOG4CXX_DEBUG(logger_, "Allow Day Color Scheme Change");
+ app->set_day_color_scheme(msg_params[strings::day_color_scheme]);
+ }
+
+ if (msg_params.keyExists(strings::night_color_scheme)) {
+ LOG4CXX_DEBUG(logger_, "Allow Night Color Scheme Change");
+ app->set_night_color_scheme(msg_params[strings::night_color_scheme]);
+ }
+
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout,
+ &((*message_)[strings::msg_params]),
+ true);
+}
+
+void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetDisplayLayout: {
+ LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool response_success = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string info;
+ GetInfo(message, info);
+ smart_objects::SmartObject msg_params = message[strings::msg_params];
+ if (response_success) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ // in case templates_available is empty copy from hmi capabilities
+ if (msg_params.keyExists(hmi_response::display_capabilities)) {
+ if (0 ==
+ msg_params[hmi_response::display_capabilities]
+ [hmi_response::templates_available].length()) {
+ msg_params[hmi_response::display_capabilities]
+ [hmi_response::templates_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::templates_available);
+ }
+ }
+ }
+ SendResponse(response_success,
+ MessageHelper::HMIToMobileResult(result_code),
+ info.empty() ? NULL : info.c_str(),
+ &msg_params);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc
new file mode 100644
index 0000000000..4bab4a3e5b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetDisplayLayoutResponse::SetDisplayLayoutResponse(
+ 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) {}
+
+SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {}
+
+void SetDisplayLayoutResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
new file mode 100644
index 0000000000..0c217b6b4f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
@@ -0,0 +1,568 @@
+/*
+ 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 <string.h>
+#include <numeric>
+#include <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetGlobalPropertiesRequest::SetGlobalPropertiesRequest(
+ 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)
+ , is_ui_send_(false)
+ , is_tts_send_(false)
+ , is_ui_received_(false)
+ , is_tts_received_(false)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {}
+
+void SetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "No application associated with connection key "
+ << connection_key());
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (!ValidateConditionalMandatoryParameters(msg_params)) {
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "There are no parameters present in request.");
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::menu_icon],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(
+ logger_, "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+ // Check for image file(s) in vrHelpItem
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ if (mobile_apis::Result::INVALID_DATA ==
+ MessageHelper::VerifyImageVrHelpItems(
+ (*message_)[strings::msg_params][strings::vr_help],
+ app,
+ application_manager_)) {
+ LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "White spaces found");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // if application waits for sending ttsGlobalProperties need to remove this
+ // application from tts_global_properties_app_list_
+ application_manager_.RemoveAppFromTTSGlobalPropertiesList(connection_key());
+ bool is_help_prompt_present = msg_params.keyExists(strings::help_prompt);
+ bool is_timeout_prompt_present =
+ msg_params.keyExists(strings::timeout_prompt);
+ bool is_vr_help_title_present = msg_params.keyExists(strings::vr_help_title);
+ bool is_vr_help_present = msg_params.keyExists(strings::vr_help);
+
+ // check VR params
+ if (is_vr_help_title_present ^ is_vr_help_present) {
+ LOG4CXX_ERROR(logger_,
+ "Reject because of vr_help or vr_help_title only provided");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ /* Need to set flags before sending request to HMI
+ * for correct processing this flags in method on_event */
+ if (is_help_prompt_present || is_timeout_prompt_present) {
+ is_tts_send_ = true;
+ }
+ if (is_vr_help_title_present && is_vr_help_present) {
+ LOG4CXX_DEBUG(logger_, "VRHelp params presents");
+
+ if (!CheckVrHelpItemsOrder(msg_params[strings::vr_help])) {
+ LOG4CXX_ERROR(logger_,
+ "VR Help Items contains nonsequential positions"
+ << " (e.g. [1,2,4]) or not started from 1");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ PrepareUIRequestVRHelpData(app, msg_params, params);
+ PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
+
+ params[strings::app_id] = app->app_id();
+ SendUIRequest(params, true);
+
+ auto& help_prompt_manager = app->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(params, false);
+ } else {
+ LOG4CXX_DEBUG(logger_, "VRHelp params does not present");
+ DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present);
+
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
+
+ // Preparing data
+ if (params.empty()) {
+ LOG4CXX_DEBUG(logger_, "No UI info provided");
+ } else {
+ params[strings::app_id] = app->app_id();
+ SendUIRequest(params, true);
+ }
+ }
+
+ // check TTS params
+ if (is_help_prompt_present || is_timeout_prompt_present) {
+ LOG4CXX_DEBUG(logger_, "TTS params presents");
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ std::vector<std::string> invalid_params;
+ if (is_help_prompt_present) {
+ smart_objects::SmartObject& help_prompt =
+ (*message_)[strings::msg_params][strings::help_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("help_prompt");
+ } else {
+ app->set_help_prompt(help_prompt);
+ params[strings::help_prompt] = (*app->help_prompt());
+ }
+ }
+
+ if (is_timeout_prompt_present) {
+ smart_objects::SmartObject& timeout_prompt =
+ (*message_)[strings::msg_params][strings::timeout_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ timeout_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("timeout_prompt");
+ } else {
+ app->set_timeout_prompt(timeout_prompt);
+ params[strings::timeout_prompt] = (*app->timeout_prompt());
+ }
+ }
+
+ if (!invalid_params.empty()) {
+ std::string params_list = std::accumulate(
+ std::begin(invalid_params),
+ std::end(invalid_params),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ const std::string info =
+ "One or more files needed for " + params_list + " are not present";
+ SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, info.c_str());
+ return;
+ }
+
+ params[strings::app_id] = app->app_id();
+ SendTTSRequest(params, true);
+
+ auto& help_prompt_manager = app->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(params, false);
+ }
+}
+
+bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder(
+ const smart_objects::SmartObject& vr_help) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(vr_help.getType() == smart_objects::SmartType_Array, false);
+ const size_t vr_help_length = vr_help.length();
+ DCHECK_OR_RETURN(vr_help_length > 0, false);
+
+ for (size_t j = 0; j < vr_help_length; ++j) {
+ const size_t position =
+ vr_help.getElement(j).getElement(strings::position).asUInt();
+ // Elements shall start from 1 and increment one by one
+ if (position != (j + 1)) {
+ LOG4CXX_ERROR(logger_,
+ "VR help items order is wrong"
+ << " at " << j << ", position value:" << position);
+ return false;
+ }
+ }
+ return true;
+}
+
+void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
+ if (application.use_count() != 0) {
+ auto& help_prompt_manager = application->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(message, true);
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ is_tts_received_ = true;
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ if (application.use_count() != 0) {
+ auto& help_prompt_manager = application->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(message, true);
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ LOG4CXX_DEBUG(logger_, "Continue waiting for response");
+ return;
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
+
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool SetGlobalPropertiesRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool SetGlobalPropertiesRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ app_mngr::commands::ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+
+ app_mngr::commands::ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
+ if (result &&
+ (HmiInterfaces::STATE_AVAILABLE == tts_properties_info.interface_state) &&
+ (tts_properties_info.is_unsupported_resource)) {
+ result_code = mobile_apis::Result::WARNINGS;
+ tts_response_info_ = "Unsupported phoneme type sent in a prompt";
+ info = app_mngr::commands::MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ return result;
+ }
+ result_code =
+ PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
+ info = app_mngr::commands::MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ return result;
+}
+
+void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData(
+ const ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+
+ app->set_vr_help_title(msg_params.getElement(strings::vr_help_title));
+ app->set_vr_help(msg_params.getElement(strings::vr_help));
+
+ out_params[strings::vr_help_title] = (*app->vr_help_title());
+ out_params[strings::vr_help] = (*app->vr_help());
+}
+
+void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData(
+ const ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+
+ const bool is_menu_title_present =
+ msg_params.keyExists(hmi_request::menu_title);
+ const bool is_menu_icon_present =
+ msg_params.keyExists(hmi_request::menu_icon);
+ const bool is_keyboard_props_present =
+ msg_params.keyExists(hmi_request::keyboard_properties);
+
+ if (is_menu_title_present) {
+ out_params[hmi_request::menu_title] =
+ msg_params[hmi_request::menu_title].asString();
+ app->set_menu_title(msg_params[hmi_request::menu_title]);
+ }
+ if (is_menu_icon_present) {
+ out_params[hmi_request::menu_icon] = msg_params[hmi_request::menu_icon];
+ app->set_menu_icon(msg_params[hmi_request::menu_icon]);
+ }
+ if (is_keyboard_props_present) {
+ out_params[hmi_request::keyboard_properties] =
+ msg_params[hmi_request::keyboard_properties];
+ app->set_keyboard_props(msg_params[hmi_request::keyboard_properties]);
+ }
+}
+
+void SetGlobalPropertiesRequest::SendTTSRequest(
+ const smart_objects::SmartObject& params, bool use_events) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_tts_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties, &params, use_events);
+}
+
+void SetGlobalPropertiesRequest::SendUIRequest(
+ const smart_objects::SmartObject& params, bool use_events) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_ui_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_SetGlobalProperties, &params, use_events);
+}
+
+bool SetGlobalPropertiesRequest::IsPendingResponseExist() {
+ return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
+}
+
+bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(
+ const smart_objects::SmartObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return params.keyExists(strings::help_prompt) ||
+ params.keyExists(strings::timeout_prompt) ||
+ params.keyExists(strings::vr_help_title) ||
+ params.keyExists(strings::vr_help) ||
+ params.keyExists(strings::menu_title) ||
+ params.keyExists(strings::menu_icon) ||
+ params.keyExists(strings::keyboard_properties);
+}
+
+bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str;
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params.keyExists(strings::help_prompt)) {
+ const smart_objects::SmartArray* hp_array =
+ msg_params[strings::help_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
+ smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
+
+ for (; it_hp != it_hp_end; ++it_hp) {
+ str = (*it_hp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::timeout_prompt)) {
+ const smart_objects::SmartArray* tp_array =
+ msg_params[strings::timeout_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
+ smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
+
+ for (; it_tp != it_tp_end; ++it_tp) {
+ str = (*it_tp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::vr_help)) {
+ const smart_objects::SmartArray* vh_array =
+ msg_params[strings::vr_help].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
+ smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
+
+ for (; it_vh != it_vh_end; ++it_vh) {
+ str = (*it_vh)[strings::text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help text syntax check failed");
+ return true;
+ }
+
+ if ((*it_vh).keyExists(strings::image)) {
+ str = (*it_vh)[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid vr_help image value syntax check failed");
+ return true;
+ }
+ } // if image exists
+ } // for - vh_array iteration
+ }
+
+ if (msg_params.keyExists(strings::menu_icon)) {
+ str = msg_params[strings::menu_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::vr_help_title)) {
+ str = msg_params[strings::vr_help_title].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help_title value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::menu_title)) {
+ str = msg_params[strings::menu_title].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_title value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::keyboard_properties)) {
+ if (msg_params[strings::keyboard_properties].keyExists(
+ strings::limited_character_list)) {
+ const smart_objects::SmartArray* lcl_array =
+ msg_params[strings::keyboard_properties]
+ [strings::limited_character_list].asArray();
+
+ smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin();
+ smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end();
+
+ for (; it_lcl != it_lcl_end; ++it_lcl) {
+ str = (*it_lcl).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid keyboard_properties "
+ "limited_character_list syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params[strings::keyboard_properties].keyExists(
+ strings::auto_complete_text)) {
+ str =
+ msg_params[strings::keyboard_properties][strings::auto_complete_text]
+ .asCharArray();
+
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid keyboard_properties "
+ "auto_complete_text syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc
new file mode 100644
index 0000000000..567a1a088b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetGlobalPropertiesResponse::SetGlobalPropertiesResponse(
+ 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) {}
+
+SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {}
+
+void SetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc
new file mode 100644
index 0000000000..55bd164368
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc
@@ -0,0 +1,166 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetMediaClockRequest::SetMediaClockRequest(
+ 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) {}
+
+SetMediaClockRequest::~SetMediaClockRequest() {}
+
+void SetMediaClockRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if (!app->is_media_application()) {
+ LOG4CXX_ERROR(logger_, "Application is not media application");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (isDataValid()) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ // copy entirely msg
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_SetMediaClockTimer, &msg_params, true);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void SetMediaClockRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool SetMediaClockRequest::isDataValid() {
+ smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
+ mobile_apis::UpdateMode::eType update_mode =
+ static_cast<mobile_apis::UpdateMode::eType>(
+ msg_params[strings::update_mode].asUInt());
+
+ if (update_mode == mobile_apis::UpdateMode::COUNTUP ||
+ update_mode == mobile_apis::UpdateMode::COUNTDOWN) {
+ if (!msg_params.keyExists(strings::start_time)) {
+ LOG4CXX_INFO(logger_, "Invalid data");
+ return false;
+ }
+
+ if (msg_params.keyExists(strings::end_time)) {
+ unsigned int start_time_in_seconds = 0;
+ start_time_in_seconds =
+ (msg_params[strings::start_time][strings::hours].asUInt()) * 3600;
+ start_time_in_seconds +=
+ (msg_params[strings::start_time][strings::minutes].asUInt()) * 60;
+ start_time_in_seconds +=
+ (msg_params[strings::start_time][strings::seconds].asUInt());
+
+ unsigned int end_time_in_seconds = 0;
+ end_time_in_seconds =
+ (msg_params[strings::end_time][strings::hours].asUInt()) * 3600;
+ end_time_in_seconds +=
+ (msg_params[strings::end_time][strings::minutes].asUInt()) * 60;
+ end_time_in_seconds +=
+ (msg_params[strings::end_time][strings::seconds].asUInt());
+
+ if (((end_time_in_seconds > start_time_in_seconds) &&
+ (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) ||
+ ((end_time_in_seconds < start_time_in_seconds) &&
+ (update_mode == mobile_apis::UpdateMode::COUNTUP))) {
+ LOG4CXX_INFO(logger_, "Invalid data");
+ return false;
+ }
+ }
+ }
+
+ LOG4CXX_INFO(logger_, "Data is valid");
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc
new file mode 100644
index 0000000000..e777533ce4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetMediaClockTimerResponse::SetMediaClockTimerResponse(
+ 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) {}
+
+SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {}
+
+void SetMediaClockTimerResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
new file mode 100644
index 0000000000..3b2936e6cd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
@@ -0,0 +1,292 @@
+/*
+
+ 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 <cstring>
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowConstantTBTRequest::ShowConstantTBTRequest(
+ 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) {}
+
+ShowConstantTBTRequest::~ShowConstantTBTRequest() {}
+
+void ShowConstantTBTRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+ // SDLAQ-CRS-664, VC3.1
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming show constant TBT has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons(
+ msg_params, app, policy_handler_, application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
+ if (msg_params.keyExists(strings::turn_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ msg_params[strings::turn_icon], app, application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if (msg_params.keyExists(strings::next_turn_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ msg_params[strings::next_turn_icon], app, application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ msg_params[hmi_request::navi_texts] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ if (msg_params.keyExists(strings::navigation_text_1)) {
+ // erase useless parametr
+ msg_params.erase(strings::navigation_text_1);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText1);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::navigation_text_1];
+ }
+
+ if (msg_params.keyExists(strings::navigation_text_2)) {
+ // erase useless param
+ msg_params.erase(strings::navigation_text_2);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText2);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::navigation_text_2];
+ }
+
+ if (msg_params.keyExists(strings::eta)) {
+ // erase useless param
+ msg_params.erase(strings::eta);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::ETA);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::eta];
+ }
+
+ if (msg_params.keyExists(strings::total_distance)) {
+ // erase useless param
+ msg_params.erase(strings::total_distance);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::totalDistance);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::total_distance];
+ }
+
+ if (msg_params.keyExists(strings::time_to_destination)) {
+ // erase useless param
+ msg_params.erase(strings::time_to_destination);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::time_to_destination];
+ }
+
+ if (msg_params.keyExists(strings::soft_buttons)) {
+ MessageHelper::SubscribeApplicationToSoftButton(
+ msg_params, app, function_id());
+ }
+
+ app->set_tbt_show_command(msg_params);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, true);
+}
+
+void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
+ LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const Common_Result::eType result_code =
+ static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) {
+ str = (*message_)[strings::msg_params][strings::turn_icon][strings::value]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid turn_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::next_turn_icon)) {
+ str = (*message_)[strings::msg_params][strings::next_turn_icon]
+ [strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid next_turn_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_1)) {
+ str = (*message_)[strings::msg_params][strings::navigation_text_1]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid navigation_text_1 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_2)) {
+ str = (*message_)[strings::msg_params][strings::navigation_text_2]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid navigation_text_2 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::eta)) {
+ str = (*message_)[strings::msg_params][strings::eta].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid eta value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::total_distance)) {
+ str =
+ (*message_)[strings::msg_params][strings::total_distance].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid total_distance value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::time_to_destination)) {
+ str = (*message_)[strings::msg_params][strings::time_to_destination]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid time_to_destination value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc
new file mode 100644
index 0000000000..239040a3b3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowConstantTBTResponse::ShowConstantTBTResponse(
+ 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) {}
+
+ShowConstantTBTResponse::~ShowConstantTBTResponse() {}
+
+void ShowConstantTBTResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
new file mode 100644
index 0000000000..e0c3e1da9a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
@@ -0,0 +1,413 @@
+/*
+
+ 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 <string.h>
+#include "sdl_rpc_plugin/commands/mobile/show_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowRequest::ShowRequest(
+ 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)
+ , core_result_code_(mobile_apis::Result::INVALID_ENUM) {}
+
+ShowRequest::~ShowRequest() {}
+
+void ShowRequest::HandleMetadata(const char* field_id,
+ int32_t field_index,
+ smart_objects::SmartObject& msg_params) {
+ smart_objects::SmartObject& metadata_tags =
+ (*message_)[strings::msg_params][strings::metadata_tags];
+
+ if (metadata_tags.keyExists(field_id)) {
+ if (field_index != -1) {
+ msg_params[hmi_request::show_strings][field_index]
+ [hmi_request::field_types] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ const size_t num_tags = metadata_tags[field_id].length();
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = metadata_tags[field_id][i].asInt();
+ msg_params[hmi_request::show_strings][field_index]
+ [hmi_request::field_types][i] = current_tag;
+ }
+ } else {
+ LOG4CXX_INFO(logger_,
+ "metadata tag provided with no item for "
+ << field_id << ", ignoring with warning");
+ // tag provided with no item, ignore with warning
+ if (mobile_apis::Result::INVALID_ENUM == core_result_code_) {
+ core_result_code_ = mobile_apis::Result::WARNINGS;
+ core_response_info_ =
+ "Metadata tag was provided for a field with no data.";
+ }
+ }
+ } else {
+ LOG4CXX_INFO(logger_,
+ "No metadata tagging provided for field: " << field_id);
+ }
+}
+
+void ShowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ // SDLAQ-CRS-494, VC3.1
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (!CheckStringsOfShowRequest()) {
+ LOG4CXX_ERROR(logger_, "Incorrect characters in string");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result = mobile_apis::Result::SUCCESS;
+ if (((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
+ ((*message_)[strings::msg_params][strings::soft_buttons].length() > 0)) {
+ processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+ }
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Processing of soft buttons failed.");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
+ if (((*message_)[strings::msg_params].keyExists(strings::graphic)) &&
+ ((*message_)[strings::msg_params][strings::graphic][strings::value]
+ .asString()).length()) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::graphic],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::secondary_graphic],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+
+ msg_params[hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ int32_t main_field_1_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField1);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_1];
+ main_field_1_index = index;
+ ++index;
+ }
+
+ int32_t main_field_2_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField2);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_2];
+ main_field_2_index = index;
+ ++index;
+ }
+
+ int32_t main_field_3_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField3);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_3];
+ main_field_3_index = index;
+ ++index;
+ }
+
+ int32_t main_field_4_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField4);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_4];
+ main_field_4_index = index;
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::metadata_tags)) {
+ HandleMetadata(strings::main_field_1, main_field_1_index, msg_params);
+ HandleMetadata(strings::main_field_2, main_field_2_index, msg_params);
+ HandleMetadata(strings::main_field_3, main_field_3_index, msg_params);
+ HandleMetadata(strings::main_field_4, main_field_4_index, msg_params);
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaClock);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::media_clock];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaTrack);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::media_track];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::statusBar);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::status_bar];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alignment)) {
+ msg_params[strings::alignment] =
+ (*message_)[strings::msg_params][strings::alignment];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
+ msg_params[strings::graphic] =
+ (*message_)[strings::msg_params][strings::graphic];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ msg_params[strings::secondary_graphic] =
+ (*message_)[strings::msg_params][strings::secondary_graphic];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[strings::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ if ((*message_)[strings::msg_params][strings::soft_buttons].length() == 0) {
+ app->UnsubscribeFromSoftButtons(function_id());
+ } else {
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
+ msg_params[strings::custom_presets] =
+ (*message_)[strings::msg_params][strings::custom_presets];
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
+
+ app_mngr::commands::MessageSharedPtr persistentData =
+ std::make_shared<smart_objects::SmartObject>(msg_params);
+ app->set_show_command(*persistentData);
+}
+
+void ShowRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_Show: {
+ LOG4CXX_DEBUG(logger_, "Received UI_Show event.");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ GetInfo(message, response_info);
+ if (hmi_apis::Common_Result::WARNINGS == result_code &&
+ message[strings::params].keyExists(hmi_response::message)) {
+ response_info =
+ message[strings::params][hmi_response::message].asString();
+ }
+ mobile_apis::Result::eType converted_result_code =
+ MessageHelper::HMIToMobileResult(result_code);
+ if (mobile_apis::Result::SUCCESS == converted_result_code &&
+ mobile_apis::Result::INVALID_ENUM != core_result_code_) {
+ converted_result_code = core_result_code_;
+ response_info = core_response_info_;
+ }
+ SendResponse(result,
+ converted_result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event " << event.id());
+ break;
+ }
+ }
+}
+
+bool ShowRequest::CheckStringsOfShowRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
+ str = (*message_)[strings::msg_params][strings::main_field_4].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_4 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
+ str = (*message_)[strings::msg_params][strings::main_field_3].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_3 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
+ str = (*message_)[strings::msg_params][strings::main_field_2].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_2 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
+ str = (*message_)[strings::msg_params][strings::main_field_1].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_1 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
+ str = (*message_)[strings::msg_params][strings::status_bar].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid status_bar syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
+ str = (*message_)[strings::msg_params][strings::media_clock].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid media_clock syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
+ str = (*message_)[strings::msg_params][strings::media_track].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid media_track syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
+ smart_objects::SmartObject& custom_presets_array =
+ (*message_)[strings::msg_params][strings::custom_presets];
+ for (size_t i = 0; i < custom_presets_array.length(); ++i) {
+ str = custom_presets_array[i].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed");
+ return false;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
+ str = (*message_)[strings::msg_params][strings::graphic][strings::value]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid graphic value syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ str = (*message_)[strings::msg_params][strings::secondary_graphic]
+ [strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid secondary_graphic value syntax check failed");
+ return false;
+ }
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc
new file mode 100644
index 0000000000..4e167e7531
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/show_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowResponse::ShowResponse(
+ 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) {}
+
+ShowResponse::~ShowResponse() {}
+
+void ShowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc
new file mode 100644
index 0000000000..08b4775d3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc
@@ -0,0 +1,207 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/slider_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+#include "config_profile/profile.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SliderRequest::SliderRequest(
+ 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) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+SliderRequest::~SliderRequest() {}
+
+bool SliderRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ application_manager_.get_settings().default_timeout() +
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ }
+
+ return true;
+}
+
+void SliderRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params][strings::num_ticks].asInt() <
+ (*message_)[strings::msg_params][strings::position].asInt()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
+ if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) {
+ if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() !=
+ (*message_)[strings::msg_params][strings::slider_footer].length()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Incoming slider has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = application->app_id();
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true);
+}
+
+void SliderRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ const SmartObject& message = event.smart_object();
+
+ const event_engine::Event::EventID event_id = event.id();
+ if (event_id == FunctionID::UI_OnResetTimeout) {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ return;
+ }
+
+ if (event_id != FunctionID::UI_Slider) {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Received UI_Slider event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ const Common_Result::eType response_code = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ SmartObject response_msg_params = message[strings::msg_params];
+
+ const bool is_timeout_aborted = Compare<Common_Result::eType, EQ, ONE>(
+ response_code, Common_Result::TIMED_OUT, Common_Result::ABORTED);
+
+ if (is_timeout_aborted) {
+ if (message[strings::params][strings::data].keyExists(
+ strings::slider_position)) {
+ // Copy slider_position info to msg_params section
+ response_msg_params[strings::slider_position] =
+ message[strings::params][strings::data][strings::slider_position];
+ } else {
+ LOG4CXX_ERROR(logger_,
+ strings::slider_position << " field is absent"
+ " in response.");
+ response_msg_params[strings::slider_position] = 0;
+ }
+ }
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool is_response_success = PrepareResultForMobileResponse(
+ response_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendResponse(is_response_success,
+ MessageHelper::HMIToMobileResult(response_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &response_msg_params);
+}
+
+bool SliderRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::slider_header].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid slider_header value syntax check failed");
+ return true;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
+ const smart_objects::SmartArray* sf_array =
+ (*message_)[strings::msg_params][strings::slider_footer].asArray();
+
+ smart_objects::SmartArray::const_iterator it_sf = sf_array->begin();
+ smart_objects::SmartArray::const_iterator it_sf_end = sf_array->end();
+
+ for (; it_sf != it_sf_end; ++it_sf) {
+ str = (*it_sf).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid slider_footer syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc
new file mode 100644
index 0000000000..4d6e714e88
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/slider_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SliderResponse::SliderResponse(
+ 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) {}
+
+SliderResponse::~SliderResponse() {}
+
+void SliderResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc
new file mode 100644
index 0000000000..e14321c488
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc
@@ -0,0 +1,184 @@
+/*
+
+ 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 <string.h>
+#include "sdl_rpc_plugin/commands/mobile/speak_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SpeakRequest::SpeakRequest(
+ 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) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+SpeakRequest::~SpeakRequest() {}
+
+void SpeakRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming speak has contains \\t\\n \\\\t \\\\n "
+ " text contains only whitespace in ttsChunks");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject& tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_chunks are not present");
+ return;
+ }
+
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ (*message_)[strings::msg_params][hmi_request::speak_type] =
+ hmi_apis::Common_MethodName::SPEAK;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak,
+ &message_->getElement(strings::msg_params),
+ true);
+}
+
+void SpeakRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ ProcessTTSSpeakResponse(event.smart_object());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+void SpeakRequest::ProcessTTSSpeakResponse(
+ const smart_objects::SmartObject& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result_code);
+
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result_code, HmiInterfaces::HMI_INTERFACE_TTS);
+
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::SpeakID;
+
+ const char* return_info = NULL;
+
+ SendResponse(
+ result, result_code, return_info, &(message[strings::msg_params]));
+}
+
+bool SpeakRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ const smart_objects::SmartArray* tc_array =
+ (*message_)[strings::msg_params][strings::tts_chunks].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
+ smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
+
+ for (; it_tc != it_tc_end; ++it_tc) {
+ str = (*it_tc)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc
new file mode 100644
index 0000000000..f57bd91cd5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/speak_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SpeakResponse::SpeakResponse(
+ 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) {}
+
+SpeakResponse::~SpeakResponse() {}
+
+void SpeakResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
new file mode 100644
index 0000000000..f76b6ab210
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
@@ -0,0 +1,147 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_request.h"
+#include "utils/semantic_version.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+SubscribeButtonRequest::SubscribeButtonRequest(
+ 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) {}
+
+SubscribeButtonRequest::~SubscribeButtonRequest() {}
+
+void SubscribeButtonRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[str::msg_params][str::button_name].asInt());
+
+ if (!IsSubscriptionAllowed(app, btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Subscribe on button " << btn_id << " isn't allowed");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (app->msg_version() < utils::rpc_version_5 &&
+ btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
+ bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
+ bool play_pause_supported =
+ CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE);
+ if (play_pause_supported) {
+ LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE");
+ btn_id = mobile_apis::ButtonName::PLAY_PAUSE;
+ (*message_)[str::msg_params][str::button_name] = btn_id;
+ } else if (!ok_supported) {
+ LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ }
+ } else if (!CheckHMICapabilities(btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Subscribe on button "
+ << btn_id << " isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+
+ if (app->IsSubscribedToButton(btn_id)) {
+ LOG4CXX_ERROR(logger_, "Already subscribed to button " << btn_id);
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ app->SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
+ SendSubscribeButtonNotification();
+
+ const bool is_succedeed = true;
+ SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
+}
+
+bool SubscribeButtonRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool SubscribeButtonRequest::IsSubscriptionAllowed(
+ ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
+ if (!app->is_media_application() &&
+ ((mobile_apis::ButtonName::PLAY_PAUSE == btn_id) ||
+ (mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
+ (mobile_apis::ButtonName::SEEKRIGHT == btn_id) ||
+ (mobile_apis::ButtonName::TUNEUP == btn_id) ||
+ (mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
+ return false;
+ }
+ return true;
+}
+
+void SubscribeButtonRequest::SendSubscribeButtonNotification() {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ // send OnButtonSubscription notification
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
+ (*message_)[strings::msg_params][strings::button_name].asUInt());
+ msg_params[strings::is_suscribed] = true;
+ CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc
new file mode 100644
index 0000000000..1350cfb66e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc
@@ -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.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SubscribeButtonResponse::SubscribeButtonResponse(
+ 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) {}
+
+SubscribeButtonResponse::~SubscribeButtonResponse() {}
+
+void SubscribeButtonResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ // TODO(DK): Some logic
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc
new file mode 100644
index 0000000000..eb4ca42568
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc
@@ -0,0 +1,123 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SubscribeWayPointsRequest::SubscribeWayPointsRequest(
+ 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) {}
+
+SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {}
+
+void SubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (application_manager_.IsAppSubscribedForWayPoints(app)) {
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ if (application_manager_.IsAnyAppSubscribedForWayPoints()) {
+ application_manager_.SubscribeAppForWayPoints(app);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, true);
+}
+
+void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
+ LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ if (result) {
+ application_manager_.SubscribeAppForWayPoints(app);
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool SubscribeWayPointsRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc
new file mode 100644
index 0000000000..7d051df7e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SubscribeWayPointsResponse::SubscribeWayPointsResponse(
+ 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) {}
+
+SubscribeWayPointsResponse::~SubscribeWayPointsResponse() {}
+
+void SubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
new file mode 100644
index 0000000000..cea00a9d5e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
@@ -0,0 +1,700 @@
+/*
+
+Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/system_request.h"
+
+#include <vector>
+#include <string>
+#include <stdio.h>
+#include <algorithm>
+#include <sstream>
+#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+#include "policy/policy_table/enums.h"
+#include "formatters/CFormatterJsonBase.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+CREATE_LOGGERPTR_LOCAL(logger_, "ApplicationManager")
+namespace {
+
+#ifdef ENABLE_LOG
+const char* kQueryAppsValidationFailedPrefix =
+ ":QUERY_APPS_VALIDATION_FAILED: ";
+#endif
+
+const unsigned int kVrSynonymLengthMax = 40U;
+const unsigned int kVrSynonymLengthMin = 1U;
+const unsigned int kTtsNameLengthMax = 500U;
+const unsigned int kVrArraySizeMax = 100U;
+const unsigned int kVrArraySizeMin = 1U;
+const unsigned int kUrlSchemaLengthMax = 255U;
+const unsigned int kPackageNameLengthMax = 255U;
+const unsigned int kAppIdLengthMax = 40U;
+const unsigned int kAppNameLengthMax = 100U;
+const unsigned int kLanguageArraySizeMax = 100U;
+
+class QueryAppsDataValidator {
+ public:
+ typedef std::set<std::string> SynonymsSet;
+ typedef std::map<std::string, SynonymsSet> SynonymsMap;
+
+ QueryAppsDataValidator(smart_objects::SmartObject& object,
+ const ApplicationManager& manager)
+ : data_(object), manager_(manager) {}
+
+ bool Validate() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!data_.isValid()) {
+ LOG4CXX_ERROR(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response is not valid.");
+ return false;
+ }
+ if (!HasResponseKey()) {
+ return false;
+ }
+ return ValidateAppDataAndOsAndLanguagesData();
+ }
+
+ private:
+ bool HasResponseKey() const {
+ if (!data_.keyExists(json::response)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response does not contain '"
+ << json::response << "' parameter.");
+ return false;
+ }
+ return true;
+ }
+
+ bool ValidateAppDataAndOsAndLanguagesData() {
+ smart_objects::SmartArray* objects_array = data_[json::response].asArray();
+
+ if (!objects_array) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response is not array.");
+ return false;
+ }
+
+ SynonymsMap synonyms_map;
+ bool has_response_valid_application = false;
+
+ smart_objects::SmartArray::iterator applications_iterator =
+ objects_array->begin();
+
+ for (; applications_iterator != objects_array->end();) {
+ const smart_objects::SmartObject& app_data = *applications_iterator;
+
+ if (!app_data.isValid()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "Wrong application data in json file.");
+ return false;
+ }
+
+ if (!CheckMandatoryParametersPresent(app_data)) {
+ LOG4CXX_WARN(logger_,
+ "Application hasn`t some of mandatory parameters. "
+ "Application will be skipped.");
+
+ applications_iterator = objects_array->erase(applications_iterator);
+ continue;
+ }
+
+ if (!ValidateAppIdAndAppName(app_data)) {
+ return false;
+ }
+
+ // If we dont have any of android/ios field
+ // we skip this json in CheckMandatoryParametersPresent
+ const std::string os_type =
+ (app_data.keyExists(json::android)) ? json::android : json::ios;
+
+ // Verify os and dependent languages data
+ if (json::ios == os_type) {
+ if (app_data[json::ios][json::urlScheme].asString().length() >
+ kUrlSchemaLengthMax) {
+ LOG4CXX_WARN(
+ logger_,
+ kQueryAppsValidationFailedPrefix
+ << "An urlscheme length exceeds maximum allowed ["
+ << app_data[json::ios][json::urlScheme].asString().length()
+ << "]>[" << kUrlSchemaLengthMax << "]");
+ return false;
+ }
+ }
+
+ if (json::android == os_type) {
+ if (app_data[json::android][json::packageName].asString().length() >
+ kPackageNameLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "Package name length ["
+ << app_data[json::android][json::packageName]
+ .asString()
+ .length() << "] exceeds max length ["
+ << kPackageNameLengthMax << "]in json file.");
+ return false;
+ }
+ }
+
+ // Languages verification
+ if (!app_data[os_type].keyExists(json::languages)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages' doesn't exist");
+ return false;
+ }
+ if (!ValidateLanguages(app_data[os_type][json::languages],
+ synonyms_map)) {
+ return false;
+ }
+ has_response_valid_application = true;
+ ++applications_iterator;
+ }
+ return has_response_valid_application;
+ }
+
+ bool ValidateAppIdAndAppName(const smart_objects::SmartObject& app_data) {
+ // Verify appid length
+ const std::string app_id(app_data[json::appId].asString());
+ if (app_id.length() > kAppIdLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "An Object ID length exceeds maximum allowed ["
+ << app_id.length() << "]>[" << kAppIdLengthMax << "]");
+ return false;
+ }
+
+ // Verify that appid is unique
+ if (applications_id_set_.find(app_id) != applications_id_set_.end()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "An Object ID is not unigue [" << app_id << "]");
+ return false;
+ }
+ applications_id_set_.insert(app_id);
+
+ // Verify that app is not registered yet
+ ApplicationSharedPtr registered_app =
+ manager_.application_by_policy_id(app_id);
+ if (registered_app) {
+ LOG4CXX_INFO(logger_,
+ "Application with the id: " << app_id
+ << " is already registered.");
+ }
+ // And app name length
+ const std::string appName(app_data[json::name].asString());
+ if (appName.length() > kAppNameLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "Name of application exceeds maximum allowed ["
+ << appName.length() << "]>[" << kAppNameLengthMax
+ << "].");
+ return false;
+ }
+ return true;
+ }
+
+ bool ValidateLanguages(const smart_objects::SmartObject& languages,
+ SynonymsMap& synonyms_map) const {
+ bool default_language_found = false;
+ const size_t languages_array_size = languages.length();
+ if (languages_array_size > kLanguageArraySizeMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages' array exceeds max size ["
+ << languages_array_size << "]>[" << kLanguageArraySizeMax
+ << "]");
+ return false;
+ }
+ // Every language has ttsname string and vrsynonyms array
+ for (size_t idx = 0; idx < languages_array_size; ++idx) {
+ const smart_objects::SmartObject& language = languages.getElement(idx);
+ if (smart_objects::SmartType_Map != language.getType()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "language is not a map.");
+ return false;
+ }
+ if (language.length() != 1) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "language map size is not equal 1.");
+ return false;
+ }
+ const std::string language_name = (*language.map_begin()).first;
+ if (!language_name.length()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "language name is empty");
+ return false;
+ }
+ // Verify default language defined
+ if (!(language_name).compare(json::default_)) {
+ default_language_found = true;
+ }
+ // Add set for synonyms' duplicates validation
+ if (synonyms_map.find(language_name) == synonyms_map.end()) {
+ synonyms_map[language_name] = SynonymsSet();
+ }
+ // ttsName verification
+ if (!language[language_name].keyExists(json::ttsName)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages.ttsName' doesn't exist");
+ return false;
+ }
+ const smart_objects::SmartObject& ttsNameObject =
+ language[language_name][json::ttsName];
+ // ttsName is string
+ if (smart_objects::SmartType_String == ttsNameObject.getType()) {
+ const std::string ttsName =
+ language[language_name][json::ttsName].asString();
+ if (ttsName.length() > kTtsNameLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "ttsName string exceeds max length ["
+ << ttsName.length() << "]>[" << kTtsNameLengthMax
+ << "]");
+ return false;
+ }
+ } else {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "ttsName is not the string type.");
+ return false;
+ }
+
+ if (!ValidateSynonymsAtLanguage(language, language_name, synonyms_map)) {
+ return false;
+ }
+ }
+ if (!default_language_found) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << " 'languages'.default' doesn't exist");
+ return false;
+ }
+ return true;
+ }
+
+ bool ValidateSynonymsAtLanguage(const smart_objects::SmartObject& language,
+ const std::string& language_name,
+ SynonymsMap& synonyms_map) const {
+ if (!language[language_name].keyExists(json::vrSynonyms)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages.vrSynonyms' doesn't exist");
+ return false;
+ }
+ const smart_objects::SmartArray* synonyms_array =
+ language[language_name][json::vrSynonyms].asArray();
+ if (!synonyms_array) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSynonyms is not array.");
+ return false;
+ }
+ const size_t synonyms_array_size = synonyms_array->size();
+ if (synonyms_array_size < kVrArraySizeMin) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSynomyms array has [" << synonyms_array_size
+ << "] size < allowed min size [" << kVrArraySizeMin
+ << "]");
+ return false;
+ }
+ if (synonyms_array_size > kVrArraySizeMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSynomyms array size [" << synonyms_array_size
+ << "] exceeds maximum allowed size [" << kVrArraySizeMax
+ << "]");
+ return false;
+ }
+
+ for (std::size_t idx = 0; idx < synonyms_array_size; ++idx) {
+ const smart_objects::SmartObject& synonym = (*synonyms_array)[idx];
+ const std::string vrSynonym = synonym.asString();
+ if (vrSynonym.length() > kVrSynonymLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSYnomym item [" << idx
+ << "] exceeds max length [" << vrSynonym.length()
+ << "]>[" << kVrSynonymLengthMax << "]");
+ return false;
+ }
+ if (vrSynonym.length() < kVrSynonymLengthMin) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSYnomym item [" << idx << "] length ["
+ << vrSynonym.length() << "] is less then min length ["
+ << kVrSynonymLengthMin << "] allowed.");
+ return false;
+ }
+ // Verify duplicates
+ SynonymsMap::iterator synonyms_map_iter =
+ synonyms_map.find(language_name);
+ if (synonyms_map_iter != synonyms_map.end()) {
+ if (!(*synonyms_map_iter).second.insert(vrSynonym).second) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSYnomym item already defined ["
+ << vrSynonym.c_str() << "] for language ["
+ << language_name << "]");
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ bool CheckMandatoryParametersPresent(
+ const smart_objects::SmartObject& app_data) const {
+ if (!app_data.keyExists(json::android) && !app_data.keyExists(json::ios)) {
+ return false;
+ }
+
+ if (app_data.keyExists(json::android) &&
+ !app_data[json::android].keyExists(json::packageName)) {
+ return false;
+ }
+
+ if (app_data.keyExists(json::ios) &&
+ !app_data[json::ios].keyExists(json::urlScheme)) {
+ return false;
+ }
+
+ if (!app_data.keyExists(json::appId)) {
+ return false;
+ }
+
+ if (!app_data.keyExists(json::name)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ smart_objects::SmartObject& data_;
+ std::set<std::string> applications_id_set_;
+ const ApplicationManager& manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(QueryAppsDataValidator);
+};
+}
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+uint32_t SystemRequest::index = 0;
+
+const std::string kSYNC = "SYNC";
+const std::string kIVSU = "IVSU";
+
+SystemRequest::SystemRequest(
+ 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) {}
+
+SystemRequest::~SystemRequest() {}
+
+void SystemRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (application.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message_)[strings::msg_params][strings::request_type].asInt());
+
+ const policy::PolicyHandlerInterface& policy_handler = policy_handler_;
+
+ const std::string stringified_request_type =
+ rpc::policy_table_interface_base::EnumToJsonString(
+ static_cast<rpc::policy_table_interface_base::RequestType>(
+ request_type));
+
+ if (!policy_handler.IsRequestTypeAllowed(application->policy_app_id(),
+ request_type)) {
+ LOG4CXX_ERROR(logger_,
+ "RequestType " << stringified_request_type
+ << " is DISALLOWED by policies");
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+ LOG4CXX_TRACE(logger_,
+ "RequestType " << stringified_request_type << " is ALLOWED");
+
+ const bool request_subtype_present =
+ (*message_)[strings::msg_params].keyExists(strings::request_subtype);
+ if (request_subtype_present) {
+ const std::string request_subtype =
+ (*message_)[strings::msg_params][strings::request_subtype].asString();
+ if (!policy_handler.IsRequestSubTypeAllowed(application->policy_app_id(),
+ request_subtype)) {
+ LOG4CXX_ERROR(logger_,
+ "Request subtype: " << request_subtype
+ << " is DISALLOWED by policies");
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+ LOG4CXX_TRACE(logger_,
+ "Request subtype: " << request_subtype << " is ALLOWED");
+ }
+
+ std::string file_name = kSYNC;
+ if ((*message_)[strings::msg_params].keyExists(strings::file_name)) {
+ file_name = (*message_)[strings::msg_params][strings::file_name].asString();
+ } else {
+ file_name = kSYNC;
+ }
+
+ if (!CheckSyntax(file_name)) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming request contains \t\n \\t \\n or whitespace");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (!file_system::IsFileNameValid(file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
+ const bool is_system_file = std::string::npos != file_name.find(kSYNC) ||
+ std::string::npos != file_name.find(kIVSU);
+
+ // to avoid override existing file
+ if (is_system_file) {
+ const uint8_t max_size = 255;
+ char buf[max_size] = {'\0'};
+ snprintf(buf, max_size - 1, "%d%s", index++, file_name.c_str());
+ file_name = buf;
+ }
+
+ std::vector<uint8_t> binary_data;
+ std::string binary_data_folder;
+ if ((*message_)[strings::params].keyExists(strings::binary_data)) {
+ binary_data = (*message_)[strings::params][strings::binary_data].asBinary();
+ binary_data_folder =
+ application_manager_.get_settings().system_files_path();
+ } else {
+ binary_data_folder =
+ application_manager_.get_settings().app_storage_folder();
+ binary_data_folder += "/";
+ binary_data_folder += application->folder_name();
+ binary_data_folder += "/";
+ }
+
+ std::string file_dst_path =
+ application_manager_.get_settings().system_files_path();
+ file_dst_path += "/";
+ file_dst_path += file_name;
+
+ if ((*message_)[strings::params].keyExists(strings::binary_data)) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Binary data is present. Trying to save it to: " << binary_data_folder);
+ if (mobile_apis::Result::SUCCESS !=
+ (application_manager_.SaveBinary(
+ binary_data, binary_data_folder, file_name, 0))) {
+ LOG4CXX_DEBUG(logger_, "Binary data can't be saved.");
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ return;
+ }
+ } else {
+ std::string app_full_file_path = binary_data_folder;
+ app_full_file_path += file_name;
+
+ LOG4CXX_DEBUG(logger_,
+ "Binary data is not present. Trying to find file "
+ << file_name << " within previously saved app file in "
+ << binary_data_folder);
+
+ const application_manager::AppFile* file =
+ application->GetFile(app_full_file_path);
+ if (!file || !file->is_download_complete ||
+ !file_system::MoveFile(app_full_file_path, file_dst_path)) {
+ LOG4CXX_DEBUG(logger_, "Binary data not found.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ processing_file_ = file_dst_path;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Binary data ok.");
+
+ if (mobile_apis::RequestType::HTTP == request_type &&
+ (*message_)[strings::msg_params].keyExists(strings::file_name)) {
+ const std::string& file =
+ (*message_)[strings::msg_params][strings::file_name].asString();
+ policy_handler_.ReceiveMessageFromSDK(file, binary_data);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ return;
+ } else if (mobile_apis::RequestType::QUERY_APPS == request_type) {
+ using namespace ns_smart_device_link::ns_json_handler::formatters;
+
+ smart_objects::SmartObject sm_object;
+ Json::Reader reader;
+ std::string json(binary_data.begin(), binary_data.end());
+ Json::Value root;
+ if (!reader.parse(json.c_str(), root)) {
+ LOG4CXX_DEBUG(logger_, "Unable to parse query_app json file.");
+ return;
+ }
+
+ CFormatterJsonBase::jsonValueToObj(root, sm_object);
+ if (!ValidateQueryAppData(sm_object)) {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ return;
+ }
+
+ application_manager_.ProcessQueryApp(sm_object, connection_key());
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if (std::string::npos != file_name.find(kIVSU)) {
+ msg_params[strings::file_name] = file_name;
+ } else {
+ msg_params[strings::file_name] = file_dst_path;
+ }
+
+ // expected int, mandatory=true, all Policies flow (HTTP,Proprietary,External)
+ msg_params[strings::app_id] = application->hmi_app_id();
+
+ msg_params[strings::request_type] =
+ (*message_)[strings::msg_params][strings::request_type];
+ if (request_subtype_present) {
+ msg_params[strings::request_subtype] =
+ (*message_)[strings::msg_params][strings::request_subtype];
+ }
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest,
+ &msg_params,
+ true);
+}
+
+void SystemRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
+ result_code,
+ mobile_api::Result::SUCCESS,
+ mobile_api::Result::WARNINGS);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (application.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (!processing_file_.empty()) {
+ file_system::DeleteFile(processing_file_);
+ processing_file_.clear();
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool SystemRequest::ValidateQueryAppData(
+ smart_objects::SmartObject& data) const {
+ if (!data.isValid()) {
+ LOG4CXX_ERROR(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response is not valid.");
+ return false;
+ }
+ if (!data.keyExists(json::response)) {
+ LOG4CXX_ERROR(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response does not contain '"
+ << json::response << "' parameter.");
+ return false;
+ }
+
+ QueryAppsDataValidator validator(data, application_manager_);
+ return validator.Validate();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc
new file mode 100644
index 0000000000..dc2e3ea3f5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/system_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SystemResponse::SystemResponse(
+ 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) {}
+
+SystemResponse::~SystemResponse() {}
+
+void SystemResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc
new file mode 100644
index 0000000000..9119fb48da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void UnregisterAppInterfaceRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!application_manager_.application(connection_key())) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key(),
+ mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM),
+ SOURCE_SDL);
+ application_manager_.EndNaviServices(connection_key());
+ application_manager_.UnregisterApplication(connection_key(),
+ mobile_apis::Result::SUCCESS);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc
new file mode 100644
index 0000000000..4e7c879b58
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc
@@ -0,0 +1,48 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void UnregisterAppInterfaceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
new file mode 100644
index 0000000000..0c30f567b4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
@@ -0,0 +1,126 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h"
+
+#include "application_manager/application_impl.h"
+#include "utils/semantic_version.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+UnsubscribeButtonRequest::UnsubscribeButtonRequest(
+ 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) {}
+
+UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {}
+
+void UnsubscribeButtonRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[str::msg_params][str::button_name].asInt());
+
+ if (app->msg_version() < utils::rpc_version_5 &&
+ btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
+ bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
+ bool play_pause_supported =
+ CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE);
+ if (play_pause_supported) {
+ LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE");
+ btn_id = mobile_apis::ButtonName::PLAY_PAUSE;
+ (*message_)[str::msg_params][str::button_name] = btn_id;
+ } else if (!ok_supported) {
+ LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ }
+ } else if (!CheckHMICapabilities(btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Button " << btn_id << " isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+
+ if (!app->UnsubscribeFromButton(
+ static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
+ LOG4CXX_ERROR(logger_, "App doesn't subscibe to button " << btn_id);
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ SendUnsubscribeButtonNotification();
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+}
+
+bool UnsubscribeButtonRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ // send OnButtonSubscription notification
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
+ (*message_)[strings::msg_params][strings::button_name].asInt());
+ msg_params[strings::is_suscribed] = false;
+ CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc
new file mode 100644
index 0000000000..592b91851e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc
@@ -0,0 +1,74 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UnsubscribeButtonResponse::UnsubscribeButtonResponse(
+ 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) {}
+
+UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {}
+
+void UnsubscribeButtonResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ // TODO(DK): Some logic
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
new file mode 100644
index 0000000000..40bb1ddfc9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
@@ -0,0 +1,117 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UnsubscribeWayPointsRequest::UnsubscribeWayPointsRequest(
+ 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) {}
+
+UnsubscribeWayPointsRequest::~UnsubscribeWayPointsRequest() {}
+
+void UnsubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (!application_manager_.IsAppSubscribedForWayPoints(app)) {
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
+}
+
+void UnsubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
+ LOG4CXX_INFO(logger_, "Received Navigation_UnsubscribeWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ if (result) {
+ application_manager_.UnsubscribeAppFromWayPoints(app);
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool UnsubscribeWayPointsRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc
new file mode 100644
index 0000000000..67e3466a44
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UnsubscribeWayPointsResponse::UnsubscribeWayPointsResponse(
+ 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) {}
+
+UnsubscribeWayPointsResponse::~UnsubscribeWayPointsResponse() {}
+
+void UnsubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
new file mode 100644
index 0000000000..c04ad34f5f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
@@ -0,0 +1,243 @@
+/*
+
+ 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 <string>
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+UpdateTurnListRequest::UpdateTurnListRequest(
+ 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) {}
+
+UpdateTurnListRequest::~UpdateTurnListRequest() {}
+
+void UpdateTurnListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming update turn list has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ smart_objects::SmartObject& turn_list_array =
+ ((*message_)[strings::msg_params][strings::turn_list]);
+ for (uint32_t i = 0; i < turn_list_array.length(); ++i) {
+ if ((turn_list_array[i].keyExists(strings::turn_icon)) &&
+ (mobile_apis::Result::INVALID_DATA ==
+ MessageHelper::VerifyImage(turn_list_array[i][strings::turn_icon],
+ app,
+ application_manager_))) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyImage return INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ if (!CheckTurnListArray()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ for (uint32_t i = 0; i < msg_params[strings::turn_list].length(); ++i) {
+ if (msg_params[strings::turn_list][i].keyExists(hmi_request::navi_text)) {
+ const custom_str::CustomString& navigation_text =
+ msg_params[strings::turn_list][i][hmi_request::navi_text]
+ .asCustomString();
+ msg_params[strings::turn_list][i].erase(hmi_request::navi_text);
+ msg_params[strings::turn_list][i][hmi_request::navi_text]
+ [hmi_request::field_name] = static_cast<int>(
+ hmi_apis::Common_TextFieldName::turnText);
+ msg_params[strings::turn_list][i][hmi_request::navi_text]
+ [hmi_request::field_text] = navigation_text;
+ }
+ }
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list) ||
+ (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params, true);
+ } else {
+ // conditional mandatory
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
+ LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool UpdateTurnListRequest::CheckTurnListArray() {
+ int32_t length =
+ (*message_)[strings::msg_params][strings::turn_list].length();
+ if (0 == length) {
+ return false;
+ }
+
+ for (int32_t i = 0; i < length; ++i) {
+ if (!((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
+ hmi_request::navi_text)) &&
+ !((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
+ strings::turn_icon))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool UpdateTurnListRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ const smart_objects::SmartArray* tl_array =
+ (*message_)[strings::msg_params][strings::turn_list].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tl = tl_array->begin();
+ smart_objects::SmartArray::const_iterator it_tl_end = tl_array->end();
+
+ for (; it_tl != it_tl_end; ++it_tl) {
+ if ((*it_tl).keyExists(strings::navigation_text)) {
+ str = (*it_tl)[strings::navigation_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Invalid turn_list navigation_text text syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*it_tl).keyExists(strings::turn_icon)) {
+ str = (*it_tl)[strings::turn_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_, "Invalid turn_list turn_icon value syntax check failed");
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc
new file mode 100644
index 0000000000..5ddf355f88
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateTurnListResponse::UpdateTurnListResponse(
+ 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) {}
+
+UpdateTurnListResponse::~UpdateTurnListResponse() {}
+
+void UpdateTurnListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
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
new file mode 100644
index 0000000000..7065c7cf7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
@@ -0,0 +1,847 @@
+/*
+ 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 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/hmi_command_factory.h"
+
+#include "application_manager/message.h"
+#include "interfaces/HMI_API.h"
+
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h"
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_find_applications.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h"
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h"
+#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h"
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h"
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h"
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h"
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/get_urls.h"
+#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h"
+
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+HMICommandFactory::HMICommandFactory(
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+CommandSharedPtr HMICommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ const hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+ LOG4CXX_DEBUG(
+ logger_, "HMICommandFactory::CreateCommand function_id: " << function_id);
+
+ const hmi_apis::messageType::eType message_type =
+ static_cast<hmi_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ if (hmi_apis::messageType::response == message_type) {
+ LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand response");
+ } else if ((*message)[strings::params][strings::message_type] ==
+ hmi_apis::messageType::error_response) {
+ LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand error response");
+ } else {
+ LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand request");
+ }
+
+ return get_creator_factory(function_id, message_type, source).create(message);
+}
+
+bool HMICommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource message_source)
+ const {
+ using app_mngr::commands::Command;
+ return get_creator_factory(
+ static_cast<hmi_apis::FunctionID::eType>(function_id),
+ hmi_apis::messageType::INVALID_ENUM,
+ message_source).CanBeCreated();
+}
+
+CommandCreator& HMICommandFactory::get_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type,
+ application_manager::commands::Command::CommandSource source) const {
+ CommandCreatorFactory factory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (static_cast<int32_t>(id)) {
+ case hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery: {
+ return factory.GetCreator<commands::OnStartDeviceDiscovery>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateDeviceListRequest>()
+ : factory.GetCreator<commands::UpdateDeviceListResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_ActivateApp: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ActivateAppRequest>()
+ : factory.GetCreator<commands::ActivateAppResponse>();
+ }
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::DecryptCertificateRequest>()
+ : factory.GetCreator<commands::DecryptCertificateResponse>();
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
+ case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetSystemInfoRequest>()
+ : factory.GetCreator<commands::GetSystemInfoResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_ActivateApp: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SDLActivateAppRequest>()
+ : factory.GetCreator<commands::SDLActivateAppResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_PolicyUpdate: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SDLPolicyUpdate>()
+ : factory.GetCreator<commands::SDLPolicyUpdateResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_GetURLS: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetUrls>()
+ : factory.GetCreator<commands::GetUrlsResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_OnAppPermissionChanged: {
+ return factory.GetCreator<commands::OnAppPermissionChangedNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_GetListOfPermissions: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::SDLGetListOfPermissionsRequest>()
+ : factory
+ .GetCreator<commands::SDLGetListOfPermissionsResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_GetUserFriendlyMessage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::SDLGetUserFriendlyMessageRequest>()
+ : factory.GetCreator<
+ commands::SDLGetUserFriendlyMessageResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_GetStatusUpdate: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SDLGetStatusUpdateRequest>()
+ : factory.GetCreator<commands::SDLGetStatusUpdateResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_OnStatusUpdate: {
+ return factory.GetCreator<commands::OnStatusUpdateNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnAppPermissionConsent: {
+ return factory.GetCreator<commands::OnAppPermissionConsentNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::MixingAudioSupportedRequest>()
+ : factory.GetCreator<commands::MixingAudioSupportedResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications: {
+ return factory.GetCreator<commands::OnExitAllApplicationsNotification>();
+ }
+ case hmi_apis::FunctionID::UI_AddCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIAddCommandRequest>()
+ : factory.GetCreator<commands::UIAddCommandResponse>();
+ }
+ case hmi_apis::FunctionID::UI_DeleteCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIDeleteCommandRequest>()
+ : factory.GetCreator<commands::UIDeleteCommandResponse>();
+ }
+ case hmi_apis::FunctionID::UI_AddSubMenu: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIAddSubmenuRequest>()
+ : factory.GetCreator<commands::UIAddSubmenuResponse>();
+ }
+ case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIDeleteSubmenuRequest>()
+ : factory.GetCreator<commands::UIDeleteSubmenuResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISetMediaClockTimerRequest>()
+ : factory.GetCreator<commands::UISetMediaClockTimerResponse>();
+ }
+ case hmi_apis::FunctionID::UI_PerformInteraction: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIPerformInteractionRequest>()
+ : factory.GetCreator<commands::UIPerformInteractionResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISetGlobalPropertiesRequest>()
+ : factory
+ .GetCreator<commands::UISetGlobalPropertiesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_ScrollableMessage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIScrollableMessageRequest>()
+ : factory.GetCreator<commands::UIScrollableMessageResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SetAppIcon: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISetAppIconRequest>()
+ : factory.GetCreator<commands::UISetAppIconResponse>();
+ }
+ case hmi_apis::FunctionID::UI_GetSupportedLanguages: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::UIGetSupportedLanguagesRequest>()
+ : factory
+ .GetCreator<commands::UIGetSupportedLanguagesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_GetLanguage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIGetLanguageRequest>()
+ : factory.GetCreator<commands::UIGetLanguageResponse>();
+ }
+ case hmi_apis::FunctionID::UI_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::UIGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_ChangeRegistration: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIChangeRegistrationRequest>()
+ : factory.GetCreator<commands::UIChangeRegistratioResponse>();
+ }
+ case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIPerformAudioPassThruRequest>()
+ : factory
+ .GetCreator<commands::UIPerformAudioPassThruResponse>();
+ }
+ case hmi_apis::FunctionID::UI_EndAudioPassThru: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIEndAudioPassThruRequest>()
+ : factory.GetCreator<commands::UIEndAudioPassThruResponse>();
+ }
+ case hmi_apis::FunctionID::UI_Alert: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIAlertRequest>()
+ : factory.GetCreator<commands::UIAlertResponse>();
+ }
+ case hmi_apis::FunctionID::VR_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRIsReadyRequest>()
+ : factory.GetCreator<commands::VRIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::VR_AddCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRAddCommandRequest>()
+ : factory.GetCreator<commands::VRAddCommandResponse>();
+ }
+ case hmi_apis::FunctionID::VR_DeleteCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRDeleteCommandRequest>()
+ : factory.GetCreator<commands::VRDeleteCommandResponse>();
+ }
+ case hmi_apis::FunctionID::VR_ChangeRegistration: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRChangeRegistrationRequest>()
+ : factory.GetCreator<commands::VRChangeRegistrationResponse>();
+ }
+ case hmi_apis::FunctionID::VR_GetSupportedLanguages: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::VRGetSupportedLanguagesRequest>()
+ : factory
+ .GetCreator<commands::VRGetSupportedLanguagesResponse>();
+ }
+ case hmi_apis::FunctionID::VR_GetLanguage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRGetLanguageRequest>()
+ : factory.GetCreator<commands::VRGetLanguageResponse>();
+ }
+ case hmi_apis::FunctionID::VR_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::VRGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSIsReadyRequest>()
+ : factory.GetCreator<commands::TTSIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_ChangeRegistration: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSChangeRegistrationRequest>()
+ : factory.GetCreator<commands::TTSChangeRegistratioResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_GetSupportedLanguages: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::TTSGetSupportedLanguagesRequest>()
+ : factory.GetCreator<
+ commands::TTSGetSupportedLanguagesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_StopSpeaking: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSStopSpeakingRequest>()
+ : factory.GetCreator<commands::TTSStopSpeakingResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_GetLanguage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSGetLanguageRequest>()
+ : factory.GetCreator<commands::TTSGetLanguageResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSSpeakRequest>()
+ : factory.GetCreator<commands::TTSSpeakResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSSetGlobalPropertiesRequest>()
+ : factory
+ .GetCreator<commands::TTSSetGlobalPropertiesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::TTSGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_Started: {
+ return factory.GetCreator<commands::OnTTSStartedNotification>();
+ }
+ case hmi_apis::FunctionID::TTS_Stopped: {
+ return factory.GetCreator<commands::OnTTSStoppedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppActivated: {
+ return factory.GetCreator<commands::OnAppActivatedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL: {
+ return factory.GetCreator<commands::OnAwakeSDLNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: {
+ return factory.GetCreator<commands::OnExitApplicationNotification>();
+ }
+ case hmi_apis::FunctionID::UI_Show: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIShowRequest>()
+ : factory.GetCreator<commands::UIShowResponse>();
+ }
+ case hmi_apis::FunctionID::UI_Slider: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISliderRequest>()
+ : factory.GetCreator<commands::UISliderResponse>();
+ }
+ case hmi_apis::FunctionID::UI_ClosePopUp: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ClosePopupRequest>()
+ : factory.GetCreator<commands::ClosePopupResponse>();
+ }
+ case hmi_apis::FunctionID::UI_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIIsReadyRequest>()
+ : factory.GetCreator<commands::UIIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviIsReadyRequest>()
+ : factory.GetCreator<commands::NaviIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_AlertManeuver: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviAlertManeuverRequest>()
+ : factory.GetCreator<commands::NaviAlertManeuverResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_GetWayPoints: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviGetWayPointsRequest>()
+ : factory.GetCreator<commands::NaviGetWayPointsResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviUpdateTurnListRequest>()
+ : factory.GetCreator<commands::NaviUpdateTurnListResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviShowConstantTBTRequest>()
+ : factory.GetCreator<commands::NaviShowConstantTBTResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviSubscribeWayPointsRequest>()
+ : factory
+ .GetCreator<commands::NaviSubscribeWayPointsResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::NaviUnsubscribeWayPointsRequest>()
+ : factory.GetCreator<
+ commands::NaviUnsubscribeWayPointsResponse>();
+ }
+ case hmi_apis::FunctionID::Buttons_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ButtonGetCapabilitiesRequest>()
+ : factory
+ .GetCreator<commands::ButtonGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: {
+ return factory
+ .GetCreator<commands::OnAllowSDLFunctionalityNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnSDLConsentNeeded: {
+ return factory.GetCreator<commands::OnSDLConsentNeededNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_UpdateSDL: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateSDLRequest>()
+ : factory.GetCreator<commands::UpdateSDLResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: {
+ return factory.GetCreator<commands::OnIgnitionCycleOverNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: {
+ return factory.GetCreator<commands::OnSystemInfoChangedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnReady: {
+ return factory.GetCreator<commands::OnReadyNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady: {
+ return factory.GetCreator<commands::OnSystemTimeReadyNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen: {
+ return factory.GetCreator<commands::OnDeviceChosenNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnSystemContext: {
+ return factory.GetCreator<commands::OnSystemContextNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnDriverDistraction: {
+ return factory
+ .GetCreator<commands::hmi::OnDriverDistractionNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: {
+ return factory.GetCreator<commands::OnUpdateDeviceList>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppRegistered: {
+ return factory.GetCreator<commands::OnAppRegisteredNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered: {
+ return factory.GetCreator<commands::OnAppUnregisteredNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnFindApplications: {
+ return factory.GetCreator<commands::OnFindApplications>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_UpdateAppList: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateAppListRequest>()
+ : factory.GetCreator<commands::UpdateAppListResponse>();
+ }
+ case hmi_apis::FunctionID::VR_Started: {
+ return factory.GetCreator<commands::OnVRStartedNotification>();
+ }
+ case hmi_apis::FunctionID::VR_Stopped: {
+ return factory.GetCreator<commands::OnVRStoppedNotification>();
+ }
+ case hmi_apis::FunctionID::VR_OnCommand: {
+ return factory.GetCreator<commands::OnVRCommandNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnCommand: {
+ return factory.GetCreator<commands::OnUICommandNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated: {
+ return factory.GetCreator<commands::OnAppDeactivatedNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnLanguageChange: {
+ return factory.GetCreator<commands::OnUILanguageChangeNotification>();
+ }
+ case hmi_apis::FunctionID::VR_OnLanguageChange: {
+ return factory.GetCreator<commands::OnVRLanguageChangeNotification>();
+ }
+ case hmi_apis::FunctionID::TTS_OnLanguageChange: {
+ return factory.GetCreator<commands::OnTTSLanguageChangeNotification>();
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonEvent: {
+ return factory.GetCreator<commands::hmi::OnButtonEventNotification>();
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonPress: {
+ return factory.GetCreator<commands::hmi::OnButtonPressNotification>();
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonSubscription: {
+ return factory
+ .GetCreator<commands::hmi::OnButtonSubscriptionNotification>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnTBTClientState: {
+ return factory.GetCreator<commands::OnNaviTBTClientStateNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnKeyboardInput: {
+ return factory.GetCreator<commands::hmi::OnUIKeyBoardInputNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnTouchEvent: {
+ return factory.GetCreator<commands::hmi::OnUITouchEventNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ return factory.GetCreator<commands::hmi::OnUIResetTimeoutNotification>();
+ }
+ case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviSetVideoConfigRequest>()
+ : factory.GetCreator<commands::NaviSetVideoConfigResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StartStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviStartStreamRequest>()
+ : factory.GetCreator<commands::NaviStartStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StopStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviStopStreamRequest>()
+ : factory.GetCreator<commands::NaviStopStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StartAudioStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::AudioStartStreamRequest>()
+ : factory.GetCreator<commands::AudioStartStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StopAudioStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::AudioStopStreamRequest>()
+ : factory.GetCreator<commands::AudioStopStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnAudioDataStreaming: {
+ return factory.GetCreator<commands::OnAudioDataStreamingNotification>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnVideoDataStreaming: {
+ return factory.GetCreator<commands::OnVideoDataStreamingNotification>();
+ }
+ case hmi_apis::FunctionID::VR_PerformInteraction: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRPerformInteractionRequest>()
+ : factory.GetCreator<commands::VRPerformInteractionResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemRequest: {
+ return factory.GetCreator<commands::OnSystemRequestNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnPutFile: {
+ return factory.GetCreator<commands::OnPutFileNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource: {
+ return factory.GetCreator<commands::OnResumeAudioSourceNotification>();
+ }
+ case hmi_apis::FunctionID::UI_SetDisplayLayout: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UiSetDisplayLayoutRequest>()
+ : factory.GetCreator<commands::UiSetDisplayLayoutResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSDLClose: {
+ return factory.GetCreator<commands::OnSDLCloseNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete: {
+ return factory
+ .GetCreator<commands::OnSDLPersistenceCompleteNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnFileRemoved: {
+ return factory.GetCreator<commands::OnFileRemovedNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnRecordStart: {
+ return factory.GetCreator<commands::OnRecordStartdNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::BasicCommunicationSystemRequest>()
+ : factory.GetCreator<
+ commands::BasicCommunicationSystemResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_GetSystemTime: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::BasicCommunicationGetSystemTimeRequest>()
+ : factory.GetCreator<
+ commands::BasicCommunicationGetSystemTimeResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_SendLocation: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviSendLocationRequest>()
+ : factory.GetCreator<commands::NaviSendLocationResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_AddStatisticsInfo: {
+ return factory.GetCreator<commands::AddStatisticsInfoNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnSystemError: {
+ return factory.GetCreator<commands::OnSystemErrorNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate: {
+ return factory.GetCreator<commands::OnReceivedPolicyUpdate>();
+ }
+ case hmi_apis::FunctionID::SDL_OnPolicyUpdate: {
+ return factory.GetCreator<commands::OnPolicyUpdate>();
+ }
+ case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: {
+ return factory.GetCreator<commands::OnDeviceStateChangedNotification>();
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ return factory.GetCreator<commands::hmi::OnTTSResetTimeoutNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: {
+ return factory.GetCreator<commands::OnEventChangedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::hmi::DialNumberRequest>()
+ : factory.GetCreator<commands::hmi::DialNumberResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnWayPointChange: {
+ return factory.GetCreator<commands::OnNaviWayPointChangeNotification>();
+ }
+ case hmi_apis::FunctionID::RC_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::RCIsReadyRequest>()
+ : factory.GetCreator<commands::RCIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::RC_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::RCGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::RCGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SendHapticData: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISendHapticDataRequest>()
+ : factory.GetCreator<commands::UISendHapticDataResponse>();
+ }
+ default: { return factory.GetCreator<InvalidCommand>(); }
+ }
+}
+
+} // namespace application_manager
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
new file mode 100644
index 0000000000..5207c7e432
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
@@ -0,0 +1,442 @@
+/*
+ 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 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/mobile_command_factory.h"
+#include "sdl_rpc_plugin/commands/mobile/add_command_request.h"
+#include "sdl_rpc_plugin/commands/mobile/add_command_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h"
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h"
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_request.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h"
+#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
+#include "sdl_rpc_plugin/commands/mobile/change_registration_response.h"
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_file_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_file_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h"
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/mobile/generic_response.h"
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_response.h"
+#include "sdl_rpc_plugin/commands/mobile/list_files_request.h"
+#include "sdl_rpc_plugin/commands/mobile/list_files_response.h"
+#include "sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_button_event_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_button_press_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h"
+#include "sdl_rpc_plugin/commands/mobile/on_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_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/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"
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_response.h"
+#include "sdl_rpc_plugin/commands/mobile/put_file_request.h"
+#include "sdl_rpc_plugin/commands/mobile/put_file_response.h"
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_request.h"
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_response.h"
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h"
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h"
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h"
+#include "sdl_rpc_plugin/commands/mobile/show_request.h"
+#include "sdl_rpc_plugin/commands/mobile/show_response.h"
+#include "sdl_rpc_plugin/commands/mobile/slider_request.h"
+#include "sdl_rpc_plugin/commands/mobile/slider_response.h"
+#include "sdl_rpc_plugin/commands/mobile/speak_request.h"
+#include "sdl_rpc_plugin/commands/mobile/speak_response.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_request.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_response.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h"
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_response.h"
+#include "sdl_rpc_plugin/commands/mobile/system_request.h"
+#include "sdl_rpc_plugin/commands/mobile/system_response.h"
+#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/send_location_request.h"
+#include "sdl_rpc_plugin/commands/mobile/send_location_response.h"
+#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h"
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h"
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h"
+#include "interfaces/MOBILE_API.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+CommandCreator& MobileCommandFactory::get_creator_factory(
+ mobile_apis::FunctionID::eType id,
+ mobile_apis::messageType::eType message_type,
+ app_mngr::commands::Command::CommandSource source) const {
+ CommandCreatorFactory factory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (id) {
+ case mobile_apis::FunctionID::RegisterAppInterfaceID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::RegisterAppInterfaceRequest>()
+ : factory.GetCreator<commands::RegisterAppInterfaceResponse>();
+ }
+ case mobile_apis::FunctionID::UnregisterAppInterfaceID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UnregisterAppInterfaceRequest>()
+ : factory
+ .GetCreator<commands::UnregisterAppInterfaceResponse>();
+ }
+ case mobile_apis::FunctionID::SetGlobalPropertiesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetGlobalPropertiesRequest>()
+ : factory.GetCreator<commands::SetGlobalPropertiesResponse>();
+ }
+ case mobile_apis::FunctionID::ResetGlobalPropertiesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ResetGlobalPropertiesRequest>()
+ : factory
+ .GetCreator<commands::ResetGlobalPropertiesResponse>();
+ }
+ case mobile_apis::FunctionID::AddCommandID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AddCommandRequest>()
+ : factory.GetCreator<commands::AddCommandResponse>();
+ }
+ case mobile_apis::FunctionID::DeleteCommandID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DeleteCommandRequest>()
+ : factory.GetCreator<commands::DeleteCommandResponse>();
+ }
+ case mobile_apis::FunctionID::AddSubMenuID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AddSubMenuRequest>()
+ : factory.GetCreator<commands::AddSubMenuResponse>();
+ }
+
+ case mobile_apis::FunctionID::DeleteSubMenuID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DeleteSubMenuRequest>()
+ : factory.GetCreator<commands::DeleteSubMenuResponse>();
+ }
+ case mobile_apis::FunctionID::DeleteInteractionChoiceSetID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::DeleteInteractionChoiceSetRequest>()
+ : factory.GetCreator<
+ commands::DeleteInteractionChoiceSetResponse>();
+ }
+ case mobile_apis::FunctionID::AlertID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AlertRequest>()
+ : factory.GetCreator<commands::AlertResponse>();
+ }
+ case mobile_apis::FunctionID::SpeakID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SpeakRequest>()
+ : factory.GetCreator<commands::SpeakResponse>();
+ }
+ case mobile_apis::FunctionID::SliderID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SliderRequest>()
+ : factory.GetCreator<commands::SliderResponse>();
+ }
+ case mobile_apis::FunctionID::PerformAudioPassThruID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::PerformAudioPassThruRequest>()
+ : factory.GetCreator<commands::PerformAudioPassThruResponse>();
+ }
+
+ case mobile_apis::FunctionID::CreateInteractionChoiceSetID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::CreateInteractionChoiceSetRequest>()
+ : factory.GetCreator<
+ commands::CreateInteractionChoiceSetResponse>();
+ }
+ case mobile_apis::FunctionID::PerformInteractionID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::PerformInteractionRequest>()
+ : factory.GetCreator<commands::PerformInteractionResponse>();
+ }
+ case mobile_apis::FunctionID::EndAudioPassThruID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::EndAudioPassThruRequest>()
+ : factory.GetCreator<commands::EndAudioPassThruResponse>();
+ }
+ case mobile_apis::FunctionID::PutFileID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::PutFileRequest>()
+ : factory.GetCreator<commands::PutFileResponse>();
+ }
+ case mobile_apis::FunctionID::DeleteFileID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DeleteFileRequest>()
+ : factory.GetCreator<commands::DeleteFileResponse>();
+ }
+ case mobile_apis::FunctionID::ListFilesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ListFilesRequest>()
+ : factory.GetCreator<commands::ListFilesResponse>();
+ }
+ case mobile_apis::FunctionID::SubscribeButtonID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SubscribeButtonRequest>()
+ : factory.GetCreator<commands::SubscribeButtonResponse>();
+ }
+ case mobile_apis::FunctionID::UnsubscribeButtonID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UnsubscribeButtonRequest>()
+ : factory.GetCreator<commands::UnsubscribeButtonResponse>();
+ }
+ case mobile_apis::FunctionID::ShowConstantTBTID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ShowConstantTBTRequest>()
+ : factory.GetCreator<commands::ShowConstantTBTResponse>();
+ }
+ case mobile_apis::FunctionID::ShowID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ShowRequest>()
+ : factory.GetCreator<commands::ShowResponse>();
+ }
+ case mobile_apis::FunctionID::GetWayPointsID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::GetWayPointsRequest>()
+ : factory.GetCreator<commands::GetWayPointsResponse>();
+ }
+ case mobile_apis::FunctionID::SubscribeWayPointsID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SubscribeWayPointsRequest>()
+ : factory.GetCreator<commands::SubscribeWayPointsResponse>();
+ }
+ case mobile_apis::FunctionID::UnsubscribeWayPointsID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UnsubscribeWayPointsRequest>()
+ : factory.GetCreator<commands::UnsubscribeWayPointsResponse>();
+ }
+ case mobile_apis::FunctionID::GetSystemCapabilityID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::GetSystemCapabilityRequest>()
+ : factory.GetCreator<commands::GetSystemCapabilityResponse>();
+ }
+ case mobile_apis::FunctionID::ScrollableMessageID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ScrollableMessageRequest>()
+ : factory.GetCreator<commands::ScrollableMessageResponse>();
+ }
+
+ case mobile_apis::FunctionID::AlertManeuverID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AlertManeuverRequest>()
+ : factory.GetCreator<commands::AlertManeuverResponse>();
+ }
+ case mobile_apis::FunctionID::SetAppIconID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetAppIconRequest>()
+ : factory.GetCreator<commands::SetAppIconResponse>();
+ }
+ case mobile_apis::FunctionID::SetDisplayLayoutID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetDisplayLayoutRequest>()
+ : factory.GetCreator<commands::SetDisplayLayoutResponse>();
+ }
+ case mobile_apis::FunctionID::UpdateTurnListID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateTurnListRequest>()
+ : factory.GetCreator<commands::UpdateTurnListResponse>();
+ }
+ case mobile_apis::FunctionID::ChangeRegistrationID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ChangeRegistrationRequest>()
+ : factory.GetCreator<commands::ChangeRegistrationResponse>();
+ }
+ case mobile_apis::FunctionID::SetMediaClockTimerID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetMediaClockRequest>()
+ : factory.GetCreator<commands::SetMediaClockTimerResponse>();
+ }
+ case mobile_apis::FunctionID::SystemRequestID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SystemRequest>()
+ : factory.GetCreator<commands::SystemResponse>();
+ }
+ case mobile_apis::FunctionID::SendLocationID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SendLocationRequest>()
+ : factory.GetCreator<commands::SendLocationResponse>();
+ }
+ case mobile_apis::FunctionID::DialNumberID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DialNumberRequest>()
+ : factory.GetCreator<commands::DialNumberResponse>();
+ }
+ case mobile_apis::FunctionID::SendHapticDataID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SendHapticDataRequest>()
+ : factory.GetCreator<commands::SendHapticDataResponse>();
+ }
+ case mobile_apis::FunctionID::OnButtonEventID: {
+ return factory.GetCreator<commands::mobile::OnButtonEventNotification>();
+ }
+ case mobile_apis::FunctionID::OnButtonPressID: {
+ return factory.GetCreator<commands::mobile::OnButtonPressNotification>();
+ }
+ case mobile_apis::FunctionID::OnAudioPassThruID: {
+ return factory.GetCreator<commands::OnAudioPassThruNotification>();
+ }
+ case mobile_apis::FunctionID::OnAppInterfaceUnregisteredID: {
+ return factory
+ .GetCreator<commands::OnAppInterfaceUnregisteredNotification>();
+ }
+ case mobile_apis::FunctionID::OnCommandID: {
+ return factory.GetCreator<commands::OnCommandNotification>();
+ }
+ case mobile_apis::FunctionID::OnTBTClientStateID: {
+ return factory.GetCreator<commands::OnTBTClientStateNotification>();
+ }
+ case mobile_apis::FunctionID::OnDriverDistractionID: {
+ return factory
+ .GetCreator<commands::mobile::OnDriverDistractionNotification>();
+ }
+ case mobile_apis::FunctionID::OnLanguageChangeID: {
+ return factory.GetCreator<commands::OnLanguageChangeNotification>();
+ }
+ case mobile_apis::FunctionID::OnPermissionsChangeID: {
+ return factory.GetCreator<commands::OnPermissionsChangeNotification>();
+ }
+ case mobile_apis::FunctionID::OnHMIStatusID: {
+ using app_mngr::commands::Command;
+ return Command::CommandSource::SOURCE_MOBILE == source
+ ? factory.GetCreator<
+ commands::OnHMIStatusNotificationFromMobile>()
+ : factory.GetCreator<commands::OnHMIStatusNotification>();
+ }
+ case mobile_apis::FunctionID::OnKeyboardInputID: {
+ return factory
+ .GetCreator<commands::mobile::OnKeyBoardInputNotification>();
+ }
+ case mobile_apis::FunctionID::OnTouchEventID: {
+ return factory.GetCreator<commands::mobile::OnTouchEventNotification>();
+ }
+ case mobile_apis::FunctionID::OnSystemRequestID: {
+ return factory
+ .GetCreator<commands::mobile::OnSystemRequestNotification>();
+ }
+ case mobile_apis::FunctionID::OnHashChangeID: {
+ using app_mngr::commands::Command;
+ return factory.GetCreator<commands::mobile::OnHashChangeNotification>();
+ }
+ case mobile_apis::FunctionID::OnWayPointChangeID: {
+ using app_mngr::commands::Command;
+ return factory.GetCreator<commands::OnWayPointChangeNotification>();
+ }
+ case mobile_apis::FunctionID::GenericResponseID: {
+ using app_mngr::commands::Command;
+ return factory.GetCreator<commands::GenericResponse>();
+ }
+ default: { return factory.GetCreator<InvalidCommand>(); }
+ }
+}
+
+MobileCommandFactory::MobileCommandFactory(
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+bool MobileCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource message_source)
+ const {
+ using app_mngr::commands::Command;
+ return get_creator_factory(
+ static_cast<mobile_apis::FunctionID::eType>(function_id),
+ mobile_apis::messageType::INVALID_ENUM,
+ message_source).CanBeCreated();
+}
+
+CommandSharedPtr MobileCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ mobile_apis::messageType::eType message_type =
+ static_cast<mobile_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "MobileCommandFactory::CreateCommand function_id: " << function_id);
+
+ return get_creator_factory(function_id, message_type, source).create(message);
+}
+
+} // namespace application_manager
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
new file mode 100644
index 0000000000..efdcde7526
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc
@@ -0,0 +1,78 @@
+/*
+ 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 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/sdl_command_factory.h"
+#include "sdl_rpc_plugin/hmi_command_factory.h"
+#include "sdl_rpc_plugin/mobile_command_factory.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+SDLCommandFactory::SDLCommandFactory(
+ app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : app_manager_(app_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ hmi_command_factory_.reset(new HMICommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+ mobile_command_factory_.reset(new MobileCommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+}
+
+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) {
+ return hmi_command_factory_->CreateCommand(message, source);
+ } else {
+ return mobile_command_factory_->CreateCommand(message, source);
+ }
+}
+
+bool SDLCommandFactory::IsAbleToProcess(
+ const int32_t FunctionID,
+ const application_manager::commands::Command::CommandSource source) const {
+ bool is_hmi_command_factory_able_to_process =
+ hmi_command_factory_->IsAbleToProcess(FunctionID, source);
+ bool is_mobile_command_factory_able_to_process =
+ mobile_command_factory_->IsAbleToProcess(FunctionID, source);
+
+ return app_mngr::commands::Command::SOURCE_HMI == source
+ ? is_hmi_command_factory_able_to_process
+ : is_mobile_command_factory_able_to_process;
+}
+
+} // namespace application_manager
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
new file mode 100644
index 0000000000..22b818f5e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the 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/sdl_rpc_plugin.h"
+#include "sdl_rpc_plugin/sdl_command_factory.h"
+
+namespace sdl_rpc_plugin {
+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) {
+ command_factory_.reset(new sdl_rpc_plugin::SDLCommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+ return true;
+}
+
+bool SDLRPCPlugin::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource
+ message_source) {
+ return command_factory_->IsAbleToProcess(function_id, message_source);
+}
+
+std::string SDLRPCPlugin::PluginName() {
+ return "SDL RPC Plugin";
+}
+
+application_manager::CommandFactory& SDLRPCPlugin::GetCommandFactory() {
+ return *command_factory_;
+}
+
+void SDLRPCPlugin::OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) {}
+
+void SDLRPCPlugin::OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {}
+
+} // namespace sdl_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+ return new sdl_rpc_plugin::SDLRPCPlugin();
+}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..1a206c2cce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
@@ -0,0 +1,37 @@
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+ ${CMAKE_SOURCE_DIR}/src
+)
+
+
+set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMPONENTS_DIR}/application_manager/src/event_engine/*
+)
+
+set(LIBRARIES
+ gmock
+ Utils
+ SmartObjects
+ HMI_API
+ MOBILE_API
+ connectionHandler
+ sdl_rpc_plugin
+ jsoncpp
+ Policy
+)
+
+create_cotired_test("sdl_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
new file mode 100644
index 0000000000..50b7aae42a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/activate_app_request.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace activate_app_request {
+
+using ::testing::_;
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::ActivateAppRequest;
+using am::commands::CommandImpl;
+
+using ::test::components::application_manager_test::MockApplication;
+
+typedef std::shared_ptr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<ActivateAppRequest> ActivateAppRequestPtr;
+
+MATCHER_P(CheckMessage, level, "") {
+ return level ==
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*arg)[strings::msg_params][strings::activate_app_hmi_level]
+ .asInt());
+}
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCorrelationId = 2u;
+} // namespace
+
+class ActivateAppRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = kAppId;
+ msg_params[strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::msg_params] = msg_params;
+ (*msg)[strings::params][strings::app_id] = kAppId;
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::app_id] = kAppId;
+ return msg;
+ }
+};
+
+TEST_F(ActivateAppRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId));
+
+// TODO(OKozlov) Investigate and fix issue with using log
+#ifdef ENABLE_LOG
+ (*msg)[strings::msg_params][strings::activate_app_hmi_level] =
+ mobile_apis::HMILevel::HMI_FULL;
+#endif
+ ActivateAppRequestPtr command(CreateCommand<ActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
+#ifdef ENABLE_LOG
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToHMI(CheckMessage(mobile_apis::HMILevel::HMI_FULL)));
+#else
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg));
+#endif
+ command->Run();
+
+#ifndef ENABLE_LOG
+ EXPECT_EQ(CommandImpl::hmi_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ EXPECT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+#endif
+}
+
+} // namespace activate_app_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
new file mode 100644
index 0000000000..a5707488dd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
@@ -0,0 +1,85 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "hmi/add_statistics_info_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace add_statistics_info_notification {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_notification = ::application_manager::hmi_notification;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AddStatisticsInfoNotification;
+using am::commands::CommandImpl;
+using policy::PolicyHandler;
+using policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<AddStatisticsInfoNotification> NotificationPtr;
+
+namespace {
+const uint32_t kStatisticType = 1u;
+} // namespace
+
+class AddStatisticsInfoNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AddStatisticsInfoNotificationTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::msg_params][am::hmi_notification::statistic_type] =
+ kStatisticType;
+ NotificationPtr command(CreateCommand<AddStatisticsInfoNotification>(msg));
+
+ EXPECT_CALL(mock_policy_handler_, AddStatisticsInfo(kStatisticType));
+
+ command->Run();
+}
+
+} // namespace add_statistics_info_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
new file mode 100644
index 0000000000..a2fcf8f605
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
@@ -0,0 +1,76 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "hmi/allow_all_apps_response.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace allow_all_apps_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AllowAllAppsResponse;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<AllowAllAppsResponse> ResponsePtr;
+
+namespace {
+const bool kResponseIsAllowed = true;
+} //
+
+class AllowAllAppsResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AllowAllAppsResponseTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::allowed] = kResponseIsAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAllAppsResponse>(msg));
+
+ EXPECT_CALL(app_mngr_, SetAllAppsAllowed(kResponseIsAllowed));
+
+ command->Run();
+}
+
+} // namespace allow_all_apps_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
new file mode 100644
index 0000000000..2ce400542a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
@@ -0,0 +1,95 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "hmi/allow_app_response.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace allow_app_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AllowAppResponse;
+using ::testing::_;
+using ::testing::Return;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const bool kIsResponseAllowed = true;
+}
+
+typedef std::shared_ptr<AllowAppResponse> ResponsePtr;
+
+class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AllowAppResponseTest, Run_AppCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_app_allowed(kIsResponseAllowed));
+
+ command->Run();
+}
+
+TEST_F(AllowAppResponseTest, Run_AppNotCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
+
+ MockAppPtr mock_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+
+ command->Run();
+}
+
+} // namespace allow_app_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
new file mode 100644
index 0000000000..a3f0ab6933
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
@@ -0,0 +1,72 @@
+/*
+ * 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 names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "hmi/basic_communication_get_system_time_request.h"
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "protocol_handler/mock_protocol_handler.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace basic_communication_get_system_time_request {
+
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::BasicCommunicationGetSystemTimeRequest;
+using namespace ::protocol_handler;
+
+class BasicCommunicationGetSystemTimeRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(BasicCommunicationGetSystemTimeRequestTest, OnTimeout) {
+ MessageSharedPtr msg = CreateMessage();
+ protocol_handler_test::MockProtocolHandler mock_protocol_handler;
+
+ auto command = CreateCommand<BasicCommunicationGetSystemTimeRequest>(msg);
+
+ ON_CALL(app_mngr_, protocol_handler())
+ .WillByDefault(ReturnRef(mock_protocol_handler));
+ EXPECT_CALL(mock_protocol_handler, NotifyOnFailedHandshake());
+
+ command->onTimeOut();
+}
+
+} // namespace basic_communication_get_system_time_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc
new file mode 100644
index 0000000000..8f56c6462c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * 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 names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "hmi/basic_communication_get_system_time_response.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/HMI_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace basic_communication_get_system_time_response {
+
+using sdl_rpc_plugin::commands::BasicCommunicationGetSystemTimeResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::ReturnRef;
+
+ACTION_P(GetEventId, event_id) {
+ *event_id = arg0.id();
+}
+
+class BasicCommunicationGetSystemTimeResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(BasicCommunicationGetSystemTimeResponseTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ MockEventDispatcher mock_event_dispatcher;
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+
+ auto command(CreateCommand<BasicCommunicationGetSystemTimeResponse>(msg));
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_GetSystemTime, event_id);
+}
+
+} // namespace basic_communication_get_system_time_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..6ed15bebeb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
@@ -0,0 +1,112 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "hmi/button_get_capabilities_response.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace button_get_capabilities_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::ButtonGetCapabilitiesResponse;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<ButtonGetCapabilitiesResponse> ResponsePtr;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+class ButtonGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams() {
+ capabilities_[strings::name] = hmi_apis::Common_ButtonName::OK;
+ preset_bank_capabilities_ = true;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::capabilities] = (capabilities_);
+ (*msg)[strings::msg_params][hmi_response::preset_bank_capabilities] =
+ (preset_bank_capabilities_);
+
+ return msg;
+ }
+
+ SmartObject capabilities_;
+ SmartObject preset_bank_capabilities_;
+};
+
+TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeSuccess_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_preset_bank_capabilities(preset_bank_capabilities_));
+
+ command->Run();
+}
+
+TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeAborted_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_))
+ .Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_preset_bank_capabilities(preset_bank_capabilities_)).Times(0);
+
+ command->Run();
+}
+
+} // namespace button_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
new file mode 100644
index 0000000000..6914a4ca7e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
@@ -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.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/close_popup_response.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace close_popup_response {
+
+namespace am = ::application_manager;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::ClosePopupResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(ClosePopupResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ ResponseFromHMIPtr command(CreateCommand<ClosePopupResponse>(command_msg));
+
+ command->Run();
+}
+
+} // namespace close_popup_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
new file mode 100644
index 0000000000..a6497ca6e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -0,0 +1,540 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "hmi/allow_all_apps_request.h"
+#include "hmi/allow_all_apps_response.h"
+#include "hmi/allow_app_request.h"
+#include "hmi/allow_app_response.h"
+#include "hmi/navi_audio_start_stream_request.h"
+#include "hmi/navi_audio_start_stream_response.h"
+#include "hmi/navi_audio_stop_stream_request.h"
+#include "hmi/navi_audio_stop_stream_response.h"
+#include "hmi/update_device_list_request.h"
+#include "hmi/update_device_list_response.h"
+#include "hmi/on_update_device_list.h"
+#include "hmi/on_start_device_discovery.h"
+#include "hmi/update_app_list_request.h"
+#include "hmi/update_app_list_response.h"
+#include "hmi/on_find_applications.h"
+#include "hmi/sdl_get_list_of_permissions_request.h"
+#include "hmi/sdl_get_list_of_permissions_response.h"
+#include "hmi/sdl_get_user_friendly_message_request.h"
+#include "hmi/sdl_get_user_friendly_message_response.h"
+#include "hmi/sdl_get_status_update_request.h"
+#include "hmi/sdl_get_status_update_response.h"
+#include "hmi/on_status_update_notification.h"
+#include "hmi/update_sdl_request.h"
+#include "hmi/update_sdl_response.h"
+#include "hmi/activate_app_request.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/mixing_audio_supported_request.h"
+#include "hmi/mixing_audio_supported_response.h"
+#include "hmi/on_allow_sdl_functionality_notification.h"
+#include "hmi/on_app_permission_changed_notification.h"
+#include "hmi/on_app_permission_consent_notification.h"
+#include "hmi/on_app_activated_notification.h"
+#include "hmi/on_audio_data_streaming_notification.h"
+#include "hmi/on_video_data_streaming_notification.h"
+#include "hmi/on_sdl_consent_needed_notification.h"
+#include "hmi/on_exit_all_applications_notification.h"
+#include "hmi/on_exit_application_notification.h"
+#include "hmi/on_put_file_notification.h"
+#include "hmi/on_resume_audio_source_notification.h"
+#include "hmi/on_ignition_cycle_over_notification.h"
+#include "hmi/on_system_info_changed_notification.h"
+#include "hmi/get_system_info_request.h"
+#include "hmi/get_system_info_response.h"
+#include "hmi/close_popup_request.h"
+#include "hmi/close_popup_response.h"
+#include "hmi/button_get_capabilities_request.h"
+#include "hmi/button_get_capabilities_response.h"
+#include "hmi/ui_add_command_request.h"
+#include "hmi/ui_add_command_response.h"
+#include "hmi/ui_delete_command_request.h"
+#include "hmi/ui_delete_command_response.h"
+#include "hmi/ui_add_submenu_request.h"
+#include "hmi/ui_add_submenu_response.h"
+#include "hmi/ui_delete_submenu_request.h"
+#include "hmi/ui_delete_submenu_response.h"
+#include "hmi/ui_get_supported_languages_request.h"
+#include "hmi/ui_get_supported_languages_response.h"
+#include "hmi/ui_get_language_request.h"
+#include "hmi/ui_get_language_response.h"
+#include "hmi/ui_get_capabilities_request.h"
+#include "hmi/ui_get_capabilities_response.h"
+#include "hmi/ui_change_registration_request.h"
+#include "hmi/ui_change_registration_response.h"
+#include "hmi/ui_show_request.h"
+#include "hmi/ui_show_response.h"
+#include "hmi/ui_alert_request.h"
+#include "hmi/ui_alert_response.h"
+#include "hmi/ui_is_ready_request.h"
+#include "hmi/ui_is_ready_response.h"
+#include "hmi/ui_slider_request.h"
+#include "hmi/ui_slider_response.h"
+#include "hmi/ui_set_media_clock_timer_request.h"
+#include "hmi/ui_set_media_clock_timer_response.h"
+#include "hmi/ui_set_global_properties_request.h"
+#include "hmi/ui_set_global_properties_response.h"
+#include "hmi/ui_scrollable_message_request.h"
+#include "hmi/ui_scrollable_message_response.h"
+#include "hmi/ui_set_app_icon_request.h"
+#include "hmi/ui_set_app_icon_response.h"
+#include "hmi/ui_perform_audio_pass_thru_response.h"
+#include "hmi/ui_perform_audio_pass_thru_request.h"
+#include "hmi/ui_end_audio_pass_thru_request.h"
+#include "hmi/ui_end_audio_pass_thru_response.h"
+#include "hmi/ui_perform_interaction_request.h"
+#include "hmi/ui_perform_interaction_response.h"
+#include "hmi/vr_is_ready_request.h"
+#include "hmi/vr_is_ready_response.h"
+#include "hmi/vr_add_command_request.h"
+#include "hmi/vr_add_command_response.h"
+#include "hmi/vr_delete_command_request.h"
+#include "hmi/vr_delete_command_response.h"
+#include "hmi/vr_change_registration_request.h"
+#include "hmi/vr_change_registration_response.h"
+#include "hmi/vr_get_supported_languages_request.h"
+#include "hmi/vr_get_supported_languages_response.h"
+#include "hmi/vr_get_language_request.h"
+#include "hmi/vr_get_language_response.h"
+#include "hmi/vr_get_capabilities_request.h"
+#include "hmi/vr_get_capabilities_response.h"
+#include "hmi/tts_is_ready_request.h"
+#include "hmi/tts_is_ready_response.h"
+#include "hmi/tts_change_registration_request.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/tts_get_supported_languages_request.h"
+#include "hmi/tts_get_supported_languages_response.h"
+#include "hmi/tts_get_language_request.h"
+#include "hmi/tts_get_language_response.h"
+#include "hmi/tts_stop_speaking_request.h"
+#include "hmi/tts_stop_speaking_response.h"
+#include "hmi/tts_speak_request.h"
+#include "hmi/tts_speak_response.h"
+#include "hmi/tts_set_global_properties_request.h"
+#include "hmi/tts_set_global_properties_response.h"
+#include "hmi/tts_get_capabilities_request.h"
+#include "hmi/tts_get_capabilities_response.h"
+#include "hmi/vr_perform_interaction_request.h"
+#include "hmi/vr_perform_interaction_response.h"
+#include "hmi/sdl_activate_app_request.h"
+#include "hmi/sdl_activate_app_response.h"
+#include "hmi/on_app_permission_changed_notification.h"
+#include "hmi/on_event_changed_notification.h"
+#include "hmi/navi_is_ready_request.h"
+#include "hmi/navi_show_constant_tbt_request.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_is_ready_response.h"
+#include "hmi/navi_alert_maneuver_request.h"
+#include "hmi/navi_alert_maneuver_response.h"
+#include "hmi/navi_update_turn_list_request.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/navi_subscribe_way_points_request.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/navi_unsubscribe_way_points_request.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_get_way_points_request.h"
+#include "hmi/navi_get_way_points_response.h"
+#include "hmi/on_ready_notification.h"
+#include "hmi/on_device_chosen_notification.h"
+#include "hmi/on_file_removed_notification.h"
+#include "hmi/on_system_context_notification.h"
+#include "hmi/on_app_registered_notification.h"
+#include "hmi/on_app_unregistered_notification.h"
+#include "hmi/on_driver_distraction_notification.h"
+#include "hmi/on_tts_started_notification.h"
+#include "hmi/on_tts_stopped_notification.h"
+#include "hmi/on_vr_started_notification.h"
+#include "hmi/on_vr_stopped_notification.h"
+#include "hmi/on_vr_command_notification.h"
+#include "hmi/on_ui_command_notification.h"
+#include "hmi/on_app_deactivated_notification.h"
+#include "hmi/on_ui_language_change_notification.h"
+#include "hmi/on_vr_language_change_notification.h"
+#include "hmi/on_tts_language_change_notification.h"
+#include "hmi/on_navi_tbt_client_state_notification.h"
+#include "hmi/on_navi_way_point_change_notification.h"
+#include "hmi/on_button_event_notification.h"
+#include "hmi/on_button_press_notification.h"
+#include "hmi/on_button_subscription_notification.h"
+#include "hmi/on_ui_keyboard_input_notification.h"
+#include "hmi/on_ui_touch_event_notification.h"
+#include "hmi/on_ui_reset_timeout_notification.h"
+#include "hmi/navi_start_stream_request.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_stop_stream_request.h"
+#include "hmi/navi_stop_stream_response.h"
+#include "hmi/on_system_request_notification.h"
+#include "hmi/ui_set_display_layout_request.h"
+#include "hmi/ui_set_display_layout_response.h"
+#include "hmi/on_sdl_close_notification.h"
+#include "hmi/on_sdl_persistence_complete_notification.h"
+#include "hmi/on_record_start_notification.h"
+#include "hmi/add_statistics_info_notification.h"
+#include "hmi/on_system_error_notification.h"
+#include "hmi/basic_communication_system_request.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/sdl_policy_update.h"
+#include "hmi/sdl_policy_update_response.h"
+#include "hmi/on_received_policy_update.h"
+#include "hmi/on_policy_update.h"
+#include "hmi/get_urls.h"
+#include "hmi/get_urls_response.h"
+#include "hmi/on_device_state_changed_notification.h"
+#include "hmi/navi_send_location_request.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/on_tts_reset_timeout_notification.h"
+#include "hmi/dial_number_request.h"
+#include "hmi/dial_number_response.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace dummy_hmi_commands_test {
+
+namespace commands = sdl_rpc_plugin::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using application_manager::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+template <class Command>
+class HMICommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ stream_retry_.first = 0;
+ stream_retry_.second = 0;
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(stream_retry_));
+ }
+
+ protected:
+ std::pair<uint32_t, int32_t> stream_retry_;
+};
+
+template <class Command>
+class HMICommandsTestFirst : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestSecond : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestThird : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestFourth : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestFifth : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::OnStartDeviceDiscovery,
+ commands::UpdateDeviceListResponse,
+ commands::UpdateDeviceListRequest,
+ commands::ActivateAppResponse,
+ commands::ActivateAppRequest,
+ commands::GetSystemInfoResponse,
+ commands::GetSystemInfoRequest,
+ commands::SDLActivateAppResponse,
+ commands::SDLActivateAppRequest,
+ commands::SDLPolicyUpdateResponse,
+ commands::SDLPolicyUpdate,
+ commands::GetUrlsResponse,
+ commands::GetUrls,
+ commands::OnAppPermissionChangedNotification,
+ commands::SDLGetListOfPermissionsResponse,
+ commands::SDLGetListOfPermissionsRequest,
+ commands::SDLGetUserFriendlyMessageResponse,
+ commands::SDLGetUserFriendlyMessageRequest,
+ commands::SDLGetStatusUpdateResponse,
+ commands::SDLGetStatusUpdateRequest,
+ commands::OnStatusUpdateNotification,
+ commands::OnAppPermissionConsentNotification,
+ commands::MixingAudioSupportedResponse,
+ commands::MixingAudioSupportedRequest,
+ commands::OnExitAllApplicationsNotification,
+ commands::UIAddCommandResponse,
+ commands::UIAddCommandRequest,
+ commands::UIDeleteCommandResponse,
+ commands::UIDeleteCommandRequest,
+ commands::UIAddSubmenuResponse,
+ commands::UIAddSubmenuRequest,
+ commands::UIDeleteSubmenuResponse,
+ commands::UIDeleteSubmenuRequest,
+ commands::UISetMediaClockTimerResponse,
+ commands::UISetMediaClockTimerRequest,
+ commands::UIPerformInteractionResponse,
+ commands::UIPerformInteractionRequest,
+ commands::UISetGlobalPropertiesResponse,
+ commands::UISetGlobalPropertiesRequest,
+ commands::UIScrollableMessageResponse,
+ commands::UIScrollableMessageRequest,
+ commands::UISetAppIconResponse,
+ commands::UISetAppIconRequest,
+ commands::UIGetSupportedLanguagesResponse,
+ commands::UIGetSupportedLanguagesRequest,
+ commands::UIGetLanguageResponse,
+ commands::UIGetLanguageRequest,
+ commands::UIGetCapabilitiesResponse,
+ commands::UIGetCapabilitiesRequest,
+ commands::UIChangeRegistratioResponse> HMICommandsListFirst;
+
+typedef Types<commands::UIChangeRegistrationRequest,
+ commands::UIPerformAudioPassThruResponse,
+ commands::UIPerformAudioPassThruRequest,
+ commands::UIEndAudioPassThruResponse,
+ commands::UIEndAudioPassThruRequest,
+ commands::UIAlertResponse,
+ commands::UIAlertRequest,
+ commands::VRIsReadyResponse,
+ commands::VRIsReadyRequest,
+ commands::VRAddCommandResponse,
+ commands::VRAddCommandRequest,
+ commands::VRDeleteCommandResponse,
+ commands::VRDeleteCommandRequest,
+ commands::VRChangeRegistrationResponse,
+ commands::VRChangeRegistrationRequest,
+ commands::VRGetSupportedLanguagesResponse,
+ commands::VRGetSupportedLanguagesRequest,
+ commands::VRGetLanguageResponse,
+ commands::VRGetLanguageRequest,
+ commands::VRGetCapabilitiesResponse,
+ commands::VRGetCapabilitiesRequest,
+ commands::TTSIsReadyResponse,
+ commands::TTSIsReadyRequest,
+ commands::TTSChangeRegistratioResponse,
+ commands::TTSChangeRegistrationRequest,
+ commands::TTSGetSupportedLanguagesResponse,
+ commands::TTSGetSupportedLanguagesRequest,
+ commands::TTSStopSpeakingResponse,
+ commands::TTSStopSpeakingRequest,
+ commands::TTSGetLanguageResponse,
+ commands::TTSGetLanguageRequest,
+ commands::TTSSpeakResponse,
+ commands::TTSSpeakRequest,
+ commands::TTSSetGlobalPropertiesResponse,
+ commands::TTSSetGlobalPropertiesRequest,
+ commands::TTSGetCapabilitiesResponse,
+ commands::TTSGetCapabilitiesRequest,
+ commands::OnTTSStartedNotification,
+ commands::OnTTSStoppedNotification,
+ commands::OnAppActivatedNotification,
+ commands::OnExitApplicationNotification,
+ commands::UIShowResponse,
+ commands::UIShowRequest,
+ commands::UISliderResponse,
+ commands::UISliderRequest,
+ commands::ClosePopupResponse,
+ commands::ClosePopupRequest,
+ commands::UIIsReadyResponse,
+ commands::UIIsReadyRequest> HMICommandsListSecond;
+
+typedef Types<commands::NaviIsReadyResponse,
+ commands::NaviIsReadyRequest,
+ commands::NaviAlertManeuverResponse,
+ commands::NaviAlertManeuverRequest,
+ commands::NaviGetWayPointsResponse,
+ commands::NaviGetWayPointsRequest,
+ commands::NaviUpdateTurnListResponse,
+ commands::NaviUpdateTurnListRequest,
+ commands::NaviShowConstantTBTResponse,
+ commands::NaviShowConstantTBTRequest,
+ commands::NaviSubscribeWayPointsResponse,
+ commands::NaviSubscribeWayPointsRequest,
+ commands::NaviUnsubscribeWayPointsResponse,
+ commands::NaviUnsubscribeWayPointsRequest,
+ commands::ButtonGetCapabilitiesResponse,
+ commands::ButtonGetCapabilitiesRequest,
+ commands::OnAllowSDLFunctionalityNotification,
+ commands::OnSDLConsentNeededNotification,
+ commands::UpdateSDLResponse,
+ commands::UpdateSDLRequest,
+ commands::OnIgnitionCycleOverNotification,
+ commands::OnSystemInfoChangedNotification,
+ commands::OnReadyNotification,
+ commands::OnDeviceChosenNotification,
+ commands::OnSystemContextNotification,
+ sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification,
+ commands::OnUpdateDeviceList,
+ commands::OnAppRegisteredNotification,
+ commands::OnAppUnregisteredNotification,
+ commands::OnFindApplications,
+ commands::UpdateAppListResponse,
+ commands::UpdateAppListRequest,
+ commands::OnVRStartedNotification,
+ commands::OnVRStoppedNotification,
+ commands::OnVRCommandNotification,
+ commands::OnUICommandNotification,
+ commands::OnAppDeactivatedNotification> HMICommandsListThird;
+
+typedef Types<commands::hmi::OnButtonEventNotification,
+ commands::hmi::OnButtonPressNotification,
+ commands::hmi::OnButtonSubscriptionNotification,
+ commands::OnNaviTBTClientStateNotification,
+ commands::hmi::OnUIKeyBoardInputNotification,
+ commands::hmi::OnUITouchEventNotification,
+ commands::hmi::OnUIResetTimeoutNotification,
+ commands::NaviStartStreamResponse,
+ commands::NaviStartStreamRequest,
+ commands::NaviStopStreamResponse,
+ commands::NaviStopStreamRequest,
+ commands::AudioStartStreamResponse,
+ commands::AudioStartStreamRequest,
+ commands::AudioStopStreamResponse,
+ commands::AudioStopStreamRequest,
+ commands::OnAudioDataStreamingNotification,
+ commands::OnVideoDataStreamingNotification,
+ commands::VRPerformInteractionResponse,
+ commands::VRPerformInteractionRequest,
+ commands::OnSystemRequestNotification,
+ commands::OnPutFileNotification,
+ commands::OnResumeAudioSourceNotification,
+ commands::UiSetDisplayLayoutResponse,
+ commands::UiSetDisplayLayoutRequest,
+ commands::OnSDLCloseNotification,
+ commands::OnSDLPersistenceCompleteNotification,
+ commands::OnFileRemovedNotification,
+ commands::OnRecordStartdNotification,
+ commands::BasicCommunicationSystemResponse,
+ commands::BasicCommunicationSystemRequest,
+ commands::NaviSendLocationResponse,
+ commands::NaviSendLocationRequest,
+ commands::AddStatisticsInfoNotification,
+ commands::OnSystemErrorNotification,
+ commands::OnReceivedPolicyUpdate,
+ commands::OnPolicyUpdate,
+ commands::OnDeviceStateChangedNotification,
+ commands::hmi::OnTTSResetTimeoutNotification,
+ commands::hmi::DialNumberResponse,
+ commands::hmi::DialNumberRequest,
+ commands::OnEventChangedNotification,
+ commands::OnNaviWayPointChangeNotification,
+ commands::OnUILanguageChangeNotification,
+ commands::OnVRLanguageChangeNotification,
+ commands::OnTTSLanguageChangeNotification> HMICommandsListFourth;
+
+typedef Types<commands::AllowAllAppsRequest,
+ commands::AllowAllAppsResponse,
+ commands::AllowAppRequest,
+ commands::AllowAppResponse> HMICommandsListFifth;
+
+TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
+TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
+TYPED_TEST_CASE(HMICommandsTestThird, HMICommandsListThird);
+TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth);
+TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
+
+TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+} // namespace dummy_hmi_commands_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
new file mode 100644
index 0000000000..4cbe7305ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
@@ -0,0 +1,98 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "hmi/get_system_info_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_system_info_request {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestToHMI;
+using sdl_rpc_plugin::commands::GetSystemInfoRequest;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+} // namespace
+
+class GetSystemInfoRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetSystemInfoRequestTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+
+ RequestToHMIPtr command(CreateCommand<GetSystemInfoRequest>(command_msg));
+
+ const uint32_t kAppId = command->application_id();
+
+ EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::msg_params][strings::app_id].asUInt(),
+ kAppId);
+ EXPECT_EQ((*command_msg)[strings::params][strings::correlation_id].asUInt(),
+ kCorrelationId);
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace get_system_info_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
new file mode 100644
index 0000000000..6908e21053
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
@@ -0,0 +1,138 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/get_system_info_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/commands_test.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_system_info_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::GetSystemInfoResponse;
+using sdl_rpc_plugin::commands::SystemInfo;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string ccpu_version("4.1.3.B_EB355B");
+const std::string wers_country_code("WAEGB");
+const uint32_t lang_code = 0u;
+const std::string kLanguage = "";
+} // namespace
+
+class GetSystemInfoResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::msg_params]["ccpu_version"] = ccpu_version;
+ (*command_msg)[strings::msg_params]["wersCountryCode"] = wers_country_code;
+ (*command_msg)[strings::msg_params]["language"] = lang_code;
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(GetSystemInfoResponseTest, GetSystemInfo_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
+
+ std::string language;
+ EXPECT_CALL(mock_message_helper_,
+ CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code)))
+ .WillOnce(Return(language));
+ EXPECT_EQ(kLanguage, language);
+
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetSystemInfo(ccpu_version, wers_country_code, kLanguage));
+
+ command->Run();
+}
+
+TEST_F(GetSystemInfoResponseTest, GetSystemInfo_UNSUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
+
+ EXPECT_CALL(mock_message_helper_,
+ CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code)))
+ .Times(0);
+
+ EXPECT_CALL(mock_policy_handler_, OnGetSystemInfo("", "", ""));
+
+ command->Run();
+}
+
+} // namespace get_system_info_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
new file mode 100644
index 0000000000..339a749909
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
@@ -0,0 +1,88 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_to_hmi.h"
+#include "hmi/get_urls_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_urls_response {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::GetUrlsResponse;
+using am::commands::ResponseToHMI;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseToHMI> ResponseToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class GetUrlResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetUrlResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ ResponseToHMIPtr command(CreateCommand<GetUrlsResponse>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace get_urls_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
new file mode 100644
index 0000000000..2191900750
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
@@ -0,0 +1,334 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/message.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "hmi/get_urls.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/request_from_hmi.h"
+#include "policy/mock_policy_manager.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_urls {
+
+using namespace hmi_apis;
+using namespace policy;
+using ::testing::NiceMock;
+using ::testing::_;
+using ::testing::SetArgReferee;
+using ::test::components::application_manager_test::MockApplication;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestFromHMI;
+using sdl_rpc_plugin::commands::GetUrls;
+using am::commands::CommandImpl;
+using policy::PolicyHandler;
+using policy_test::MockPolicyHandlerInterface;
+
+typedef std::shared_ptr<RequestFromHMI> RequestFromHMIPtr;
+
+namespace {
+const uint32_t kInvalidAppId_ = 0u;
+const uint32_t kAppIdForSending = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kServiceType = 0u;
+const std::string kInitialService = "0x0";
+const std::string kPolicyService = "7";
+const std::string kDefaultUrl = "URL is not found";
+const std::string kDefaultId = "default";
+const std::string kPolicyAppId = "policy_app_id";
+} // namespace
+
+class GetUrlsTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr command_msg_;
+ RequestFromHMIPtr request_command_;
+
+ GetUrlsTest() {
+ command_msg_ =
+ CreateMessage(ns_smart_device_link::ns_smart_objects::SmartType_Map);
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kInitialService;
+
+ request_command_ = CreateCommand<GetUrls>(command_msg_);
+ }
+};
+
+TEST_F(GetUrlsTest, RUN_SUCCESS) {
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+ // EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(_, _));
+
+ request_command_->Run();
+}
+
+TEST_F(GetUrlsTest, RUN_PolicyNotEnabled_UNSUCCESS) {
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+TEST_F(GetUrlsTest, RUN_EmptyEndpoints_UNSUCCESS) {
+ EndpointUrls endpoints_;
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+#ifdef EXTENDED_POLICY
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ 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_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::SUCCESS,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+
+ EXPECT_EQ(kAppIdForSending,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [strings::app_id].asInt());
+ EXPECT_EQ(kDefaultUrl,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [strings::url].asString());
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kInvalidAppId_));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, application(kInvalidAppId_)).Times(0);
+
+ request_command_->Run();
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_ApplicationIsNotValid_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr invalid_mock_app;
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(invalid_mock_app));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_FoundURLForApplication_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ data.app_id = kPolicyAppId;
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(kPolicyAppId));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::SUCCESS,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+#endif
+
+TEST_F(GetUrlsTest, DISABLED_ProcessServiceURLs_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
+ kDefaultUrl;
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id] = "1";
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ data.app_id = "1";
+ endpoints_.push_back(data);
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+ EXPECT_EQ(kDefaultUrl,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::strings::url].asString());
+ EXPECT_EQ(endpoints_[0].app_id,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id].asString());
+}
+
+TEST_F(GetUrlsTest, ProcessServiceURLs_PolicyDefaultId_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
+ kDefaultUrl;
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id] = kDefaultId;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(_))
+ .WillOnce(Return(mock_app));
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+ EXPECT_TRUE(
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ .keyExists(am::hmi_response::policy_app_id));
+}
+
+} // namespace get_urls
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
new file mode 100644
index 0000000000..fe82b16f3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
@@ -0,0 +1,1856 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+
+#include "utils/lock.h"
+#include "utils/data_accessor.h"
+#include "utils/signals.h"
+
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/hmi_capabilities_impl.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "transport_manager/mock_transport_manager.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "application_manager/mock_resume_ctrl.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace hmi_notifications_test {
+
+using ::testing::_;
+using ::testing::Test;
+using ::testing::Types;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::InSequence;
+using ::smart_objects::SmartObject;
+using ::application_manager::commands::MessageSharedPtr;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::application_manager::MockMessageHelper;
+using namespace sdl_rpc_plugin::commands;
+using namespace am::commands;
+
+typedef std::shared_ptr<MockApplication> MockAppPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+#define MEDIA true
+#define NOT_MEDIA false
+#define VC true
+#define NOT_VC false
+#define NAVI true
+#define NOT_NAVI false
+
+ACTION_P(GetEventId, event_id) {
+ *event_id = arg0.id();
+}
+ACTION_P(GetArg, arg) {
+ *arg = arg0;
+}
+
+ACTION_P(GetArg3, result) {
+ arg3 = *result;
+}
+
+ACTION_P2(GetConnectIdPermissionConsent, connect_id, consent) {
+ *connect_id = arg0;
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ arg1.group_permissions.begin();
+ for (; it != arg1.group_permissions.end(); ++it) {
+ consent->group_permissions.push_back(*it);
+ }
+ consent->consent_source = arg1.consent_source;
+}
+ACTION_P2(GetBoolValueAndString, value, str) {
+ *value = arg0;
+ *str = arg1;
+}
+ACTION_P(GetMessage, message) {
+ (*message)[am::strings::params][am::strings::function_id] =
+ (*arg0)[am::strings::params][am::strings::function_id].asInt();
+ (*message)[am::strings::params][am::strings::message_type] =
+ (*arg0)[am::strings::params][am::strings::message_type].asInt();
+ (*message)[am::strings::params][am::strings::correlation_id] =
+ (*arg0)[am::strings::params][am::strings::correlation_id].asInt();
+ (*message)[am::strings::params][am::strings::connection_key] =
+ (*arg0)[am::strings::params][am::strings::connection_key].asInt();
+ return (*message)[am::strings::params][am::strings::correlation_id].asInt();
+}
+
+namespace {
+const uint32_t kCountCommandsManageMobile_ = 22u;
+const uint32_t kCountCommandsToHmi_ = 12u;
+const int32_t kHmiProtocolType_ = 1;
+const int32_t kMobileProtocolType_ = 0;
+const int32_t kProtocolVersion_ = 3;
+const uint32_t kCorrelationId_ = 1939u;
+const uint32_t kAppId_ = 2014u;
+} // namespace
+
+class HMICommandsNotificationsTest
+ : public components::commands_test::CommandsTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ HMICommandsNotificationsTest()
+ : applications_lock_(std::make_shared<sync_primitives::Lock>())
+ , applications_(application_set_, applications_lock_)
+ , app_ptr_(NULL) {}
+
+ ~HMICommandsNotificationsTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+ typedef Command CommandType;
+
+ protected:
+ am::ApplicationSet application_set_;
+ std::shared_ptr<sync_primitives::Lock> applications_lock_;
+ DataAccessor<am::ApplicationSet> applications_;
+
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+
+ application_manager_test::MockStateController mock_state_controller_;
+
+ am::ApplicationSharedPtr app_;
+ NiceMock<MockApplication>* app_ptr_;
+
+ typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
+ kMocksAreNice>::Result MockConnectionHandler;
+
+ typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
+ kMocksAreNice>::Result MockSessionObserver;
+
+ MockConnectionHandler mock_connection_handler_;
+ MockSessionObserver mock_session_observer_;
+
+ void InitCommand(const uint32_t& default_timeout) OVERRIDE {
+ app_ = ConfigureApp(&app_ptr_, kAppId_, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(default_timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(app_mngr_, application_by_hmi_app(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_));
+ }
+
+ am::ApplicationSharedPtr ConfigureApp(NiceMock<MockApplication>** app_mock,
+ uint32_t app_id,
+ bool media,
+ bool navi,
+ bool vc) {
+ *app_mock = new NiceMock<MockApplication>;
+
+ Mock::AllowLeak(*app_mock); // WorkAround for gogletest bug
+ am::ApplicationSharedPtr app(*app_mock);
+
+ ON_CALL(**app_mock, app_id()).WillByDefault(Return(app_id));
+ ON_CALL(**app_mock, is_media_application()).WillByDefault(Return(media));
+ ON_CALL(**app_mock, is_navi()).WillByDefault(Return(navi));
+ ON_CALL(**app_mock, is_voice_communication_supported())
+ .WillByDefault(Return(vc));
+ ON_CALL(**app_mock, IsAudioApplication())
+ .WillByDefault(Return(media || navi || vc));
+ return app;
+ }
+#if defined(OS_POSIX)
+ void SubscribeForSignal() {
+ sigset_t signal_set;
+ sigemptyset(&signal_set);
+ sigaddset(&signal_set, SIGINT);
+ sigaddset(&signal_set, SIGTERM);
+ pthread_sigmask(SIG_BLOCK, &signal_set, NULL);
+ }
+#endif
+};
+
+namespace {
+void sig_handler(int sig) {
+ switch (sig) {
+ case SIGINT:
+ break;
+ case SIGTERM:
+ break;
+ case SIGSEGV:
+ abort();
+ default:
+ exit(EXIT_FAILURE);
+ }
+}
+} // namespace
+
+template <class Command>
+class HMIOnNotificationsListToHMI
+ : public commands_test::CommandsTest<kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <class CommandT, hmi_apis::FunctionID::eType kCommandId>
+struct CommandPair {
+ typedef CommandT CommandType;
+ enum { kHMICommandId = kCommandId };
+};
+
+template <class Command>
+class HMIOnNotificationsEventDispatcher
+ : public commands_test::CommandsTest<kIsNice> {
+ public:
+ typedef Command CommandType;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+typedef Types<OnAppPermissionChangedNotification,
+ OnAudioDataStreamingNotification,
+ hmi::OnButtonSubscriptionNotification,
+ OnFileRemovedNotification,
+ OnPutFileNotification,
+ OnResumeAudioSourceNotification,
+ OnSDLCloseNotification,
+ OnSDLConsentNeededNotification,
+ OnSDLPersistenceCompleteNotification,
+ OnStatusUpdateNotification,
+ OnVideoDataStreamingNotification,
+ OnRecordStartdNotification> HMIOnNotificationsListToHMITypes;
+
+typedef Types<
+ CommandPair<OnAppActivatedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated>,
+ CommandPair<OnAppDeactivatedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated>,
+ CommandPair<OnEventChangedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged>,
+ CommandPair<hmi::OnTTSResetTimeoutNotification,
+ hmi_apis::FunctionID::TTS_OnResetTimeout>,
+ CommandPair<OnTTSStartedNotification, hmi_apis::FunctionID::TTS_Started>,
+ CommandPair<OnTTSStoppedNotification, hmi_apis::FunctionID::TTS_Stopped>,
+ CommandPair<hmi::OnUIResetTimeoutNotification,
+ hmi_apis::FunctionID::UI_OnResetTimeout>,
+ CommandPair<OnVRStartedNotification, hmi_apis::FunctionID::VR_Started>,
+ CommandPair<OnVRStoppedNotification, hmi_apis::FunctionID::VR_Stopped> >
+ HMIOnNotificationsEventDispatcherTypes;
+
+TYPED_TEST_CASE(HMIOnNotificationsListToHMI, HMIOnNotificationsListToHMITypes);
+TYPED_TEST_CASE(HMIOnNotificationsEventDispatcher,
+ HMIOnNotificationsEventDispatcherTypes);
+
+TYPED_TEST(HMIOnNotificationsListToHMI, CommandsSendNotificationToHmi) {
+ MessageSharedPtr message =
+ commands_test::CommandsTest<kIsNice>::CreateMessage();
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>(message);
+ EXPECT_CALL(commands_test::CommandsTest<kIsNice>::mock_rpc_service_,
+ SendMessageToHMI(_));
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(kHmiProtocolType_),
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kProtocolVersion_),
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TYPED_TEST(HMIOnNotificationsEventDispatcher,
+ CommandsNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message =
+ commands_test::CommandsTest<kIsNice>::CreateMessage();
+ std::shared_ptr<typename TestFixture::CommandType::CommandType> command =
+ this->template CreateCommand<
+ typename TestFixture::CommandType::CommandType>(message);
+ EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
+ event_dispatcher())
+ .WillOnce(ReturnRef(this->mock_event_dispatcher_));
+ EXPECT_CALL(this->mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(TestFixture::CommandType::kHMICommandId, event_id);
+}
+
+// notifications(SendNotificationToMobile)
+TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnButtonEventNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnNaviTBTClientStateNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnNaviWayPointChangeSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnNaviWayPointChangeNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUICommandNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU),
+ (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUIKeyBoardInputSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnUIKeyBoardInputNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnKeyboardInputID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUITouchEventSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnUITouchEventNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTouchEventID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppRegisteredNotificationSendNotificationToHmi) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppRegisteredNotification>(message);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ event_id);
+ EXPECT_EQ(
+ kHmiProtocolType_,
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ kProtocolVersion_,
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppUnregisteredNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppUnregisteredNotification>(message);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered),
+ event_id);
+ EXPECT_EQ(
+ kHmiProtocolType_,
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ kProtocolVersion_,
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnButtonPressNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(hmi_apis::FunctionID::Buttons_OnButtonPress),
+ event_id);
+ EXPECT_EQ(static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnReadyNotification>(message);
+
+ EXPECT_CALL(app_mngr_, OnHMIStartedCooperation());
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_OnReady, event_id);
+}
+
+// policy handler
+TEST_F(HMICommandsNotificationsTest,
+ OnIgnitionCycleOverNotificationPolicyHandler) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnIgnitionCycleOverNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, OnIgnitionCycleOver());
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnPolicyUpdateNotificationPolicyHandler) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command = CreateCommand<OnPolicyUpdate>(message);
+
+ EXPECT_CALL(mock_policy_handler_, OnPTExchangeNeeded());
+ command->Run();
+}
+
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+TEST_F(HMICommandsNotificationsTest,
+ OnReceivePolicyUpdateNotification_SUCCESS) {
+ const std::string kFile = "./test_file.txt";
+ EXPECT_TRUE(file_system::CreateFile(kFile));
+ uint8_t tmp[] = {1u, 2u, 3u, 4u};
+ std::vector<uint8_t> data(tmp, tmp + 4);
+ EXPECT_TRUE(file_system::WriteBinaryFile(kFile, data));
+
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
+ (*message)[am::strings::msg_params][am::hmi_notification::policyfile] = kFile;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnReceivedPolicyUpdate>(message);
+
+ EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(kFile, data));
+ command->Run();
+ EXPECT_TRUE(file_system::DeleteFile(kFile));
+}
+#endif
+
+TEST_F(HMICommandsNotificationsTest,
+ OnReceivePolicyUpdateNotification_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
+ std::shared_ptr<Command> command =
+ CreateCommand<OnReceivedPolicyUpdate>(message);
+
+ EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerNoAppId) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ SmartObject& applications =
+ (*message)[am::strings::msg_params]["consentedFunctions"];
+
+ smart_objects::SmartObject hmi_application_temp(smart_objects::SmartType_Map);
+ applications[0] = hmi_application_temp;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(GetArg(&connection_id));
+ command->Run();
+ EXPECT_EQ(0, connection_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerWithAppId) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObjectSPtr consented_function =
+ std::make_shared<smart_objects::SmartObject>();
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(policy::kGroupUndefined, (*it).state);
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowTrue) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["source"] = "test_content_source";
+
+ smart_objects::SmartObjectSPtr consented_function =
+ std::make_shared<smart_objects::SmartObject>();
+ (*consented_function)["allowed"] = true;
+ (*consented_function)[am::strings::id] = 999;
+ (*consented_function)[am::strings::name] = "test_group_alias";
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(999, (*it).group_id);
+ EXPECT_EQ("test_group_alias", (*it).group_alias);
+ EXPECT_EQ(policy::kGroupAllowed, (*it).state);
+ }
+ EXPECT_EQ("test_content_source", permission_consent.consent_source);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowFalse) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["source"] = "test_content_source";
+
+ smart_objects::SmartObjectSPtr consented_function =
+ std::make_shared<smart_objects::SmartObject>();
+ (*consented_function)["allowed"] = false;
+ (*consented_function)[am::strings::id] = 999;
+ (*consented_function)[am::strings::name] = "test_group_alias";
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(999, (*it).group_id);
+ EXPECT_EQ("test_group_alias", (*it).group_alias);
+ EXPECT_EQ(policy::kGroupDisallowed, (*it).state);
+ }
+ EXPECT_EQ("test_content_source", permission_consent.consent_source);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemErrorNotificationOnSystemErrorCode) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::error] =
+ hmi_apis::Common_SystemError::SYNC_REBOOTED;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemErrorNotification>(message);
+
+ int32_t code = hmi_apis::Common_SystemError::INVALID_ENUM;
+ EXPECT_CALL(mock_policy_handler_, OnSystemError(_)).WillOnce(GetArg(&code));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(hmi_apis::Common_SystemError::SYNC_REBOOTED),
+ code);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemInfoChangedNotificationCheckLanguage) {
+ const uint32_t kLangCode = 5u;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLangCode;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemInfoChangedNotification>(message);
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_));
+ EXPECT_CALL(mock_policy_handler_, OnSystemInfoChanged(_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAllowSDLFunctionalityNotificationDeviceKeyNotExist) {
+ const std::string kDeviceId = "";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAllowSDLFunctionalityNotification>(message);
+
+ bool value = false;
+ std::string str;
+ EXPECT_CALL(mock_policy_handler_, OnAllowSDLFunctionalityNotification(_, _))
+ .WillOnce(GetBoolValueAndString(&value, &str));
+ command->Run();
+ EXPECT_EQ(true, value);
+ EXPECT_EQ(kDeviceId, str);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAllowSDLFunctionalityNotificationDeviceKeyExist) {
+ const std::string kDeviceId = "device_id";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
+ (*message)[am::strings::msg_params]["device"]["id"] = kDeviceId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAllowSDLFunctionalityNotification>(message);
+
+ bool value;
+ std::string str;
+ EXPECT_CALL(mock_policy_handler_, OnAllowSDLFunctionalityNotification(_, _))
+ .WillOnce(GetBoolValueAndString(&value, &str));
+ command->Run();
+ EXPECT_EQ(true, value);
+ EXPECT_EQ(kDeviceId, str);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateNotUnpaired) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::INVALID_ENUM;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateUnpaired) {
+ // Random MAC adress for test. It must contain 12 symbols.
+ const std::string device_id = "AA15F2204D6B";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = device_id;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateEmptyDeviceId) {
+ const std::string empty_device_id = "";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ std::string device_id = "default_id";
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_))
+ .WillOnce(GetArg(&device_id));
+ command->Run();
+ EXPECT_EQ(empty_device_id, device_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateDeviceIdFromId) {
+ const std::string empty_device_id = "";
+ const std::string id = "id_string";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
+ (*message)[am::strings::msg_params]["deviceId"]["id"] = id;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ std::string device_id = "default_id";
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_))
+ .WillOnce(GetArg(&device_id));
+ command->Run();
+ EXPECT_EQ(id, device_id);
+}
+
+//~policy_handler
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonIgnitionOff) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+#if defined(OS_POSIX)
+ am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason;
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_))
+ .WillOnce(GetArg(&mob_reason));
+ EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
+
+ SubscribeForSignal();
+ command->Run();
+ utils::Signals::WaitTerminationSignals(sig_handler);
+
+ EXPECT_EQ(am::mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF,
+ mob_reason);
+#endif
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonMasterResetAndFactoryDefaults) {
+ MessageSharedPtr message = CreateMessage();
+
+ std::vector<hmi_apis::Common_ApplicationsCloseReason::eType> reason_list;
+ reason_list.push_back(hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET);
+ reason_list.push_back(
+ hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
+ mob_reason_list;
+ mob_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::MASTER_RESET);
+ mob_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS);
+
+ std::vector<hmi_apis::Common_ApplicationsCloseReason::eType>::iterator
+ it_reason = reason_list.begin();
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
+ it_mob_reason = mob_reason_list.begin();
+
+ for (; it_reason != reason_list.end(); ++it_reason, ++it_mob_reason) {
+ (*message)[am::strings::msg_params][am::hmi_request::reason] = *it_reason;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+#if defined(OS_POSIX)
+ am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
+ *it_mob_reason;
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(mob_reason));
+ EXPECT_CALL(app_mngr_, HeadUnitReset(mob_reason));
+
+ SubscribeForSignal();
+ command->Run();
+ utils::Signals::WaitTerminationSignals(sig_handler);
+#endif
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonSuspend) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::SUSPEND;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+
+ MessageSharedPtr ethalon_message =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*ethalon_message)[am::strings::params][am::strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
+ (*ethalon_message)[am::strings::params][am::strings::message_type] =
+ am::MessageType::kNotification;
+ (*ethalon_message)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId_;
+ MessageSharedPtr temp_message = CreateMessage();
+
+ resumprion_test::MockResumeCtrl mock_resume_ctrl;
+ EXPECT_CALL(app_mngr_, resume_controller())
+ .WillOnce(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, OnSuspend());
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(GetMessage(temp_message));
+
+ command->Run();
+ EXPECT_EQ(
+ static_cast<uint32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete),
+ (*temp_message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<uint32_t>(am::MessageType::kNotification),
+ (*temp_message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(static_cast<uint32_t>(kCorrelationId_),
+ (*temp_message)[am::strings::params][am::strings::correlation_id]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonInvalidEnum) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::INVALID_ENUM;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+
+ 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);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationManageMobileCommand) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(
+ mobile_apis::FunctionID::OnAppInterfaceUnregisteredID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+
+ std::vector<hmi_apis::Common_ApplicationExitReason::eType> reason_list;
+ reason_list.push_back(hmi_apis::Common_ApplicationExitReason::
+ UNAUTHORIZED_TRANSPORT_REGISTRATION);
+ reason_list.push_back(
+ hmi_apis::Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
+ mobile_reason_list;
+ mobile_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
+ mobile_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
+ it_mobile_reason = mobile_reason_list.begin();
+ std::vector<hmi_apis::Common_ApplicationExitReason::eType>::iterator
+ it_reason = reason_list.begin();
+
+ for (; it_reason != reason_list.end(); ++it_reason, ++it_mobile_reason) {
+ (*message)[am::strings::msg_params][am::strings::reason] = *it_reason;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(*it_mobile_reason);
+
+ am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(mock_rpc_plugin_manager_));
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_, *it_mobile_reason)).WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationUnhandledReason) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::INVALID_ENUM;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
+
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillOnce(ReturnRef(mock_rpc_plugin_manager_));
+ EXPECT_CALL(mock_rpc_plugin_manager_, ForEachPlugin(_)).Times(1);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnExitApplicationNotificationInvalidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ DISABLED_OnExitApplicationNotificationDriverDistractionValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ false));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationrUserExitValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::USER_EXIT;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+ am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillOnce(ReturnRef(mock_rpc_plugin_manager_));
+ EXPECT_CALL(mock_rpc_plugin_manager_, ForEachPlugin(_)).Times(1);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ false));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationSwitchedAndValidApp) {
+ const uint32_t cmd_id = 12u;
+ const uint32_t max_cmd_id = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = cmd_id;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, mobile_apis::HMILevel::HMI_FULL, true));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(max_cmd_id));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationSwitchedAndInvalidApp) {
+ const uint32_t kCmdId = 12u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationCmdIdEqualToMaxCmdId) {
+ const uint32_t kCmdId = 11u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationCmdIdLessMaxCmdIsInvalidApp) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationActivePerformIteraction) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+ const uint32_t kIsPerformInteractionActive = 1u;
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
+ .WillOnce(Return(kIsPerformInteractionActive));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+ EXPECT_EQ(hmi_apis::FunctionID::VR_OnCommand, event_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationNotActivePerformIteraction) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+ const uint32_t kIsPerformInteractionActive = 0u;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ (*message)[am::strings::msg_params][am::strings::function_id] =
+ mobile_apis::FunctionID::eType::OnCommandID;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
+ .WillOnce(Return(kIsPerformInteractionActive));
+
+ EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR),
+ (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnVRLanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRLanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRLanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_, mobile_apis::HMILevel::HMI_NONE, false));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnStartDeviceDiscoveryRun) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnStartDeviceDiscovery>(message);
+ EXPECT_CALL(app_mngr_, StartDevicesDiscovery());
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceChosenNotificationDeviceInfoExists) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::device_info]
+ [am::strings::id] = "2014";
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceChosenNotification>(message);
+ EXPECT_CALL(app_mngr_,
+ ConnectToDevice(
+ (*message)[am::strings::msg_params][am::strings::device_info]
+ [am::strings::id].asString()));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceChosenNotificationDeviceInfoNotExists) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceChosenNotification>(message);
+ EXPECT_CALL(app_mngr_, ConnectToDevice(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationValidActiveApplication) {
+ MessageSharedPtr message = CreateMessage();
+ std::vector<am::mobile_api::SystemContext::eType> system_context_list;
+ system_context_list.push_back(
+ am::mobile_api::SystemContext::SYSCTXT_VRSESSION);
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MENU);
+ system_context_list.push_back(
+ am::mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED);
+
+ std::vector<am::mobile_api::SystemContext::eType>::iterator it =
+ system_context_list.begin();
+ for (; it != system_context_list.end(); ++it) {
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ *it;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationInvalidActiveApplication) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::SYSCTXT_VRSESSION;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationInvalidSystemContext) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::INVALID_ENUM;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, active_application()).Times(0);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationValidApplication) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ std::vector<am::mobile_api::SystemContext::eType> system_context_list;
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_ALERT);
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MAIN);
+
+ std::vector<am::mobile_api::SystemContext::eType>::iterator it =
+ system_context_list.begin();
+ for (; it != system_context_list.end(); ++it) {
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ *it;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationAppIdDoesntExists) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::SYSCTXT_ALERT;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdExistsAndValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ const int32_t device_id = 1;
+ ON_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
+ .WillByDefault(Return(device_id));
+
+ EXPECT_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdExistsAndInvalidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+ ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdDoesntExistsAndValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppId_));
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ const int32_t device_id = 1;
+ ON_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
+ .WillByDefault(Return(device_id));
+
+ EXPECT_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdDoesntExistsAndNullAppId) {
+ const uint32_t kNullApppId = 0u;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kNullApppId));
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnTTSLanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnTTSLanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnTTSLanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUILanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, ui_language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUILanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kLang),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUILanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::Language::EN_US),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(state));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDriverDistractionNotificationInvalidApp) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ ApplicationSharedPtr invalid_app;
+ application_set_.insert(invalid_app);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::mobile_notification::state] = state;
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_));
+ EXPECT_CALL(mock_policy_handler_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL))
+ .WillOnce(GetMessage(message));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(am::mobile_api::FunctionID::OnDriverDistractionID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+} // namespace hmi_notifications_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
new file mode 100644
index 0000000000..8164f957cb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
@@ -0,0 +1,89 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "hmi/mixing_audio_supported_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace mixing_audio_supported_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestToHMI;
+using sdl_rpc_plugin::commands::MixingAudioSupportedRequest;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class MixingAudioSupportedRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(MixingAudioSupportedRequestTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ RequestToHMIPtr command(
+ CreateCommand<MixingAudioSupportedRequest>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace mixing_audio_supported_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
new file mode 100644
index 0000000000..aa651c2dca
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
@@ -0,0 +1,100 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace mixing_audio_supported_response {
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::MixingAudioSupportedResponse;
+using application_manager::commands::ResponseFromHMI;
+using am::commands::CommandImpl;
+using am::HMICapabilities;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class MixingAudioSupportedResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(MixingAudioSupportedResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<MixingAudioSupportedResponse>(command_msg));
+
+ const bool hmiResponse =
+ (*command_msg)[strings::msg_params][hmi_response::attenuated_supported]
+ .asBool();
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_attenuated_supported(hmiResponse));
+
+ command->Run();
+}
+
+} // namespace mixing_audio_supported_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
new file mode 100644
index 0000000000..d8454bb98e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
@@ -0,0 +1,121 @@
+/*
+ * 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 <utility>
+
+#include "hmi/navi_audio_start_stream_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_audio_start_stream_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AudioStartStreamRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kHmiAppId = 13u;
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+class AudioStartStreamRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AudioStartStreamRequestTest() {
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(start_stream_retry_amount_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<AudioStartStreamRequest>(msg_);
+ }
+
+ std::pair<uint32_t, int32_t> start_stream_retry_amount_;
+ MessageSharedPtr msg_;
+ std::shared_ptr<AudioStartStreamRequest> command_;
+};
+
+TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(AudioStartStreamRequestTest,
+ Run_HmiInterfaceAvailableButNoApp_NoRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_audio_streaming_allowed(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg_));
+
+ command_->Run();
+}
+
+} // namespace navi_audio_start_stream_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
new file mode 100644
index 0000000000..1a03ecf523
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
@@ -0,0 +1,135 @@
+/*
+ * 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 "hmi/navi_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::NaviIsReadyRequest;
+using am::event_engine::Event;
+
+namespace {
+const hmi_apis::FunctionID::eType kEventID =
+ hmi_apis::FunctionID::Navigation_IsReady;
+} // namespace
+
+typedef std::shared_ptr<NaviIsReadyRequest> NaviIsReadyRequestPtr;
+
+class NaviIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviIsReadyRequestTest() : command_(CreateCommand<NaviIsReadyRequest>()) {}
+
+ NaviIsReadyRequestPtr command_;
+};
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_HmiInterfaceIsAvailable_NaviCooperatingIsAvailable) {
+ const bool is_hmi_interface_available = true;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::msg_params][am::strings::available] =
+ is_hmi_interface_available;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
+ am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_HmiInterfaceIsNotAvailable_NaviCooperatingIsNotAvailable) {
+ const bool is_hmi_interface_available = false;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::msg_params][am::strings::available] =
+ is_hmi_interface_available;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_AvailabilityFieldMissing_NaviCooperatingIsNotAvailable) {
+ const bool is_hmi_interface_available = false;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+} // namespace navi_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
new file mode 100644
index 0000000000..23f01fac3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "hmi/navi_is_ready_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_is_ready_responce {
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+
+using ::testing::ReturnRef;
+
+using application_manager::commands::ResponseFromHMI;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class NaviIsReadyResponseTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NaviIsReadyResponseTest, NaviIsReadyResponse_Run_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<commands::NaviIsReadyResponse>());
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+ command->Run();
+}
+
+} // namespace navi_is_ready_responce
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
new file mode 100644
index 0000000000..3110a11fd8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
@@ -0,0 +1,216 @@
+/*
+ * 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 names of the copyright holders 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 <algorithm>
+
+#include "hmi/navi_set_video_config_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_set_video_config_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::NaviSetVideoConfigRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kHmiAppId = 13u;
+const hmi_apis::FunctionID::eType kEventID =
+ hmi_apis::FunctionID::Navigation_SetVideoConfig;
+} // namespace
+
+typedef std::shared_ptr<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr;
+
+class NaviSetVideoConfigRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviSetVideoConfigRequestTest() {
+ mock_app_ptr_ = CreateMockApp();
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_ptr_));
+ ON_CALL(app_mngr_, application_by_hmi_app(_))
+ .WillByDefault(Return(mock_app_ptr_));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_ptr_, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+ }
+
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+ MockAppPtr mock_app_ptr_;
+ MockEventDispatcher mock_event_dispatcher_;
+};
+
+TEST_F(NaviSetVideoConfigRequestTest, OnEventWithSuccessResponse) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, true, empty))
+ .Times(1);
+
+ command->on_event(event);
+}
+
+static bool ValidateList(std::vector<std::string>& expected,
+ std::vector<std::string>& actual) {
+ std::sort(expected.begin(), expected.end());
+ std::sort(actual.begin(), actual.end());
+ return std::equal(expected.begin(), expected.end(), actual.begin());
+}
+
+TEST_F(NaviSetVideoConfigRequestTest, OnEventWithRejectedResponse) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*request_msg)[am::strings::msg_params][am::strings::config] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::codec] =
+ hmi_apis::Common_VideoStreamingCodec::H265;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::height] = 640;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::width] = 480;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params][0] =
+ "codec";
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params][1] =
+ "protocol";
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, _))
+ .WillOnce(SaveArg<3>(&rejected_params));
+
+ command->on_event(event);
+
+ ASSERT_EQ(2u, rejected_params.size());
+ std::vector<std::string> expected_list;
+ expected_list.push_back(std::string("protocol"));
+ expected_list.push_back(std::string("codec"));
+ ASSERT_TRUE(ValidateList(expected_list, rejected_params));
+}
+
+TEST_F(NaviSetVideoConfigRequestTest,
+ OnEventWithRejectedResponseWithoutParams) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
+ .WillOnce(Return());
+
+ command->on_event(event);
+}
+
+TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
+ .WillOnce(Return());
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1);
+
+ command->onTimeOut();
+}
+
+} // namespace navi_set_video_config_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
new file mode 100644
index 0000000000..06fa61db29
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
@@ -0,0 +1,78 @@
+/*
+ * 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 names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "hmi/navi_set_video_config_response.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_set_video_config_response {
+
+using sdl_rpc_plugin::commands::NaviSetVideoConfigResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+class NaviSetVideoConfigResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<NaviSetVideoConfigResponse> command(
+ CreateCommand<NaviSetVideoConfigResponse>(msg));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace navi_set_video_config_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
new file mode 100644
index 0000000000..a7f50504fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
@@ -0,0 +1,120 @@
+/*
+ * 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 <utility>
+
+#include "hmi/navi_start_stream_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_start_stream_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::NaviStartStreamRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kHmiAppId = 13u;
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+class NaviStartStreamRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviStartStreamRequestTest() {
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(start_stream_retry_amount_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<NaviStartStreamRequest>(msg_);
+ }
+
+ std::pair<uint32_t, int32_t> start_stream_retry_amount_;
+ MessageSharedPtr msg_;
+ std::shared_ptr<NaviStartStreamRequest> command_;
+};
+
+TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(NaviStartStreamRequestTest,
+ Run_HmiInterfaceAvailableButNoApp_NoRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_video_streaming_allowed(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg_));
+
+ command_->Run();
+}
+
+} // namespace navi_start_stream_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
new file mode 100644
index 0000000000..e4a79997fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
@@ -0,0 +1,105 @@
+/*
+ * 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 "hmi/navi_stop_stream_request.h"
+#include "hmi/navi_audio_stop_stream_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_stop_stream_requests {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+namespace {
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+template <typename Command>
+class NaviStopStreamRequestsTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviStopStreamRequestsTest() {
+ ON_CALL(this->app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<Command>(msg_);
+ }
+
+ MessageSharedPtr msg_;
+ std::shared_ptr<Command> command_;
+};
+
+typedef testing::Types<commands::AudioStopStreamRequest,
+ commands::NaviStopStreamRequest> RequestCommandsList;
+TYPED_TEST_CASE(NaviStopStreamRequestsTest, RequestCommandsList);
+
+TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
+ GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(TestFixture::mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ TestFixture::command_->Run();
+}
+
+TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceAvailable_SentRequest) {
+ EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
+ GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(TestFixture::mock_rpc_service_,
+ SendMessageToHMI(TestFixture::msg_));
+
+ TestFixture::command_->Run();
+}
+
+} // namespace navi_stop_stream_requests
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
new file mode 100644
index 0000000000..fc3899e861
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
@@ -0,0 +1,159 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/lock.h"
+#include "utils/data_accessor.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/on_driver_distraction_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace on_driver_distraction_notification {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::Eq;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification;
+using namespace am::commands;
+
+typedef std::shared_ptr<OnDriverDistractionNotification> NotificationPtr;
+
+class HMIOnDriverDistractionNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ HMIOnDriverDistractionNotificationTest()
+ : app_set_lock_(std::make_shared<sync_primitives::Lock>()) {}
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+};
+
+MATCHER_P2(CheckNotificationParams, function_id, state, "") {
+ bool is_function_id_matched =
+ function_id ==
+ static_cast<am::mobile_api::FunctionID::eType>(
+ (*arg)[am::strings::params][am::strings::function_id].asInt());
+ bool is_state_matched =
+ state ==
+ static_cast<hmi_apis::Common_DriverDistractionState::eType>(
+ (*arg)[am::strings::msg_params][am::mobile_notification::state]
+ .asInt());
+ return is_function_id_matched && is_state_matched;
+}
+
+ACTION_P(GetArg3, result) {
+ arg3 = *result;
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest, Run_PushMobileMessage_SUCCESS) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
+
+ MockAppPtr mock_app = CreateMockApp();
+ am::ApplicationSet app_set;
+ app_set.insert(mock_app);
+
+ DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcDisallowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_interface_));
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+
+ EXPECT_CALL(*mock_app,
+ PushMobileMessage(CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state)));
+
+ command->Run();
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_SendNotificationToMobile_SUCCESS) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
+
+ MockAppPtr mock_app = CreateMockApp();
+ am::ApplicationSet app_set;
+ app_set.insert(mock_app);
+
+ DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_interface_));
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state),
+ Command::CommandSource::SOURCE_SDL));
+
+ command->Run();
+}
+
+} // on_driver_distraction_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc
new file mode 100644
index 0000000000..2d50ec2b72
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc
@@ -0,0 +1,80 @@
+/*
+ * 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 names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "hmi/on_system_time_ready_notification.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/HMI_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace on_system_time_ready_notification {
+
+using sdl_rpc_plugin::commands::OnSystemTimeReadyNotification;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::ReturnRef;
+
+class OnSystemTimeReadyNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+ACTION_P(GetEventId, event_id) {
+ *event_id = arg0.id();
+}
+
+TEST_F(OnSystemTimeReadyNotificationTest, Run_SUCCESS) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr msg = CreateMessage();
+ MockEventDispatcher mock_event_dispatcher;
+
+ auto command(CreateCommand<OnSystemTimeReadyNotification>(msg));
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady,
+ event_id);
+}
+
+} // namespace on_system_time_ready_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..8e62c1a409
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
@@ -0,0 +1,176 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "hmi/rc_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_get_capabilities_response {
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class RCGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][strings::rc_capability] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::rc_capability] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& remote_control_capability =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::rc_capability];
+
+ remote_control_capability["climateControlCapabilities"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability["climateControlCapabilities"][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& climate_control_capability =
+ remote_control_capability["climateControlCapabilities"][0];
+
+ climate_control_capability["moduleName"] = "Climate";
+ climate_control_capability["fanSpeedAvailable"] = true;
+ climate_control_capability["desiredTemperatureAvailable"] = true;
+ climate_control_capability["acEnableAvailable"] = true;
+ climate_control_capability["acMaxEnableAvailable"] = true;
+ climate_control_capability["circulateAirEnableAvailable"] = true;
+ climate_control_capability["autoModeEnableAvailable"] = true;
+ climate_control_capability["dualModeEnableAvailable"] = true;
+
+ climate_control_capability["defrostZoneAvailable"] = true;
+ climate_control_capability["defrostZone"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ climate_control_capability["defrostZone"][0] = "ALL";
+
+ climate_control_capability["ventilationModeAvailable"] = true;
+ climate_control_capability["ventilationMode"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ climate_control_capability["ventilationMode"][0] = "BOTH";
+
+ remote_control_capability["radioControlCapabilities"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability["radioControlCapabilities"][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& radio_control_capability =
+ remote_control_capability["radioControlCapabilities"][0];
+
+ radio_control_capability["moduleName"] = "Radio";
+ radio_control_capability["radioEnableAvailable"] = true;
+ radio_control_capability["radioBandAvailable"] = true;
+ radio_control_capability["radioFrequencyAvailable"] = true;
+ radio_control_capability["hdChannelAvailable"] = true;
+ radio_control_capability["rdsDataAvailable"] = true;
+ radio_control_capability["availableHDsAvailable"] = true;
+ radio_control_capability["stateAvailable"] = true;
+ radio_control_capability["signalStrengthAvailable"] = true;
+ radio_control_capability["signalChangeThresholdAvailable"] = true;
+
+ remote_control_capability[hmi_response::button_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability[hmi_response::button_capabilities][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& button_capability =
+ remote_control_capability[hmi_response::button_capabilities][0];
+
+ button_capability[strings::button_name] = "OK";
+ button_capability["shortPressAvailable"] = true;
+ button_capability["longPressAvailable"] = true;
+ button_capability["upDownAvailable"] = true;
+
+ RCGetCapabilitiesResponsePtr command(
+ CreateCommand<RCGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject rc_capability_so =
+ (*command_msg)[strings::msg_params][strings::rc_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_capability(rc_capability_so));
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(true));
+
+ command->Run();
+}
+
+} // namespace rc_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/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
new file mode 100644
index 0000000000..030db2f424
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
@@ -0,0 +1,168 @@
+/*
+ * 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 "hmi/rc_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::RCIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<RCIsReadyRequest> RCIsReadyRequestPtr;
+
+class RCIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCIsReadyRequestTest() : command_(CreateCommand<RCIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_rc_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_rc_cooperating(is_rc_cooperating_available));
+ if (!is_rc_cooperating_available) {
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(false));
+ }
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillOnce(Return(state));
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr capabilities(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_rc_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_rc_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ RCIsReadyRequestPtr command_;
+ am::MockHmiInterfaces mock_hmi_interfaces_;
+};
+
+TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_rc_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_rc_cooperating_available);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace rc_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
new file mode 100644
index 0000000000..a1a8c1c87e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "hmi/rc_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_response {
+
+using ::testing::Return;
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::RCIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<RCIsReadyResponse> RCIsReadyResponsePtr;
+
+class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(RCIsReadyResponseTest, RUN_SUCCESS) {
+ RCIsReadyResponsePtr command(CreateCommand<RCIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace rc_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
new file mode 100644
index 0000000000..0b1f2df491
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
@@ -0,0 +1,131 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
+#include "application_manager/commands/response_from_hmi.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace response_from_hmi {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::SaveArg;
+using ::testing::DoAll;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+namespace am = ::application_manager;
+using application_manager::commands::ResponseFromHMI;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResponseFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(ResponseFromHMITest, SendResponseToMobile_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(msg, _));
+
+ command->SendResponseToMobile(msg, app_mngr_);
+
+ const application_manager::MessageType received_message_tipe =
+ static_cast<application_manager::MessageType>(
+ (*msg)[am::strings::params][am::strings::message_type].asInt());
+
+ EXPECT_EQ(application_manager::MessageType::kResponse, received_message_tipe);
+}
+
+TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr result_msg;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(true)));
+
+ const hmi_apis::FunctionID::eType posted_function_id =
+ hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr dummy_msg_params = CreateMessage();
+ command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
+
+ ASSERT_TRUE((bool)result_msg);
+
+ const application_manager::MessageType received_message_tipe =
+ static_cast<application_manager::MessageType>(
+ (*result_msg)[am::strings::params][am::strings::message_type]
+ .asInt());
+
+ EXPECT_EQ(am::MessageType::kRequest, received_message_tipe);
+
+ const hmi_apis::FunctionID::eType received_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ EXPECT_EQ(posted_function_id, received_function_id);
+}
+
+TEST_F(ResponseFromHMITest, CreateHMIRequest_CantManageCommand_Covering) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr result_msg;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID()).WillByDefault(Return(1u));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(false)));
+
+ const hmi_apis::FunctionID::eType posted_function_id =
+ hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr dummy_msg_params = CreateMessage();
+ command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
+}
+
+} // namespace response_from_hmi
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/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
new file mode 100644
index 0000000000..38cbc7b069
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
@@ -0,0 +1,500 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/lock.h"
+#include "utils/helpers.h"
+#include "hmi/sdl_activate_app_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_state_controller.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_activate_app_request {
+
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLActivateAppRequest;
+using am::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::Mock;
+using ::testing::NiceMock;
+using policy_test::MockPolicyHandlerInterface;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const uint32_t kAppIDFirst = 1u;
+const connection_handler::DeviceHandle kHandle = 2u;
+} // namespace
+
+MATCHER_P2(CheckMsgParams, result, corr_id, "") {
+ const bool is_func_id_valid =
+ hmi_apis::FunctionID::SDL_ActivateApp ==
+ static_cast<int32_t>(
+ (*arg)[strings::params][strings::function_id].asInt());
+
+ const bool is_result_code_valid =
+ hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED ==
+ static_cast<int32_t>(
+ (*arg)[strings::msg_params][strings::result_code].asInt());
+
+ const bool is_result_valid =
+ result == (*arg)[strings::msg_params][strings::success].asBool();
+
+ const bool is_corr_id_valid =
+ corr_id == ((*arg)[strings::params][strings::correlation_id].asUInt());
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ is_func_id_valid,
+ is_result_code_valid,
+ is_result_valid,
+ is_corr_id_valid);
+}
+
+class SDLActivateAppRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SDLActivateAppRequestTest()
+ : lock_(std::make_shared<sync_primitives::Lock>()) {}
+
+ protected:
+ ~SDLActivateAppRequestTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ MockAppPtr mock_app = CreateMockApp();
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app), app_id()).WillByDefault(Return(kAppID));
+ ON_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillByDefault(Return(mock_app));
+ }
+ void SetCorrelationAndAppID(MessageSharedPtr msg) {
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+ }
+
+ ApplicationSet app_list_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+ policy_test::MockPolicyHandlerInterface policy_handler_;
+ application_manager_test::MockStateController mock_state_controller_;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+
+TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+ (*msg)[strings::msg_params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_ActivateApp;
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp)))
+ .WillOnce(Return(true));
+
+ command->Run();
+}
+#else
+
+TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppID)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ ON_CALL(*mock_app, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ const std::string url = "url";
+ ON_CALL(*mock_app_first, SchemaUrl()).WillByDefault(Return(url));
+ const std::string package = "package";
+ ON_CALL(*mock_app_first, PackageName()).WillByDefault(Return(package));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, AppIdNotFound_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
+
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ app_list_ = accessor.GetData();
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ app_list_ = accessor.GetData();
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppIDFirst))
+ .WillByDefault(Return(mock_app_first));
+
+ app_list_.insert(mock_app_first);
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+
+ const std::string schema("schema");
+ mock_app->SetShemaUrl(schema);
+ const std::string package_name("package_name");
+ mock_app->SetPackageName(package_name);
+
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, schema, package_name, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ app_list_ = accessor.GetData();
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+#endif
+
+TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+ ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->onTimeOut();
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>());
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*event_msg);
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) {
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
+ kAppID;
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>());
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr invalid_mock_app;
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_))
+ .WillOnce(Return(invalid_mock_app));
+
+ command->on_event(event);
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
+ kAppID;
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppID));
+
+ EXPECT_CALL(mock_policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->on_event(event);
+}
+
+} // namespace sdl_activate_app_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
new file mode 100644
index 0000000000..bca316bcfa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
@@ -0,0 +1,85 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "hmi/sdl_activate_app_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_activate_app_response {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::SDLActivateAppResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class SDLActivateAppResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SDLActivateAppResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ SDLActivateAppResponsePtr command(
+ CreateCommand<SDLActivateAppResponse>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace sdl_activate_app_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
new file mode 100644
index 0000000000..262ac5fc7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
@@ -0,0 +1,111 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_list_of_permissions_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLGetListOfPermissionsRequest;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using smart_objects::SmartObject;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const uint32_t kConnectionKey = 0u;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+class SDLGetListOfPermissionsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
+ }
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillOnce(Return(mock_app_));
+
+ std::shared_ptr<SDLGetListOfPermissionsRequest> command(
+ CreateCommand<SDLGetListOfPermissionsRequest>(msg));
+
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetListOfPermissions(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetListOfPermissionsRequestTest, Run_KeyDoesntExist_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Binary);
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ std::shared_ptr<SDLGetListOfPermissionsRequest> command(
+ CreateCommand<SDLGetListOfPermissionsRequest>(msg));
+
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetListOfPermissions(kConnectionKey, kCorrelationID));
+
+ command->Run();
+}
+
+} // namespace sdl_get_list_of_permissions_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
new file mode 100644
index 0000000000..fca8ed840f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
@@ -0,0 +1,79 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_status_update_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_status_update_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLGetStatusUpdateRequest;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+class SDLGetStatusUpdateRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ std::shared_ptr<SDLGetStatusUpdateRequest> command(
+ CreateCommand<SDLGetStatusUpdateRequest>(msg));
+
+ EXPECT_CALL(mock_policy_handler_, OnGetStatusUpdate(kCorrelationID));
+
+ command->Run();
+}
+
+} // namespace sdl_get_status_update_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
new file mode 100644
index 0000000000..b040f8ea40
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
@@ -0,0 +1,160 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_user_friendly_message_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLGetUserFriendlyMessageRequest;
+using application_manager::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using test::components::application_manager_test::MockHMICapabilities;
+using testing::_;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const std::string kLanguageDe = "de-de";
+const std::string kLanguageEn = "en-gb";
+const std::string kMessageCodes = "messageCodes";
+const hmi_apis::Common_Language::eType kLanguage =
+ hmi_apis::Common_Language::EN_GB;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+
+class SDLGetUserFriendlyMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillOnce(Return(mock_app_));
+ }
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ (*msg)[strings::msg_params][kMessageCodes] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
+ (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
+
+ (*msg)[strings::msg_params][strings::language] = kLanguage;
+
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
+ .WillOnce(Return(kLanguageEn));
+ std::vector<std::string> msg_codes;
+ msg_codes.push_back(kLanguageDe);
+ msg_codes.push_back(kLanguageEn);
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ (*msg)[strings::msg_params][kMessageCodes] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
+ (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
+
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(kLanguage));
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
+ .WillOnce(Return(kLanguageEn));
+ std::vector<std::string> msg_codes;
+ msg_codes.push_back(kLanguageDe);
+ msg_codes.push_back(kLanguageEn);
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_NoMsgCodes_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_)).Times(0);
+ EXPECT_CALL(mock_policy_handler_, OnGetUserFriendlyMessage(_, _, _)).Times(0);
+
+ command->Run();
+}
+
+} // namespace sdl_get_user_friendly_message_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
new file mode 100644
index 0000000000..581913d3a5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
@@ -0,0 +1,78 @@
+/*
+ * 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 "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+
+#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/commands/command_notification_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_notifications_test {
+
+using namespace application_manager;
+
+using ::testing::Types;
+using commands::NotificationToHMI;
+template <typename Command>
+class SimpleNotificationsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::CommandNotificationImpl, NotificationToHMI>
+ CommandsList;
+
+TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList);
+
+TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+} // namespace simple_notifications_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/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
new file mode 100644
index 0000000000..5c42d265c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
@@ -0,0 +1,96 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_requests_from_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+using ::testing::NiceMock;
+namespace commands = ::application_manager::commands;
+using commands::MessageSharedPtr;
+using ::application_manager::event_engine::EventObserver;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ }
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<commands::RequestFromHMI> command(
+ CreateCommand<commands::RequestFromHMI>());
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_NO_THROW(command->on_event(event));
+}
+
+TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
+ std::shared_ptr<commands::RequestFromHMI> command(
+ CreateCommand<commands::RequestFromHMI>());
+
+ const bool success = false;
+ const uint32_t correlation_id = 1u;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(NotNull()));
+
+ command->SendResponse(success,
+ correlation_id,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+} // namespace simple_requests_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
new file mode 100644
index 0000000000..599c7e50f2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
@@ -0,0 +1,265 @@
+/*
+ * 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 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 "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/command.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_requests_to_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+namespace am_commands = application_manager::commands;
+using am_commands::MessageSharedPtr;
+using event_engine_test::MockEventDispatcher;
+
+class RequestToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<am_commands::RequestToHMI> command(
+ CreateCommand<am_commands::RequestToHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(RequestToHMITest, SendRequest_SUCCESS) {
+ std::shared_ptr<am_commands::RequestToHMI> command(
+ CreateCommand<am_commands::RequestToHMI>());
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->SendRequest();
+}
+
+template <typename Command>
+class RequestToHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <typename Command>
+class RequestToHMICommandsTest2 : public RequestToHMICommandsTest<Command> {};
+
+template <typename Command>
+class RequestToHMICommandsTest3
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<sdl_rpc_plugin::commands::hmi::DialNumberRequest,
+ sdl_rpc_plugin::commands::ClosePopupRequest,
+ sdl_rpc_plugin::commands::TTSSetGlobalPropertiesRequest,
+ sdl_rpc_plugin::commands::TTSSpeakRequest,
+ sdl_rpc_plugin::commands::TTSStopSpeakingRequest,
+ sdl_rpc_plugin::commands::TTSGetSupportedLanguagesRequest,
+ sdl_rpc_plugin::commands::UIAddCommandRequest,
+ sdl_rpc_plugin::commands::UIAddSubmenuRequest,
+ sdl_rpc_plugin::commands::UIAlertRequest,
+ sdl_rpc_plugin::commands::UIChangeRegistrationRequest,
+ sdl_rpc_plugin::commands::UIDeleteCommandRequest,
+ sdl_rpc_plugin::commands::UIDeleteSubmenuRequest,
+ sdl_rpc_plugin::commands::UIEndAudioPassThruRequest,
+ sdl_rpc_plugin::commands::UIGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::UIGetLanguageRequest,
+ sdl_rpc_plugin::commands::UIGetSupportedLanguagesRequest,
+ sdl_rpc_plugin::commands::UIPerformAudioPassThruRequest,
+ sdl_rpc_plugin::commands::UIPerformInteractionRequest,
+ sdl_rpc_plugin::commands::UISetMediaClockTimerRequest,
+ sdl_rpc_plugin::commands::UIShowRequest,
+ sdl_rpc_plugin::commands::VRAddCommandRequest,
+ sdl_rpc_plugin::commands::VRChangeRegistrationRequest,
+ sdl_rpc_plugin::commands::VRDeleteCommandRequest,
+ sdl_rpc_plugin::commands::UISliderRequest,
+ sdl_rpc_plugin::commands::TTSChangeRegistrationRequest,
+ sdl_rpc_plugin::commands::TTSGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::TTSGetLanguageRequest,
+ sdl_rpc_plugin::commands::AllowAllAppsRequest,
+ sdl_rpc_plugin::commands::BasicCommunicationSystemRequest,
+ sdl_rpc_plugin::commands::ButtonGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::NaviSendLocationRequest,
+ sdl_rpc_plugin::commands::NaviUnsubscribeWayPointsRequest,
+ sdl_rpc_plugin::commands::NaviUpdateTurnListRequest,
+ sdl_rpc_plugin::commands::NaviShowConstantTBTRequest,
+ sdl_rpc_plugin::commands::NaviStopStreamRequest,
+ sdl_rpc_plugin::commands::NaviSubscribeWayPointsRequest,
+ sdl_rpc_plugin::commands::NaviAlertManeuverRequest,
+ sdl_rpc_plugin::commands::AudioStopStreamRequest,
+ sdl_rpc_plugin::commands::NaviGetWayPointsRequest,
+ sdl_rpc_plugin::commands::UISetGlobalPropertiesRequest,
+ sdl_rpc_plugin::commands::UISendHapticDataRequest>
+ RequestCommandsList;
+
+typedef Types<sdl_rpc_plugin::commands::UIScrollableMessageRequest,
+ sdl_rpc_plugin::commands::VRGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::UISetAppIconRequest,
+ sdl_rpc_plugin::commands::UiSetDisplayLayoutRequest,
+ sdl_rpc_plugin::commands::VRGetSupportedLanguagesRequest,
+ sdl_rpc_plugin::commands::VRGetLanguageRequest,
+ sdl_rpc_plugin::commands::VRPerformInteractionRequest,
+ sdl_rpc_plugin::commands::AllowAppRequest,
+// TODO (OKozlov). Need to clarify why UT fails
+// for UISetIconRequest
+// am_commands::UISetIconRequest,
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ sdl_rpc_plugin::commands::SDLPolicyUpdate,
+#endif
+ sdl_rpc_plugin::commands::hmi::DialNumberRequest>
+ RequestCommandsList2;
+
+typedef Types<sdl_rpc_plugin::commands::TTSIsReadyRequest,
+ sdl_rpc_plugin::commands::UIIsReadyRequest,
+ sdl_rpc_plugin::commands::NaviIsReadyRequest,
+ sdl_rpc_plugin::commands::VRIsReadyRequest> RequestCommandsList3;
+
+TYPED_TEST_CASE(RequestToHMICommandsTest, RequestCommandsList);
+TYPED_TEST_CASE(RequestToHMICommandsTest2, RequestCommandsList2);
+TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3);
+
+TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+} // namespace simple_requests_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/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
new file mode 100644
index 0000000000..4a86fa9458
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
@@ -0,0 +1,324 @@
+/*
+ * 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 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/navi_alert_maneuver_response.h"
+#include "hmi/navi_audio_start_stream_response.h"
+#include "hmi/navi_audio_stop_stream_response.h"
+#include "hmi/navi_get_way_points_response.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_stop_stream_response.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/ui_set_app_icon_response.h"
+#include "hmi/ui_set_display_layout_response.h"
+#include "hmi/ui_set_global_properties_response.h"
+#include "hmi/ui_scrollable_message_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/dial_number_response.h"
+#include "hmi/close_popup_response.h"
+#include "hmi/tts_set_global_properties_response.h"
+#include "hmi/tts_speak_response.h"
+#include "hmi/tts_stop_speaking_response.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/ui_add_command_response.h"
+#include "hmi/ui_add_submenu_response.h"
+#include "hmi/ui_alert_response.h"
+#include "hmi/ui_change_registration_response.h"
+#include "hmi/ui_delete_command_response.h"
+#include "hmi/ui_delete_submenu_response.h"
+#include "hmi/ui_end_audio_pass_thru_response.h"
+#include "hmi/ui_perform_audio_pass_thru_response.h"
+#include "hmi/ui_perform_interaction_response.h"
+#include "hmi/ui_set_media_clock_timer_response.h"
+#include "hmi/ui_show_response.h"
+#include "hmi/ui_slider_response.h"
+#include "hmi/vr_add_command_response.h"
+#include "hmi/vr_change_registration_response.h"
+#include "hmi/vr_delete_command_response.h"
+#include "hmi/vr_perform_interaction_response.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/on_find_applications.h"
+#include "hmi/on_update_device_list.h"
+#include "hmi/sdl_policy_update_response.h"
+#include "hmi/update_app_list_response.h"
+#include "hmi/update_device_list_response.h"
+#include "application_manager/commands/notification_from_hmi.h"
+#include "hmi/ui_send_haptic_data_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_response_from_hmi_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Types;
+using ::testing::Eq;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+using am::commands::MessageSharedPtr;
+template <class CommandD>
+class ResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef CommandD CommandData;
+ MockEventDispatcher event_dispatcher_;
+
+ ResponseFromHMICommandsTest() {
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ }
+};
+
+template <class Command>
+class EmptyResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <class Command, hmi_apis::FunctionID::eType kExpectedEventId>
+struct CommandData {
+ typedef Command CommandType;
+ enum { kEventId = kExpectedEventId };
+};
+
+typedef Types<
+ CommandData<sdl_rpc_plugin::commands::TTSSpeakResponse,
+ hmi_apis::FunctionID::TTS_Speak>,
+ CommandData<sdl_rpc_plugin::commands::hmi::DialNumberResponse,
+ hmi_apis::FunctionID::BasicCommunication_DialNumber>,
+ CommandData<sdl_rpc_plugin::commands::UIDeleteSubmenuResponse,
+ hmi_apis::FunctionID::UI_DeleteSubMenu>,
+ CommandData<sdl_rpc_plugin::commands::UIEndAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_EndAudioPassThru>,
+ CommandData<sdl_rpc_plugin::commands::TTSSetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::TTS_SetGlobalProperties>,
+ CommandData<sdl_rpc_plugin::commands::TTSStopSpeakingResponse,
+ hmi_apis::FunctionID::TTS_StopSpeaking>,
+ CommandData<sdl_rpc_plugin::commands::UIAddCommandResponse,
+ hmi_apis::FunctionID::UI_AddCommand>,
+ CommandData<sdl_rpc_plugin::commands::UIAddSubmenuResponse,
+ hmi_apis::FunctionID::UI_AddSubMenu>,
+ CommandData<sdl_rpc_plugin::commands::UIAlertResponse,
+ hmi_apis::FunctionID::UI_Alert>,
+ CommandData<sdl_rpc_plugin::commands::UIChangeRegistratioResponse,
+ hmi_apis::FunctionID::UI_ChangeRegistration>,
+ CommandData<sdl_rpc_plugin::commands::UIDeleteCommandResponse,
+ hmi_apis::FunctionID::UI_DeleteCommand>,
+ CommandData<sdl_rpc_plugin::commands::UIPerformAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_PerformAudioPassThru>,
+ CommandData<sdl_rpc_plugin::commands::UIPerformInteractionResponse,
+ hmi_apis::FunctionID::UI_PerformInteraction>,
+ CommandData<sdl_rpc_plugin::commands::UIDeleteSubmenuResponse,
+ hmi_apis::FunctionID::UI_DeleteSubMenu>,
+ CommandData<sdl_rpc_plugin::commands::UIEndAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_EndAudioPassThru>,
+ CommandData<sdl_rpc_plugin::commands::UISetMediaClockTimerResponse,
+ hmi_apis::FunctionID::UI_SetMediaClockTimer>,
+ CommandData<sdl_rpc_plugin::commands::UIShowResponse,
+ hmi_apis::FunctionID::UI_Show>,
+ CommandData<sdl_rpc_plugin::commands::VRAddCommandResponse,
+ hmi_apis::FunctionID::VR_AddCommand>,
+ CommandData<sdl_rpc_plugin::commands::VRChangeRegistrationResponse,
+ hmi_apis::FunctionID::VR_ChangeRegistration>,
+ CommandData<sdl_rpc_plugin::commands::VRDeleteCommandResponse,
+ hmi_apis::FunctionID::VR_DeleteCommand>,
+ CommandData<sdl_rpc_plugin::commands::UISliderResponse,
+ hmi_apis::FunctionID::UI_Slider>,
+ CommandData<sdl_rpc_plugin::commands::TTSChangeRegistratioResponse,
+ hmi_apis::FunctionID::TTS_ChangeRegistration>,
+ CommandData<sdl_rpc_plugin::commands::ActivateAppResponse,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp>,
+ CommandData<sdl_rpc_plugin::commands::BasicCommunicationSystemResponse,
+ hmi_apis::FunctionID::BasicCommunication_SystemRequest>,
+ CommandData<sdl_rpc_plugin::commands::NaviAlertManeuverResponse,
+ hmi_apis::FunctionID::Navigation_AlertManeuver>,
+ CommandData<sdl_rpc_plugin::commands::AudioStartStreamResponse,
+ hmi_apis::FunctionID::Navigation_StartAudioStream>,
+ CommandData<sdl_rpc_plugin::commands::NaviGetWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_GetWayPoints>,
+ CommandData<sdl_rpc_plugin::commands::NaviSendLocationResponse,
+ hmi_apis::FunctionID::Navigation_SendLocation>,
+ CommandData<sdl_rpc_plugin::commands::NaviShowConstantTBTResponse,
+ hmi_apis::FunctionID::Navigation_ShowConstantTBT>,
+ CommandData<sdl_rpc_plugin::commands::NaviStartStreamResponse,
+ hmi_apis::FunctionID::Navigation_StartStream>,
+ CommandData<sdl_rpc_plugin::commands::NaviSubscribeWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints>,
+ CommandData<sdl_rpc_plugin::commands::NaviUnsubscribeWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints>,
+ CommandData<sdl_rpc_plugin::commands::NaviUpdateTurnListResponse,
+ hmi_apis::FunctionID::Navigation_UpdateTurnList>,
+ CommandData<sdl_rpc_plugin::commands::UISetAppIconResponse,
+ hmi_apis::FunctionID::UI_SetAppIcon>,
+ CommandData<sdl_rpc_plugin::commands::UiSetDisplayLayoutResponse,
+ hmi_apis::FunctionID::UI_SetDisplayLayout>,
+ CommandData<sdl_rpc_plugin::commands::UISetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::UI_SetGlobalProperties>,
+ CommandData<sdl_rpc_plugin::commands::UISetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::UI_SetGlobalProperties>,
+ CommandData<sdl_rpc_plugin::commands::VRPerformInteractionResponse,
+ hmi_apis::FunctionID::VR_PerformInteraction>,
+ CommandData<sdl_rpc_plugin::commands::UIScrollableMessageResponse,
+ hmi_apis::FunctionID::UI_ScrollableMessage>,
+ CommandData<sdl_rpc_plugin::commands::UISendHapticDataResponse,
+ hmi_apis::FunctionID::UI_SendHapticData> > ResponseCommandsList;
+
+typedef Types<sdl_rpc_plugin::commands::AudioStopStreamResponse,
+ sdl_rpc_plugin::commands::NaviStopStreamResponse,
+ sdl_rpc_plugin::commands::OnFindApplications,
+ sdl_rpc_plugin::commands::OnUpdateDeviceList,
+ sdl_rpc_plugin::commands::SDLPolicyUpdateResponse,
+ sdl_rpc_plugin::commands::UpdateAppListResponse,
+ sdl_rpc_plugin::commands::UpdateDeviceListResponse>
+ EmptyResponseCommandsList;
+
+TYPED_TEST_CASE(ResponseFromHMICommandsTest, ResponseCommandsList);
+
+TYPED_TEST_CASE(EmptyResponseFromHMICommandsTest, EmptyResponseCommandsList);
+
+MATCHER_P(EventIdIsEqualTo, function_id, "") {
+ return static_cast<hmi_apis::FunctionID::eType>(function_id) == arg.id();
+}
+
+TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandData CommandData;
+ typedef typename CommandData::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ EXPECT_CALL(this->event_dispatcher_,
+ raise_event(EventIdIsEqualTo(CommandData::kEventId)));
+
+ command->Run();
+}
+
+TYPED_TEST(EmptyResponseFromHMICommandsTest, Run_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ command->Run();
+}
+
+class OtherResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P(VehicleTypeIsEqualTo, vehicle_type, "") {
+ return (*vehicle_type) == arg.asString();
+}
+
+MATCHER_P(CheckMsgType, msg_type, "") {
+ return msg_type ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::message_type].asInt());
+}
+
+class NotificationFromHMITest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NotificationFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
+ CreateCommand<application_manager::commands::NotificationFromHMI>());
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+}
+
+TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
+ CreateCommand<application_manager::commands::NotificationFromHMI>());
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMsgType(am::MessageType::kNotification),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command->SendNotificationToMobile(command_msg);
+}
+
+TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params] = 0;
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
+ CreateCommand<application_manager::commands::NotificationFromHMI>(
+ command_msg));
+
+ const uint32_t correlation_id = 1u;
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(correlation_id));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(CheckMsgType(am::MessageType::kRequest)))
+ .WillOnce(Return(false));
+
+ command->CreateHMIRequest(hmi_apis::FunctionID::INVALID_ENUM,
+ (*command_msg)[am::strings::msg_params]);
+}
+
+} // namespace simple_response_from_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
new file mode 100644
index 0000000000..643e21d818
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
@@ -0,0 +1,103 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_response_to_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+namespace commands = sdl_rpc_plugin::commands;
+using application_manager::commands::MessageSharedPtr;
+
+template <class Command>
+class ResponseToHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::SDLActivateAppResponse,
+ commands::SDLGetListOfPermissionsResponse,
+ commands::SDLGetStatusUpdateResponse,
+ commands::SDLGetUserFriendlyMessageResponse> ResponseCommandsList;
+
+TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList);
+
+TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+class ResponseToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<application_manager::commands::ResponseToHMI> command(
+ CreateCommand<application_manager::commands::ResponseToHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(ResponseToHMITest, Run_SUCCESS) {
+ std::shared_ptr<application_manager::commands::ResponseToHMI> command(
+ CreateCommand<application_manager::commands::ResponseToHMI>());
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+} // namespace simple_response_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..bc9d262e6d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
@@ -0,0 +1,125 @@
+/*
+ * 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 <string>
+
+#include "gtest/gtest.h"
+#include "hmi/tts_get_capabilities_response.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_capabilities_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::TTSGetCapabilitiesResponse;
+using test::components::application_manager_test::MockHMICapabilities;
+
+using testing::_;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const std::string kText = "TEXT";
+}
+
+class TTSGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
+ (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
+ kText;
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_speech_capabilities(SmartObject(kText)));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_prerecorded_speech(SmartObject(kText)));
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlySpeech_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_speech_capabilities(SmartObject(kText)));
+ EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
+ kText;
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_prerecorded_speech(SmartObject(kText)));
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_Nothing_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+} // namespace tts_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
new file mode 100644
index 0000000000..0d22500f48
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
@@ -0,0 +1,102 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "hmi/tts_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_language_response {
+
+using sdl_rpc_plugin::commands::TTSGetLanguageResponse;
+using test::components::application_manager_test::MockHMICapabilities;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+namespace {
+const Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class TTSGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ std::shared_ptr<TTSGetLanguageResponse> command(
+ CreateCommand<TTSGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(TTSGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<TTSGetLanguageResponse> command(
+ CreateCommand<TTSGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_active_tts_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace tts_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..417b8e1898
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
@@ -0,0 +1,128 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/tts_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_supported_languages_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::TTSGetSupportedLanguagesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class TTSGetSupportedLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SmartObject capabilities_;
+};
+
+TEST_F(TTSGetSupportedLanguageResponseTest, RUN_SUCCESS) {
+ smart_objects::SmartObject supported_languages("EN_US");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_tts_supported_languages((
+ *command_msg)[strings::msg_params][hmi_response::languages]));
+
+ command->Run();
+}
+TEST_F(TTSGetSupportedLanguageResponseTest, RUN_UNSUCCESS) {
+ smart_objects::SmartObject supported_languages("EN_US");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(
+ CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_tts_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace tts_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
new file mode 100644
index 0000000000..2fae8a6819
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
@@ -0,0 +1,97 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/tts_is_ready_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_is_ready_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::TTSIsReadyResponse;
+using am::commands::CommandImpl;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const bool kIsAvailable = true;
+const bool kIsNotAvailable = false;
+} // namespace
+
+class TTSIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(TTSIsReadyResponseTest, RUN_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<TTSIsReadyResponse>());
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace tts_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..31e4860d4a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
@@ -0,0 +1,311 @@
+/*
+ * 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 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "hmi/ui_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_capabilities_response {
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::UIGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class UIGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(UIGetCapabilitiesResponseTest, RUN_SetDisplay_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities]
+ [hmi_response::display_type] = "GEN2_8_DMA";
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities]
+ [hmi_response::display_name] = "GENERIC_DISPLAY";
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject display_capabilities_so =
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_display_capabilities(display_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetSoftButton_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities]
+ [hmi_response::image_supported] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject soft_button_capabilities_so = (*command_msg)
+ [strings::msg_params][hmi_response::soft_button_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_soft_button_capabilities(soft_button_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetHmiZone_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities][0] =
+ "FRONT";
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_zone_capabilities_so =
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_hmi_zone_capabilities(hmi_zone_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::audio_pass_thru_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject audio_pass_thru_capabilities_so = (*command_msg)
+ [strings::msg_params][strings::audio_pass_thru_capabilities];
+ EXPECT_CALL(
+ mock_hmi_capabilities_,
+ set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetNavigation_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::navigation] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_navigation_supported(
+ hmi_capabilities_so[strings::navigation].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetPhoneCall_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::phone_call] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_phone_call_supported(
+ hmi_capabilities_so[strings::phone_call].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreaming_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::video_streaming] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_video_streaming_supported(
+ hmi_capabilities_so[strings::video_streaming].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability]["sendLocationEnabled"] = true;
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability]["getWayPointsEnabled"] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject navigation_capability_so =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_navigation_capability(navigation_capability_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::phone_capability]["dialNumberEnabled"] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject phone_capability_so =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::phone_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_phone_capability(phone_capability_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::video_streaming_capability] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& video_streaming_capability =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::video_streaming_capability];
+
+ video_streaming_capability[strings::preferred_resolution] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ video_streaming_capability[strings::preferred_resolution]
+ [strings::resolution_width] = 800;
+ video_streaming_capability[strings::preferred_resolution]
+ [strings::resolution_height] = 350;
+
+ video_streaming_capability[strings::max_bitrate] = 10000;
+
+ video_streaming_capability[strings::supported_formats] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ video_streaming_capability[strings::supported_formats][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ video_streaming_capability[strings::supported_formats][0][strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RAW;
+
+ video_streaming_capability[strings::supported_formats][0][strings::codec] =
+ hmi_apis::Common_VideoStreamingCodec::H264;
+
+ video_streaming_capability[strings::haptic_spatial_data_supported] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_video_streaming_capability(video_streaming_capability));
+
+ command->Run();
+}
+
+} // namespace ui_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
new file mode 100644
index 0000000000..de69c5de5c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
@@ -0,0 +1,106 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "hmi/ui_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_language_response {
+
+using sdl_rpc_plugin::commands::UIGetLanguageResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class UIGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ std::shared_ptr<UIGetLanguageResponse> command(
+ CreateCommand<UIGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(UIGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<UIGetLanguageResponse> command(
+ CreateCommand<UIGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_active_ui_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace ui_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..5626e2b0ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "hmi/ui_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_supported_languages_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::UIGetSupportedLanguagesResponse;
+
+typedef std::shared_ptr<UIGetSupportedLanguagesResponse>
+ UIGetSupportedLanguagesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const std::string kLanguage = "EN_US";
+const smart_objects::SmartObject supported_languages(kLanguage);
+} // namespace
+
+class UIGetSupportedLanguagesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SmartObject capabilities_;
+};
+
+TEST_F(UIGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ UIGetSupportedLanguagesResponsePtr command(
+ CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_ui_supported_languages((supported_languages)));
+
+ command->Run();
+}
+TEST_F(UIGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ UIGetSupportedLanguagesResponsePtr command(
+ CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_ui_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace ui_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/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
new file mode 100644
index 0000000000..fe0d8a8470
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
@@ -0,0 +1,199 @@
+/*
+ * 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 "hmi/ui_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_is_ready_request {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::UIIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<UIIsReadyRequest> UIIsReadyRequestPtr;
+
+class UIIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UIIsReadyRequestTest() : command_(CreateCommand<UIIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_ui_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_ui_cooperating(is_ui_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillOnce(Return(state));
+
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr get_language(CreateMessage());
+ (*get_language)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_language)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, _))
+ .WillOnce(Return(get_language));
+
+ smart_objects::SmartObjectSPtr get_all_language(CreateMessage());
+ (*get_all_language)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_all_language)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages, _))
+ .WillOnce(Return(get_all_language));
+
+ smart_objects::SmartObjectSPtr get_capabilities(CreateMessage());
+ (*get_capabilities)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_capabilities)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetCapabilities, _))
+ .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));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_ui_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_ui_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ UIIsReadyRequestPtr command_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+};
+
+TEST_F(UIIsReadyRequestTest,
+ OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_ui_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest,
+ OnEvent_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_ui_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest, OnEvent_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_ui_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_ui_cooperating_available);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest, OnTimeout_SUCCESS) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace ui_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
new file mode 100644
index 0000000000..cccdbdc44d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
@@ -0,0 +1,90 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "hmi/ui_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_is_ready_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::UIIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<UIIsReadyResponse> UIIsReadyResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const bool kIsAvailable = true;
+const bool kIsNotAvailable = false;
+} // namespace
+
+class UIIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(UIIsReadyResponseTest, RUN_SUCCESS) {
+ UIIsReadyResponsePtr command(CreateCommand<UIIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace ui_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
new file mode 100644
index 0000000000..c566702998
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
@@ -0,0 +1,171 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/request_controller_settings.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "hmi/update_device_list_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_device_list_request {
+
+using testing::_;
+using testing::ReturnRef;
+using testing::Return;
+using test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::event_engine::Event;
+using sdl_rpc_plugin::commands::UpdateDeviceListRequest;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class UpdateDeviceListRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ return command_msg;
+ }
+
+ MockApplicationManagerSettings settings_;
+ MockEventDispatcher mock_event_dispatcher_;
+};
+
+TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(
+ CreateCommand<UpdateDeviceListRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
+
+ EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, IsHMICooperating()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsTrue_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(
+ CreateCommand<UpdateDeviceListRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
+
+ EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, IsHMICooperating()).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+TEST_F(UpdateDeviceListRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
+
+ command->on_event(event);
+}
+
+TEST_F(UpdateDeviceListRequestTest, OnEvent_SUCCESS) {
+ Event event(Event::EventID::BasicCommunication_OnReady);
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
+
+ command->on_event(event);
+}
+
+} // namespace update_device_list_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
new file mode 100644
index 0000000000..af3b9bebf6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
@@ -0,0 +1,86 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/update_sdl_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_sdl_request {
+
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::UpdateSDLRequest;
+
+typedef std::shared_ptr<UpdateSDLRequest> UpdateSDLRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class UpdateSDLRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UpdateSDLRequestTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+
+ UpdateSDLRequestPtr command(CreateCommand<UpdateSDLRequest>(command_msg));
+
+ EXPECT_CALL(mock_policy_handler_, PTExchangeAtUserRequest(kCorrelationId));
+
+ command->Run();
+
+ EXPECT_EQ(kCorrelationId,
+ (*command_msg)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace update_sdl_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
new file mode 100644
index 0000000000..93c49724ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
@@ -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.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "hmi/update_sdl_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_sdl_response {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::UpdateSDLResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<UpdateSDLResponse> UpdateSDLResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class UpdateSDLResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(UpdateSDLResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ UpdateSDLResponsePtr command(CreateCommand<UpdateSDLResponse>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace update_sdl_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..15d38d4ef3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
@@ -0,0 +1,106 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "hmi/vr_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_capabilities_response {
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class VRGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(VRGetCapabilitiesResponseTest, RUN_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::vr_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][strings::vr_capabilities][0] =
+ "vrCapabilities";
+
+ VRGetCapabilitiesResponsePtr command(
+ CreateCommand<VRGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject vr_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::vr_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_vr_capabilities(vr_capabilities_so));
+
+ command->Run();
+}
+
+} // namespace vr_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
new file mode 100644
index 0000000000..05ed186963
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
@@ -0,0 +1,106 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "hmi/vr_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_language_response {
+
+using sdl_rpc_plugin::commands::VRGetLanguageResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class VRGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ std::shared_ptr<VRGetLanguageResponse> command(
+ CreateCommand<VRGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(VRGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<VRGetLanguageResponse> command(
+ CreateCommand<VRGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_active_vr_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vr_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..56b11ad440
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "hmi/vr_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_supported_languages_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::VRGetSupportedLanguagesResponse;
+
+typedef std::shared_ptr<VRGetSupportedLanguagesResponse>
+ VRGetSupportedLanguagesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const std::string kLanguage = "EN_US";
+const smart_objects::SmartObject supported_languages(kLanguage);
+} // namespace
+
+class VRGetSupportedLanguagesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SmartObject capabilities_;
+};
+
+TEST_F(VRGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ VRGetSupportedLanguagesResponsePtr command(
+ CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_vr_supported_languages((supported_languages)));
+
+ command->Run();
+}
+TEST_F(VRGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ VRGetSupportedLanguagesResponsePtr command(
+ CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_vr_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace vr_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/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
new file mode 100644
index 0000000000..5aa00e0264
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
@@ -0,0 +1,182 @@
+/*
+ * 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 "hmi/vr_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::VRIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<VRIsReadyRequest> VRIsReadyRequestPtr;
+
+class VRIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ VRIsReadyRequestTest() : command_(CreateCommand<VRIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_vr_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ const bool is_send_message_by_timeout = false;
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI(is_send_message_by_timeout);
+ }
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_vr_cooperating(is_vr_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillOnce(Return(state));
+ }
+
+ void ExpectSendMessagesToHMI(bool is_send_message_by_timeout) {
+ smart_objects::SmartObjectSPtr language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_message_helper_,
+ 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));
+
+ smart_objects::SmartObjectSPtr support_language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _))
+ .WillOnce(Return(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));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_vr_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_vr_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ VRIsReadyRequestPtr command_;
+};
+
+TEST_F(VRIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_vr_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_vr_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_vr_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_vr_cooperating_available);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ const bool is_send_message_by_timeout = true;
+ ExpectSendMessagesToHMI(is_send_message_by_timeout);
+ command_->onTimeOut();
+}
+
+} // namespace vr_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
new file mode 100644
index 0000000000..0e56f5b483
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
@@ -0,0 +1,77 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "hmi/vr_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_is_ready_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::VRIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<VRIsReadyResponse> VRIsReadyResponsePtr;
+
+class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(VRIsReadyResponseTest, RUN_SUCCESS) {
+ VRIsReadyResponsePtr command(CreateCommand<VRIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vr_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
new file mode 100644
index 0000000000..7c99b5f2b8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
@@ -0,0 +1,1154 @@
+/*
+ * 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 <stdint.h>
+#include <memory>
+#include <string>
+#include <set>
+
+#include "mobile/add_command_request.h"
+
+#include "gtest/gtest.h"
+
+#include "utils/helpers.h"
+
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace add_command_request {
+
+namespace am = application_manager;
+namespace am_test = application_manager_test;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+using sdl_rpc_plugin::commands::AddCommandRequest;
+using ns_smart_device_link::ns_smart_objects::SmartObjectSPtr;
+using ::test::components::application_manager_test::MockApplication;
+using am::event_engine::EventObserver;
+using namespace smart_objects;
+
+namespace custom_str = utils::custom_string;
+namespace strings = ::application_manager::strings;
+namespace mobile_result = mobile_apis::Result;
+namespace hmi_response = ::application_manager::hmi_response;
+namespace hmi_request = ::application_manager::hmi_request;
+using namespace strings;
+
+namespace {
+const hmi_apis::FunctionID::eType kInvalidFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const std::string kMenuName = "LG";
+const uint32_t kFirstParentId = 10u;
+const uint32_t kSecondParentId = 1u;
+const std::string kErroredVRCommand = "l\namer";
+const std::string kFirstVrCommand = "lamer";
+const std::string kSecondVrCommand = "hacker";
+const uint32_t kFirstCommandId = 10u;
+const uint32_t kSecondCommandId = 11u;
+const int32_t kType = 34;
+const int32_t kGrammarId = 12;
+const int32_t kPosition = 10;
+} // namespace
+
+class AddCommandRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AddCommandRequestTest()
+ : msg_(CreateMessage())
+ , default_app_name_("test_default_app_name_")
+ , lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
+ , mock_app_(CreateMockApp()) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ InitGetters();
+ InitBasicMessage();
+ }
+
+ protected:
+ void InitBasicMessage() {
+ (*msg_)[params][connection_key] = kConnectionKey;
+ (*msg_)[msg_params][app_id] = kAppId;
+ (*msg_)[msg_params][app_name] = default_app_name_;
+ }
+
+ void InitGetters() {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillByDefault(Return(so_ptr_.get()));
+ }
+
+ void CreateBasicParamsUIRequest() {
+ SmartObject menu_params = SmartObject(SmartType_Map);
+ menu_params[position] = kPosition;
+ menu_params[menu_name] = kMenuName;
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[strings::menu_params] = menu_params;
+ msg_params[cmd_icon] = 1;
+ msg_params[cmd_icon][value] = "10";
+ msg_params[info] = "UI info";
+ }
+
+ void CreateBasicParamsVRRequest() {
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[vr_commands] = SmartObject(SmartType_Array);
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ msg_params[type] = kPosition;
+ msg_params[grammar_id] = kGrammarId;
+ msg_params[info] = "VR info";
+ }
+
+ const am::CommandsMap CreateCommandsMap(SmartObject& first_command,
+ SmartObject& second_command) {
+ second_command[menu_params] = SmartObject(SmartType_Map);
+ second_command[menu_params][hmi_request::parent_id] = kFirstParentId;
+ second_command[menu_params][menu_name] = kMenuName;
+ second_command[vr_commands] = SmartObject(SmartType_Array);
+ second_command[vr_commands][0] = kSecondVrCommand;
+ am::CommandsMap commands_map;
+ commands_map.insert(std::make_pair(kFirstCommandId, &first_command));
+ commands_map.insert(std::make_pair(kSecondCommandId, &second_command));
+ return commands_map;
+ }
+
+ void CheckOnTimeOutCommandDeletion(
+ const hmi_apis::FunctionID::eType incoming_cmd,
+ const hmi_apis::FunctionID::eType cmd_to_delete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event(incoming_cmd);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(cmd_to_delete)))
+
+ .WillOnce(Return(true));
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(response,
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
+ base_class_request->onTimeOut();
+ }
+
+ MessageSharedPtr msg_;
+ SmartObjectSPtr so_ptr_;
+ const utils::custom_string::CustomString default_app_name_;
+ std::shared_ptr<sync_primitives::Lock> lock_ptr_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_WARNINGS) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MenuNameHasSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ const std::string errored_menu_name = "L\nG";
+ msg_params[menu_params][menu_name] = errored_menu_name;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ SmartObject parent = SmartObject(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kFirstParentId))
+ .WillOnce(Return(&parent));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_VRCommandsHaveSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[vr_commands][0] = kErroredVRCommand;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_CMDIconHasError_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ (*msg)[params][connection_key] = kConnectionKey;
+ msg_params[cmd_id] = kCmdId;
+ msg_params[cmd_icon] = 1;
+ const std::string errored_cmd_icon_value = "1\n0";
+ msg_params[cmd_icon][value] = errored_cmd_icon_value;
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_CommandIDAlreadyExists_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CommandNameAlreadyExists_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgParentIDsAreDifferentSubmenuNotExisted_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgVrSynonymsAreTheSame_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ msg_params[vr_commands][0] = kSecondVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MsgDataEmpty_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[params][connection_key] = kConnectionKey;
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ msg_params[app_id] = kAppId;
+ msg_params[cmd_id] = kCmdId;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsg_UI_and_Vr_AreCorrect_EXPECT_VR_AND_UI_SENT) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_ptr_)));
+
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) {
+ CreateBasicParamsVRRequest();
+ MessageSharedPtr msg = CreateMessage(SmartType_Map);
+ (*msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*msg)[msg_params][cmd_id] = kCmdId;
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg);
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_VR_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::VR_AddCommand,
+ hmi_apis::FunctionID::VR_DeleteCommand);
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_UI_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::UI_AddCommand,
+ hmi_apis::FunctionID::UI_DeleteCommand);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
+ MessageSharedPtr command_msg = CreateMessage(SmartType_Map);
+ (*command_msg)[params][connection_key] = kConnectionKey;
+ MessageSharedPtr event_msg = CreateMessage(SmartType_Map);
+ (*event_msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[msg_params][cmd_id] = kCmdId;
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*event_msg);
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(command_msg);
+ request_ptr->Run();
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_AppNotExisted_UNSUCCESS) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsRejected_ExpectUICommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::REJECTED;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::REJECTED), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsWarnings_ExpectCommandUpdated) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::WARNINGS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::WARNINGS), _));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandAdded(kCmdId, _, false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsGenericError_VR_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsGenericError_UI_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_vr);
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ event_ui.set_smart_object(*msg_ui);
+ request_ptr->on_event(event_ui);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_UI_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_VR_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_EventWithNotSuccesResponseCode_ExpectVRCommandDelete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ 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)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_VR_Events_VRErrorPresent_ExpectRemoveCommand) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ 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)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnTimeOut_AppNotExisted_NoAppRemoveCommandCalled) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ response, am::commands::Command::CommandSource::SOURCE_SDL));
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(
+ CreateCommand<AddCommandRequest>(msg_));
+ base_class_request->onTimeOut();
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ response, am::commands::Command::CommandSource::SOURCE_SDL));
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
+ base_class_request->onTimeOut();
+}
+
+} // namespace add_command_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
new file mode 100644
index 0000000000..ecaa436529
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
@@ -0,0 +1,158 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "mobile/add_sub_menu_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace add_sub_menu_request {
+
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::AddSubMenuRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using ::testing::_;
+using ::testing::Return;
+
+typedef std::shared_ptr<AddSubMenuRequest> AddSubMenuPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kAppId = 1u;
+} // namespace
+
+class AddSubMenuRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AddSubMenuRequestTest() : mock_app(CreateMockApp()) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ }
+
+ MockAppPtr mock_app;
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+ }
+};
+
+TEST_F(AddSubMenuRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
+ const uint32_t menu_id = 10u;
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject& msg_params = (*msg)[am::strings::msg_params];
+
+ msg_params[am::strings::menu_icon] = 1;
+ msg_params[am::strings::menu_icon][am::strings::value] = "10";
+ msg_params[am::strings::menu_id] = menu_id;
+ msg_params[am::strings::menu_name] = "test";
+ SmartObject& image = msg_params[am::strings::menu_icon];
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddSubMenuRequest> request_ptr =
+ CreateCommand<AddSubMenuRequest>(msg);
+
+ request_ptr->Run();
+}
+
+TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ const uint32_t menu_id = 10u;
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::menu_id] = menu_id;
+
+ std::shared_ptr<AddSubMenuRequest> command =
+ CreateCommand<AddSubMenuRequest>(msg);
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app, AddSubMenu(menu_id, _));
+ EXPECT_CALL(*mock_app, UpdateHash());
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_AddSubMenu);
+ event.set_smart_object(*ev_msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ command->Init();
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+} // namespace add_sub_menu_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
new file mode 100644
index 0000000000..7d2dd0b2c2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
@@ -0,0 +1,256 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/alert_maneuver_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace alert_maneuver_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::AlertManeuverRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<AlertManeuverRequest> CommandPtr;
+
+class AlertManeuverRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] = hmi_response;
+ (*response)[am::strings::msg_params][am::strings::info] = "test";
+
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*response);
+
+ std::shared_ptr<AlertManeuverRequest> command =
+ CreateCommand<AlertManeuverRequest>(response);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+ command->on_event(event);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ success);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+};
+
+TEST_F(AlertManeuverRequestTest, Run_RequiredFieldsDoesNotExist_UNSUCCESS) {
+ CommandPtr command(CreateCommand<AlertManeuverRequest>());
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks] = 0;
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::text] = "text";
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ const mobile_apis::Result::eType kProcessingResult =
+ mobile_apis::Result::ABORTED;
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
+ .WillOnce(Return(kProcessingResult));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(kProcessingResult,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_IsWhiteSpaceExist_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks] =
+ SmartObject(smart_objects::SmartType_Array);
+
+ SmartObject tts_chunk(smart_objects::SmartType_Map);
+ tts_chunk[am::strings::text] = "wrong chunk syntax\t\n";
+
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks].asArray()->push_back(
+ tts_chunk);
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::text] = "text";
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_AlertManeuver,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
+ CommandPtr command(CreateCommand<AlertManeuverRequest>());
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_ENUM,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_SUCCESS) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::SUCCESS,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_WARNINGS) {
+ CheckExpectations(hmi_apis::Common_Result::WARNINGS,
+ mobile_apis::Result::WARNINGS,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ true);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_GENERIC_ERROR) {
+ CheckExpectations(hmi_apis::Common_Result::GENERIC_ERROR,
+ mobile_apis::Result::GENERIC_ERROR,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ false);
+}
+
+} // namespace alert_maneuver_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
new file mode 100644
index 0000000000..e32cc2b335
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
@@ -0,0 +1,809 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/alert_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace alert_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::AlertRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::event_engine::Event;
+using policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<AlertRequest> CommandPtr;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kDefaultTimeout = 1000u;
+const uint32_t kCorrelationId = 2u;
+const mobile_apis::FunctionID::eType kFunctionId =
+ mobile_apis::FunctionID::AlertID;
+} // namespace
+
+class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AlertRequestTest() : mock_app_(CreateMockApp()), msg_(CreateMessage()) {}
+
+ protected:
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void PreConditions() {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(
+ Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(
+ Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ }
+
+ void Expectations() {
+ (*msg_)[am::strings::params][am::strings::function_id] = kFunctionId;
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(
+ *mock_app_,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+ }
+
+ void AddAlertTextsToMsg() {
+ (*msg_)[am::strings::msg_params][am::strings::alert_text1] = "alert_text1";
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] = "alert_text2";
+ (*msg_)[am::strings::msg_params][am::strings::alert_text3] = "alert_text3";
+ }
+ void AddTTSChunkToMsg() {
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "tts_chunk_text";
+ }
+
+ void ExpectCallHmiLevel(const mobile_apis::HMILevel::eType level) {
+ EXPECT_CALL(*mock_app_, hmi_level()).WillRepeatedly(Return(level));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ void ExpectManageHmiCommandTTSAndUI() {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+ }
+ sync_primitives::Lock lock_;
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+};
+
+TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
+ PreConditions();
+ MessageSharedPtr command_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*command_msg)[am::strings::msg_params][am::strings::success] = false;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<AlertRequest> command = CreateCommand<AlertRequest>();
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(command_msg));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->onTimeOut();
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ PreConditions();
+ MessageSharedPtr command_msg = CreateFullParamsUISO();
+ (*command_msg)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = 10u;
+ (*command_msg)[am::strings::msg_params][am::strings::menu_params]
+ [am::strings::menu_name] = "menu_name";
+
+ std::shared_ptr<AlertRequest> command =
+ CreateCommand<AlertRequest>(command_msg);
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ MessageSharedPtr msg_tts = CreateMessage();
+ (*msg_tts)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_vr(hmi_apis::FunctionID::TTS_Speak);
+ event_vr.set_smart_object(*msg_tts);
+
+ command->on_event(event_vr);
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+class CallOnTimeOut {
+ public:
+ CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.onTimeOut();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+TEST_F(AlertRequestTest, Init_DurationExists_SUCCESS) {
+ Expectations();
+ (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, Init_DurationNotExists_SUCCESS) {
+ Expectations();
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, OnTimeOut_SUCCESS) {
+ Expectations();
+ MessageSharedPtr result_msg(CreateMessage(smart_objects::SmartType_Null));
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(result_msg));
+
+ CommandPtr command(CreateCommand<AlertRequest>());
+ MessageSharedPtr received_result_msg(
+ CatchMobileCommandResult(CallOnTimeOut(*command)));
+ EXPECT_EQ(result_msg, received_result_msg);
+}
+
+TEST_F(AlertRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ Expectations();
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_AlertFrequencyIsTooHigh_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(
+ *mock_app_,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertRequestTest, Run_FailToProcessSoftButtons_UNSUCCESS) {
+ Expectations();
+ const mobile_apis::Result::eType result_code =
+ mobile_apis::Result::INVALID_ENUM;
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(result_code));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(result_code,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertRequestTest, Run_MandatoryParametersAreMissed_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_MandatoryParametersAreInvalid_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
+ "invalid\t\nParam";
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+ (*msg_)[am::strings::msg_params][am::strings::progress_indicator] =
+ "progress_indicator";
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageHmiCommandTTSAndUI();
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_UI_OnResetTimeout_SUCCESS) {
+ PreConditions();
+ Expectations();
+ AddAlertTextsToMsg();
+
+ (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+
+ EXPECT_CALL(
+ app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_ENUM);
+
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageHmiCommandTTSAndUI();
+
+ command->Run();
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)));
+
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) {
+ PreConditions();
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ 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));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSUnsupportedResource_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ 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));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ PreConditions();
+
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest,
+ DISABLED_OnEvent_TTSUnsupportedResourceUiAlertSent_SUCCESS) {
+ PreConditions();
+
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_TTSUnsupportedResourceUiAlertSuccess_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*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)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ 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));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*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)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ 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));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*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)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert2_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert3_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text3] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidTTSChunk_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+} // namespace alert_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
new file mode 100644
index 0000000000..58755c8b36
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
@@ -0,0 +1,559 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/change_registration_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace change_registration_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgPointee;
+using sdl_rpc_plugin::commands::ChangeRegistrationRequest;
+using policy_test::MockPolicyHandlerInterface;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace custom_str = utils::custom_string;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class ChangeRegistrationRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ChangeRegistrationRequestTest()
+ : app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_app_(CreateMockApp())
+ , supported_languages_(CreateMessage(smart_objects::SmartType_Array)) {}
+
+ MessageSharedPtr CreateMsgFromMobile() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::hmi_display_language] = mobile_apis::Language::EN_US;
+ msg_params[strings::language] = mobile_apis::Language::EN_US;
+ (*msg)[strings::msg_params] = msg_params;
+ return msg;
+ }
+ void PrepareExpectationBeforeRun() {
+ (*supported_languages_)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+ EXPECT_CALL(mock_hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ }
+
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success,
+ const hmi_apis::Common_Result::eType ui_hmi_response =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ const hmi_apis::Common_Result::eType vr_hmi_response =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set,
+ app_set_lock_ptr_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+ PrepareExpectationBeforeRun();
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(ui_response, ui_hmi_response, "ui_info");
+ CreateResponseFromHMI(vr_response, vr_hmi_response, "unsupported_resource");
+
+ (*tts_response)[strings::params][hmi_response::code] = hmi_response;
+ (*tts_response)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(
+ hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_ui);
+ command->on_event(event_vr);
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ success);
+ EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+
+ void CreateResponseFromHMI(MessageSharedPtr msg,
+ hmi_apis::Common_Result::eType result,
+ const std::string& info) {
+ (*msg)[strings::params][hmi_response::code] = static_cast<int32_t>(result);
+ (*msg)[strings::msg_params][strings::info] = info;
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ExpectationsHmiCapabilities(
+ smart_objects::SmartObjectSPtr supported_languages) {
+ EXPECT_CALL(mock_hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
+ MockHMICapabilities hmi_capabilities_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr supported_languages_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_ptr_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ smart_objects::SmartObjectSPtr supported_languages(
+ CreateMessage(smart_objects::SmartType_Array));
+ (*supported_languages)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+
+ ExpectationsHmiCapabilities(supported_languages);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(
+ ui_response, hmi_apis::Common_Result::WARNINGS, "ui_info");
+ CreateResponseFromHMI(vr_response,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ "VR is not supported by system");
+ CreateResponseFromHMI(
+ tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
+ (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*tts_response)[am::strings::msg_params][am::strings::app_id] =
+ kConnectionKey;
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_ui);
+ command->on_event(event_tts);
+ command->on_event(event_vr);
+
+ ResultCommandExpectations(response_to_mobile,
+ "ui_info, VR is not supported by system, tts_info");
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_ptr_);
+ application_set.insert(app);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ (*supported_languages_)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+ EXPECT_CALL(mock_hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+ command->Run();
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(mobile_apis::Result::UNSUPPORTED_RESOURCE));
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ false);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_SUCCESS_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_SUCCESS_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::SUCCESS,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_WRONG_LANGUAGE_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::WRONG_LANGUAGE,
+ mobile_apis::Result::WRONG_LANGUAGE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_INVALID_DATA_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::INVALID_DATA,
+ mobile_apis::Result::INVALID_DATA,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_ptr_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ smart_objects::SmartObjectSPtr supported_languages(
+ CreateMessage(smart_objects::SmartType_Array));
+ (*supported_languages)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+
+ ExpectationsHmiCapabilities(supported_languages);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(ui_response,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ "unsupported_resource");
+ CreateResponseFromHMI(
+ vr_response, hmi_apis::Common_Result::WARNINGS, "vr_info");
+ CreateResponseFromHMI(
+ tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
+ (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*tts_response)[am::strings::msg_params][am::strings::app_id] =
+ kConnectionKey;
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+ command->on_event(event_tts);
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "unsupported_resource, vr_info, tts_info");
+}
+
+} // namespace change_registration_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/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
new file mode 100644
index 0000000000..c42be48e57
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
@@ -0,0 +1,923 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/create_interaction_choice_set_request.h"
+#include "mobile/create_interaction_choice_set_response.h"
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace create_interaction_choice_set_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::AtLeast;
+using sdl_rpc_plugin::commands::CreateInteractionChoiceSetRequest;
+using sdl_rpc_plugin::commands::CreateInteractionChoiceSetResponse;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace custom_str = utils::custom_string;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<CreateInteractionChoiceSetRequest>
+ CreateInteractionChoiceSetRequestPtr;
+typedef std::shared_ptr<CreateInteractionChoiceSetResponse>
+ CreateInteractionChoiceSetResponsePtr;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::FunctionID::eType kInvalidFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kGrammarId = 10u;
+const int32_t kMenuId = 5;
+const uint32_t kChoiceSetId = 1u;
+const uint32_t kChoiceId1 = 2u;
+const uint32_t kChoiceId2 = 3u;
+const std::string kImage = "image";
+const std::string kSecondImage = "second_image";
+const std::string kVrCommands1 = "vr_commands_1";
+const std::string kVrCommands2 = "vr_commands_2";
+const std::string kMenuName = "menu_name";
+
+} // namespace
+
+class CreateInteractionChoiceSetRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ CreateInteractionChoiceSetRequestTest()
+ : message_(CreateMessage())
+ , command_(CreateCommand<CreateInteractionChoiceSetRequest>(message_))
+ , mock_app_(CreateMockApp())
+ , lock_(std::make_shared<sync_primitives::Lock>()) {}
+
+ MessageSharedPtr CreateFullParamsVRSO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = kCmdId;
+ msg_params[strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands][0] = "lamer";
+ msg_params[strings::type] = 34;
+ msg_params[strings::grammar_id] = 12;
+ msg_params[strings::app_id] = kAppId;
+ (*msg)[strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void FillMessageFieldsItem1(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ }
+ void FillMessageFieldsItem2(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands2;
+ (*message)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id] = kChoiceSetId;
+ }
+
+ MessageSharedPtr message_;
+ CreateInteractionChoiceSetRequestPtr command_;
+ MockAppPtr mock_app_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+};
+
+class CreateInteractionChoiceSetResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
+ MessageSharedPtr msg_vr = CreateMessage(smart_objects::SmartType_Map);
+ (*msg_vr)[strings::msg_params][strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*msg_vr)[strings::msg_params][strings::success] = false;
+
+ std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
+ CreateCommand<CreateInteractionChoiceSetRequest>();
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, RemoveCommand(_)).WillByDefault(Return());
+
+ MessageSharedPtr vr_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ req_vr->onTimeOut();
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsVRSO();
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::choice_id] =
+ 10;
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::menu_name] =
+ "menu_name";
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::vr_commands]
+ [0] = kVrCommands1;
+ (*msg_vr)[strings::msg_params][strings::interaction_choice_set_id] = 11;
+ std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
+ CreateCommand<CreateInteractionChoiceSetRequest>(msg_vr);
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ smart_objects::SmartObject* null_obj = NULL;
+ ON_CALL(*mock_app_, FindChoiceSet(_)).WillByDefault(Return(null_obj));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[strings::msg_params][strings::info] = "VR is not supported by system";
+ (*msg)[strings::msg_params][strings::cmd_id] = kCommandId;
+
+ am::event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg);
+
+ smart_objects::SmartObject* ptr = NULL;
+ ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr));
+ EXPECT_EQ(NULL, ptr);
+
+ am::CommandsMap commands_map;
+ ON_CALL(*mock_app_, commands_map())
+ .WillByDefault(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(
+ Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+ req_vr->Run();
+
+ MessageSharedPtr vr_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ req_vr->on_event(event);
+
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*vr_command_result)[strings::msg_params].keyExists(strings::info)) {
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::info].asString(),
+ (*msg)[strings::msg_params][strings::info].asString());
+ }
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_VerifyImageFail_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image] = kSecondImage;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* invalid_choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(invalid_choice_set_id));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_CheckChoiceSet_InvalidChoiceId_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+
+ FillMessageFieldsItem2(message_);
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][1] = " kVrCommands2\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands1;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_IsWhiteSpaceVRCommandsExist_InvalidMenuName_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = "menu_name\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_text] = "secondary_text\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::tertiary_text] = "tertiary_text\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = "image\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] =
+ "second_image\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = "vr_commands_1\t";
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::menu_name)) {
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::secondary_text)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::tertiary_text)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_text] = "secondary_text";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::vr_commands)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::tertiary_text] = "tertiary_text";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::image)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = "vr_commands";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::secondary_image)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_ValidAmountVrCommands_SUCCESS) {
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .Times(AtLeast(2))
+ .WillOnce(Return(kConnectionKey))
+ .WillOnce(Return(kConnectionKey));
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_EmptyAmountVrCommands_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands2;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_WithoutVrCommands_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillOnce(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::NONE));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ // No VR commands
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_WithMixedVrCommands_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillOnce(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::MIXED));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InvalidEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InvalidVrCommand_UNSUCCESS) {
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InValidVrNoError_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_DATA;
+
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_ValidVrNoErrorAndExpectedChoiceLessThanReceiveChoice_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+
+ FillMessageFieldsItem1(message_);
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_InvalidErrorFromHMI_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
+ am::commands::Command::SOURCE_SDL));
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_ValidErrorFromHMI_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_ENUM;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(kChoiceSetId));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_ENUM;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(2);
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(_)).Times(0);
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_SuccessfulResponseReceived_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(_));
+
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::success] = false;
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::INVALID_ENUM;
+ CreateInteractionChoiceSetResponsePtr command(
+ CreateCommand<CreateInteractionChoiceSetResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, false));
+ command->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessTrue_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::success] = true;
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+ CreateInteractionChoiceSetResponsePtr command(
+ CreateCommand<CreateInteractionChoiceSetResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, false));
+ command->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+
+ FillMessageFieldsItem1(message_);
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID())
+ .WillRepeatedly(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(2);
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
+ am::commands::Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+ command_->Run();
+}
+
+} // namespace create_interaction_choice_set_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
new file mode 100644
index 0000000000..a87d172923
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
@@ -0,0 +1,272 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "mobile/delete_command_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_command_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace am_test = application_manager_test;
+using sdl_rpc_plugin::commands::DeleteCommandRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+
+typedef std::shared_ptr<DeleteCommandRequest> DeleteCommandPtr;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class DeleteCommandRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteCommandRequestTest()
+ : mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
+ , mock_app_(CreateMockApp()) {}
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateFullParamsVRSO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[am::strings::vr_commands][0] = "lamer";
+ msg_params[am::strings::type] = 34;
+ msg_params[am::strings::grammar_id] = 12;
+ msg_params[am::strings::app_id] = kAppId;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(hmi_interfaces_));
+ }
+
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(DeleteCommandRequestTest,
+ OnEvent_VrHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr command_msg = CreateFullParamsVRSO();
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*test_msg)[am::strings::vr_commands] = 0;
+ (*test_msg)[am::strings::menu_params] = 0;
+
+ ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(*mock_app_, FindCommand(kCommandId))
+ .WillByDefault(Return(test_msg.get()));
+ ON_CALL(*mock_app_, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
+ event_ui.set_smart_object(*msg);
+ command->Init();
+ command->Run();
+ command->on_event(event_ui);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::msg_params][am::strings::info] =
+ "VR is not supported by system";
+ Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
+ event_vr.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCommandId));
+
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandDeleted(kCommandId, false));
+
+ command->on_event(event_vr);
+
+ ResultCommandExpectations(vr_command_result, "VR is not supported by system");
+}
+
+TEST_F(DeleteCommandRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr command_msg = CreateFullParamsUISO();
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
+
+ MockAppPtr app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*test_msg)[am::strings::vr_commands] = 0;
+ (*test_msg)[am::strings::menu_params] = 0;
+
+ ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(*app, FindCommand(kCommandId)).WillByDefault(Return(test_msg.get()));
+ ON_CALL(*app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
+ event_vr.set_smart_object(*msg);
+
+ command->Init();
+ command->Run();
+ command->on_event(event_vr);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+ Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
+ event_ui.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*app, RemoveCommand(kCommandId));
+
+ EXPECT_CALL(*app, UpdateHash());
+
+ EXPECT_CALL(*app, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandDeleted(kCommandId, false));
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event_ui)));
+
+ ASSERT_TRUE((bool)result_msg);
+
+ ResultCommandExpectations(result_msg, "UI is not supported by system");
+}
+
+} // namespace delete_command_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
new file mode 100644
index 0000000000..0ed7a92fa4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
@@ -0,0 +1,250 @@
+/*
+ * 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 <stdint.h>
+#include <vector>
+#include <string>
+#include <map>
+
+#include "mobile/delete_file_request.h"
+#include "mobile/delete_file_response.h"
+
+#include "gtest/gtest.h"
+
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_application_manager_settings.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_file {
+
+using ::testing::_;
+using ::testing::Test;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgReferee;
+using ::testing::AtLeast;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::DeleteFileRequest;
+using sdl_rpc_plugin::commands::DeleteFileResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef std::shared_ptr<DeleteFileRequest> DeleteFileRequestPtr;
+typedef std::shared_ptr<DeleteFileResponse> DeleteFileResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+ACTION_TEMPLATE(SetArgPointer,
+ HAS_1_TEMPLATE_PARAMS(int, k),
+ AND_1_VALUE_PARAMS(vec)) {
+ *std::tr1::get<k>(args) = *vec;
+}
+
+MATCHER_P(CheckMessageResultCode, result_code, "") {
+ return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ result_code;
+}
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kCorrelationId = 10u;
+const int32_t kMenuId = 5;
+} // namespace
+
+class DeleteFileRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteFileRequest>(message_);
+ mock_app_ = CreateMockApp();
+ }
+ DeleteFileRequestPtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr mock_app_;
+};
+
+class DeleteFileResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(DeleteFileRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, get_settings()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_HMILevelNone_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const uint32_t num = 0;
+ EXPECT_CALL(app_mngr_settings_, delete_file_in_none())
+ .WillOnce(ReturnRef(num));
+ EXPECT_CALL(*mock_app_, delete_file_in_none_count()).WillOnce(Return(1));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::REJECTED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) {
+ const std::string file_name = "test_file.txt";
+ EXPECT_TRUE(file_system::CreateFile(file_name));
+ (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kFullFilePath));
+
+ am::AppFile file;
+ file.file_name = file_name;
+ file.file_type = mobile_apis::FileType::BINARY;
+
+ EXPECT_CALL(*mock_app_, GetFile(_)).WillOnce(Return(&file));
+ EXPECT_CALL(*mock_app_, DeleteFile(_));
+ EXPECT_CALL(*mock_app_, increment_delete_file_in_none_count());
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::SUCCESS),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_InvalidFile_UNSUCCESS) {
+ const std::string file_name = "test_file.txt";
+ (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kFullFilePath));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ command_->Run();
+}
+
+TEST_F(DeleteFileResponseTest, Run_InvalidApp_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(CheckMessageResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ false));
+
+ command->Run();
+}
+
+TEST_F(DeleteFileResponseTest, Run_ValidApp_SUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*message)[am::strings::msg_params][am::strings::success] = true;
+
+ DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+ const uint32_t kAvailableDiskSpace = 10u;
+ EXPECT_CALL(*app, GetAvailableDiskSpace())
+ .WillOnce(Return(kAvailableDiskSpace));
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(
+ CheckMessageResultCode(mobile_apis::Result::SUCCESS), _));
+
+ command->Run();
+}
+
+} // namespace delete_file
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
new file mode 100644
index 0000000000..43c30809e5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
@@ -0,0 +1,296 @@
+/*
+ * 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 <stdint.h>
+#include <map>
+
+#include "mobile/delete_interaction_choice_set_request.h"
+#include "mobile/delete_interaction_choice_set_response.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_interaction_choice_set {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetRequest;
+using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<DeleteInteractionChoiceSetRequest>
+ DeleteInteractionChoiceSetRequestPtr;
+typedef std::shared_ptr<DeleteInteractionChoiceSetResponse>
+ DeleteInteractionChoiceSetResponsePtr;
+
+MATCHER_P(CheckMessageSuccess, success, "") {
+ return success ==
+ (*arg)[am::strings::msg_params][am::strings::success].asBool();
+}
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kChoiceSetId = 11u;
+const uint32_t kChoiceId = 110u;
+const uint32_t kGrammarId = 101u;
+} // namespace
+
+class DeleteInteractionChoiceSetRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteInteractionChoiceSetRequestTest()
+ : performinteraction_choice_set_lock_(
+ std::make_shared<sync_primitives::Lock>())
+ , accessor_(choice_set_map_, performinteraction_choice_set_lock_) {}
+
+ ~DeleteInteractionChoiceSetRequestTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+
+ am::PerformChoiceSetMap choice_set_map_;
+ mutable std::shared_ptr<sync_primitives::Lock>
+ performinteraction_choice_set_lock_;
+ DataAccessor<am::PerformChoiceSetMap> accessor_;
+
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+ app_ = CreateMockApp();
+ }
+
+ DeleteInteractionChoiceSetRequestPtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr app_;
+};
+
+class DeleteInteractionChoiceSetResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteInteractionChoiceSetResponse>(message_);
+ app_ = CreateMockApp();
+ }
+ DeleteInteractionChoiceSetResponsePtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr app_;
+};
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_, FindChoiceSet(_)).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_ChoiceSetInUse_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+
+ choice_set_map_[0].insert(
+ std::make_pair(kChoiceSetId,
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id])));
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(true));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map())
+ .WillOnce(Return(accessor_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest,
+ Run_SendVrDeleteCommand_PerformInteractionFalse_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+ smart_objects::SmartObject* invalid_choice_set_id = NULL;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app_));
+
+ {
+ InSequence seq;
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(invalid_choice_set_id));
+
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
+ EXPECT_CALL(*app_, UpdateHash());
+ }
+
+ DeleteInteractionChoiceSetRequestPtr command =
+ CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ (*message_)[am::strings::msg_params][am::strings::grammar_id] = kGrammarId;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId;
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app_));
+
+ {
+ InSequence seq;
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(*app_, app_id())
+ .WillOnce(Return(kConnectionKey))
+ .WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
+ EXPECT_CALL(*app_, UpdateHash());
+ }
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ DeleteInteractionChoiceSetRequestPtr command =
+ CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::success] = false;
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckMessageSuccess(false), false));
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest, Run_ValidResultCode_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::result_code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckMessageSuccess(true), false));
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest,
+ Run_InvalidResultCode_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::result_code] =
+ hmi_apis::Common_Result::INVALID_ENUM;
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckMessageSuccess(false), false));
+ command_->Run();
+}
+
+} // namespace delete_interaction_choice_set
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
new file mode 100644
index 0000000000..f1c44f86ac
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
@@ -0,0 +1,375 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "mobile/delete_sub_menu_request.h"
+#include "mobile/delete_sub_menu_response.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_sub_menu_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::InSequence;
+namespace am = ::application_manager;
+namespace am_test = application_manager_test;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockHmiInterfaces;
+using am::MockMessageHelper;
+
+using sdl_rpc_plugin::commands::DeleteSubMenuRequest;
+using sdl_rpc_plugin::commands::DeleteSubMenuResponse;
+
+typedef std::shared_ptr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
+typedef std::shared_ptr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
+
+MATCHER_P(CheckMessageResultCode, result_code, "") {
+ return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ result_code;
+}
+
+MATCHER_P(CheckMessageConnectionKey, connection_key, "") {
+ return (*arg)[am::strings::msg_params][am::strings::connection_key].asInt() ==
+ connection_key;
+}
+
+ACTION_P(DeleteCommand, commands_map) {
+ am::CommandsMap::iterator it = (*commands_map).begin();
+ if ((*commands_map).end() != it) {
+ (*commands_map).erase(it);
+ }
+}
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kMenuId = 100u;
+const uint32_t kGrammarId = 101u;
+const int32_t kCmdId = 102;
+} // namespace
+
+class DeleteSubMenuRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteSubMenuRequestTest()
+ : commands_lock_(std::make_shared<sync_primitives::Lock>())
+ , accessor_(commands_map_, commands_lock_)
+ , message_(CreateMessage())
+ , command_(CreateCommand<DeleteSubMenuRequest>(message_))
+ , mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
+ , app_(CreateMockApp()) {}
+
+ am::CommandsMap commands_map_;
+ mutable std::shared_ptr<sync_primitives::Lock> commands_lock_;
+ DataAccessor<am::CommandsMap> accessor_;
+
+ MessageSharedPtr message_;
+ DeleteSubMenuRequestPtr command_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
+ MockAppPtr app_;
+};
+
+class DeleteSubMenuResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::menu_id] = 10u;
+
+ std::shared_ptr<DeleteSubMenuRequest> command =
+ CreateCommand<DeleteSubMenuRequest>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app, RemoveSubMenu(_));
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ event.set_smart_object(*ev_msg);
+
+ MockHmiInterfaces hmi_interfaces;
+ ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
+ EXPECT_CALL(hmi_interfaces,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ am::CommandsMap commands_map;
+ smart_objects::SmartObject commands_msg(smart_objects::SmartType_Map);
+ commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &commands_msg));
+ DataAccessor<am::CommandsMap> accessor(
+ commands_map, std::make_shared<sync_primitives::Lock>());
+ EXPECT_CALL(*mock_app, commands_map())
+ .WillOnce(Return(accessor))
+ .WillOnce(Return(accessor));
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMessageResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_, FindSubMenu(_)).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_FindSubMenuFalse_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* invalid_sub_menu = NULL;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(invalid_sub_menu));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageResultCode(mobile_apis::Result::INVALID_ID),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_, app_id()).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* sub_menu =
+ &((*message_)[am::strings::msg_params][am::strings::menu_id]);
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(sub_menu));
+
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteSubMenu)))
+ .WillOnce(Return(true));
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_UnknownEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ event.set_smart_object(*message_);
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(*app_, RemoveSubMenu(_)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::vr_commands] =
+ "vr_commands";
+ (*message_)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ (*message_)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = kMenuId;
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*message_)[am::strings::params][am::hmi_response::code] = result_code;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+
+ InSequence seq;
+ EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveCommand(_)).WillOnce(DeleteCommand(&commands_map_));
+ EXPECT_CALL(*app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandDeleted(kCmdId, false));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*app_, RemoveSubMenu(_));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+ EXPECT_CALL(*app_, UpdateHash());
+
+ DeleteSubMenuRequestPtr command =
+ CreateCommand<DeleteSubMenuRequest>(message_);
+
+ command->Init();
+ command->on_event(event);
+}
+
+TEST_F(DeleteSubMenuResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::connection_key] =
+ kConnectionKey;
+ DeleteSubMenuResponsePtr command(
+ CreateCommand<DeleteSubMenuResponse>(message));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(CheckMessageConnectionKey(kConnectionKey), _));
+ command->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest,
+ DeleteSubmenu_CommandhaventVrCommadsAndMenuParams_DontSendHMIRequest) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ am::mobile_api::Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ 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(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
+ EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest,
+ DeleteSubmenu_NotAChildOfMenupartam_DontSendHMIRequest) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = kMenuId + 1;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ am::mobile_api::Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ 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(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
+ EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+ command_->on_event(event);
+}
+
+} // namespace delete_sub_menu_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
new file mode 100644
index 0000000000..5d6c6dc89e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
@@ -0,0 +1,187 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/dial_number_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dial_number_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::DialNumberRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<DialNumberRequest> DialNumberRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class DialNumberRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DialNumberRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_InvalidNumber_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "\t\n";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_EmptyNumber_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "NotANumber";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_DialNumber)));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ (*event_msg)[am::strings::params][am::strings::info] = "test_info";
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app));
+ ON_CALL(app_mngr_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+ command->on_event(event);
+}
+
+} // namespace dial_number_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
new file mode 100644
index 0000000000..8589cbb6be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "mobile/add_command_request.h"
+#include "mobile/add_command_response.h"
+#include "mobile/add_sub_menu_request.h"
+#include "mobile/add_sub_menu_response.h"
+#include "mobile/alert_maneuver_request.h"
+#include "mobile/alert_maneuver_response.h"
+#include "mobile/alert_request.h"
+#include "mobile/alert_response.h"
+#include "mobile/change_registration_request.h"
+#include "mobile/change_registration_response.h"
+#include "mobile/create_interaction_choice_set_request.h"
+#include "mobile/create_interaction_choice_set_response.h"
+#include "mobile/delete_command_request.h"
+#include "mobile/delete_command_response.h"
+#include "mobile/delete_file_request.h"
+#include "mobile/delete_file_response.h"
+#include "mobile/delete_interaction_choice_set_request.h"
+#include "mobile/delete_interaction_choice_set_response.h"
+#include "mobile/delete_sub_menu_request.h"
+#include "mobile/delete_sub_menu_response.h"
+#include "mobile/dial_number_request.h"
+#include "mobile/dial_number_response.h"
+#include "mobile/end_audio_pass_thru_request.h"
+#include "mobile/end_audio_pass_thru_response.h"
+#include "mobile/generic_response.h"
+#include "mobile/get_way_points_request.h"
+#include "mobile/get_way_points_response.h"
+#include "mobile/list_files_request.h"
+#include "mobile/list_files_response.h"
+#include "mobile/on_app_interface_unregistered_notification.h"
+#include "mobile/on_audio_pass_thru_notification.h"
+#include "mobile/on_button_event_notification.h"
+#include "mobile/on_button_press_notification.h"
+#include "mobile/on_command_notification.h"
+#include "mobile/on_driver_distraction_notification.h"
+#include "mobile/on_hash_change_notification.h"
+#include "mobile/on_hmi_status_notification.h"
+#include "mobile/on_hmi_status_notification_from_mobile.h"
+#include "mobile/on_keyboard_input_notification.h"
+#include "mobile/on_language_change_notification.h"
+#include "mobile/on_permissions_change_notification.h"
+#include "mobile/on_system_request_notification.h"
+#include "mobile/on_tbt_client_state_notification.h"
+#include "mobile/on_touch_event_notification.h"
+#include "mobile/on_way_point_change_notification.h"
+#include "mobile/perform_audio_pass_thru_request.h"
+#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/perform_interaction_request.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/put_file_request.h"
+#include "mobile/put_file_response.h"
+#include "mobile/register_app_interface_request.h"
+#include "mobile/register_app_interface_response.h"
+#include "mobile/reset_global_properties_request.h"
+#include "mobile/reset_global_properties_response.h"
+#include "mobile/scrollable_message_request.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/send_location_request.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_request.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_request.h"
+#include "mobile/set_display_layout_response.h"
+#include "mobile/set_global_properties_request.h"
+#include "mobile/set_global_properties_response.h"
+#include "mobile/set_media_clock_timer_request.h"
+#include "mobile/set_media_clock_timer_response.h"
+#include "mobile/show_constant_tbt_request.h"
+#include "mobile/show_constant_tbt_response.h"
+#include "mobile/show_request.h"
+#include "mobile/show_response.h"
+#include "mobile/slider_request.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_request.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_button_request.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/subscribe_way_points_request.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/unregister_app_interface_request.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_request.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_way_points_request.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_request.h"
+#include "mobile/update_turn_list_response.h"
+
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dummy_mobile_commands_test {
+
+namespace commands = sdl_rpc_plugin::commands;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using am::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace {
+const std::string kEmptyString_ = "";
+} // namespace
+
+template <class Command>
+class MobileCommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kEmptyString_));
+ }
+};
+
+template <class Command>
+class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class MobileCommandsTestSecond : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class MobileCommandsTestThird : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::AddCommandRequest,
+ commands::AddCommandResponse,
+ commands::AddSubMenuRequest,
+ commands::AddSubMenuResponse,
+ commands::AlertManeuverRequest,
+ commands::AlertManeuverResponse,
+ commands::AlertRequest,
+ commands::AlertResponse,
+ commands::ChangeRegistrationRequest,
+ commands::ChangeRegistrationResponse,
+ commands::CreateInteractionChoiceSetRequest,
+ commands::CreateInteractionChoiceSetResponse,
+ commands::DeleteCommandRequest,
+ commands::DeleteCommandResponse,
+ commands::DeleteFileRequest,
+ commands::DeleteFileResponse,
+ commands::DeleteInteractionChoiceSetRequest,
+ commands::DeleteInteractionChoiceSetResponse,
+ commands::DeleteSubMenuRequest,
+ commands::DeleteSubMenuResponse,
+ commands::DialNumberRequest,
+ commands::DialNumberResponse,
+ commands::EndAudioPassThruRequest,
+ commands::EndAudioPassThruResponse,
+ commands::GenericResponse,
+ commands::GetWayPointsRequest,
+ commands::GetWayPointsResponse,
+ commands::ListFilesRequest,
+ commands::ListFilesResponse,
+ commands::OnAppInterfaceUnregisteredNotification,
+ commands::OnAudioPassThruNotification,
+ commands::mobile::OnButtonEventNotification,
+ commands::mobile::OnButtonPressNotification,
+ commands::OnCommandNotification,
+ commands::mobile::OnDriverDistractionNotification,
+ commands::mobile::OnHashChangeNotification,
+ commands::OnHMIStatusNotification,
+ commands::OnHMIStatusNotificationFromMobile,
+ commands::mobile::OnKeyBoardInputNotification,
+ commands::OnLanguageChangeNotification,
+ commands::OnPermissionsChangeNotification,
+ commands::mobile::OnSystemRequestNotification,
+ commands::OnTBTClientStateNotification,
+ commands::mobile::OnTouchEventNotification>
+ MobileCommandsListFirst;
+
+typedef Types<commands::OnWayPointChangeNotification,
+ commands::PerformAudioPassThruRequest,
+ commands::PerformAudioPassThruResponse,
+ commands::PerformInteractionRequest,
+ commands::PerformInteractionResponse,
+ commands::PutFileRequest,
+ commands::PutFileResponse,
+ commands::RegisterAppInterfaceRequest,
+ commands::RegisterAppInterfaceResponse,
+ commands::ResetGlobalPropertiesRequest,
+ commands::ResetGlobalPropertiesResponse,
+ commands::ScrollableMessageRequest,
+ commands::ScrollableMessageResponse,
+ commands::SendLocationRequest,
+ commands::SendLocationResponse,
+ commands::SetAppIconRequest,
+ commands::SetAppIconResponse,
+ commands::SetDisplayLayoutRequest,
+ commands::SetDisplayLayoutResponse,
+ commands::SetGlobalPropertiesRequest,
+ commands::SetGlobalPropertiesResponse,
+ commands::SetMediaClockRequest,
+ commands::SetMediaClockTimerResponse,
+ commands::ShowConstantTBTRequest,
+ commands::ShowConstantTBTResponse,
+ commands::ShowRequest,
+ commands::ShowResponse,
+ commands::SliderRequest,
+ commands::SliderResponse,
+ commands::SpeakRequest,
+ commands::SpeakResponse,
+ commands::SubscribeButtonRequest,
+ commands::SubscribeButtonResponse,
+ commands::SubscribeWayPointsRequest,
+ commands::SubscribeWayPointsResponse,
+ commands::SystemResponse,
+ commands::UnregisterAppInterfaceRequest,
+ commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeButtonRequest,
+ commands::UnsubscribeButtonResponse> MobileCommandsListSecond;
+
+typedef Types<commands::UnsubscribeWayPointsRequest,
+ commands::UnsubscribeWayPointsResponse,
+ commands::UpdateTurnListRequest,
+ commands::UpdateTurnListResponse> MobileCommandsListThird;
+
+TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
+TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond);
+TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
+
+TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+} // namespace dummy_mobile_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
new file mode 100644
index 0000000000..304cf13ffd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
@@ -0,0 +1,120 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "mobile/end_audio_pass_thru_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace end_audio_pass_thru_request {
+
+namespace am = ::application_manager;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::EndAudioPassThruRequest;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef std::shared_ptr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr;
+
+class EndAudioPassThruRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
+ const uint32_t kConnectionKey = 2u;
+ const uint32_t app_id = kConnectionKey;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EndAudioPassThruRequestPtr command(
+ CreateCommand<EndAudioPassThruRequest>(command_msg));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::UNSUPPORTED_RESOURCE;
+
+ Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+} // namespace end_audio_pass_thru_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
new file mode 100644
index 0000000000..09a3336a10
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
@@ -0,0 +1,282 @@
+/*
+ * 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 "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "mobile/get_way_points_request.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_way_points_request {
+
+using namespace mobile_apis::Result;
+using ::testing::Return;
+using ::testing::_;
+using sdl_rpc_plugin::commands::GetWayPointsRequest;
+using application_manager::MockMessageHelper;
+using application_manager::MockHmiInterfaces;
+
+typedef std::shared_ptr<GetWayPointsRequest> CommandPtr;
+typedef mobile_apis::Result::eType MobileResult;
+typedef hmi_apis::Common_Result::eType HmiResult;
+
+namespace {
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppId = 3u;
+const uint32_t kConnectionKey = kAppId;
+const std::string kMethodName = "Navigation.GetWayPoints";
+}
+
+class GetWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetWayPointsRequestTest() : mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ message_ = std::make_shared<SmartObject>(::smart_objects::SmartType_Map);
+ (*message_)[am::strings::msg_params] =
+ ::smart_objects::SmartObject(::smart_objects::SmartType_Map);
+
+ command_sptr_ = CreateCommand<GetWayPointsRequest>(message_);
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ }
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ std::shared_ptr<GetWayPointsRequest> command_sptr_;
+};
+
+class GetWayPointsRequestOnEventTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetWayPointsRequestOnEventTest() : app_(CreateMockApp()) {}
+
+ void CheckOnEventResponse(const std::string& wayPointsParam,
+ const HmiResult ResultCode,
+ const bool success) {
+ Event event(Event::EventID::Navigation_GetWayPoints);
+ CommandPtr command(CreateCommand<GetWayPointsRequest>());
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = ResultCode;
+ if ("0" == wayPointsParam) {
+ (*event_msg)[am::strings::msg_params] = 0;
+ } else {
+ (*event_msg)[am::strings::msg_params][am::strings::way_points][0]["123"] =
+ wayPointsParam;
+ }
+
+ event.set_smart_object(*event_msg);
+
+ const MobileResult mobile_result = static_cast<MobileResult>(ResultCode);
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event)));
+ EXPECT_EQ(
+ mobile_result,
+ static_cast<MobileResult>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+ EXPECT_EQ(
+ success,
+ (*result_msg)[am::strings::msg_params][am::strings::success].asBool());
+ }
+
+ protected:
+ MockAppPtr app_;
+ MockHmiInterfaces hmi_interfaces_;
+};
+
+TEST_F(GetWayPointsRequestTest,
+ Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(null_application_sptr));
+
+ CallRun caller(*command_sptr_);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const mobile_apis::Result::eType result =
+ static_cast<mobile_apis::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED, result);
+}
+
+TEST_F(GetWayPointsRequestTest, Run_ApplicationRegistered_Success) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ MockAppPtr application_sptr = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(application_sptr));
+ EXPECT_CALL(*application_sptr, app_id()).WillOnce(Return(1));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ CallRun caller(*command_sptr_);
+
+ MessageSharedPtr result_message = CatchHMICommandResult(caller);
+
+ const hmi_apis::FunctionID::eType result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_message)[am::strings::params][am::strings::function_id]
+ .asInt());
+
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_GetWayPoints, result_function_id);
+ EXPECT_EQ(kCorrelationId,
+ (*result_message)[am::strings::params][am::strings::correlation_id]
+ .asUInt());
+}
+
+TEST_F(GetWayPointsRequestTest,
+ OnEvent_NavigationGetWayPointsEvent_SendResponse) {
+ am::event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ event.set_smart_object(*message_);
+
+ CallOnEvent caller(*command_sptr_, event);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const mobile_apis::Result::eType result =
+ static_cast<mobile_apis::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+}
+
+TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) {
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ CommandPtr command(CreateCommand<GetWayPointsRequest>());
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case1) {
+ CheckOnEventResponse("0", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case2) {
+ CheckOnEventResponse("", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case3) {
+ CheckOnEventResponse("test", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case1) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse(" ", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case2) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\t", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case3) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\n", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case4) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\t\n", HmiResult::GENERIC_ERROR, false);
+}
+
+} // namespace get_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
new file mode 100644
index 0000000000..3fcc4225f3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
@@ -0,0 +1,145 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "mobile/list_files_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace list_files_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::ListFilesRequest;
+using am::commands::MessageSharedPtr;
+
+class ListFilesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ListFilesRequestTest() : kStoragePath_("storage"), kResponseSize_(1) {}
+ const std::string kStoragePath_;
+ const uint32_t kResponseSize_;
+};
+
+TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ const uint32_t kListFilesInNoneAllowed = 1u;
+ const uint32_t kListFilesInNoneCount = 2u;
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, list_files_in_none())
+ .WillByDefault(ReturnRef(kListFilesInNoneAllowed));
+ ON_CALL(*app, list_files_in_none_count())
+ .WillByDefault(Return(kListFilesInNoneCount));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ListFilesRequestTest, Run_SUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillRepeatedly(ReturnRef(app_mngr_settings_));
+
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kStoragePath_));
+
+ ON_CALL(app_mngr_settings_, list_files_response_size())
+ .WillByDefault(ReturnRef(kResponseSize_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ ON_CALL(*app, increment_list_files_in_none_count()).WillByDefault(Return());
+
+ ON_CALL(*app, GetAvailableDiskSpace()).WillByDefault(Return(0));
+
+ am::AppFilesMap files_map;
+ ON_CALL(*app, getAppFiles()).WillByDefault(ReturnRef(files_map));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+} // namespace list_files_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
new file mode 100644
index 0000000000..a0e41cf728
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
@@ -0,0 +1,337 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "mobile/on_button_event_notification.h"
+#include "mobile/on_button_press_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_button_notification {
+
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using sdl_rpc_plugin::commands::mobile::OnButtonEventNotification;
+using sdl_rpc_plugin::commands::mobile::OnButtonPressNotification;
+using ::testing::_;
+using ::testing::Types;
+using ::testing::Return;
+using am::commands::MessageSharedPtr;
+
+namespace {
+const uint32_t kAppId = 5u;
+const uint32_t kCustomButtonId = 3u;
+const mobile_apis::ButtonName::eType kButtonName = mobile_apis::ButtonName::OK;
+} // namespace
+
+template <class NotificationT,
+ mobile_apis::FunctionID::eType kExpectedFunctionId>
+struct NotificationData {
+ typedef NotificationT Notification;
+ enum { kFunctionId = kExpectedFunctionId };
+};
+
+template <class NotificationDataT>
+class OnButtonNotificationCommandsTest
+ : public CommandsTest<CommandsTestMocks::kNotNice>,
+ public NotificationDataT {};
+
+typedef Types<NotificationData<OnButtonEventNotification,
+ mobile_apis::FunctionID::OnButtonEventID>,
+ NotificationData<OnButtonPressNotification,
+ mobile_apis::FunctionID::OnButtonPressID> >
+ OnButtonNotificationCommandsList;
+
+MATCHER_P(CheckNotificationMessage, function_id, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsFunctionIdCorrect =
+ (*arg)[am::strings::params][am::strings::function_id].asInt() ==
+ function_id;
+
+ bool is_custom_button_id_correct = true;
+ if ((*arg)[am::strings::msg_params].keyExists(
+ am::hmi_response::custom_button_id)) {
+ is_custom_button_id_correct =
+ (*arg)[am::strings::msg_params][am::strings::custom_button_id] ==
+ kCustomButtonId;
+ }
+
+ return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
+ kIsNotificationCorrect && kIsFunctionIdCorrect &&
+ is_custom_button_id_correct;
+}
+
+TYPED_TEST_CASE(OnButtonNotificationCommandsTest,
+ OnButtonNotificationCommandsList);
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_NoAppId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_NoCustomButtonId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_AppNotRegistered_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ EXPECT_CALL(this->app_mngr_, application(kAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_AppNotSubscribedToCustomButtonId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
+ .WillOnce(Return(false));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ ON_CALL(*mock_app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
+ .WillOnce(Return(true));
+ EXPECT_CALL(this->mock_rpc_service_,
+ SendMessageToMobile(
+ CheckNotificationMessage(TestFixture::kFunctionId), _));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_NoSubscribedApps_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ const std::vector<ApplicationSharedPtr> empty_subscribed_apps_list;
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(empty_subscribed_apps_list));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_ButtonOkOnlyForHmiLevelFull_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+ EXPECT_CALL(this->mock_rpc_service_,
+ SendMessageToMobile(
+ CheckNotificationMessage(TestFixture::kFunctionId), _));
+
+ command->Run();
+}
+
+} // namespace on_button_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
new file mode 100644
index 0000000000..2fd6f6137d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
@@ -0,0 +1,137 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "mobile/on_command_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_command_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::OnCommandNotification;
+
+typedef std::shared_ptr<OnCommandNotification> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCommandId = 5u;
+} // namespace
+
+class OnCommandNotificationTest
+ : public CommandsTest<CommandsTestMocks::kNotNice> {};
+
+TEST_F(OnCommandNotificationTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<OnCommandNotification>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnCommandNotificationTest, Run_NoAppsForTheCommand_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, FindCommand(kCommandId))
+ .WillOnce(Return(static_cast<SmartObject*>(NULL)));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->Run();
+}
+
+MATCHER(CheckNotificationMessage, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
+ kIsNotificationCorrect;
+}
+
+TEST_F(OnCommandNotificationTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(*mock_app, FindCommand(kCommandId))
+ .WillOnce(Return(dummy_msg.get()));
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckNotificationMessage(), _));
+
+ command->Run();
+}
+
+} // namespace on_command_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
new file mode 100644
index 0000000000..1d6711e36f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
@@ -0,0 +1,119 @@
+/*
+ * 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 <string>
+
+#include "gtest/gtest.h"
+#include "mobile/on_hash_change_notification.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hash_change_notification {
+
+namespace strings = application_manager::strings;
+
+using sdl_rpc_plugin::commands::mobile::OnHashChangeNotification;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::_;
+
+class OnHashChangeNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) {
+ const uint32_t kConnectionKey = 1u;
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<OnHashChangeNotification> command =
+ CreateCommand<OnHashChangeNotification>(msg);
+
+ std::string return_string = "1234";
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, curHash()).WillOnce(ReturnRef(return_string));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ ASSERT_EQ(return_string,
+ (*msg)[strings::msg_params][strings::hash_id].asString());
+}
+
+TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) {
+ const uint32_t kConnectionKey = 1u;
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<OnHashChangeNotification> command =
+ CreateCommand<OnHashChangeNotification>(msg);
+
+ std::string return_string;
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, curHash()).Times(0);
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+} // namespace on_hash_change_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
new file mode 100644
index 0000000000..333c204d57
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
@@ -0,0 +1,284 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "mobile/on_hmi_status_notification_from_mobile.h"
+#include "application_manager/commands/commands_test.h"
+#include <application_manager/smart_object_keys.h>
+#include "application_manager/message.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/mock_message_helper.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hmi_status_notification_from_mobile {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const connection_handler::DeviceHandle kHandle = 2u;
+} // namespace
+
+namespace strings = application_manager::strings;
+
+using sdl_rpc_plugin::commands::OnHMIStatusNotificationFromMobile;
+using protocol_handler::MajorProtocolVersion;
+using application_manager::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnHMIStatusNotificationFromMobileTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnHMIStatusNotificationFromMobileTest()
+ : lock_(std::make_shared<sync_primitives::Lock>()) {}
+ MessageSharedPtr CreateMsgParams(
+ const mobile_apis::HMILevel::eType kHMIState) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
+ return msg;
+ }
+ ApplicationSet app_set_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+};
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_CurrentStateForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, set_foreground(true)).Times(0);
+
+ EXPECT_CALL(*mock_app, device()).Times(0);
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).Times(0);
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version()).Times(0);
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_CurrentStateNotForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(false));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_ProtocolVersionKV3_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(false));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AppNotRequestedBeforeAndKV3_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AppNotRequestedBefore_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, is_foreground()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendQueryApps(kConnectionKey, _));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AnotherForegroundSDLApp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(false));
+
+ EXPECT_CALL(app_mngr_, MarkAppsGreyOut(kHandle, false));
+ EXPECT_CALL(app_mngr_, SendUpdateAppList());
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+} // namespace on_hmi_status_notification_from_mobile
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
new file mode 100644
index 0000000000..ba3b1e8f1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
@@ -0,0 +1,166 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "mobile/on_hmi_status_notification.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hmi_status_notification {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+} // namespace
+
+namespace strings = application_manager::strings;
+using sdl_rpc_plugin::commands::OnHMIStatusNotification;
+using protocol_handler::MajorProtocolVersion;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnHMIStatusNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams(
+ const mobile_apis::HMILevel::eType kHMIState) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
+ return msg;
+ }
+
+ void SetSendNotificationExpectations(MessageSharedPtr& msg) {
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+ }
+
+ void VerifySendNotificationData(MessageSharedPtr& msg) {
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ }
+};
+
+TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).Times(0);
+ EXPECT_CALL(*mock_app, set_tts_properties_in_full(_)).Times(0);
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey))
+ .Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::INVALID_ENUM);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, set_tts_properties_in_full(true));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_FullAndTrueProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(true));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+} // namespace on_hmi_status_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
new file mode 100644
index 0000000000..04f88e2b13
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
@@ -0,0 +1,167 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "mobile/on_keyboard_input_notification.h"
+#include "application_manager/commands/commands_test.h"
+#include <application_manager/smart_object_keys.h>
+#include "application_manager/message.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_keyboard_input_notification {
+
+namespace strings = application_manager::strings;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+} // namespace
+
+using sdl_rpc_plugin::commands::mobile::OnKeyBoardInputNotification;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using application_manager::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnKeyBoardInputNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnKeyBoardInputNotificationTest()
+ : lock_(std::make_shared<sync_primitives::Lock>()) {}
+ void SetSendNotificationExpectations(MessageSharedPtr msg) {
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+ }
+
+ void SetSendNotificationVariables(MessageSharedPtr msg) {
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ }
+
+ MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) {
+ app_set = (!app_set ? std::make_shared<ApplicationSet>() : app_set);
+ MockAppPtr app(CreateMockApp());
+ app_set->insert(app);
+ EXPECT_CALL(app_mngr_, applications())
+ .WillOnce(Return(DataAccessor<ApplicationSet>(*app_set, lock_)));
+ return app;
+ }
+
+ std::shared_ptr<ApplicationSet> app_set_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+};
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active()).WillOnce(Return(1));
+ EXPECT_CALL(*mock_app, perform_interaction_layout())
+ .WillOnce(Return(mobile_apis::LayoutMode::KEYBOARD));
+ EXPECT_CALL(*mock_app, hmi_level()).Times(0);
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ SetSendNotificationVariables(msg);
+
+ ASSERT_EQ(kConnectionKey,
+ (*msg)[strings::params][strings::connection_key].asInt());
+}
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active())
+ .WillRepeatedly(Return(0));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_FULL));
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ SetSendNotificationVariables(msg);
+
+ ASSERT_EQ(kConnectionKey,
+ (*msg)[strings::params][strings::connection_key].asInt());
+}
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active())
+ .WillRepeatedly(Return(0));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_BACKGROUND));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+} // namespace on_keyboard_input_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
new file mode 100644
index 0000000000..4981301e07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
@@ -0,0 +1,273 @@
+/*
+ * 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 <string>
+
+#include "gtest/gtest.h"
+#include "mobile/on_system_request_notification.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_system_request_notification {
+
+namespace strings = application_manager::strings;
+
+using sdl_rpc_plugin::commands::mobile::OnSystemRequestNotification;
+using application_manager::commands::CommandImpl;
+using application_manager::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using namespace mobile_apis;
+using testing::SaveArg;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::_;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "fake-app-id";
+} // namespace
+
+class OnSystemRequestNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnSystemRequestNotificationTest() : mock_app_(CreateMockApp()) {}
+
+ void PreConditions() {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ }
+
+ protected:
+ MockAppPtr mock_app_;
+};
+
+TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::PROPRIETARY;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kPolicyAppId, request_type))
+ .WillRepeatedly(Return(true));
+
+#ifdef PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, TimeoutExchangeSec()).WillOnce(Return(5u));
+#endif // PROPRIETARY_MODE
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(FileType::JSON,
+ (*msg)[strings::msg_params][strings::file_type].asInt());
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
+ EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(FileType::BINARY,
+ (*msg)[strings::msg_params][strings::file_type].asInt());
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app_, policy_app_id()).Times(0);
+ EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _)).Times(0);
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
+ EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(
+ OnSystemRequestNotificationTest,
+ Run_RequestTypeAllowedAndRequestSubTypeDisallowed_MessageNotSentToMobile) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ const auto request_type = mobile_apis::RequestType::HTTP;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+ const std::string request_subtype = "fakeSubType";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kPolicyAppId, request_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kPolicyAppId, request_subtype))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ auto command = CreateCommand<OnSystemRequestNotification>(msg);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(OnSystemRequestNotificationTest,
+ Run_RequestTypeAllowedAndRequestSubTypeAllowed_SendMessageToMobile) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ const auto request_type = mobile_apis::RequestType::OEM_SPECIFIC;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+ const std::string request_subtype = "fakeSubType";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kPolicyAppId, request_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kPolicyAppId, request_subtype))
+ .WillOnce(Return(true));
+
+ smart_objects::SmartObjectSPtr result;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _))
+ .WillOnce((SaveArg<0>(&result)));
+
+ auto command = CreateCommand<OnSystemRequestNotification>(msg);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(application_manager::MessageType::kNotification,
+ (*result)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(request_type,
+ (*result)[strings::msg_params][strings::request_type].asInt());
+ EXPECT_EQ(
+ request_subtype,
+ (*result)[strings::msg_params][strings::request_subtype].asString());
+}
+
+} // namespace on_system_request_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
new file mode 100644
index 0000000000..3d989db478
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
@@ -0,0 +1,138 @@
+/*
+ * 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 <stdint.h>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "mobile/on_tbt_client_state_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_tbt_client_state_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::OnTBTClientStateNotification;
+
+typedef std::shared_ptr<OnTBTClientStateNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnTBTClientStateNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnTBTClientStateNotificationTest()
+ : command_(CreateCommand<OnTBTClientStateNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+TEST_F(OnTBTClientStateNotificationTest, Run_HmiLevelNone_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ command_->Run();
+}
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnTBTClientStateNotificationTest,
+ Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(CheckMessageData(), _));
+
+ command_->Run();
+}
+
+} // namespace on_tbt_client_state_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
new file mode 100644
index 0000000000..f69dd5da2e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
@@ -0,0 +1,148 @@
+/*
+ * 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 <stdint.h>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "mobile/on_touch_event_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_touch_event_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::mobile::OnTouchEventNotification;
+
+typedef std::shared_ptr<OnTouchEventNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnTouchEventNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnTouchEventNotificationTest()
+ : command_(CreateCommand<OnTouchEventNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ command_->Run();
+}
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnTouchEventNotificationTest, Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(CheckMessageData(), _))
+ .Times(2);
+
+ command_->Run();
+}
+
+} // namespace on_touch_event_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
new file mode 100644
index 0000000000..ed0a9b07d2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
@@ -0,0 +1,115 @@
+/*
+ * 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 <stdint.h>
+#include <set>
+
+#include "gtest/gtest.h"
+#include "mobile/on_way_point_change_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_way_point_change_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::OnWayPointChangeNotification;
+
+typedef std::shared_ptr<OnWayPointChangeNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnWayPointChangeNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnWayPointChangeNotificationTest()
+ : command_(CreateCommand<OnWayPointChangeNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnWayPointChangeNotificationTest,
+ Run_NotEmptyListOfAppsSubscribedForWayPoints_SUCCESS) {
+ std::set<uint32_t> apps_subscribed_for_way_points;
+ apps_subscribed_for_way_points.insert(kAppId);
+
+ EXPECT_CALL(app_mngr_, GetAppsSubscribedForWayPoints())
+ .WillOnce(Return(apps_subscribed_for_way_points));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(CheckMessageData(), _));
+
+ command_->Run();
+}
+
+} // namespace on_way_point_change_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/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
new file mode 100644
index 0000000000..f51f1aa655
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
@@ -0,0 +1,834 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/perform_audio_pass_thru_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace perform_audio_pass_thru_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::PerformAudioPassThruRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::InSequence;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 2u;
+const std::string kCorrectPrompt = "CorrectPrompt";
+const std::string kCorrectType = "CorrectType";
+const std::string kCorrectDisplayText1 = "CorrectDisplayText1";
+const std::string kCorrectDisplayText2 = "CorrectDisplayText2";
+const std::string kFunctionId = "FunctionId";
+const uint32_t kTimeoutForTTSSpeak = 1u;
+} // namespace
+
+class PerformAudioPassThruRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PerformAudioPassThruRequestTest()
+ : mock_app_(CreateMockApp())
+ , message_(std::make_shared<SmartObject>(::smart_objects::SmartType_Map))
+ , msg_params_((*message_)[am::strings::msg_params]) {}
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void TestWrongSyntaxInField(const std::string& field) {
+ if (field == am::strings::initial_prompt) {
+ msg_params_[field][0][am::strings::text] = "prompt\\n";
+ } else {
+ msg_params_[field] = "prompt\\n";
+ }
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::INVALID_DATA, result);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ command_sptr_ = CreateCommand<PerformAudioPassThruRequest>(message_);
+
+ application_sptr_ = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(application_sptr_));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ ::smart_objects::SmartObject& msg_params_;
+ std::shared_ptr<PerformAudioPassThruRequest> command_sptr_;
+ MockAppPtr application_sptr_;
+};
+
+TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
+ MessageSharedPtr msg_ui = CreateMessage(smart_objects::SmartType_Map);
+ (*msg_ui)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*msg_ui)[am::strings::msg_params][am::strings::success] = false;
+
+ MessageSharedPtr message =
+ std::make_shared<SmartObject>(::smart_objects::SmartType_Map);
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<PerformAudioPassThruRequest> command =
+ CreateCommand<PerformAudioPassThruRequest>(message);
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(msg_ui));
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ command->onTimeOut();
+ EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr mobile_request = CreateFullParamsUISO();
+ (*mobile_request)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject initial_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ initial_prompt[0] = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ initial_prompt[0][am::strings::text] = "tts chunk text";
+ initial_prompt[0][am::strings::type] = 0;
+ (*mobile_request)[am::strings::msg_params][am::strings::initial_prompt] =
+ initial_prompt;
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+ std::shared_ptr<PerformAudioPassThruRequest> command =
+ CreateCommand<PerformAudioPassThruRequest>(mobile_request);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MessageSharedPtr response_msg_tts =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_tts)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response_msg_tts)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_msg_tts);
+
+ MessageSharedPtr response_ui = CreateMessage(smart_objects::SmartType_Map);
+ (*response_ui)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_ui)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*response_ui)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ event_ui.set_smart_object(*response_ui);
+
+ 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(_))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles((*mobile_request)[am::strings::msg_params]
+ [am::strings::initial_prompt],
+ _,
+ _)).WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ command->Run();
+ command->on_event(event_tts);
+ command->on_event(event_ui);
+
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::info]
+ .asString(),
+ "UI is not supported by system");
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ std::shared_ptr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(null_application_sptr));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+ EXPECT_EQ(am::mobile_api::Result::APPLICATION_NOT_REGISTERED, result);
+}
+
+TEST_F(PerformAudioPassThruRequestTest, Run_HmiLevelNone_Rejected) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+ EXPECT_EQ(am::mobile_api::Result::REJECTED, result);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInInitialPrompt_InvalidData) {
+ TestWrongSyntaxInField(am::strings::initial_prompt);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInAudioPassDisplayText1_InvalidData) {
+ TestWrongSyntaxInField(am::strings::audio_pass_display_text1);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInAudioPassDisplayText2_InvalidData) {
+ TestWrongSyntaxInField(am::strings::audio_pass_display_text2);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_TTSSpeakIsAbsent) {
+ // First we need to call SendSpeakRequest()
+ // to enable the "is_active_tts_speak" key
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ // Send speak request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun run_caller(*command_sptr_);
+ run_caller();
+
+ const ::smart_objects::SmartObject& speak_msg_params =
+ (*speak_reqeust_result_msg)[am::strings::msg_params];
+
+ const std::string result_initial_prompt =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
+ .asString();
+ const std::string result_prompt_type =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
+ .asString();
+
+ EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
+ EXPECT_EQ(kCorrectType, result_prompt_type);
+
+ // Now we recieve on_event()
+
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+ event.set_smart_object(*message_);
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
+
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_StopSpeaking))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ CallOnEvent on_event_caller(*command_sptr_, event);
+ MessageSharedPtr command_result = CatchHMICommandResult(on_event_caller);
+
+ const hmi_apis::FunctionID::eType result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*command_result)[am::strings::params][am::strings::function_id]
+ .asInt());
+
+ EXPECT_EQ(hmi_apis::FunctionID::TTS_StopSpeaking, result_function_id);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteTrue) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+ msg_params_[am::strings::audio_pass_display_text1] = kCorrectDisplayText1;
+ msg_params_[am::strings::audio_pass_display_text2] = kCorrectDisplayText2;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun caller(*command_sptr_);
+ caller();
+
+ const ::smart_objects::SmartObject& speak_msg_params =
+ (*speak_reqeust_result_msg)[am::strings::msg_params];
+ const ::smart_objects::SmartObject& perform_msg_params =
+ (*perform_result_msg)[am::strings::msg_params];
+
+ const std::string result_initial_prompt =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
+ .asString();
+ const std::string result_prompt_type =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
+ .asString();
+ const std::string result_display_text_1 =
+ perform_msg_params[am::hmi_request::audio_pass_display_texts][0]
+ [am::hmi_request::field_text].asString();
+ const std::string result_display_text_2 =
+ perform_msg_params[am::hmi_request::audio_pass_display_texts][1]
+ [am::hmi_request::field_text].asString();
+
+ EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
+ EXPECT_EQ(kCorrectType, result_prompt_type);
+ EXPECT_EQ(kCorrectDisplayText1, result_display_text_1);
+ EXPECT_EQ(kCorrectDisplayText2, result_display_text_2);
+
+ EXPECT_EQ(true, perform_msg_params[am::strings::mute_audio].asBool());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteFalse) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ const bool muted = false;
+
+ msg_params_[am::strings::mute_audio] = muted;
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun caller(*command_sptr_);
+ caller();
+
+ EXPECT_EQ(
+ muted,
+ (*perform_result_msg)[am::strings::msg_params][am::strings::mute_audio]
+ .asBool());
+}
+
+TEST_F(
+ PerformAudioPassThruRequestTest,
+ Run_InitPromptEmpty_PerformAndRecordStartNotificationsAndStartRecording) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ MessageSharedPtr start_record_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // Perform audio path thru request sending
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_OnRecordStart))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // Start recording notification sending
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&start_record_result_msg), Return(true)));
+ }
+
+ // Start microphone recording cals
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
+ EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
+
+ CallRun caller(*command_sptr_);
+ caller();
+
+ const hmi_apis::FunctionID::eType start_record_result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*start_record_result_msg)[am::strings::params]
+ [am::strings::function_id].asInt());
+ EXPECT_EQ(hmi_apis::FunctionID::UI_OnRecordStart,
+ start_record_result_function_id);
+}
+
+TEST_F(PerformAudioPassThruRequestTest, OnEvent_UIPAPT_Rejected) {
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+ event.set_smart_object(*message_);
+
+ CallOnEvent caller(*command_sptr_, event);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result_code =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::REJECTED, result_code);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ OnEvent_TTSSpeakSuccess_UpdateRequestTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ // Start recording notification sending
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ // Start microphone recording cals
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
+ EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_PAPTunsupportedResource_CorrectInfo) {
+ const std::string return_info = "Unsupported phoneme type sent in a prompt";
+
+ am::event_engine::Event event_speak(hmi_apis::FunctionID::TTS_Speak);
+ am::event_engine::Event event_perform(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ event_speak.set_smart_object(*message_);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ event_perform.set_smart_object(*message_);
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // First call on_event for setting result_tts_speak_ to UNSUPPORTED_RESOURCE
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ CallOnEvent caller_speak(*command_sptr_, event_speak);
+ caller_speak();
+
+ // Second call for test correct behavior of UI_PerformAudioPassThru event
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_)).Times(0);
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller_perform(*command_sptr_, event_perform);
+
+ MessageSharedPtr perform_event_result =
+ CatchMobileCommandResult(caller_perform);
+
+ EXPECT_EQ(return_info,
+ (*perform_event_result)[am::strings::msg_params][am::strings::info]
+ .asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_TTSSpeak_UpdateTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+
+ msg_params_[am::strings::connection_key] = kConnectionKey;
+ msg_params_[am::strings::function_id] = kFunctionId;
+ msg_params_[am::strings::correlation_id] = kCorrelationId;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+
+ EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
+ EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_TTSOnResetTimeout_UpdateTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+
+ msg_params_[am::strings::connection_key] = kConnectionKey;
+ msg_params_[am::strings::function_id] = kFunctionId;
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+
+ EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
+ EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) {
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).Times(0);
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(PerformAudioPassThruRequestTest, Init_CorrectTimeout) {
+ const uint32_t kDefaultTimeout = command_sptr_->default_timeout();
+ const uint32_t kMaxDuration = 10000u;
+
+ msg_params_[am::strings::max_duration] = kMaxDuration;
+
+ command_sptr_->Init();
+
+ EXPECT_EQ(kDefaultTimeout + kMaxDuration, command_sptr_->default_timeout());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ onTimeOut_ttsSpeakNotActive_DontSendHMIReqeust) {
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ // For setting current_state_ -> kCompleted
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ command_sptr_->onTimeOut();
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_onTimeOut_ttsSpeakActive_SendHMIReqeust) {
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(msg));
+
+ // For setting is_active_tts_speak -> true
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .Times(2)
+ .WillRepeatedly(Return(false));
+ CallRun caller(*command_sptr_);
+ caller();
+
+ // For setting current_state_ -> kCompleted
+
+ EXPECT_CALL(mock_rpc_service_,
+ 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)))
+ .WillOnce(Return(false));
+
+ command_sptr_->onTimeOut();
+}
+
+} // namespace perform_audio_pass_thru_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
new file mode 100644
index 0000000000..3b68d3ea72
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
@@ -0,0 +1,261 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/perform_interaction_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace perform_interaction_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using sdl_rpc_plugin::commands::PerformInteractionRequest;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class PerformInteractionRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PerformInteractionRequestTest() : mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ static_cast<uint64_t>(hmi_apis::Common_Result::SUCCESS);
+ (*response_msg_vr)[strings::msg_params][strings::info] = "info";
+ MessageSharedPtr request_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*request_msg)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::BOTH;
+ std::shared_ptr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(request_msg);
+ MockAppPtr mock_app;
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ Event event(hmi_apis::FunctionID::VR_PerformInteraction);
+ event.set_smart_object(*response_msg_vr);
+
+ command->Init();
+ command->on_event(event);
+ MessageSharedPtr response_to_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_to_mobile)[strings::msg_params][strings::result_code] =
+ static_cast<uint64_t>(am::mobile_api::Result::GENERIC_ERROR);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(response_to_mobile));
+
+ MessageSharedPtr vr_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+ command->onTimeOut();
+
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(PerformInteractionRequestTest,
+ OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::VR_ONLY;
+ std::shared_ptr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ command->Init();
+
+ MockAppPtr mock_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_msg_vr)[strings::msg_params][strings::cmd_id] = kCommandId;
+ (*response_msg_vr)[am::strings::msg_params][am::strings::info] =
+ "VR is not supported by system";
+
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
+ event_vr.set_smart_object(*response_msg_vr);
+
+ MessageSharedPtr response_msg_ui =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
+ event_ui.set_smart_object(*response_msg_ui);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "VR is not supported by system");
+}
+
+TEST_F(PerformInteractionRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::VR_ONLY;
+ std::shared_ptr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
+ event_vr.set_smart_object(*response_msg_vr);
+
+ MessageSharedPtr response_msg_ui =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_msg_ui)[strings::msg_params][strings::cmd_id] = kCommandId;
+ (*response_msg_ui)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
+ event_ui.set_smart_object(*response_msg_ui);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+
+ EXPECT_CALL(*mock_app_, is_perform_interaction_active())
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app_, DeletePerformInteractionChoiceSet(_));
+
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "UI is not supported by system");
+}
+
+} // namespace perform_interaction_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
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
new file mode 100644
index 0000000000..df4f69f0d0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
@@ -0,0 +1,406 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+
+#include "mobile/put_file_response.h"
+#include "mobile/put_file_request.h"
+
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace put_file {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::AtLeast;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::PutFileRequest;
+using sdl_rpc_plugin::commands::PutFileResponse;
+using am::commands::MessageSharedPtr;
+using policy_test::MockPolicyHandlerInterface;
+
+typedef std::shared_ptr<PutFileRequest> PutFileRequestPtr;
+typedef std::shared_ptr<PutFileResponse> PutFileResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kFileName = "sync_file_name.txt";
+const int64_t kOffset = 10u;
+const int64_t kZeroOffset = 0u;
+const std::string kStorageFolder = "./storage";
+const std::string kFolder = "folder";
+const std::string kAppFolder = "app_folder";
+}
+
+class PutFileRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PutFileRequestTest()
+ : msg_(CreateMessage(::smart_objects::SmartType_Map))
+ , mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ binary_data_.push_back(1u);
+
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::sync_file_name] = kFileName;
+ (*msg_)[am::strings::msg_params][am::strings::persistent_file] = true;
+ (*msg_)[am::strings::msg_params][am::strings::file_type] =
+ mobile_apis::FileType::JSON;
+ (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ }
+
+ void ExpectReceiveMessageFromSDK() {
+ EXPECT_CALL(mock_policy_handler_,
+ ReceiveMessageFromSDK(kFileName, binary_data_))
+ .WillOnce(Return(false));
+ }
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+ std::vector<uint8_t> binary_data_;
+};
+
+class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ PutFileResponceTest() : message_(CreateMessage()) {}
+
+ void SetUp() OVERRIDE {
+ command_sptr_ = CreateCommand<PutFileResponse>(message_);
+ }
+
+ MessageSharedPtr message_;
+ std::shared_ptr<PutFileResponse> command_sptr_;
+};
+
+TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+
+ message_ref[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(null_application_sptr));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(
+ MobileResultCodeIs(mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ _));
+ command_sptr_->Run();
+}
+
+TEST_F(PutFileResponceTest, Run_ApplicationRegistered_Success) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+
+ message_ref[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ message_ref[am::strings::msg_params][am::strings::success] = true;
+
+ std::shared_ptr<am::Application> application_sptr =
+ std::make_shared<MockApplication>();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(application_sptr));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command_sptr_->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_HmiLevelNone_UNSUCCESS) {
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ const uint32_t settings_put_file_in_none = 1u;
+ const uint32_t app_put_file_in_none_count = 2u;
+ EXPECT_CALL(app_mngr_settings_, put_file_in_none())
+ .WillOnce(ReturnRef(settings_put_file_in_none));
+ EXPECT_CALL(*mock_app_, put_file_in_none_count())
+ .WillOnce(Return(app_put_file_in_none_count));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_BinaryDataDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::params].erase(am::strings::binary_data);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_SyncFileNameDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params].erase(am::strings::sync_file_name);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_FileTypeDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params].erase(am::strings::file_type);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_BinaryDataGreaterThanAvaliableSpace_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 0u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::OUT_OF_MEMORY);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_IvalidCreationDirectory_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+
+ const std::string storage_folder = "/storage";
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(storage_folder));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::GENERIC_ERROR);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_IvalidUpdateFile_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 2u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space))
+ .WillOnce(Return(avaliable_space));
+
+ const std::string file_path = kStorageFolder + "/" + kAppFolder;
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(false));
+ EXPECT_CALL(*mock_app_, UpdateFile(_)).WillOnce(Return(false));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_AddFile_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 2u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space))
+ .WillOnce(Return(avaliable_space));
+
+ const std::string file_path = kStorageFolder + "/" + kAppFolder;
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(true));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(kStorageFolder));
+ 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));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_InvalidPutFile_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_CrcSumEqual_SendSuccessResponse) {
+ binary_data_ = {1u};
+ (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
+ const uint32_t correct_crc_sum =
+ 2768625435u; // calculated using the GetCrc32CheckSum method
+ (*msg_)[am::strings::msg_params][am::strings::crc32_check_sum] =
+ correct_crc_sum;
+
+ ExpectReceiveMessageFromSDK();
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kStorageFolder));
+ ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kFolder));
+ const size_t available_space = binary_data_.size() + 1;
+ ON_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillByDefault(Return(available_space));
+ ON_CALL(*mock_app_, AddFile(_)).WillByDefault(Return(true));
+
+ const std::string file_path = kStorageFolder + "/" + kFolder;
+ EXPECT_CALL(app_mngr_, SaveBinary(binary_data_, file_path, kFileName, 0u))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, increment_put_file_in_none_count());
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ // The folder was created in the "Run" method
+ EXPECT_TRUE(file_system::RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(PutFileRequestTest, Run_CrcSumUnequal_SendCorruptedDataResponse) {
+ binary_data_ = {1u};
+ (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
+ const uint32_t incorrect_crc_sum = 0u;
+ (*msg_)[am::strings::msg_params][am::strings::crc32_check_sum] =
+ incorrect_crc_sum;
+
+ ExpectReceiveMessageFromSDK();
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kStorageFolder));
+ ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kFolder));
+ const size_t available_space = binary_data_.size() + 1;
+ ON_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillByDefault(Return(available_space));
+ ON_CALL(*mock_app_, AddFile(_)).WillByDefault(Return(true));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::CORRUPTED_DATA);
+ EXPECT_CALL(app_mngr_, SaveBinary(_, _, _, _)).Times(0);
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ // The folder was created in the "Run" method
+ EXPECT_TRUE(file_system::RemoveDirectory(kStorageFolder, true));
+}
+
+} // namespace put_file
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/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
new file mode 100644
index 0000000000..7dab16fe35
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
@@ -0,0 +1,536 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "mobile/register_app_interface_request.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "utils/data_accessor.h"
+#include "utils/custom_string.h"
+#include "utils/lock.h"
+#include "utils/macro.h"
+#include "utils/semantic_version.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace register_app_interface_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+
+namespace am = ::application_manager;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::RegisterAppInterfaceRequest;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const hmi_apis::Common_Language::eType kHmiLanguage =
+ hmi_apis::Common_Language::EN_US;
+const mobile_apis::Language::eType kMobileLanguage =
+ mobile_apis::Language::EN_US;
+const std::string kMacAddress = "test_mac_address";
+const std::string kAppId = "test_app_id";
+const std::string kFullAppId = "test_app_id_long";
+const std::string kDummyString = "test_string";
+const std::vector<uint32_t> kDummyDiagModes;
+const utils::SemanticVersion mock_semantic_version(1, 0, 0);
+} // namespace
+
+class RegisterAppInterfaceRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RegisterAppInterfaceRequestTest()
+ : msg_(CreateMessage())
+ , command_(CreateCommand<RegisterAppInterfaceRequest>(msg_))
+ , app_name_("test_app_name_")
+ , lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_application_helper_(
+ application_manager_test::MockApplicationHelper::
+ application_helper_mock()) {
+ InitGetters();
+ InitLanguage();
+ }
+
+ void SetUp() OVERRIDE {
+ testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
+ }
+
+ void InitBasicMessage() {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*msg_)[am::strings::msg_params][am::strings::full_app_id] = kFullAppId;
+ (*msg_)[am::strings::msg_params][am::strings::app_name] = app_name_;
+ (*msg_)[am::strings::msg_params][am::strings::language_desired] =
+ kHmiLanguage;
+ (*msg_)[am::strings::msg_params]
+ [am::strings::hmi_display_language_desired] = kHmiLanguage;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::major_version] = 4;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::minor_version] = 0;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::patch_version] = 0;
+ }
+
+ MockAppPtr CreateBasicMockedApp() {
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(*mock_app, name()).WillByDefault(ReturnRef(app_name_));
+ ON_CALL(*mock_app, mac_address()).WillByDefault(ReturnRef(kMacAddress));
+ ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+ return mock_app;
+ }
+
+ void InitLanguage(
+ hmi_apis::Common_Language::eType ui_language = kHmiLanguage,
+ hmi_apis::Common_Language::eType vr_language = kHmiLanguage,
+ hmi_apis::Common_Language::eType tts_language = kHmiLanguage) {
+ ON_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillByDefault(Return(vr_language));
+ ON_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillByDefault(Return(ui_language));
+ ON_CALL(mock_hmi_capabilities_, active_tts_language())
+ .WillByDefault(Return(tts_language));
+ }
+
+ void InitGetters() {
+ ON_CALL(app_mngr_, GetCorrectMobileIDFromMessage(msg_))
+ .WillByDefault(Return(kAppId));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(true));
+ ON_CALL(app_mngr_, resume_controller())
+ .WillByDefault(ReturnRef(mock_resume_crt_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ ON_CALL(app_mngr_settings_, sdl_version())
+ .WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(mock_hmi_capabilities_, ccpu_version())
+ .WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillByDefault(ReturnRef(kDummyDiagModes));
+ ON_CALL(mock_policy_handler_, GetAppRequestTypes(_))
+ .WillByDefault(Return(std::vector<std::string>()));
+ ON_CALL(mock_policy_handler_, GetAppRequestTypeState(_))
+ .WillByDefault(Return(policy::RequestType::State::EMPTY));
+ ON_CALL(mock_policy_handler_, GetAppRequestSubTypes(_))
+ .WillByDefault(Return(std::vector<std::string>()));
+ ON_CALL(mock_policy_handler_, GetAppRequestSubTypeState(_))
+ .WillByDefault(Return(policy::RequestSubType::State::EMPTY));
+ ON_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
+ .WillByDefault(Return(policy::DeviceConsent::kDeviceAllowed));
+ ON_CALL(app_mngr_, GetDeviceTransportType(_))
+ .WillByDefault(Return(hmi_apis::Common_TransportType::WIFI));
+ ON_CALL(app_mngr_, IsAppInReconnectMode(_)).WillByDefault(Return(false));
+ ON_CALL(app_mngr_, application_by_policy_id(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ }
+
+ void SetCommonExpectionsOnSwitchedApplication(
+ MockAppPtr mock_app, mobile_apis::Result::eType response_result_code) {
+ EXPECT_CALL(mock_policy_handler_, AddApplication(_, _)).Times(0);
+
+ EXPECT_CALL(
+ 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::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::TTS_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(app_mngr_,
+ OnApplicationSwitched(
+ std::static_pointer_cast<application_manager::Application>(
+ mock_app)));
+ }
+
+ MessageSharedPtr msg_;
+ std::shared_ptr<RegisterAppInterfaceRequest> command_;
+
+ const utils::custom_string::CustomString app_name_;
+ std::shared_ptr<sync_primitives::Lock> lock_ptr_;
+ am::ApplicationSet app_set_;
+
+ typedef IsNiceMock<policy_test::MockPolicyHandlerInterface,
+ kMocksAreNice>::Result MockPolicyHandlerInterface;
+
+ typedef IsNiceMock<resumprion_test::MockResumeCtrl, kMocksAreNice>::Result
+ MockResumeCtrl;
+
+ typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
+ kMocksAreNice>::Result MockConnectionHandler;
+
+ typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
+ kMocksAreNice>::Result MockSessionObserver;
+
+ typedef IsNiceMock<application_manager_test::MockHMICapabilities,
+ kMocksAreNice>::Result MockHMICapabilities;
+
+ MockResumeCtrl mock_resume_crt_;
+ MockConnectionHandler mock_connection_handler_;
+ MockSessionObserver mock_session_observer_;
+ application_manager_test::MockApplicationHelper& mock_application_helper_;
+};
+
+TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) {
+ EXPECT_TRUE(command_->Init());
+}
+
+TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
+ InitBasicMessage();
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId;
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()))
+ .WillRepeatedly(Return(mock_app));
+
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(
+ Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ .WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ std::make_shared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
+
+ 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));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .Times(2);
+ EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
+ command_->Run();
+}
+
+MATCHER_P(CheckHMIInterfacesRealtedData, expected_data, "") {
+ const bool is_result_id_correct =
+ mobile_apis::Result::SUCCESS ==
+ static_cast<mobile_apis::Result::eType>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ const bool are_ui_related_data_exist =
+ (*arg)[am::strings::msg_params].keyExists(
+ am::hmi_response::display_capabilities);
+
+ const bool are_vi_related_data_exist =
+ (*arg)[am::strings::msg_params][am::hmi_response::vehicle_type] ==
+ (*expected_data)[am::hmi_response::vehicle_type];
+
+ const bool are_vr_related_data_exist =
+ (*arg)[am::strings::msg_params][am::strings::vr_capabilities] ==
+ (*expected_data)[am::strings::vr_capabilities];
+
+ return is_result_id_correct && are_ui_related_data_exist &&
+ are_vi_related_data_exist && are_vr_related_data_exist;
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ Run_HmiInterfacesStateAvailable_SUCCESS) {
+ InitBasicMessage();
+
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()))
+ .WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr expected_message =
+ CreateMessage(smart_objects::SmartType_Map);
+
+ (*expected_message)[am::hmi_response::vehicle_type] = "test_vehicle_type";
+ (*expected_message)[am::strings::vr_capabilities] = "test_vr_capabilities";
+ (*expected_message)[am::hmi_response::display_capabilities] = 0;
+ SmartObject& display_capabilities =
+ (*expected_message)[am::hmi_response::display_capabilities];
+ display_capabilities[am::hmi_response::display_type] = "test_display_type";
+ display_capabilities[am::hmi_response::display_name] = "GENERIC_DISPLAY";
+ display_capabilities[am::hmi_response::text_fields] = "test_text_fields";
+ display_capabilities[am::hmi_response::image_fields] = "test_image_fields";
+ display_capabilities[am::hmi_response::media_clock_formats] =
+ "test_media_clock_ptr_formats";
+ display_capabilities[am::hmi_response::num_custom_presets_available] =
+ "test_num_custom_presets_available";
+ display_capabilities[am::hmi_response::graphic_supported] =
+ "test_graphic_supported";
+ display_capabilities[am::hmi_response::templates_available] =
+ "test_templates_available";
+ display_capabilities[am::hmi_response::screen_params] = "test_screen_params";
+
+ ON_CALL(mock_hmi_capabilities_, vehicle_type())
+ .WillByDefault(
+ Return(&(*expected_message)[am::hmi_response::vehicle_type]));
+ ON_CALL(mock_hmi_capabilities_, vr_capabilities())
+ .WillByDefault(
+ Return(&(*expected_message)[am::strings::vr_capabilities]));
+ ON_CALL(mock_hmi_capabilities_, display_capabilities())
+ .WillByDefault(
+ Return(&(*expected_message)[am::hmi_response::display_capabilities]));
+
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(
+ Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ .WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ std::make_shared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .Times(2);
+ EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_CorrectHash_ExpectNoCleanupSuccess) {
+ InitBasicMessage();
+
+ const std::string request_hash_id = "abc123";
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(
+ mock_resume_crt_,
+ CheckApplicationHash(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ request_hash_id)).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0);
+
+ EXPECT_CALL(mock_application_helper_, RecallApplicationData(_, _)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::SUCCESS);
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_WrongHash_ExpectCleanupResumeFailed) {
+ InitBasicMessage();
+
+ const std::string request_hash_id = "abc123";
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(
+ mock_resume_crt_,
+ CheckApplicationHash(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ request_hash_id)).WillOnce(Return(false));
+
+ EXPECT_CALL(
+ mock_application_helper_,
+ RecallApplicationData(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ _));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::RESUME_FAILED);
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_NoHash_ExpectCleanupResumeFailed) {
+ InitBasicMessage();
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(
+ mock_application_helper_,
+ RecallApplicationData(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ _));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::RESUME_FAILED);
+
+ command_->Run();
+}
+
+} // namespace register_app_interface_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
new file mode 100644
index 0000000000..0e3cd685fa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
@@ -0,0 +1,575 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "mobile/reset_global_properties_request.h"
+#include "mobile/reset_global_properties_response.h"
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace reset_global_properties {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::ResetGlobalPropertiesRequest;
+using sdl_rpc_plugin::commands::ResetGlobalPropertiesResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef std::shared_ptr<ResetGlobalPropertiesRequest>
+ ResetGlobalPropertiesRequestPtr;
+typedef std::shared_ptr<ResetGlobalPropertiesResponse>
+ ResetGlobalPropertiesResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+} // namespace
+
+class ResetGlobalPropertiesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ ResetGlobalPropertiesRequestTest()
+ : msg_(CreateMessage()), mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ command_ = CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+ ResetGlobalPropertiesRequestPtr command_;
+};
+
+class ResetGlobalPropertiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ command_->Run();
+ EXPECT_EQ(
+ (*command_result)[am::strings::msg_params][am::strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::APPLICATION_NOT_REGISTERED));
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidVrHelp_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::HELPPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][2] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+ (*msg_)[am::strings::msg_params][am::strings::properties][3] =
+ mobile_apis::GlobalProperty::MENUNAME;
+ (*msg_)[am::strings::msg_params][am::strings::properties][4] =
+ mobile_apis::GlobalProperty::MENUICON;
+ (*msg_)[am::strings::msg_params][am::strings::properties][5] =
+ mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ smart_objects::SmartObject so_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ smart_objects::SmartObject timeout_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeout_prompt[am::strings::text] = time_out_prompt[0];
+ timeout_prompt[am::strings::type] =
+ hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+
+ smart_objects::SmartObject so_time_out_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ so_time_out_prompt[0] = timeout_prompt;
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help; // = NULL;
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::HELPPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][2] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+ (*msg_)[am::strings::msg_params][am::strings::properties][3] =
+ mobile_apis::GlobalProperty::MENUNAME;
+ (*msg_)[am::strings::msg_params][am::strings::properties][4] =
+ mobile_apis::GlobalProperty::MENUICON;
+ (*msg_)[am::strings::msg_params][am::strings::properties][5] =
+ mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ smart_objects::SmartObject so_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ smart_objects::SmartObject timeout_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeout_prompt[am::strings::text] = time_out_prompt[0];
+ timeout_prompt[am::strings::type] =
+ hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+
+ smart_objects::SmartObject so_time_out_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ so_time_out_prompt[0] = timeout_prompt;
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::hmi_request::menu_title] = "";
+
+ EXPECT_CALL(*mock_app_,
+ set_menu_title(msg_params[am::hmi_request::menu_title]));
+
+ const smart_objects::SmartObjectSPtr so_help_prompt =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(so_help_prompt.get()));
+ EXPECT_CALL(*mock_app_, timeout_prompt())
+ .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)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ OnEvent_UI_SetGlobalProperties_SUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg_)[am::strings::params][am::hmi_response::code] = result_code;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+
+ event.set_smart_object(*msg_);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ OnEvent_TTS_SetGlobalProperties_SUCCESS) {
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ MessageSharedPtr ui_msg = CreateMessage();
+ (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*ui_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .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);
+
+ command_->Run();
+ command_->on_event(ui_event);
+ event.set_smart_object(*msg_);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::WARNINGS),
+ am::commands::Command::SOURCE_SDL));
+
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ ResetGlobalPropertiesResponsePtr command(
+ CreateCommand<ResetGlobalPropertiesResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _));
+ command->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ smart_objects::SmartObjectSPtr vr_help =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ ResetGlobalPropertiesRequestPtr command =
+ CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+ command->Run();
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitTTS_Timeout_GENERIC_ERROR_TTSNotRespond) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ 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)))
+ .WillOnce(Return(true));
+
+ ResetGlobalPropertiesRequestPtr command =
+ CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+ command->Run();
+
+ // Received response only from UI
+ MessageSharedPtr ui_msg = CreateMessage();
+ (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*ui_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*ui_msg)[am::strings::msg_params] =
+ SmartObject(smart_objects::SmartType_Map);
+ Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ ui_event.set_smart_object(*ui_msg);
+ command->on_event(ui_event);
+
+ // TTS doesn't respond, so timeout should send generic error
+ smart_objects::SmartObjectSPtr response =
+ std::make_shared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+ const std::string info = "TTS component does not respond";
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::SOURCE_SDL));
+ command->onTimeOut();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitUI_Timeout_GENERIC_ERROR_UINotRespond) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ 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)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+
+ // Received response only from TTS
+ MessageSharedPtr tts_msg = CreateMessage();
+ (*tts_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*tts_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ Event tts_event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ tts_event.set_smart_object(*tts_msg);
+ command_->on_event(tts_event);
+
+ // UI doesn't respond, so timeout should send generic error
+ smart_objects::SmartObjectSPtr response =
+ std::make_shared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+
+ const std::string info = "UI component does not respond";
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::SOURCE_SDL));
+ command_->onTimeOut();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitUIAndTTS_Timeout_GENERIC_ERROR_TTSAndUINotRespond) {
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ 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)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+ // TTS and UI don't respond, so timeout should send generic error
+ std::string info = "TTS, UI component does not respond";
+ smart_objects::SmartObjectSPtr response =
+ std::make_shared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::SOURCE_SDL));
+ command_->onTimeOut();
+}
+
+} // namespace reset_global_properties
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
new file mode 100644
index 0000000000..cf25a82972
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
@@ -0,0 +1,285 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/scrollable_message_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace scrollable_message_request {
+
+namespace am = application_manager;
+namespace hmi_response = am::hmi_response;
+namespace mobile_result = mobile_apis::Result;
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::ScrollableMessageRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Eq;
+using ::testing::Ref;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+using namespace am::strings;
+using test::components::policy_test::MockPolicyHandlerInterface;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kTimeOut = 30000u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kFunctionID = 3u;
+} // namespace
+
+class ScrollableMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+ sync_primitives::Lock lock_;
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ command_ = CreateCommand<ScrollableMessageRequest>(msg_);
+ }
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ std::shared_ptr<ScrollableMessageRequest> command_;
+};
+
+typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<ScrollableMessageRequest> command =
+ CreateCommand<ScrollableMessageRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info1";
+
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_SUCCESS) {
+ (*msg_)[msg_params][timeout] = kTimeOut;
+ (*msg_)[msg_params][interaction_mode] =
+ mobile_apis::InteractionMode::MANUAL_ONLY;
+ EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ command_->Init();
+ EXPECT_EQ(kTimeOut, command_->default_timeout());
+}
+
+TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_UNSUCCESS) {
+ (*msg_)[msg_params][interaction_mode] =
+ mobile_apis::InteractionMode::MANUAL_ONLY;
+ EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ command_->Init();
+ EXPECT_EQ(kTimeOut, command_->default_timeout());
+}
+
+TEST_F(ScrollableMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+ command_->Run();
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ Run_SoftButtonProcessingResultWrogParameters_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ const mobile_apis::Result::eType processing_result =
+ mobile_apis::Result::ABORTED;
+ smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
+ EXPECT_CALL(
+ mock_message_helper_,
+ ProcessSoftButtons(
+ msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
+ .WillOnce(Return(processing_result));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command_)));
+ EXPECT_EQ(processing_result,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][result_code].asInt()));
+}
+
+TEST_F(ScrollableMessageRequestTest, Run_SoftButtonProcessingResult_SUCCESS) {
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
+ (*msg_)[am::strings::params][am::strings::function_id] = kFunctionID;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::soft_button_id] = 0;
+ EXPECT_CALL(
+ mock_message_helper_,
+ ProcessSoftButtons(
+ msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ EXPECT_EQ(hmi_apis::FunctionID::UI_ScrollableMessage,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[params][function_id].asInt()));
+}
+
+TEST_F(ScrollableMessageRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ OnEvent_ReceivedUIOnResetTimeoutEvent_SUCCESS) {
+ (*msg_)[params][connection_key] = kConnectionKey;
+ (*msg_)[params][correlation_id] = kCorrelationId;
+ EXPECT_CALL(
+ app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout_));
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ DISABLED_OnEvent_ReceivedUIScrollableMessage_SUCCESS) {
+ (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ DISABLED_OnEvent_UnsupportedRCAndUICoop_SUCCESS) {
+ (*msg_)[params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+} // namespace scrollable_message_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
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
new file mode 100644
index 0000000000..6c7127e48c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
@@ -0,0 +1,164 @@
+/*
+ * 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 "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+
+#include "mobile/send_haptic_data_request.h"
+#include "mobile/send_haptic_data_response.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace send_haptic_data {
+
+using ::testing::_;
+using ::testing::Return;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::SendHapticDataRequest;
+using sdl_rpc_plugin::commands::SendHapticDataResponse;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<SendHapticDataRequest> SendHapticDataRequestPtr;
+typedef std::shared_ptr<SendHapticDataResponse> SendHapticDataResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+}
+
+class SendHapticDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SendHapticDataRequestTest()
+ : msg_(CreateMessage(::smart_objects::SmartType_Map))
+ , mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+};
+
+class SendHapticDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SendHapticDataResponseTest() : message_(CreateMessage()) {}
+
+ void SetUp() OVERRIDE {
+ command_sptr_ = CreateCommand<SendHapticDataResponse>(message_);
+ }
+
+ MessageSharedPtr message_;
+ std::shared_ptr<SendHapticDataResponse> command_sptr_;
+};
+
+TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData)))
+ .WillOnce(Return(true));
+
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(SendHapticDataRequestTest, Run_DISALLOWED) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled()).WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(Return(true));
+
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+
+ (*msg_)[am::strings::msg_params] = 0;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ Event event(hmi_apis::FunctionID::UI_SendHapticData);
+ event.set_smart_object(*msg_);
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->on_event(event);
+}
+
+TEST_F(SendHapticDataResponseTest, Run_Success) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+ message_ref[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command_sptr_->Init();
+ command_sptr_->Run();
+}
+
+} // namespace send_haptic_data
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
new file mode 100644
index 0000000000..4f44293fc9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
@@ -0,0 +1,421 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/send_location_request.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace send_location_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SendLocationRequest;
+using application_manager::MockMessageHelper;
+using test::components::application_manager_test::MockHMICapabilities;
+using smart_objects::SmartObject;
+
+using testing::_;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+namespace Common_TextFieldName = hmi_apis::Common_TextFieldName;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kFunctionID = 2u;
+const uint32_t kAppID = 3u;
+const double kLongitudeDegrees = 13.4;
+const std::string kLocationDescription = "Location_Description";
+const std::string kNewLine = "\\n";
+const std::string kAddressLine = "Address_Line";
+const std::string kPhoneNumber = "Phone_number";
+const std::string kCorrectAddress = "Correct address";
+const std::string kEmptyAddress = "";
+const std::string kAddressWithWrongSyntax = "Wrong Syntax\\n";
+} // namespace
+
+class SendLocationRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ class UnwrappedSendLocationRequest : public SendLocationRequest {
+ public:
+ UnwrappedSendLocationRequest(
+ const MessageSharedPtr& message,
+ application_manager::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : SendLocationRequest(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+ ::application_manager::CommandParametersPermissions&
+ get_parameters_permissions() {
+ return parameters_permissions_;
+ }
+ };
+
+ typedef std::shared_ptr<UnwrappedSendLocationRequest> CommandSPrt;
+
+ SendLocationRequestTest() {
+ mock_app_ = CreateMockApp();
+ disp_cap_ = std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ message_ = CreateMessage();
+ command_ = CreateCommand<UnwrappedSendLocationRequest>(message_);
+ }
+
+ void InitialSetup(MessageSharedPtr message_) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ (*message_)[strings::params][strings::function_id] = kFunctionID;
+ (*message_)[strings::msg_params] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ AllowMandatoryFields();
+ }
+
+ void HMICapabilitiesSetupHelper() {
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+ }
+
+ void HMICapabilitiesSetupWithArguments(
+ Common_TextFieldName::eType field_name) {
+ HMICapabilitiesSetupHelper();
+ (*disp_cap_)[hmi_response::text_fields] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*disp_cap_)[hmi_response::text_fields][0] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*disp_cap_)[hmi_response::text_fields][0][strings::name] = field_name;
+ EXPECT_CALL(mock_hmi_capabilities_, display_capabilities())
+ .Times(2)
+ .WillRepeatedly(Return(disp_cap_.get()));
+ }
+
+ void FinishSetup() {
+ EXPECT_CALL(*mock_app_, hmi_app_id()).WillOnce(Return(kAppID));
+
+ 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_,
+ ManageMobileCommand(MobileResultCodeIs(result), _));
+ }
+
+ void AllowMandatoryFields() {
+ application_manager::CommandParametersPermissions& permissions =
+ command_->get_parameters_permissions();
+ permissions.allowed_params.insert(strings::longitude_degrees);
+ permissions.allowed_params.insert(strings::latitude_degrees);
+ }
+
+ MockAppPtr mock_app_;
+ std::shared_ptr<SmartObject> disp_cap_;
+ MessageSharedPtr message_;
+ CommandSPrt command_;
+};
+
+TEST_F(SendLocationRequestTest, Run_InvalidApp_Success) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ FinishSetupCancelled(mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_DeliveryMode_Success) {
+ InitialSetup(message_);
+ SmartObject msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::delivery_mode] = SmartObject();
+ (*message_)[strings::msg_params] = msg_params;
+ msg_params.erase(strings::delivery_mode);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name\\n";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesAreAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesAreNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] =
+ kAddressLine + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] =
+ kPhoneNumber + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressesContainWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address]["Address 1"] =
+ kCorrectAddress;
+ (*message_)[strings::msg_params][strings::address]["Address 2"] =
+ kAddressWithWrongSyntax;
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageValid_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "1";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageValid_Warnings) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "notavailable";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageInvalid_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "1";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_HMIUINotCoop_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ (*disp_cap_)[hmi_response::text_fields] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*disp_cap_)[hmi_response::text_fields][0] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*disp_cap_)[hmi_response::text_fields][0][strings::name] =
+ Common_TextFieldName::phoneNumber;
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(false));
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, OnEvent_Success) {
+ mobile_apis::Result::eType response_code = mobile_apis::Result::SUCCESS;
+ (*message_)[strings::params][hmi_response::code] = response_code;
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+
+ Event event(hmi_apis::FunctionID::Navigation_SendLocation);
+ event.set_smart_object(*message_);
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(false));
+ command_->on_event(event);
+}
+
+TEST_F(SendLocationRequestTest, OnEvent_Cancelled) {
+ (*message_)[strings::params][hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ Event event(hmi_apis::FunctionID::Navigation_OnWayPointChange);
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(SendLocationRequestTest, Run_MandatoryParamsDisallowed_InvalidData) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ (*message_)[strings::params][strings::function_id] = kFunctionID;
+ (*message_)[strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
+ (*message_)[strings::msg_params][strings::longitude_degrees] =
+ kLongitudeDegrees;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ application_manager::CommandParametersPermissions& permissions =
+ command_->get_parameters_permissions();
+ // 1st one allowed
+ permissions.allowed_params.insert(strings::longitude_degrees);
+ // 2nd one disallowed
+ permissions.disallowed_params.insert(strings::latitude_degrees);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ command_->Run();
+}
+
+} // namespace send_location_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
new file mode 100644
index 0000000000..d8d1faca47
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
@@ -0,0 +1,173 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/set_app_icon_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "protocol_handler/mock_protocol_handler_settings.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_app_icon_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SetAppIconRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using test::components::protocol_handler_test::MockProtocolHandler;
+using test::components::protocol_handler_test::MockProtocolHandlerSettings;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class SetAppIconRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ protocol_handler_test::MockProtocolHandler mock_protocol_handler_;
+ protocol_handler_test::MockProtocolHandlerSettings
+ mock_protocol_handler_settings_;
+};
+
+TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ const std::string file_path = "file_path";
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_vr)[am::strings::msg_params][am::strings::sync_file_name]
+ [am::strings::value] = file_path;
+
+ const std::string dir_path = "./";
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(dir_path));
+
+ std::shared_ptr<SetAppIconRequest> req_vr =
+ CreateCommand<SetAppIconRequest>(msg_vr);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(hmi_interfaces_));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(app_mngr_, protocol_handler())
+ .WillByDefault(ReturnRef(mock_protocol_handler_));
+ ON_CALL(mock_protocol_handler_, get_settings())
+ .WillByDefault(ReturnRef(mock_protocol_handler_settings_));
+
+ ON_CALL(mock_protocol_handler_settings_, max_supported_protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, set_app_icon_path(_)).WillByDefault(Return(true));
+ ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(file_path));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info1";
+
+ Event event(hmi_apis::FunctionID::UI_SetAppIcon);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ req_vr->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+} // namespace set_app_icon_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
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
new file mode 100644
index 0000000000..cd6af1512d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
@@ -0,0 +1,249 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/set_display_layout_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_display_layout_request {
+
+namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
+using sdl_rpc_plugin::commands::SetDisplayLayoutRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<SetDisplayLayoutRequest> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationKey = 2u;
+const std::string kLayout = "media";
+} // namespace
+
+MATCHER_P(CheckMshCorrId, corr_id, "") {
+ return (*arg)[am::strings::params][am::strings::correlation_id].asUInt() ==
+ corr_id;
+}
+
+class SetDisplayLayoutRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetDisplayLayoutRequestTest() : mock_app_(CreateMockApp()) {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ MockAppPtr mock_app_;
+};
+
+typedef SetDisplayLayoutRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(SetDisplayLayoutRequestTest,
+ OnEvent_UIHmiUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<SetDisplayLayoutRequest> command =
+ CreateCommand<SetDisplayLayoutRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ event.set_smart_object(*msg);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+
+ MockAppPtr invalid_mock_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_mock_app));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command->Run();
+}
+
+TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, display_layout()).WillOnce(ReturnRef(kLayout));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationKey));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetDisplayLayout))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(CheckMshCorrId(kCorrelationKey)))
+ .WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>());
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ SmartObject msg(smart_objects::SmartType_Map);
+
+ event.set_smart_object(msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ MessageSharedPtr msg = CreateMessage();
+
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params][am::hmi_response::display_capabilities] = 0;
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr dispaly_capabilities_msg = CreateMessage();
+ (*dispaly_capabilities_msg)[am::hmi_response::templates_available] =
+ "templates_available";
+
+ EXPECT_CALL(mock_hmi_capabilities_, display_capabilities())
+ .WillOnce(Return(dispaly_capabilities_msg.get()));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ command->on_event(event);
+}
+
+} // namespace set_display_layout_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
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
new file mode 100644
index 0000000000..03aa5d85a1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
@@ -0,0 +1,1375 @@
+/*
+ * 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 <stdint.h>
+#include <memory>
+#include <string>
+#include <set>
+
+#include "mobile/set_global_properties_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_global_properties_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::CommandsMap;
+using utils::custom_string::CustomString;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 1u;
+const std::string kText = "one";
+const uint32_t kPosition = 1u;
+} // namespace
+
+class SetGlobalPropertiesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetGlobalPropertiesRequestTest()
+ : lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_app_(CreateMockApp()) {
+ mock_help_prompt_manager_ =
+ std::shared_ptr<application_manager_test::MockHelpPromptManager>(
+ new application_manager_test::MockHelpPromptManager());
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ msg_params[am::strings::vr_help_title] = "vr_help_title";
+ msg_params[am::strings::vr_help][0][am::strings::text] = "vr_help";
+ msg_params[am::strings::vr_help][0][am::strings::position] = 1u;
+ msg_params[am::strings::help_prompt][0][am::strings::text] = "help_promt";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+ }
+
+ void VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array) {
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ }
+
+ void OnEventUISetupHelper(
+ MessageSharedPtr msg,
+ std::shared_ptr<SetGlobalPropertiesRequest> command) {
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ EXPECT_CALL(mock_message_helper_,
+ VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ command->Run();
+ }
+
+ void OnEventTTSSetupHelper(
+ MessageSharedPtr msg,
+ std::shared_ptr<SetGlobalPropertiesRequest> command) {
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] =
+ timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ command->Run();
+ }
+
+ void EmptyExpectationsSetupHelper() {
+ EXPECT_CALL(*mock_app_, set_vr_help_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_vr_help(_)).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help_title()).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help()).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ }
+
+ void ExpectInvalidData() {
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
+ am::commands::Command::SOURCE_SDL));
+ }
+
+ void ExpectVerifyImageVrHelpSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageVrHelpUnsuccess() {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void ExpectationsHmiInterface_Run() {
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ }
+ std::shared_ptr<sync_primitives::Lock> lock_ptr_;
+ MockAppPtr mock_app_;
+ std::shared_ptr<application_manager_test::MockHelpPromptManager>
+ mock_help_prompt_manager_;
+};
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::msg_params][am::strings::vr_commands][0] =
+ "vr_command";
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(msg_vr);
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ const smart_objects::SmartObject* vr_help_title =
+ &((*msg_vr)[am::strings::msg_params][am::strings::vr_help_title]);
+ const smart_objects::SmartObject* vr_help =
+ &((*msg_vr)[am::strings::msg_params][am::strings::vr_help]);
+ const smart_objects::SmartObject* vr_help_prompt =
+ &((*msg_vr)[am::strings::msg_params][am::strings::help_prompt]);
+ ON_CALL(*mock_app_, vr_help_title()).WillByDefault(Return(vr_help_title));
+ ON_CALL(*mock_app_, vr_help()).WillByDefault(Return(vr_help));
+ ON_CALL(*mock_app_, help_prompt()).WillByDefault(Return(vr_help_prompt));
+
+ ExpectationsHmiInterface_Run();
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ ON_CALL(mock_message_helper_,
+ VerifyImageVrHelpItems(
+ (*msg_vr)[am::strings::msg_params][am::strings::vr_help], _, _))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+
+ ON_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false)).Times(2);
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_vr)[am::strings::msg_params][am::strings::help_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .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;
+ Event event_vr(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event_vr.set_smart_object(*msg_vr);
+
+ command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+ command->on_event(event_vr);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response)[am::strings::msg_params][am::strings::info] = "test";
+
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*response);
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(response);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_Expect_false) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*response)[am::strings::msg_params][am::strings::info] = "qwe";
+
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event_tts.set_smart_object(*response);
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event_tts.set_smart_object(*response);
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(response);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true)).Times(2);
+ command->on_event(event_ui);
+ command->on_event(event_tts);
+
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::INVALID_DATA));
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ OnEventUISetupHelper(msg, command);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_VRWithMenuAndKeyboard_Menu_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::WARNINGS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_VR_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::WARNINGS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = " 1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::ABORTED)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EmptyExpectationsSetupHelper();
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenVRHelp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::ABORTED)));
+ EmptyExpectationsSetupHelper();
+
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRIncorrectSyntax_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ SmartObject vr_help_title("wrong syntax string\\n");
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingTitle_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingArray_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWrongOrder_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ vr_help_array[1] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[1][am::strings::text] = "two";
+ vr_help_array[1][am::strings::position] = 3u;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRCouldNotGenerate_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_));
+ EXPECT_CALL(*mock_app_, app_id());
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataFromSynonyms_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ SmartObject vr_synonyms(smart_objects::SmartType_Array);
+ vr_synonyms[0] = vr_help_array;
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_)).Times(0);
+ EXPECT_CALL(*mock_app_, timeout_prompt()).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(_)).Times(0);
+ EXPECT_CALL(*mock_app_, help_prompt()).Times(0);
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSIncorrectSyntax_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One\\n";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidHelpPromptText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] =
+ "invalid help prompt text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidVrHelpText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help(smart_objects::SmartType_Array);
+ vr_help[0][am::strings::text] =
+ "invalid vr_help text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
+
+ ExpectVerifyImageVrHelpSuccess(vr_help);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidImageValue_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help(smart_objects::SmartType_Array);
+ vr_help[0][am::strings::text] = "vr_help";
+ vr_help[0][am::strings::image][am::strings::value] =
+ "invalid value text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
+
+ ExpectVerifyImageVrHelpSuccess(vr_help);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuIcon_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject menu_icon(smart_objects::SmartType_Array);
+ menu_icon[am::strings::value] =
+ "invalid menu icon text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::menu_icon] = menu_icon;
+
+ ExpectVerifyImageSuccess(menu_icon);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuTitle_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject menu_title(smart_objects::SmartType_Array);
+ menu_title = "invalid menu title text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::menu_title] = menu_title;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_InvalidLimitedCharacterList_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject limited_character_list(smart_objects::SmartType_Array);
+ limited_character_list[0] =
+ "invalid limited character list text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
+ [am::strings::limited_character_list] = limited_character_list;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_InvalidAutoCompleteText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject auto_complete_text(smart_objects::SmartType_Array);
+ auto_complete_text =
+ "invalid auto completetext with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
+ [am::strings::auto_complete_text] = auto_complete_text;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoData_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ OnEventUISetupHelper(msg, command);
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ OnEventUISetupHelper(msg, command);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventUISetupHelper(msg, command);
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(MockAppPtr()));
+
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ Event event(hmi_apis::FunctionID::TTS_Stopped);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_TTSAndSuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventTTSSetupHelper(msg, command);
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_TTSAndWarningsResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ const hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventTTSSetupHelper(msg, command);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::WARNINGS));
+}
+
+} // namespace set_global_properties_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/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
new file mode 100644
index 0000000000..a69d3d741b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
@@ -0,0 +1,365 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "mobile/set_media_clock_timer_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_media_clock_timer_request {
+
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::SetMediaClockRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace UpdateMode = mobile_apis::UpdateMode;
+namespace AudioStreamingIndicator = mobile_apis::AudioStreamingIndicator;
+
+typedef std::shared_ptr<SetMediaClockRequest> SetMediaClockRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppID = 2u;
+const uint32_t kHours = 2u;
+const uint32_t kMinutes = 26u;
+const uint32_t kSeconds = 1u;
+} // namespace
+
+class SetMediaClockRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetMediaClockRequestTest() : mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ return msg;
+ }
+
+ void ExpectationsSetupHelper(bool is_media) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(is_media));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ }
+
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SetMediaClockRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<SetMediaClockRequest> command =
+ CreateCommand<SetMediaClockRequest>(msg);
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*ev_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTUP;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
+ kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::seconds] = kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountUpWrongTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTUP;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::seconds] = kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY_PAUSE;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountDownWrongTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
+ kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY_PAUSE;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(false);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app_, is_media_application()).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, OnEvent_Success) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Null);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*msg);
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+ command->on_event(event);
+}
+
+TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+} // namespace set_media_clock_timer_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
new file mode 100644
index 0000000000..4725af4671
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
@@ -0,0 +1,974 @@
+/*
+ * 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 <stdint.h>
+#include <memory>
+#include <string>
+#include <set>
+
+#include "mobile/show_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace show_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::ShowRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kFunctionID = 3u;
+} // namespace
+
+class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ShowRequestTest() {
+ mock_app_ = CreateMockApp();
+ }
+ sync_primitives::Lock lock_;
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ return msg;
+ }
+
+ void TestSetupHelper(MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params.erase(field);
+ msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_name] =
+ 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_app_, set_show_command(msg_params));
+ }
+
+ void TestSetupHelperWrongSyntax(
+ MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+ }
+
+ void TestSetupHelperWithMetadata(
+ MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field,
+ size_t num_tags,
+ int32_t* field_tags,
+ bool set_field_text = true) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ if (set_field_text) {
+ msg_params[field] = text_field_;
+ }
+ msg_params[am::strings::metadata_tags][field] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = field_tags[i];
+ msg_params[am::strings::metadata_tags][field][i] = current_tag;
+ }
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_EQ((*msg)[am::strings::msg_params], msg_params);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params.erase(field);
+ msg_params.erase(am::strings::metadata_tags);
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ if (set_field_text) {
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_name] =
+ static_cast<int32_t>(field_name);
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_text] = text_field_;
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_types] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = field_tags[i];
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_types][i] = current_tag;
+ }
+ }
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+ }
+
+ MockAppPtr mock_app_;
+ std::string text_field_;
+};
+
+TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = 10u;
+ (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
+ [am::strings::menu_name] = "menu_name";
+
+ std::shared_ptr<ShowRequest> command = CreateCommand<ShowRequest>(msg_vr);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*vr_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*vr_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "Soft_Buttons";
+ (*msg)[am::strings::msg_params] = msg_params;
+ SmartObject creation_msg_params(msg_params);
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ SubscribeApplicationToSoftButton(creation_msg_params, _, kFunctionID));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "";
+ (*msg)[am::strings::msg_params] = msg_params;
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(*mock_app_, UnsubscribeFromSoftButtons(kFunctionID));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "Soft_Buttons";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _))
+ .Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ 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_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ 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_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .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_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "\\n";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ 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_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ 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_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .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_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 5;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaTitle,
+ hmi_apis::Common_MetadataType::mediaArtist,
+ hmi_apis::Common_MetadataType::rating,
+ hmi_apis::Common_MetadataType::humidity,
+ hmi_apis::Common_MetadataType::currentTemperature};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags,
+ false);
+ command->Run();
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "";
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*ev_msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::WARNINGS));
+}
+
+TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Clock";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mediaClock,
+ am::strings::media_clock);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Clock\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mediaClock,
+ am::strings::media_clock);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Track";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mediaTrack,
+ am::strings::media_track);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Track\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mediaTrack,
+ am::strings::media_track);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Status_Bar";
+ TestSetupHelper(
+ msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_StatusBar_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Status_Bar\\n";
+ TestSetupHelperWrongSyntax(
+ msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::alignment] = "Alignment";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ 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_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject custom_presets(smart_objects::SmartType_Array);
+ custom_presets[0] = "Custom_Presets";
+ msg_params[am::strings::custom_presets] = custom_presets;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ 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_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject custom_presets(smart_objects::SmartType_Array);
+ custom_presets[0] = "Custom_Presets\\t";
+ msg_params[am::strings::custom_presets] = custom_presets;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .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_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _));
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::message] = "Response Info";
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+} // namespace show_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
new file mode 100644
index 0000000000..d96a9d7643
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
@@ -0,0 +1,99 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "mobile/on_app_interface_unregistered_notification.h"
+#include "mobile/on_audio_pass_thru_notification.h"
+#include "mobile/on_driver_distraction_notification.h"
+#include "mobile/on_language_change_notification.h"
+#include "mobile/on_permissions_change_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace simple_notification_commands_test {
+
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::Return;
+
+template <class Command>
+class MobileNotificationCommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::OnAppInterfaceUnregisteredNotification,
+ commands::OnAudioPassThruNotification,
+ commands::OnLanguageChangeNotification,
+ commands::OnPermissionsChangeNotification,
+ commands::mobile::OnDriverDistractionNotification>
+ NotificationCommandsList;
+
+MATCHER(CheckNotificationMessage, "") {
+ return (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_ &&
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_ &&
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ application_manager::MessageType::kNotification;
+}
+
+TYPED_TEST_CASE(MobileNotificationCommandsTest, NotificationCommandsList);
+
+TYPED_TEST(MobileNotificationCommandsTest, Run_SendMessageToMobile_SUCCESS) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_,
+ SendMessageToMobile(CheckNotificationMessage(), _));
+ command->Run();
+}
+
+} // namespace simple_notification_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
new file mode 100644
index 0000000000..bbd39874e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
@@ -0,0 +1,189 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "mobile/delete_command_response.h"
+#include "mobile/alert_maneuver_response.h"
+#include "mobile/alert_response.h"
+#include "mobile/list_files_response.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/add_sub_menu_response.h"
+#include "mobile/dial_number_response.h"
+#include "mobile/end_audio_pass_thru_response.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_response.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/get_way_points_response.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/set_global_properties_response.h"
+#include "mobile/set_media_clock_timer_response.h"
+#include "mobile/show_constant_tbt_response.h"
+#include "mobile/show_response.h"
+#include "mobile/add_command_response.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_response.h"
+#include "mobile/generic_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/change_registration_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace simple_response_commands_test {
+
+namespace commands = sdl_rpc_plugin::commands;
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+using am::commands::MessageSharedPtr;
+
+template <class Command>
+class MobileResponseCommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::ListFilesResponse,
+ commands::DeleteCommandResponse,
+ commands::AlertManeuverResponse,
+ commands::AlertResponse,
+ commands::SubscribeButtonResponse,
+ commands::AddSubMenuResponse,
+ commands::DialNumberResponse,
+ commands::EndAudioPassThruResponse,
+ commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeWayPointsResponse,
+ commands::UpdateTurnListResponse,
+ commands::UnsubscribeButtonResponse,
+ commands::SliderResponse,
+ commands::SpeakResponse,
+ commands::SubscribeWayPointsResponse,
+ commands::SystemResponse,
+ commands::GetWayPointsResponse,
+ commands::PerformInteractionResponse,
+ commands::PerformAudioPassThruResponse,
+ commands::SetGlobalPropertiesResponse,
+ commands::SetMediaClockTimerResponse,
+ commands::ShowConstantTBTResponse,
+ commands::ShowResponse,
+ commands::SystemResponse,
+ commands::AddCommandResponse,
+ commands::SendLocationResponse,
+ commands::SetAppIconResponse,
+ commands::SetDisplayLayoutResponse,
+ commands::ChangeRegistrationResponse> ResponseCommandsList;
+
+TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
+
+TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToMobile(NotNull(), _));
+ command->Run();
+}
+
+class GenericResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P2(CheckMessageParams, success, result, "") {
+ const bool is_msg_type_correct =
+ (am::MessageType::kResponse) ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::message_type].asInt());
+ const bool is_success_correct =
+ success == (*arg)[am::strings::msg_params][am::strings::success].asBool();
+ const bool is_result_code_correct =
+ result ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(
+ true, is_msg_type_correct, is_success_correct, is_result_code_correct);
+}
+
+TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+
+ std::shared_ptr<commands::GenericResponse> command(
+ CreateCommand<commands::GenericResponse>(command_msg));
+
+ EXPECT_CALL(
+ this->mock_rpc_service_,
+ SendMessageToMobile(
+ CheckMessageParams(false, mobile_apis::Result::INVALID_DATA), false));
+
+ command->Run();
+}
+
+class ScrollableMessageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+
+ MockAppPtr app(CreateMockApp());
+
+ std::shared_ptr<commands::ScrollableMessageResponse> command(
+ CreateCommand<commands::ScrollableMessageResponse>(message));
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app));
+ EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_));
+ command->Run();
+}
+
+} // namespace simple_response_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
new file mode 100644
index 0000000000..be14aebc8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
@@ -0,0 +1,340 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/slider_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace slider_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SliderRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<SliderRequest> CommandPtr;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kDefaultTimeout = 1000u;
+const uint32_t kCorrelationId = 2u;
+const uint32_t kFunctionId = 3u;
+const uint32_t kNumTicks = 2u;
+const uint32_t kPositionGreaterTicks = 3u;
+const uint32_t kPositionLessTicks = 1u;
+} // namespace
+
+class SliderRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SliderRequestTest()
+ : mock_app_(CreateMockApp())
+ , msg_(CreateMessage(smart_objects::SmartType_Map)) {}
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void PreConditions() {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::num_ticks] = kNumTicks;
+ (*msg_)[am::strings::msg_params][am::strings::position] =
+ kPositionLessTicks;
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
+ "slider_footer1";
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][1] =
+ "slider_footer2";
+ (*msg_)[am::strings::msg_params][am::strings::slider_header] =
+ "slider_header";
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ sync_primitives::Lock lock_;
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<SliderRequest> command = CreateCommand<SliderRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+class CallOnTimeOut {
+ public:
+ CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.onTimeOut();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+TEST_F(SliderRequestTest, Init_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(SliderRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ PreConditions();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_PositionGreaterTicks_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::position] =
+ kPositionGreaterTicks;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_SliderFooterNotEqToNumticks_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][2] =
+ "slider_footer3";
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_InvalidSliderHeader_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_header] =
+ "invalid_test_with_empty_str\\n";
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_InvalidSliderFooter_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
+ "invalid_test_with_empty_str\\n";
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_SUCCESS) {
+ PreConditions();
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider)));
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+
+ EXPECT_CALL(app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, _));
+
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UI_UnknownEventId_UNSUCCESS) {
+ PreConditions();
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UISliderPositionExists_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::TIMED_OUT;
+ (*msg_)[am::strings::params][am::strings::data]
+ [am::strings::slider_position] = "position";
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::TIMED_OUT);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UISliderAborted_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+} // namespace slider_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
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
new file mode 100644
index 0000000000..9eb23eeee3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
@@ -0,0 +1,406 @@
+/*
+
+ 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 <string>
+#include "gtest/gtest.h"
+#include "mobile/speak_request.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "utils/helpers.h"
+
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/application.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace speak_request {
+
+namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
+namespace hmi_response = ::application_manager::hmi_response;
+namespace strings = ::application_manager::strings;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using sdl_rpc_plugin::commands::SpeakRequest;
+using ::test::components::application_manager_test::MockApplication;
+
+typedef std::shared_ptr<SpeakRequest> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 10u;
+const uint32_t kConnectionKey = 5u;
+}
+
+class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SpeakRequestTest()
+ : request_(CreateMessage(smart_objects::SmartType_Map))
+ , response_(CreateMessage(smart_objects::SmartType_Map))
+ , app_(CreateMockApp()) {}
+
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success) {
+ std::shared_ptr<SpeakRequest> command =
+ CreateCommand<SpeakRequest>(request_);
+
+ (*response_)[strings::params][hmi_response::code] = hmi_response;
+ (*response_)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ success);
+ EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+
+ MessageSharedPtr request_;
+ MessageSharedPtr response_;
+ MockAppPtr app_;
+};
+
+TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) {
+ std::shared_ptr<SpeakRequest> command = CreateCommand<SpeakRequest>(request_);
+
+ (*response_)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response_)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(mobile_apis::Result::SUCCESS));
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true);
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE,
+ false);
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ true);
+}
+
+TEST_F(SpeakRequestTest, Run_ApplicationIsNotRegistered) {
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithWhiteSpace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = " ";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar1_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\t";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar2_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar3_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\tdf";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar4_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\n rer";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectCharInfirstPlace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithEmptyString_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgCorrect_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "asda";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ CommandPtr command(CreateCommand<SpeakRequest>());
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_Speak_SUCCESS) {
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "1234";
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_SpeakWithWarning_WarningWithSuccess) {
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::WARNINGS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "asda";
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::WARNINGS), _));
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_OnResetTimeout_UpdateTimeout) {
+ Event event(Event::EventID::TTS_OnResetTimeout);
+ (*request_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*request_)[am::strings::params][am::strings::correlation_id] = kAppId;
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(kConnectionKey, kAppId, _));
+
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "text";
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->on_event(event);
+}
+
+} // namespace speak_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace component
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
new file mode 100644
index 0000000000..caca56e297
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
@@ -0,0 +1,262 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "mobile/subscribe_button_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace subscribe_button_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::SubscribeButtonRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<SubscribeButtonRequest> CommandPtr;
+
+class SubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
+
+typedef SubscribeButtonRequestTest::MockHMICapabilities MockHMICapabilities;
+const utils::SemanticVersion mock_semantic_version(5, 0, 0);
+const utils::SemanticVersion mock_base_rpc_version(4, 5, 1);
+
+TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SubscriptionNotAllowed_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] =
+ mobile_apis::ButtonName::SEEKLEFT;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_UiIsNotSupported_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>());
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_IsSubscribedToButton_UNSUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::SEEKLEFT;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(true));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::IGNORED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::SEEKLEFT;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+
+ MessageSharedPtr hmi_result_msg;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
+
+ MessageSharedPtr mobile_result_msg;
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&mobile_result_msg), Return(true)));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*hmi_result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::OK;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_base_rpc_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+ (*button_caps_ptr)[1][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::PLAY_PAUSE;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+
+ MessageSharedPtr hmi_result_msg;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
+
+ MessageSharedPtr mobile_result_msg;
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&mobile_result_msg), Return(true)));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*hmi_result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+
+ EXPECT_EQ(hmi_apis::Common_ButtonName::PLAY_PAUSE,
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*hmi_result_msg)[am::strings::msg_params][am::strings::name]
+ .asInt()));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+} // namespace subscribe_button_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
new file mode 100644
index 0000000000..d08c13b3f3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
@@ -0,0 +1,130 @@
+/*
+ * 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 "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/subscribe_way_points_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace subscribe_way_points_request {
+
+using ::testing::_;
+using ::testing::A;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+using ::testing::InSequence;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::SubscribeWayPointsRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<SubscribeWayPointsRequest> CommandPtr;
+
+class SubscribeWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
+ MockAppPtr app(CreateMockApp());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(A<am::ApplicationSharedPtr>()))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
+ .WillByDefault(Return(true));
+
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_,
+ SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
+ EXPECT_CALL(*app, UpdateHash());
+ }
+
+ command->Init();
+ MessageSharedPtr mobile_result_msg(
+ CatchMobileCommandResult(CallRun(*command)));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
+ MockAppPtr app(CreateMockApp());
+ Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = result_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ event.set_smart_object(*event_msg);
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_,
+ SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(result_code))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*app, UpdateHash());
+ }
+
+ command->Init();
+ command->on_event(event);
+}
+
+} // namespace subscribe_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
new file mode 100644
index 0000000000..9e6bc8f505
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
@@ -0,0 +1,236 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <set>
+
+#include "gtest/gtest.h"
+
+#include "mobile/system_request.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace system_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SystemRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockHmiInterfaces;
+using am::event_engine::Event;
+using am::MessageType;
+using policy_test::MockPolicyHandlerInterface;
+
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kAppPolicyId = "fake-app-id";
+const uint32_t kDefaultTimeout = 1000u;
+const std::string kAppFolderName = "fake-app-name";
+const std::string kAppStorageFolder = "fake-storage";
+const std::string kSystemFilesPath = "/fake/system/files";
+const std::string kFileName = "Filename";
+const uint32_t kHmiAppId = 3u;
+} // namespace
+
+class SystemRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SystemRequestTest() : mock_app_(CreateMockApp()) {}
+
+ protected:
+ MessageSharedPtr CreateIVSUMessage() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::HTTP;
+ (*msg)[am::strings::msg_params][am::strings::file_name] = kFileName;
+ return msg;
+ }
+
+ void PreConditions() {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kAppPolicyId));
+ ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kAppFolderName));
+ ON_CALL(*mock_app_, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+
+ ON_CALL(app_mngr_settings_, system_files_path())
+ .WillByDefault(ReturnRef(kSystemFilesPath));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+
+ ON_CALL(mock_policy_handler_, IsRequestTypeAllowed(kAppPolicyId, _))
+ .WillByDefault(Return(true));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SystemRequestTest, Run_HTTP_FileName_no_binary_data_REJECTED) {
+ PreConditions();
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ command->Run();
+}
+
+TEST_F(SystemRequestTest,
+ Run_RequestTypeAllowedAndRequestSubTypeAllowed_SendHMIRequest) {
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::OEM_SPECIFIC;
+
+ const std::string request_subtype = "fakeSubType";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ const std::vector<uint8_t> binary_data = {1u, 2u};
+ (*msg)[am::strings::params][am::strings::binary_data] = binary_data;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kAppPolicyId,
+ mobile_apis::RequestType::OEM_SPECIFIC))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kAppPolicyId, request_subtype))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data, kSystemFilesPath, kFileName, 0u))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObjectSPtr result;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(MessageType::kRequest,
+ (*result)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ mobile_apis::RequestType::OEM_SPECIFIC,
+ (*result)[am::strings::msg_params][am::strings::request_type].asInt());
+ EXPECT_EQ(
+ request_subtype,
+ (*msg)[am::strings::msg_params][am::strings::request_subtype].asString());
+}
+
+TEST_F(
+ SystemRequestTest,
+ Run_RequestTypeAllowedAndRequestSubTypeDisallowed_SendDisallowedResponse) {
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::OEM_SPECIFIC;
+
+ const std::string request_subtype = "fakeSubType2";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kAppPolicyId,
+ mobile_apis::RequestType::OEM_SPECIFIC))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kAppPolicyId, request_subtype))
+ .WillOnce(Return(false));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SystemRequestTest, Run_RequestTypeDisallowed_SendDisallowedResponse) {
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::OEM_SPECIFIC;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kAppPolicyId,
+ mobile_apis::RequestType::OEM_SPECIFIC))
+ .WillOnce(Return(false));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+} // namespace system_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
new file mode 100644
index 0000000000..771374348b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
@@ -0,0 +1,118 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/unregister_app_interface_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unregister_app_interface_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<UnregisterAppInterfaceRequest> CommandPtr;
+
+class UnregisterAppInterfaceRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UnregisterAppInterfaceRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) {
+ const uint32_t kConnectionKey = 1u;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ const mobile_apis::AppInterfaceUnregisteredReason::eType kUnregisterReason =
+ mobile_apis::AppInterfaceUnregisteredReason::INVALID_ENUM;
+
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kConnectionKey, kUnregisterReason))
+ .WillOnce(Return(dummy_msg));
+ {
+ ::testing::InSequence sequence;
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(dummy_msg, _));
+
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kConnectionKey, mobile_apis::Result::SUCCESS, _, _));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ }
+
+ command->Run();
+}
+
+} // namespace unregister_app_interface_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
new file mode 100644
index 0000000000..a848fff2b2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
@@ -0,0 +1,201 @@
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "mobile/unsubscribe_button_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_button_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using sdl_rpc_plugin::commands::UnsubscribeButtonRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<UnsubscribeButtonRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
+const utils::SemanticVersion mock_semantic_version(5, 0, 0);
+const utils::SemanticVersion mock_base_rpc_version(4, 5, 1);
+} // namespace
+
+class UnsubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
+
+TEST_F(UnsubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest,
+ Run_UnsubscribeNotSubscribedButton_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+ EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest,
+ Run_UnsubscribeNotAllowedByHmiCapabilities_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::UNSUPPORTED_RESOURCE), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+
+ EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ EXPECT_CALL(*mock_app, UpdateHash());
+ command->Init();
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS_Base_RPC_Version) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ mobile_apis::ButtonName::OK;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillRepeatedly(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::OK;
+ (*button_caps_ptr)[1][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::PLAY_PAUSE;
+
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillRepeatedly(Return(button_caps_ptr.get()));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_base_rpc_version));
+ ON_CALL(*mock_app, is_media_application()).WillByDefault(Return(true));
+
+ EXPECT_CALL(*mock_app,
+ UnsubscribeFromButton(mobile_apis::ButtonName::PLAY_PAUSE))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ EXPECT_CALL(*mock_app, UpdateHash());
+ command->Init();
+ command->Run();
+}
+
+} // namespace unsubscribe_button_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/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
new file mode 100644
index 0000000000..f345d719c6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
@@ -0,0 +1,171 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/unsubscribe_way_points_request.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_way_points_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+using ::testing::Return;
+
+using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest;
+using am::commands::MessageSharedPtr;
+
+namespace {
+const uint32_t kConnectionKey = 3u;
+const uint32_t kAppId = 5u;
+} // namespace
+
+class UnsubscribeWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UnsubscribeWayPointsRequestTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<UnsubscribeWayPointsRequest>(command_msg_)) {
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ }
+
+ MessageSharedPtr command_msg_;
+ std::shared_ptr<UnsubscribeWayPointsRequest> command_;
+};
+
+TEST_F(UnsubscribeWayPointsRequestTest,
+ Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command_->Run();
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest,
+ Run_AppIsNotSubscribedForWayPoints_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ IsAppSubscribedForWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command_->Run();
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ IsAppSubscribedForWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints)));
+
+ command_->Run();
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ command_->on_event(event);
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest,
+ OnEvent_ReceivedNavigationUnsubscribeWayPointsEvent_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_result::SUCCESS;
+ Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(app_mngr_,
+ UnsubscribeAppFromWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command_->on_event(event);
+}
+
+} // namespace unsubscribe_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
new file mode 100644
index 0000000000..78fca8681a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
@@ -0,0 +1,352 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/update_turn_list_request.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace update_turn_list_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Ref;
+using ::testing::Eq;
+
+using sdl_rpc_plugin::commands::UpdateTurnListRequest;
+using am::commands::MessageSharedPtr;
+using application_manager_test::MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 3u;
+const hmi_apis::FunctionID::eType kFunctionId =
+ hmi_apis::FunctionID::Buttons_OnButtonEvent;
+const uint32_t kAppId = 5u;
+} // namespace
+
+class UpdateTurnListRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UpdateTurnListRequestTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<UpdateTurnListRequest>(command_msg_)) {
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg_)[am::strings::params][am::strings::function_id] =
+ kFunctionId;
+ }
+
+ MessageSharedPtr command_msg_;
+ std::shared_ptr<UpdateTurnListRequest> command_;
+};
+
+TEST_F(UpdateTurnListRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_InvalidNavigationText_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "invalid_navigation_text\t\n";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_InvalidTurnIcon_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "valid_navigation_text";
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "invalid_turn_icon\t\n";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest,
+ Run_ProcessSoftButtonsNotSucceeded_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "valid_navigation_text";
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ const mobile_result::eType kExpectedResult = mobile_result::INVALID_ENUM;
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(kExpectedResult));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(kExpectedResult), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_NoTurnList_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
+ const std::string kNavigationText = "valid_navigation_text";
+
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = kNavigationText;
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+ (*command_msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon],
+ Eq(mock_app),
+ Ref(app_mngr_))).WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(_, _, kFunctionId));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ ASSERT_TRUE((bool)result_msg);
+ EXPECT_EQ(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ ASSERT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ .keyExists(am::hmi_request::navi_text));
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_name));
+ EXPECT_EQ(
+ hmi_apis::Common_TextFieldName::turnText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_name]
+ .asInt());
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_text));
+ EXPECT_EQ(
+ kNavigationText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_text]
+ .asString());
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) {
+ const std::string kNavigationText = "valid_navigation_text";
+
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = kNavigationText;
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+ (*command_msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon],
+ Eq(mock_app),
+ Ref(app_mngr_))).WillOnce(Return(mobile_result::WARNINGS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(_, _, kFunctionId));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ ASSERT_TRUE(result_msg != nullptr);
+ EXPECT_EQ(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ ASSERT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ .keyExists(am::hmi_request::navi_text));
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_name));
+ EXPECT_EQ(
+ hmi_apis::Common_TextFieldName::turnText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_name]
+ .asInt());
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_text));
+ EXPECT_EQ(
+ kNavigationText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_text]
+ .asString());
+}
+
+TEST_F(UpdateTurnListRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command_->on_event(event);
+}
+
+TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) {
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ const mobile_result::eType mobile_response_code =
+ mobile_result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command_->on_event(event);
+}
+
+TEST_F(UpdateTurnListRequestTest,
+ OnEvent_ReceivedNavigationUpdateTurnListEvent_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_result::eType mobile_response_code = mobile_result::SUCCESS;
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command_->on_event(event);
+}
+
+} // namespace update_turn_list_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt
new file mode 100644
index 0000000000..0e556a6993
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt
@@ -0,0 +1,72 @@
+# 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 copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories(include)
+
+set (HMI_COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands/hmi
+)
+
+set (MOBILE_COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands/mobile
+)
+
+collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
+collect_sources(VEHICLE_INFO_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ Utils
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+add_library("vehicle_info_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${VEHICLE_INFO_PLUGIN_SOURCES})
+target_link_libraries("vehicle_info_plugin" ${LIBRARIES})
+
+set(INSTALL_DESTINATION bin)
+
+install(TARGETS vehicle_info_plugin
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h
new file mode 100644
index 0000000000..1fb9c0a008
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIVehicleDataNotification command class
+ * Sent by HMI for the periodic and non periodic vehicle data
+ **/
+class OnVIVehicleDataNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIVehicleDataNotification(
+ 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 OnVIVehicleDataNotification class destructor
+ **/
+ virtual ~OnVIVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVehicleDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h
new file mode 100644
index 0000000000..0b0a9ef99e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageRequest command class
+ **/
+class VIDiagnosticMessageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIDiagnosticMessageRequest(
+ 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 VIDiagnosticMessageRequest class destructor
+ **/
+ virtual ~VIDiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h
new file mode 100644
index 0000000000..31fc73897e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageResponse command class
+ **/
+class VIDiagnosticMessageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIDiagnosticMessageResponse(
+ 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 VIDiagnosticMessageResponse class destructor
+ **/
+ virtual ~VIDiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h
new file mode 100644
index 0000000000..67308a3898
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsRequest command class
+ **/
+class VIGetDTCsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIGetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetDTCsRequest(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 VIGetDTCsRequest class destructor
+ **/
+ virtual ~VIGetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h
new file mode 100644
index 0000000000..0ddf225c93
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsResponse command class
+ **/
+class VIGetDTCsResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetDTCsResponse(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 VIGetDTCsResponse class destructor
+ **/
+ virtual ~VIGetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h
new file mode 100644
index 0000000000..1b4669cf24
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataRequest command class
+ **/
+class VIGetVehicleDataRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleDataRequest(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 VIGetVehicleDataRequest class destructor
+ **/
+ virtual ~VIGetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h
new file mode 100644
index 0000000000..df5e630aea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataResponse command class
+ **/
+class VIGetVehicleDataResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleDataResponse(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 VIGetVehicleDataResponse class destructor
+ **/
+ virtual ~VIGetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
new file mode 100644
index 0000000000..79a5270f8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeRequest command class
+ **/
+class VIGetVehicleTypeRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleTypeRequest(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 VIGetVehicleTypeRequest class destructor
+ **/
+ virtual ~VIGetVehicleTypeRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
new file mode 100644
index 0000000000..baa4a936ae
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeResponse command class
+ **/
+class VIGetVehicleTypeResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleTypeResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIGetVehicleTypeResponse class destructor
+ **/
+ virtual ~VIGetVehicleTypeResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h
new file mode 100644
index 0000000000..3f12a30c8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyRequest command class
+ **/
+class VIIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief VIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIIsReadyRequest(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 VIIsReadyRequest class destructor
+ **/
+ virtual ~VIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h
new file mode 100644
index 0000000000..3531aa03c4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyResponse command class
+ **/
+class VIIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIIsReadyResponse(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 VIIsReadyResponse class destructor
+ **/
+ virtual ~VIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h
new file mode 100644
index 0000000000..2d10bbf11d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDRequest command class
+ **/
+class VIReadDIDRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIReadDIDRequest(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 VIReadDIDRequest class destructor
+ **/
+ virtual ~VIReadDIDRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h
new file mode 100644
index 0000000000..5ac655b499
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDResponse command class
+ **/
+class VIReadDIDResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIReadDIDResponse(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 VIReadDIDResponse class destructor
+ **/
+ virtual ~VIReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..bd22a313e7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataRequest command class
+ **/
+class VISubscribeVehicleDataRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VISubscribeVehicleDataRequest(
+ 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 VISubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VISubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..1148a8b41a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataResponse command class
+ **/
+class VISubscribeVehicleDataResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VISubscribeVehicleDataResponse(
+ 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 VISubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VISubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..3b39835fbf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataRequest command class
+ **/
+class VIUnsubscribeVehicleDataRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIUnsubscribeVehicleDataRequest(
+ 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 VIUnsubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..ada6896520
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataResponse command class
+ **/
+class VIUnsubscribeVehicleDataResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIUnsubscribeVehicleDataResponse(
+ 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 VIUnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h
new file mode 100644
index 0000000000..e2bc7c4dfd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h
@@ -0,0 +1,85 @@
+/*
+
+ 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_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageRequest command class
+ **/
+class DiagnosticMessageRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DiagnosticMessageRequest(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 DiagnosticMessageRequest class destructor
+ **/
+ virtual ~DiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h
new file mode 100644
index 0000000000..d69a6a0155
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h
@@ -0,0 +1,79 @@
+/*
+
+ 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_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageResponse command class
+ **/
+class DiagnosticMessageResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DiagnosticMessageResponse(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 DiagnosticMessageResponse class destructor
+ **/
+ virtual ~DiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h
new file mode 100644
index 0000000000..01f007697d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h
@@ -0,0 +1,85 @@
+/*
+
+ 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_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetDTCsRequest command class
+ **/
+class GetDTCsRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief GetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetDTCsRequest(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 GetDTCsRequest class destructor
+ **/
+ virtual ~GetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h
new file mode 100644
index 0000000000..87024b1860
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetDTCsResponse command class
+ **/
+class GetDTCsResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief GetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetDTCsResponse(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 GetDTCsResponse class destructor
+ **/
+ virtual ~GetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
new file mode 100644
index 0000000000..04a131da8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
@@ -0,0 +1,82 @@
+/*
+
+ 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_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+class SmartObject;
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataRequest command class
+ **/
+class GetVehicleDataRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief GetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetVehicleDataRequest(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 GetVehicleDataRequest class destructor
+ **/
+ virtual ~GetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ protected:
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h
new file mode 100644
index 0000000000..22ec1a5a78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataResponse command class
+ **/
+class GetVehicleDataResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief GetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetVehicleDataResponse(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 GetVehicleDataResponse class destructor
+ **/
+ virtual ~GetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h
new file mode 100644
index 0000000000..57c30164e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h
@@ -0,0 +1,88 @@
+/*
+
+ 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_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVehicleDataNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnVehicleDataNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVehicleDataNotification(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 OnVehicleDataNotification class destructor
+ **/
+ virtual ~OnVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends vehicle data notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendVehicleData(app_mngr::ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnVehicleDataNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h
new file mode 100644
index 0000000000..9a8fbbd62e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h
@@ -0,0 +1,85 @@
+/*
+
+ 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_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ReadDIDRequest command class
+ **/
+class ReadDIDRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ReadDIDRequest(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 ReadDIDRequest class destructor
+ **/
+ virtual ~ReadDIDRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h
new file mode 100644
index 0000000000..2b7ab04768
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h
@@ -0,0 +1,78 @@
+/*
+
+ 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_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ReadDIDResponse command class
+ **/
+class ReadDIDResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ReadDIDResponse(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 ReadDIDResponse class destructor
+ **/
+ virtual ~ReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..7c6e1754da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
@@ -0,0 +1,158 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Copyright (c) 2018, Livio, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ 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_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataRequest command class
+ **/
+class SubscribeVehicleDataRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeVehicleDataRequest(
+ 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 SubscribeButtonCommandRequest class destructor
+ **/
+ ~SubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Checks, if any app is subscribed for particular VI parameter
+ * @param param_id VI parameter id
+ * @return true, if there are registered apps subscribed for VI parameter,
+ * otherwise - false
+ */
+ bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
+
+ /**
+ * @brief Adds VI parameters being subscribed by another or the same app to
+ * response with appropriate results
+ * @param msg_params 'message_params' response section reference
+ */
+ void AddAlreadySubscribedVI(smart_objects::SmartObject& msg_params) const;
+
+ /**
+ * @brief Removes subscription for VI parameters which subsription attempt
+ * returned an error
+ * @param app Pointer to application sent subscribe request
+ * @param msg_params 'message_parameters' response section reference
+ */
+ void UnsubscribeFailedSubscriptions(
+ app_mngr::ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params) const;
+
+ /**
+ * @brief Checks if current application and other applications
+ * were subscribed to VI, prepare data that need to send to mobile app
+ * or HMI.
+ * @param app contains application
+ * @param out_info contains resulting info for sending to mobile app
+ * @param out_result_code contains result code for sending to mobile app
+ * @param out_response_params contains parameters that SDL sends to
+ * mobile application
+ * @param out_request_params contains parameters that SDL sends to
+ * HMI
+ * @param result contains result that SDL sends to mobile app.
+ */
+ void CheckVISubscriptions(app_mngr::ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result);
+
+ /**
+ * @brief VI parameters which had been already subscribed by another apps
+ * befor particular app subscribed for these parameters
+ */
+ VehicleInfoSubscriptions vi_already_subscribed_by_another_apps_;
+
+ /**
+ * @brief VI parameters which had been subscribed already by particular app
+ */
+ VehicleInfoSubscriptions vi_already_subscribed_by_this_app_;
+
+ /**
+ * @brief VI parameters which wait for subscribe after HMI respond
+ */
+ VehicleInfoSubscriptions vi_waiting_for_subscribe_;
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..60670afee1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataResponse command class
+ **/
+class SubscribeVehicleDataResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeVehicleDataResponse(
+ 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 UnsubscribeVehicleDataCommandRequest class destructor
+ **/
+ virtual ~SubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..e04d1fb97a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -0,0 +1,120 @@
+/*
+
+ 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_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataRequest command class
+ **/
+class UnsubscribeVehicleDataRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeVehicleDataRequest(
+ 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 UnsubscribeVehicleDataRequest class destructor
+ **/
+ ~UnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Checks, if any app is subscribed for particular VI parameter
+ * @param param_id VI parameter id
+ * @return true, if there are registered apps subscribed for VI parameter,
+ * otherwise - false
+ */
+ bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
+
+ /**
+ * @brief Adds VI parameters being unsubscribed by another or the same app to
+ * response with appropriate results
+ * @param msg_params 'message_params' response section reference
+ */
+ void AddAlreadyUnsubscribedVI(smart_objects::SmartObject& response) const;
+
+ /**
+ * @brief VI parameters which still being subscribed by another apps after
+ * particular app had been unsubscribed from these parameters
+ */
+ VehicleInfoSubscriptions vi_still_subscribed_by_another_apps_;
+
+ /**
+ * @brief VI parameters which had been unsubscribed already by particular app
+ */
+ VehicleInfoSubscriptions vi_already_unsubscribed_by_this_app_;
+
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..397ae3cbce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h
@@ -0,0 +1,80 @@
+/*
+
+ 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_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataResponse command class
+ **/
+class UnsubscribeVehicleDataResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeVehicleDataResponse(
+ 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 UnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~UnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
new file mode 100644
index 0000000000..ead6af841f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
@@ -0,0 +1,135 @@
+/*
+ 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_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H
+
+#include <application_manager/application_manager.h>
+
+#include <set>
+#include <string>
+
+namespace vehicle_info_plugin {
+class VehicleInfoPlugin;
+
+namespace app_mngr = application_manager;
+
+typedef mobile_apis::VehicleDataType::eType VehicleDataType;
+/**
+ * @brief Defines set of vehicle info types
+ */
+typedef std::set<mobile_apis::VehicleDataType::eType> VehicleInfoSubscriptions;
+
+class VehicleInfoAppExtension : public app_mngr::AppExtension {
+ public:
+ /**
+ * @brief VehicleInfoAppExtension constructor
+ * @param plugin vehicle info plugin
+ * @param app application that contains this plugin
+ */
+ VehicleInfoAppExtension(VehicleInfoPlugin& plugin,
+ app_mngr::Application& app);
+ virtual ~VehicleInfoAppExtension();
+
+ /**
+ * @brief subscribeToVehicleInfo add vehicle_data to list of subscriptions of
+ * application extension
+ * @param vehicle_data data to subscribe
+ * @return true in case if subscription is successful
+ */
+ bool subscribeToVehicleInfo(const VehicleDataType vehicle_data);
+
+ /**
+ * @brief unsubscribeFromVehicleInfo 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 unsubscribeFromVehicleInfo(const VehicleDataType vehicle_data);
+ /**
+ * @brief unsubscribeFromVehicleInfo unsubscribe from all vehicle info data
+ */
+ void unsubscribeFromVehicleInfo();
+
+ /**
+ * @brief isSubscribedToVehicleInfo checks if extension is subscribed to
+ * vehicle data
+ * @param vehicle_data_type data type to check subscription
+ * @return true if extension is subscribed this vehicle_data_type, otherwise
+ * return false
+ */
+ bool isSubscribedToVehicleInfo(const VehicleDataType vehicle_data_type) const;
+
+ /**
+ * @brief Subscriptions get list of subscriptions for application extension
+ * @return list of subscriptions for application extension
+ */
+ VehicleInfoSubscriptions 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 VehicleInfoAppExtensionUID unique identifier of VehicleInfo
+ * aplication extension
+ */
+ static unsigned VehicleInfoAppExtensionUID;
+
+ /**
+ * @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 VehicleInfoAppExtension& ExtractVIExtension(
+ application_manager::Application& app);
+
+ private:
+ VehicleInfoSubscriptions subscribed_data_;
+ VehicleInfoPlugin& plugin_;
+ app_mngr::Application& app_;
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h
new file mode 100644
index 0000000000..e36611dfa6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h
@@ -0,0 +1,70 @@
+/*
+ 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_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+#include "vehicle_info_plugin/vehicle_info_hmi_command_factory.h"
+#include "vehicle_info_plugin/vehicle_info_mobile_command_factory.h"
+
+namespace vehicle_info_plugin {
+
+namespace app_mngr = application_manager;
+namespace commands = application_manager::commands;
+
+/**
+ * @brief The Vehicle Info command factory.
+ */
+class VehicleInfoCommandFactory : public app_mngr::CommandFactory {
+ public:
+ VehicleInfoCommandFactory(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ virtual ~VehicleInfoCommandFactory();
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const commands::MessageSharedPtr& message,
+ commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ std::unique_ptr<app_mngr::CommandFactory> hmi_command_factory_;
+ std::unique_ptr<app_mngr::CommandFactory> mob_command_factory_;
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h
new file mode 100644
index 0000000000..412949eedb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.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_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+/**
+ * @brief The vehicle info hmi command factory.
+ */
+class VehicleInfoHmiCommandFactory : public app_mngr::CommandFactory {
+ public:
+ VehicleInfoHmiCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ app_mngr::CommandCreator& buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const;
+
+ DISALLOW_COPY_AND_ASSIGN(VehicleInfoHmiCommandFactory);
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h
new file mode 100644
index 0000000000..6cfc77a41c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.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_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+/**
+ * @brief The vehicle info mobile command factory.
+ */
+class VehicleInfoMobileCommandFactory : public app_mngr::CommandFactory {
+ public:
+ VehicleInfoMobileCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ app_mngr::CommandCreator& buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const;
+
+ DISALLOW_COPY_AND_ASSIGN(VehicleInfoMobileCommandFactory);
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
new file mode 100644
index 0000000000..b15b7006e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
@@ -0,0 +1,82 @@
+/*
+ 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_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H
+
+#include "application_manager/command_factory.h"
+
+namespace vehicle_info_plugin {
+class VehicleInfoAppExtension;
+namespace app_mngr = application_manager;
+namespace plugins = application_manager::plugin_manager;
+
+class VehicleInfoPlugin : public plugins::RPCPlugin {
+ public:
+ VehicleInfoPlugin();
+
+ bool Init(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ std::string PluginName() OVERRIDE;
+ app_mngr::CommandFactory& GetCommandFactory() OVERRIDE;
+
+ void OnPolicyEvent(plugins::PolicyEvent event) OVERRIDE;
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief ProcessResumptionSubscription send Subscribe vehicle data requests
+ * to HMI
+ * @param app application for subscription
+ * @param ext application extension
+ */
+ void ProcessResumptionSubscription(app_mngr::Application& app,
+ VehicleInfoAppExtension& ext);
+
+ private:
+ void DeleteSubscriptions(app_mngr::ApplicationSharedPtr app);
+
+ std::unique_ptr<app_mngr::CommandFactory> command_factory_;
+ app_mngr::ApplicationManager* application_manager_;
+};
+}
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc
new file mode 100644
index 0000000000..6125c4ee45
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIVehicleDataNotification::OnVIVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {}
+
+void OnVIVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+ if (msg_params.keyExists(strings::odometer)) {
+ application_manager_.IviInfoUpdated(
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER,
+ msg_params[strings::odometer].asInt());
+ }
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc
new file mode 100644
index 0000000000..8d3b9f13fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIDiagnosticMessageRequest::VIDiagnosticMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {}
+
+void VIDiagnosticMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc
new file mode 100644
index 0000000000..e22ba7ddb2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc
@@ -0,0 +1,66 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIDiagnosticMessageResponse::VIDiagnosticMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {}
+
+void VIDiagnosticMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc
new file mode 100644
index 0000000000..71ce6331ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetDTCsRequest::VIGetDTCsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetDTCsRequest::~VIGetDTCsRequest() {}
+
+void VIGetDTCsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc
new file mode 100644
index 0000000000..9d39c60796
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc
@@ -0,0 +1,65 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetDTCsResponse::VIGetDTCsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetDTCsResponse::~VIGetDTCsResponse() {}
+
+void VIGetDTCsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc
new file mode 100644
index 0000000000..9fc48c8820
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetVehicleDataRequest::VIGetVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {}
+
+void VIGetVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc
new file mode 100644
index 0000000000..73ba1a94fe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc
@@ -0,0 +1,89 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+VIGetVehicleDataResponse::VIGetVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {}
+
+void VIGetVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+
+ if ((*message_)[strings::params][strings::message_type] ==
+ static_cast<int32_t>(hmi_apis::messageType::error_response)) {
+ smart_objects::SmartObject result(smart_objects::SmartType_Map);
+
+ if ((*message_)[strings::params].keyExists(strings::data)) {
+ result[strings::msg_params] = (*message_)[strings::params][strings::data];
+ result[strings::params][hmi_response::code] =
+ (*message_)[strings::params][hmi_response::code];
+ result[strings::params][strings::correlation_id] =
+ (*message_)[strings::params][strings::correlation_id];
+ result[strings::params][strings::error_msg] =
+ (*message_)[strings::params][strings::error_msg];
+ result[strings::params][strings::message_type] =
+ (*message_)[strings::params][strings::message_type];
+ result[strings::params][strings::protocol_type] =
+ (*message_)[strings::params][strings::protocol_type];
+ result[strings::params][strings::protocol_version] =
+ (*message_)[strings::params][strings::protocol_version];
+ }
+
+ event.set_smart_object(result);
+ } else {
+ event.set_smart_object(*message_);
+ policy_handler_.OnVehicleDataUpdated(*message_);
+ }
+
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
new file mode 100644
index 0000000000..a1a221220a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetVehicleTypeRequest::VIGetVehicleTypeRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {}
+
+void VIGetVehicleTypeRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
new file mode 100644
index 0000000000..9f14b4e7ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
@@ -0,0 +1,64 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetVehicleTypeResponse::VIGetVehicleTypeResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {}
+
+void VIGetVehicleTypeResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_vehicle_type(
+ (*message_)[strings::msg_params][hmi_response::vehicle_type]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
new file mode 100644
index 0000000000..04bcc435ba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
@@ -0,0 +1,112 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIIsReadyRequest::VIIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+VIIsReadyRequest::~VIIsReadyRequest() {}
+
+void VIIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::VehicleInfo_IsReady,
+ correlation_id());
+ SendRequest();
+}
+
+void VIIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_IsReady: {
+ LOG4CXX_DEBUG(logger_, "VehicleInfo_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_,
+ message,
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_ivi_cooperating(is_available);
+ policy_handler_.OnVIIsReady();
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
+ LOG4CXX_INFO(
+ logger_,
+ "HmiInterfaces::HMI_INTERFACE_VehicleInfo isn't available");
+ return;
+ }
+ SendMessageToHMI();
+
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void VIIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void VIIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_type(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_type);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc
new file mode 100644
index 0000000000..35907e11d2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_is_ready_response.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIIsReadyResponse::VIIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIIsReadyResponse::~VIIsReadyResponse() {}
+
+void VIIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc
new file mode 100644
index 0000000000..b55c9e32a0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_read_did_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIReadDIDRequest::VIReadDIDRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIReadDIDRequest::~VIReadDIDRequest() {}
+
+void VIReadDIDRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc
new file mode 100644
index 0000000000..9d56b2aa78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc
@@ -0,0 +1,64 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_read_did_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIReadDIDResponse::VIReadDIDResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIReadDIDResponse::~VIReadDIDResponse() {}
+
+void VIReadDIDResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_ReadDID);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..60e9dc88c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {}
+
+void VISubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..f004d6f3cd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {}
+
+void VISubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..9056538514
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {}
+
+void VIUnsubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..348bc1b269
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {}
+
+void VIUnsubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc
new file mode 100644
index 0000000000..4eba894025
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc
@@ -0,0 +1,130 @@
+/*
+
+ 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 <algorithm>
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
+
+#include "application_manager/application_impl.h"
+
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DiagnosticMessageRequest::DiagnosticMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DiagnosticMessageRequest::~DiagnosticMessageRequest() {}
+
+void DiagnosticMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const std::vector<uint32_t>& supported_diag_modes =
+ application_manager_.get_settings().supported_diag_modes();
+
+ smart_objects::SmartObject& msg_data =
+ (*message_)[strings::msg_params][strings::message_data];
+
+ const uint8_t mode_position = 0;
+ const uint32_t msg_diagnostic_mode = msg_data[mode_position].asUInt();
+ if (supported_diag_modes.end() == std::find(supported_diag_modes.begin(),
+ supported_diag_modes.end(),
+ msg_diagnostic_mode)) {
+ LOG4CXX_ERROR(logger_,
+ "Received diagnostic mode " << msg_diagnostic_mode
+ << " is not supported.");
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "Received diagnostic mode is not supported.");
+ return;
+ }
+
+ // Add app_id for HMI request
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
+ &(*message_)[strings::msg_params],
+ true);
+}
+
+void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc
new file mode 100644
index 0000000000..54d8382f5d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ 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 "vehicle_info_plugin/commands/mobile/diagnostic_message_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DiagnosticMessageResponse::DiagnosticMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DiagnosticMessageResponse::~DiagnosticMessageResponse() {}
+
+void DiagnosticMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc
new file mode 100644
index 0000000000..6c04e874e8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc
@@ -0,0 +1,119 @@
+/*
+
+ 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 "vehicle_info_plugin/commands/mobile/get_dtcs_request.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetDTCsRequest::GetDTCsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetDTCsRequest::~GetDTCsRequest() {}
+
+void GetDTCsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::ecu_name] =
+ (*message_)[strings::msg_params][strings::ecu_name];
+
+ if ((*message_)[strings::msg_params].keyExists(strings::dtc_mask)) {
+ msg_params[strings::dtc_mask] =
+ (*message_)[strings::msg_params][strings::dtc_mask];
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetDTCs, &msg_params, true);
+}
+
+void GetDTCsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc
new file mode 100644
index 0000000000..3686094b73
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ 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 "vehicle_info_plugin/commands/mobile/get_dtcs_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetDTCsResponse::GetDTCsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetDTCsResponse::~GetDTCsResponse() {}
+
+void GetDTCsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
new file mode 100644
index 0000000000..87a9ace377
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
@@ -0,0 +1,147 @@
+/*
+
+ 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 <string>
+#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+GetVehicleDataRequest::GetVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetVehicleDataRequest::~GetVehicleDataRequest() {}
+
+void GetVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ int32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->AreCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::CONFIG_FILE)) {
+ LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ const uint32_t min_length_msg_params = 1;
+ for (; vehicle_data.end() != it; ++it) {
+ if (true == (*message_)[str::msg_params].keyExists(it->first) &&
+ true == (*message_)[str::msg_params][it->first].asBool()) {
+ msg_params[it->first] = (*message_)[strings::msg_params][it->first];
+ }
+ }
+ if (msg_params.length() > min_length_msg_params) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData, &msg_params, true);
+ return;
+ } else if (HasDisallowedParams()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+ result = result ||
+ ((hmi_apis::Common_Result::DATA_NOT_AVAILABLE == result_code) &&
+ (message[strings::msg_params].length() > 1));
+
+ if (true ==
+ message[strings::msg_params].keyExists(hmi_response::method)) {
+ message[strings::msg_params].erase(hmi_response::method);
+ }
+ if (true == message[strings::params].keyExists(strings::error_msg)) {
+ response_info = message[strings::params][strings::error_msg].asString();
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc
new file mode 100644
index 0000000000..3a7d663756
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ 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 "vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetVehicleDataResponse::GetVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetVehicleDataResponse::~GetVehicleDataResponse() {}
+
+void GetVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
new file mode 100644
index 0000000000..f8553c84f8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
@@ -0,0 +1,136 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "application_manager/helpers/application_helper.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVehicleDataNotification::OnVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnVehicleDataNotification::~OnVehicleDataNotification() {}
+
+void OnVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::vector<ApplicationSharedPtr> appNotification;
+ std::vector<ApplicationSharedPtr>::iterator appNotification_it =
+ appNotification.begin();
+ std::vector<smart_objects::SmartObject> appSO;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (true == (*message_)[strings::msg_params].keyExists(it->first)) {
+ LOG4CXX_ERROR(logger_, "vehicle_data nanme" << it->first);
+ auto vehicle_data_value =
+ (*message_)[strings::msg_params][it->first].asInt();
+
+ application_manager_.IviInfoUpdated(it->second, vehicle_data_value);
+
+ auto subscribed_to_ivi_predicate = [&it](const ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ return ext.isSubscribedToVehicleInfo(it->second);
+ };
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ application_manager::FindAllApps(application_manager_.applications(),
+ subscribed_to_ivi_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;
+ }
+
+ appNotification_it =
+ find(appNotification.begin(), appNotification.end(), app);
+ if (appNotification_it == appNotification.end()) {
+ appNotification.push_back(app);
+ smart_objects::SmartObject msg_param =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_param[it->first] = (*message_)[strings::msg_params][it->first];
+ appSO.push_back(msg_param);
+ } else {
+ size_t idx =
+ std::distance(appNotification.begin(), appNotification_it);
+ appSO[idx][it->first] = (*message_)[strings::msg_params][it->first];
+ }
+ }
+ }
+ }
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Number of Notifications to be send: " << appNotification.size());
+
+ for (size_t idx = 0; idx < appNotification.size(); idx++) {
+ LOG4CXX_INFO(logger_,
+ "Send OnVehicleData PRNDL notification to "
+ << appNotification[idx]->name().c_str()
+ << " application id " << appNotification[idx]->app_id());
+ (*message_)[strings::params][strings::connection_key] =
+ appNotification[idx]->app_id();
+ (*message_)[strings::msg_params] = appSO[idx];
+ SendNotification();
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc
new file mode 100644
index 0000000000..010cce4c63
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc
@@ -0,0 +1,134 @@
+/*
+ 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 <string>
+#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ReadDIDRequest::ReadDIDRequest(
+ 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) {}
+
+ReadDIDRequest::~ReadDIDRequest() {}
+
+void ReadDIDRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ LOG4CXX_INFO(
+ logger_,
+ "Correlation_id :"
+ << (*message_)[strings::params][strings::correlation_id].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "An application is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->AreCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::CONFIG_FILE)) {
+ LOG4CXX_ERROR(logger_, "ReadDID frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params][strings::did_location].empty()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::ecu_name] =
+ (*message_)[strings::msg_params][strings::ecu_name];
+ msg_params[strings::did_location] =
+ (*message_)[strings::msg_params][strings::did_location];
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_ReadDID, &msg_params, true);
+}
+
+void ReadDIDRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc
new file mode 100644
index 0000000000..82d49574f0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ 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 "vehicle_info_plugin/commands/mobile/read_did_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ReadDIDResponse::ReadDIDResponse(
+ 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) {}
+
+ReadDIDResponse::~ReadDIDResponse() {}
+
+void ReadDIDResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..65f4fde0b2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -0,0 +1,360 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+ Copyright (c) 2018, Livio, Inc.
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice,
+ 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 "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+SubscribeVehicleDataRequest::SubscribeVehicleDataRequest(
+ 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) {}
+
+SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {}
+
+void SubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ std::string info;
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ bool result = false;
+ CheckVISubscriptions(
+ app, info, result_code, response_params, msg_params, result);
+
+ if (mobile_apis::Result::INVALID_ENUM != result_code) {
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ response_params.empty() ? NULL : &response_params);
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
+ &msg_params,
+ true);
+}
+
+void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ if (hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData != event.id()) {
+ LOG4CXX_ERROR(logger_, "Received unknown event.");
+ return;
+ }
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ bool is_succeeded = result || !vi_already_subscribed_by_another_apps_.empty();
+
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result);
+
+ if (is_succeeded) {
+ if (!vi_already_subscribed_by_this_app_.empty()) {
+ result_code = mobile_apis::Result::IGNORED;
+ response_info = "Already subscribed on some provided VehicleData.";
+ }
+
+ if (!vi_waiting_for_subscribe_.empty()) {
+ LOG4CXX_DEBUG(logger_, "Subscribing to all pending VehicleData");
+ VehicleInfoSubscriptions::const_iterator key =
+ vi_waiting_for_subscribe_.begin();
+ for (; key != vi_waiting_for_subscribe_.end(); ++key) {
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ ext.subscribeToVehicleInfo(*key);
+ }
+ }
+ }
+
+ UnsubscribeFailedSubscriptions(app, message[strings::msg_params]);
+
+ if (!vi_already_subscribed_by_another_apps_.empty() ||
+ !vi_already_subscribed_by_this_app_.empty()) {
+ AddAlreadySubscribedVI(
+ const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
+ }
+
+ SendResponse(is_succeeded,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool SubscribeVehicleDataRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void SubscribeVehicleDataRequest::AddAlreadySubscribedVI(
+ smart_objects::SmartObject& msg_params) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ auto vi_to_string =
+ [](const mobile_apis::VehicleDataType::eType vehicle_data) {
+ for (auto& vi_str_to_int_pair : MessageHelper::vehicle_data()) {
+ if (vehicle_data == vi_str_to_int_pair.second) {
+ return vi_str_to_int_pair.first;
+ }
+ }
+ return std::string();
+ };
+
+ VehicleInfoSubscriptions::const_iterator it_same_app =
+ vi_already_subscribed_by_this_app_.begin();
+ for (; vi_already_subscribed_by_this_app_.end() != it_same_app;
+ ++it_same_app) {
+ msg_params[vi_to_string(*it_same_app)][strings::result_code] =
+ VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
+ msg_params[vi_to_string(*it_same_app)][strings::data_type] = *it_same_app;
+ }
+
+ VehicleInfoSubscriptions::const_iterator it_another_app =
+ vi_already_subscribed_by_another_apps_.begin();
+ for (; vi_already_subscribed_by_another_apps_.end() != it_another_app;
+ ++it_another_app) {
+ msg_params[vi_to_string(*it_another_app)][strings::result_code] =
+ VehicleDataResultCode::VDRC_SUCCESS;
+ msg_params[vi_to_string(*it_another_app)][strings::data_type] =
+ *it_another_app;
+ }
+}
+
+void SubscribeVehicleDataRequest::UnsubscribeFailedSubscriptions(
+ ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (msg_params.keyExists(it->first)) {
+ if (msg_params[it->first][strings::result_code].asInt() !=
+ hmi_apis::Common_VehicleDataResultCode::VDRC_SUCCESS) {
+ LOG4CXX_DEBUG(logger_,
+ "Subscription for VehicleDataType "
+ << it->first
+ << " is unsuccessfull. "
+ "Unsubscribing app with connection key "
+ << connection_key() << " from it.");
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .unsubscribeFromVehicleInfo(it->second);
+ }
+ }
+ }
+}
+
+struct SubscribedToIVIPredicate {
+ int32_t vehicle_info_;
+ SubscribedToIVIPredicate(int32_t vehicle_info)
+ : vehicle_info_(vehicle_info) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ return ext.isSubscribedToVehicleInfo(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_));
+ }
+};
+
+bool SubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
+ const uint32_t param_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SubscribedToIVIPredicate finder(param_id);
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetConstIt it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ return it != accessor.GetData().end();
+}
+
+void SubscribeVehicleDataRequest::CheckVISubscriptions(
+ ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result) {
+ // counter for items to subscribe
+ VehicleInfoSubscriptions::size_type items_to_subscribe = 0;
+ // counter for subscribed items by application
+ uint32_t subscribed_items = 0;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ HmiInterfaces::InterfaceState interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ const bool is_interface_not_available =
+ interface_state == HmiInterfaces::STATE_NOT_AVAILABLE;
+
+ for (; vehicle_data.end() != it; ++it) {
+ const std::string& key_name = it->first;
+ if ((*message_)[strings::msg_params].keyExists(key_name)) {
+ const bool is_key_enabled =
+ (*message_)[strings::msg_params][key_name].asBool();
+ if (is_key_enabled) {
+ ++items_to_subscribe;
+ }
+ if (!is_interface_not_available && is_key_enabled) {
+ mobile_apis::VehicleDataType::eType key_type = it->second;
+ const auto is_subscribed =
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .isSubscribedToVehicleInfo(key_type);
+ if (is_subscribed) {
+ LOG4CXX_DEBUG(logger_,
+ "App with connection key "
+ << connection_key()
+ << " is subscribed already for VehicleDataType: "
+ << key_type);
+ ++subscribed_items;
+ vi_already_subscribed_by_this_app_.insert(key_type);
+ out_response_params[key_name][strings::data_type] = key_type;
+ out_response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
+ continue;
+ }
+
+ if (IsSomeoneSubscribedFor(key_type)) {
+ LOG4CXX_DEBUG(logger_,
+ "There are apps subscribed already for "
+ "VehicleDataType: "
+ << key_type);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+
+ if (!ext.subscribeToVehicleInfo(key_type)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Unable to subscribe for VehicleDataType: " << key_type);
+ continue;
+ }
+ LOG4CXX_DEBUG(
+ logger_,
+ "App with connection key "
+ << connection_key()
+ << " have been subscribed for VehicleDataType: " << key_type);
+ ++subscribed_items;
+ vi_already_subscribed_by_another_apps_.insert(key_type);
+ out_response_params[key_name][strings::data_type] = key_type;
+ out_response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
+ continue;
+ }
+
+ out_request_params[key_name] = is_key_enabled;
+
+ if (is_key_enabled) {
+ vi_waiting_for_subscribe_.insert(key_type);
+ LOG4CXX_DEBUG(
+ logger_,
+ "App with connection key "
+ << connection_key()
+ << " will be subscribed for VehicleDataType: " << key_type);
+ ++subscribed_items;
+ }
+ }
+ }
+ }
+
+ const bool is_everything_already_subscribed =
+ items_to_subscribe ==
+ vi_already_subscribed_by_another_apps_.size() +
+ vi_already_subscribed_by_this_app_.size();
+
+ if (0 == items_to_subscribe) {
+ if (HasDisallowedParams()) {
+ out_result_code = mobile_apis::Result::DISALLOWED;
+ } else {
+ out_result_code = mobile_apis::Result::INVALID_DATA;
+ out_info = "No data in the request";
+ }
+ out_result = false;
+ }
+
+ if (0 == subscribed_items && !is_interface_not_available) {
+ out_result_code = mobile_apis::Result::IGNORED;
+ out_info = "Already subscribed on provided VehicleData.";
+ out_result = false;
+ }
+
+ if (is_everything_already_subscribed) {
+ out_result_code = vi_already_subscribed_by_this_app_.size()
+ ? mobile_apis::Result::IGNORED
+ : mobile_apis::Result::SUCCESS;
+ if (!(vi_already_subscribed_by_this_app_.empty())) {
+ out_info = "Already subscribed on some provided VehicleData.";
+ }
+ out_result = true;
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..2bea839320
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc
@@ -0,0 +1,63 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+SubscribeVehicleDataResponse::SubscribeVehicleDataResponse(
+ 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) {}
+
+SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {}
+
+void SubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..d0152ea0c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
@@ -0,0 +1,287 @@
+/*
+
+ 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 "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h"
+#include "application_manager/commands/command_impl.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/helpers.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest(
+ 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) {}
+
+UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {}
+
+void UnsubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ int32_t items_to_unsubscribe = 0;
+ int32_t unsubscribed_items = 0;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ for (; vehicle_data.end() != it; ++it) {
+ const std::string& key_name = it->first;
+ if ((*message_)[strings::msg_params].keyExists(key_name)) {
+ bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
+ if (is_key_enabled) {
+ ++items_to_unsubscribe;
+
+ mobile_apis::VehicleDataType::eType key_type = it->second;
+ const auto is_subscribed =
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .isSubscribedToVehicleInfo(key_type);
+ if (!is_subscribed) {
+ ++unsubscribed_items;
+ vi_already_unsubscribed_by_this_app_.insert(key_type);
+ response_params[key_name][strings::data_type] = key_type;
+ response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
+ continue;
+ }
+
+ if (!VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .unsubscribeFromVehicleInfo(it->second)) {
+ LOG4CXX_ERROR(logger_,
+ "Unable to unsubscribe from "
+ "VehicleDataType: "
+ << key_type);
+ continue;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Unsubscribed app with connection key "
+ << connection_key()
+ << " from VehicleDataType: " << key_type);
+
+ ++unsubscribed_items;
+
+ if (IsSomeoneSubscribedFor(key_type)) {
+ LOG4CXX_DEBUG(logger_,
+ "There are another apps still subscribed for "
+ "VehicleDataType: "
+ << key_type);
+
+ vi_still_subscribed_by_another_apps_.insert(key_type);
+ response_params[key_name][strings::data_type] = key_type;
+ response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
+ continue;
+ }
+
+ msg_params[key_name] = is_key_enabled;
+ }
+ }
+ }
+
+ bool is_everything_already_unsubscribed =
+ static_cast<uint32_t>(items_to_unsubscribe) ==
+ vi_still_subscribed_by_another_apps_.size() +
+ vi_already_unsubscribed_by_this_app_.size();
+
+ if (0 == items_to_unsubscribe) {
+ if (HasDisallowedParams()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ } else {
+ SendResponse(
+ false, mobile_apis::Result::INVALID_DATA, "No data in the request.");
+ }
+ return;
+ }
+
+ if (0 == unsubscribed_items) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Was not subscribed on any VehicleData.",
+ &response_params);
+ return;
+ }
+
+ if (is_everything_already_unsubscribed) {
+ if (!vi_already_unsubscribed_by_this_app_.empty()) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Some provided VehicleData was not subscribed.",
+ &response_params);
+ } else {
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ }
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
+ &msg_params,
+ true);
+}
+
+void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ if (hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData != event.id()) {
+ LOG4CXX_ERROR(logger_, "Received unknown event.");
+ return;
+ }
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result);
+
+ if (result) {
+ if (vi_already_unsubscribed_by_this_app_.size()) {
+ result_code = mobile_apis::Result::IGNORED;
+ response_info = "Some provided VehicleData was not subscribed.";
+ }
+ }
+
+ if (!vi_still_subscribed_by_another_apps_.empty() ||
+ !vi_already_unsubscribed_by_this_app_.empty()) {
+ AddAlreadyUnsubscribedVI(
+ const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
+ }
+
+ if (result) {
+ SetAllowedToTerminate(false);
+ }
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ if (result) {
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+ }
+}
+
+bool UnsubscribeVehicleDataRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+struct SubscribedToIVIPredicate {
+ int32_t vehicle_info_;
+ SubscribedToIVIPredicate(int32_t vehicle_info)
+ : vehicle_info_(vehicle_info) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ return ext.isSubscribedToVehicleInfo(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_));
+ }
+};
+
+bool UnsubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
+ const uint32_t param_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SubscribedToIVIPredicate finder(param_id);
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetConstIt it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ return it != accessor.GetData().end();
+}
+
+void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI(
+ smart_objects::SmartObject& response) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ VehicleInfoSubscriptions::const_iterator it_same_app =
+ vi_already_unsubscribed_by_this_app_.begin();
+ for (; vi_already_unsubscribed_by_this_app_.end() != it_same_app;
+ ++it_same_app) {
+ response[*it_same_app][strings::result_code] =
+ VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
+ }
+
+ VehicleInfoSubscriptions::const_iterator it_another_app =
+ vi_still_subscribed_by_another_apps_.begin();
+ for (; vi_still_subscribed_by_another_apps_.end() != it_another_app;
+ ++it_another_app) {
+ response[*it_another_app][strings::result_code] =
+ VehicleDataResultCode::VDRC_SUCCESS;
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..5f79785784
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
@@ -0,0 +1,70 @@
+/*
+
+ 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 "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h"
+#include "smart_objects/smart_object.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse(
+ 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) {}
+
+UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {}
+
+void UnsubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+ SendResponse(true);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
new file mode 100644
index 0000000000..3b1d411841
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
@@ -0,0 +1,125 @@
+/*
+ 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 "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+
+unsigned VehicleInfoAppExtension::VehicleInfoAppExtensionUID = 146;
+
+VehicleInfoAppExtension::VehicleInfoAppExtension(
+ VehicleInfoPlugin& plugin, application_manager::Application& app)
+ : app_mngr::AppExtension(
+ VehicleInfoAppExtension::VehicleInfoAppExtensionUID)
+ , plugin_(plugin)
+ , app_(app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+VehicleInfoAppExtension::~VehicleInfoAppExtension() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool VehicleInfoAppExtension::subscribeToVehicleInfo(
+ const VehicleDataType vehicle_data) {
+ LOG4CXX_DEBUG(logger_, vehicle_data);
+ return subscribed_data_.insert(vehicle_data).second;
+}
+
+bool VehicleInfoAppExtension::unsubscribeFromVehicleInfo(
+ const VehicleDataType vehicle_data) {
+ LOG4CXX_DEBUG(logger_, vehicle_data);
+ auto it = subscribed_data_.find(vehicle_data);
+ if (it != subscribed_data_.end()) {
+ subscribed_data_.erase(it);
+ return true;
+ }
+ return false;
+}
+
+void VehicleInfoAppExtension::unsubscribeFromVehicleInfo() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribed_data_.clear();
+}
+
+bool VehicleInfoAppExtension::isSubscribedToVehicleInfo(
+ const VehicleDataType vehicle_data) const {
+ LOG4CXX_DEBUG(logger_, vehicle_data);
+ return subscribed_data_.find(vehicle_data) != subscribed_data_.end();
+}
+
+VehicleInfoSubscriptions VehicleInfoAppExtension::Subscriptions() {
+ return subscribed_data_;
+}
+
+void VehicleInfoAppExtension::SaveResumptionData(
+ smart_objects::SmartObject& resumption_data) {
+ const char* application_vehicle_info = "vehicleInfo";
+ resumption_data[application_vehicle_info] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ int i = 0;
+ for (const auto& subscription : subscribed_data_) {
+ resumption_data[application_vehicle_info][i] = subscription;
+ }
+}
+
+void VehicleInfoAppExtension::ProcessResumption(
+ const smart_objects::SmartObject& resumption_data) {
+ const char* application_vehicle_info = "vehicleInfo";
+ if (resumption_data.keyExists(application_vehicle_info)) {
+ const smart_objects::SmartObject& subscriptions_ivi =
+ resumption_data[application_vehicle_info];
+ for (size_t i = 0; i < subscriptions_ivi.length(); ++i) {
+ mobile_apis::VehicleDataType::eType ivi =
+ static_cast<mobile_apis::VehicleDataType::eType>(
+ (resumption_data[i]).asInt());
+ subscribeToVehicleInfo(ivi);
+ }
+ plugin_.ProcessResumptionSubscription(app_, *this);
+ }
+}
+
+VehicleInfoAppExtension& VehicleInfoAppExtension::ExtractVIExtension(
+ application_manager::Application& app) {
+ auto ext_ptr =
+ app.QueryInterface(VehicleInfoAppExtension::VehicleInfoAppExtensionUID);
+ DCHECK(ext_ptr);
+ DCHECK(dynamic_cast<VehicleInfoAppExtension*>(ext_ptr.get()));
+ auto vi_app_extension =
+ std::static_pointer_cast<VehicleInfoAppExtension>(ext_ptr);
+ DCHECK(vi_app_extension);
+ return *vi_app_extension;
+}
+}
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
new file mode 100644
index 0000000000..32959174da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc
@@ -0,0 +1,70 @@
+/*
+ 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 "vehicle_info_plugin/vehicle_info_command_factory.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+
+VehicleInfoCommandFactory::VehicleInfoCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : hmi_command_factory_(new VehicleInfoHmiCommandFactory(
+ application_manager, rpc_service, hmi_capabilities, policy_handler))
+ , mob_command_factory_(new VehicleInfoMobileCommandFactory(
+ application_manager, rpc_service, hmi_capabilities, policy_handler)) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+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) {
+ return hmi_command_factory_->CreateCommand(message, source);
+ } else {
+ return mob_command_factory_->CreateCommand(message, source);
+ }
+}
+
+bool VehicleInfoCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource source) const {
+ return commands::Command::SOURCE_HMI == source
+ ? hmi_command_factory_->IsAbleToProcess(function_id, source)
+ : mob_command_factory_->IsAbleToProcess(function_id, source);
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
new file mode 100644
index 0000000000..9311cea6d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
@@ -0,0 +1,156 @@
+/*
+ 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 "vehicle_info_plugin/vehicle_info_hmi_command_factory.h"
+#include "application_manager/message.h"
+#include "interfaces/HMI_API.h"
+
+#include "vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_is_ready_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_read_did_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_read_did_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+namespace strings = app_mngr::strings;
+
+VehicleInfoHmiCommandFactory::VehicleInfoHmiCommandFactory(
+ application_manager::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+app_mngr::CommandSharedPtr VehicleInfoHmiCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ UNUSED(source);
+
+ const hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ const hmi_apis::messageType::eType message_type =
+ static_cast<hmi_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ auto message_type_str = "request";
+ if (hmi_apis::messageType::response == message_type) {
+ message_type_str = "response";
+ } else if (hmi_apis::messageType::error_response == message_type) {
+ message_type_str = "error response";
+ }
+
+ UNUSED(message_type_str);
+ LOG4CXX_DEBUG(logger_,
+ "HMICommandFactory::CreateCommand function_id: "
+ << function_id << ", message type: " << message_type_str);
+
+ return buildCommandCreator(function_id, message_type).create(message);
+}
+
+bool VehicleInfoHmiCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const {
+ UNUSED(source);
+ return buildCommandCreator(function_id, hmi_apis::messageType::INVALID_ENUM)
+ .CanBeCreated();
+}
+
+app_mngr::CommandCreator& VehicleInfoHmiCommandFactory::buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const {
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (function_id) {
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleType:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIGetVehicleTypeRequest>()
+ : factory.GetCreator<commands::VIGetVehicleTypeResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_IsReady:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIIsReadyRequest>()
+ : factory.GetCreator<commands::VIIsReadyResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VISubscribeVehicleDataRequest>()
+ : factory
+ .GetCreator<commands::VISubscribeVehicleDataResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData:
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::VIUnsubscribeVehicleDataRequest>()
+ : factory.GetCreator<
+ commands::VIUnsubscribeVehicleDataResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleData:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIGetVehicleDataRequest>()
+ : factory.GetCreator<commands::VIGetVehicleDataResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_OnVehicleData:
+ return factory.GetCreator<commands::OnVIVehicleDataNotification>();
+ case hmi_apis::FunctionID::VehicleInfo_ReadDID:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIReadDIDRequest>()
+ : factory.GetCreator<commands::VIReadDIDResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_GetDTCs:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIGetDTCsRequest>()
+ : factory.GetCreator<commands::VIGetDTCsResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIDiagnosticMessageRequest>()
+ : factory.GetCreator<commands::VIDiagnosticMessageResponse>();
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id);
+ return factory.GetCreator<app_mngr::InvalidCommand>();
+ }
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
new file mode 100644
index 0000000000..7600afa091
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
@@ -0,0 +1,144 @@
+/*
+ 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 "vehicle_info_plugin/vehicle_info_mobile_command_factory.h"
+
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_response.h"
+#include "vehicle_info_plugin/commands/mobile/get_dtcs_request.h"
+#include "vehicle_info_plugin/commands/mobile/get_dtcs_response.h"
+#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h"
+#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
+#include "vehicle_info_plugin/commands/mobile/read_did_response.h"
+#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+namespace strings = app_mngr::strings;
+
+VehicleInfoMobileCommandFactory::VehicleInfoMobileCommandFactory(
+ application_manager::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ UNUSED(source);
+
+ const mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ const mobile_apis::messageType::eType message_type =
+ static_cast<mobile_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ auto message_type_str = "request";
+ if (mobile_apis::messageType::response == message_type) {
+ message_type_str = "response";
+ } else if (mobile_apis::messageType::notification == message_type) {
+ message_type_str = "notification";
+ }
+
+ UNUSED(message_type_str);
+ LOG4CXX_DEBUG(logger_,
+ "HMICommandFactory::CreateCommand function_id: "
+ << function_id << ", message type: " << message_type_str);
+
+ return buildCommandCreator(function_id, message_type).create(message);
+}
+
+bool VehicleInfoMobileCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const {
+ UNUSED(source);
+ return buildCommandCreator(function_id,
+ mobile_apis::messageType::INVALID_ENUM)
+ .CanBeCreated();
+}
+
+app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const {
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (function_id) {
+ case mobile_apis::FunctionID::GetVehicleDataID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetVehicleDataRequest>()
+ : factory.GetCreator<commands::GetVehicleDataResponse>();
+ case mobile_apis::FunctionID::SubscribeVehicleDataID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SubscribeVehicleDataRequest>()
+ : factory.GetCreator<commands::SubscribeVehicleDataResponse>();
+ case mobile_apis::FunctionID::UnsubscribeVehicleDataID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UnsubscribeVehicleDataRequest>()
+ : factory
+ .GetCreator<commands::UnsubscribeVehicleDataResponse>();
+ case mobile_apis::FunctionID::OnVehicleDataID:
+ return factory.GetCreator<commands::OnVehicleDataNotification>();
+ case mobile_apis::FunctionID::ReadDIDID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ReadDIDRequest>()
+ : factory.GetCreator<commands::ReadDIDResponse>();
+ case mobile_apis::FunctionID::GetDTCsID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetDTCsRequest>()
+ : factory.GetCreator<commands::GetDTCsResponse>();
+ case mobile_apis::FunctionID::DiagnosticMessageID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::DiagnosticMessageRequest>()
+ : factory.GetCreator<commands::DiagnosticMessageResponse>();
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id);
+ return factory.GetCreator<app_mngr::InvalidCommand>();
+ }
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
new file mode 100644
index 0000000000..d0bcc36ab4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
@@ -0,0 +1,167 @@
+/*
+ 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 "vehicle_info_plugin/vehicle_info_plugin.h"
+#include "vehicle_info_plugin/vehicle_info_command_factory.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace strings = application_manager::strings;
+
+VehicleInfoPlugin::VehicleInfoPlugin() : application_manager_(nullptr) {}
+
+bool VehicleInfoPlugin::Init(
+ application_manager::ApplicationManager& app_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) {
+ application_manager_ = &app_manager;
+ command_factory_.reset(new vehicle_info_plugin::VehicleInfoCommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+ return true;
+}
+
+bool VehicleInfoPlugin::IsAbleToProcess(
+ const int32_t function_id, const commands::Command::CommandSource source) {
+ return command_factory_->IsAbleToProcess(function_id, source);
+}
+
+std::string VehicleInfoPlugin::PluginName() {
+ return "Vehicle Info Plugin";
+}
+
+app_mngr::CommandFactory& VehicleInfoPlugin::GetCommandFactory() {
+ return *command_factory_;
+}
+
+void VehicleInfoPlugin::OnPolicyEvent(plugins::PolicyEvent event) {}
+
+void VehicleInfoPlugin::OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) {
+ if (plugins::ApplicationEvent::kApplicationRegistered == event) {
+ application->AddExtension(
+ std::make_shared<VehicleInfoAppExtension>(*this, *application));
+ } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) {
+ DeleteSubscriptions(application);
+ }
+}
+
+void VehicleInfoPlugin::ProcessResumptionSubscription(
+ application_manager::Application& app, VehicleInfoAppExtension& ext) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app.app_id();
+ const auto& subscriptions = ext.Subscriptions();
+ for (auto& ivi_data : application_manager::MessageHelper::vehicle_data()) {
+ mobile_apis::VehicleDataType::eType type_id = ivi_data.second;
+ if (subscriptions.end() != subscriptions.find(type_id)) {
+ std::string key_name = ivi_data.first;
+ msg_params[key_name] = true;
+ }
+ }
+ smart_objects::SmartObjectSPtr request =
+ application_manager::MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
+ *application_manager_);
+ (*request)[strings::msg_params] = msg_params;
+ application_manager_->GetRPCService().ManageHMICommand(request);
+}
+
+application_manager::ApplicationSharedPtr FindAppSubscribedToIVI(
+ mobile_apis::VehicleDataType::eType ivi_data,
+ application_manager::ApplicationManager& app_mngr) {
+ auto applications = app_mngr.applications();
+
+ for (auto& app : applications.GetData()) {
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ if (ext.isSubscribedToVehicleInfo(ivi_data)) {
+ return app;
+ }
+ }
+ return application_manager::ApplicationSharedPtr();
+}
+
+smart_objects::SmartObjectSPtr GetUnsubscribeIVIRequest(
+ int32_t ivi_id, application_manager::ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+
+ auto find_ivi_name = [ivi_id]() {
+ for (auto item : application_manager::MessageHelper::vehicle_data()) {
+ if (ivi_id == item.second) {
+ return item.first;
+ }
+ }
+ return std::string();
+ };
+ std::string key_name = find_ivi_name();
+ DCHECK_OR_RETURN(!key_name.empty(), smart_objects::SmartObjectSPtr());
+ auto msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[key_name] = true;
+
+ auto message = application_manager::MessageHelper::CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData;
+
+ object[strings::msg_params] = msg_params;
+ return message;
+}
+
+void VehicleInfoPlugin::DeleteSubscriptions(
+ application_manager::ApplicationSharedPtr app) {
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ auto subscriptions = ext.Subscriptions();
+ for (auto& ivi : subscriptions) {
+ ext.unsubscribeFromVehicleInfo(ivi);
+ auto still_subscribed_app =
+ FindAppSubscribedToIVI(ivi, *application_manager_);
+ if (!still_subscribed_app) {
+ auto message = GetUnsubscribeIVIRequest(ivi, *application_manager_);
+ application_manager_->GetRPCService().ManageHMICommand(message);
+ }
+ }
+}
+}
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+ return new vehicle_info_plugin::VehicleInfoPlugin();
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..3ea4a50a8a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt
@@ -0,0 +1,64 @@
+# 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 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/vehicle_info_plugin/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+)
+
+
+set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMPONENTS_DIR}/application_manager/src/event_engine/*
+)
+
+set(LIBRARIES
+ gmock
+ Utils
+ SmartObjects
+ HMI_API
+ MOBILE_API
+ connectionHandler
+ vehicle_info_plugin
+ jsoncpp
+)
+
+create_cotired_test("vi_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
new file mode 100644
index 0000000000..0508f0cdd6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
@@ -0,0 +1,153 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/vi_get_vehicle_data_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vi_get_vehicle_data_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::VIGetVehicleDataResponse;
+using am::event_engine::Event;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class VIGetVehicleDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(VIGetVehicleDataResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::message_type] =
+ hmi_apis::messageType::response;
+
+ VIGetVehicleDataResponsePtr command(
+ CreateCommand<VIGetVehicleDataResponse>(command_msg));
+
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(*command_msg);
+
+ EXPECT_CALL(mock_policy_handler_, OnVehicleDataUpdated(*command_msg));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(VIGetVehicleDataResponseTest, ErrorResponse_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::message_type] =
+ hmi_apis::messageType::error_response;
+ (*command_msg)[strings::params][strings::data][strings::slider_position] = 1;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*command_msg)[am::strings::params][am::strings::error_msg] = "test_error";
+ (*command_msg)[am::strings::params][am::strings::protocol_type] =
+ am::commands::CommandImpl::hmi_protocol_type_;
+ (*command_msg)[strings::params][strings::protocol_version] =
+ am::commands::CommandImpl::protocol_version_;
+
+ smart_objects::SmartObject result(smart_objects::SmartType_Map);
+ result[strings::msg_params] = (*command_msg)[strings::params][strings::data];
+ result[strings::params][hmi_response::code] =
+ (*command_msg)[strings::params][hmi_response::code];
+ result[strings::params][strings::correlation_id] =
+ (*command_msg)[strings::params][strings::correlation_id];
+ result[strings::params][strings::error_msg] =
+ (*command_msg)[strings::params][strings::error_msg];
+ result[strings::params][strings::message_type] =
+ (*command_msg)[strings::params][strings::message_type];
+ result[strings::params][strings::protocol_type] =
+ (*command_msg)[strings::params][strings::protocol_type];
+ result[strings::params][strings::protocol_version] =
+ (*command_msg)[strings::params][strings::protocol_version];
+
+ VIGetVehicleDataResponsePtr command(
+ CreateCommand<VIGetVehicleDataResponse>(command_msg));
+
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(result);
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vi_get_vehicle_data_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
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
new file mode 100644
index 0000000000..d4477d5d5f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
@@ -0,0 +1,169 @@
+/*
+ * 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 "hmi/vi_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vi_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::VIIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<VIIsReadyRequest> VIIsReadyRequestPtr;
+
+class VIIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ VIIsReadyRequestTest() : command_(CreateCommand<VIIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_vi_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_ivi_cooperating(is_vi_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(
+ am::HmiInterfaces::HMI_INTERFACE_VehicleInfo, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_policy_handler_, OnVIIsReady());
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VehicleInfo))
+ .WillOnce(Return(state));
+
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr ivi_type;
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
+ .WillOnce(Return(ivi_type));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(ivi_type));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_vi_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_vi_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ VIIsReadyRequestPtr command_;
+};
+
+TEST_F(VIIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_vi_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_vi_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_vi_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_vi_cooperating_available);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace vi_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
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
new file mode 100644
index 0000000000..9cdf60b1ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
@@ -0,0 +1,185 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace diagnostic_message_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::DiagnosticMessageRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kDiagnosticMode = 5u;
+} // namespace
+
+class DiagnosticMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DiagnosticMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, Run_NotSupportedDiagnosticMode_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
+ kDiagnosticMode;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ const std::vector<uint32_t> empty_supported_diag_modes;
+ EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillOnce(ReturnRef(empty_supported_diag_modes));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
+ kDiagnosticMode;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ std::vector<uint32_t> supported_diag_modes;
+ supported_diag_modes.push_back(kDiagnosticMode);
+
+ 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)));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, OnEvent_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>());
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
+
+ MessageSharedPtr event_message(CreateMessage(smart_objects::SmartType_Map));
+ (*event_message)[am::strings::msg_params] = 0;
+ (*event_message)[am::strings::params][am::hmi_response::code] =
+ mobile_result::SUCCESS;
+ event.set_smart_object(*event_message);
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>());
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command->on_event(event);
+}
+
+} // namespace diagnostic_message_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
new file mode 100644
index 0000000000..4473a36c63
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
@@ -0,0 +1,142 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/get_dtcs_request.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_dtcs_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::GetDTCsRequest;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+using testing::Mock;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<GetDTCsRequest> GetDTCsRequestPtr;
+
+class GetDTCsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetDTCsRequestTest() : CommandRequestTest<CommandsTestMocks::kIsNice>() {}
+};
+
+TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(GetDTCsRequestTest, Run_SUCCESS) {
+ const uint32_t kConnectionKey = 2u;
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::dtc_mask] = 0;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs)));
+
+ command->Run();
+}
+
+TEST_F(GetDTCsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+
+ Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+ command->on_event(event);
+}
+
+} // namespace get_dtcs_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/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
new file mode 100644
index 0000000000..a88d362968
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
@@ -0,0 +1,256 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/get_vehicle_data_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_vehicle_data_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::GetVehicleDataRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class GetVehicleDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest {
+ public:
+ UnwrappedGetVehicleDataRequest(const MessageSharedPtr& message,
+ am::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : GetVehicleDataRequest(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ policy::RPCParams& get_disallowed_params() {
+ return removed_parameters_permissions_.disallowed_params;
+ }
+
+ using GetVehicleDataRequest::on_event;
+};
+
+TEST_F(GetVehicleDataRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ GetVehicleDataRequestPtr command(CreateCommand<GetVehicleDataRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_TooHighFrequency_UNSUCCESS) {
+ const mobile_apis::FunctionID::eType kFunctionId =
+ mobile_apis::FunctionID::GetVehicleDataID;
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::function_id] = kFunctionId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ *app,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::CONFIG_FILE))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_EmptyMsgParams_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ const am::VehicleData kEmptyVehicleData;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(kEmptyVehicleData));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest,
+ Run_EmptyMsgParamsAndHasDisallowedParams_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ const am::VehicleData kEmptyVehicleData;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(kEmptyVehicleData));
+
+ policy::RPCParams& disallowed_params = command->get_disallowed_params();
+ disallowed_params.insert("test_param");
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::DISALLOWED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) {
+ const std::string kMsgParamKey("test_key");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMsgParamKey, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData)));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
+ const mobile_result::eType mobile_response_code =
+ mobile_result::DATA_NOT_AVAILABLE;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::params][am::strings::error_msg] = "test_error";
+ (*event_msg)[am::strings::msg_params][am::hmi_response::method] = 0;
+
+ Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command->on_event(event);
+}
+
+} // namespace get_vehicle_data_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
new file mode 100644
index 0000000000..1e8a289637
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -0,0 +1,114 @@
+/*
+ * 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 <stdint.h>
+#include <vector>
+#include <map>
+
+#include "gtest/gtest.h"
+#include "mobile/on_vehicle_data_notification.h"
+
+#include "utils/custom_string.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_vehicle_data_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::OnVehicleDataNotification;
+
+typedef std::shared_ptr<OnVehicleDataNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnVehicleDataNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnVehicleDataNotificationTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {}
+
+ MessageSharedPtr command_msg_;
+ NotificationPtr command_;
+};
+
+MATCHER_P2(CheckMessageData, key, value, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ const bool kAreMsgParamsCorrect =
+ (*arg)[am::strings::msg_params][key].asInt() == value;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect,
+ kAreMsgParamsCorrect);
+}
+
+} // namespace on_vehicle_data_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
new file mode 100644
index 0000000000..c0a07fb57c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
@@ -0,0 +1,164 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace read_did_request {
+
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::Return;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using vehicle_info_plugin::commands::ReadDIDRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+class ReadDIDRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
+ Event event(Event::EventID::VehicleInfo_ReadDID);
+
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_apis::Result::eType mobile_response_code =
+ mobile_apis::Result::SUCCESS;
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ command->on_event(event);
+}
+
+TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) {
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(true));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_EmptyDidLocation_UNSUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_SUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::msg_params][am::strings::did_location]["SomeData"] = 0;
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(msg));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
+ EXPECT_EQ(hmi_apis::FunctionID::VehicleInfo_ReadDID,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+}
+
+} // namespace read_did_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
new file mode 100644
index 0000000000..323334de2d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
@@ -0,0 +1,301 @@
+/*
+ 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/unsubscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<UnsubscribeVehicleDataRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kMsgParamKey = "test_key";
+const mobile_apis::VehicleDataType::eType kVehicleType =
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED;
+} // namespace
+
+class UnsubscribeVehicleRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UnsubscribeVehicleRequestTest()
+ : mock_app_(CreateMockApp())
+ , vi_app_extension_ptr_(
+ std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>(
+ vi_plugin_, *mock_app_))
+ , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
+
+ protected:
+ void UnsubscribeSuccessfully();
+ void SetUp() OVERRIDE {
+ vi_plugin_.Init(app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
+ ON_CALL(*mock_app_, AddExtension(vi_app_extension_ptr_));
+ vi_plugin_.OnApplicationEvent(application_manager::plugin_manager::
+ ApplicationEvent::kApplicationRegistered,
+ mock_app_);
+ ON_CALL(*mock_app_,
+ QueryInterface(vehicle_info_plugin::VehicleInfoAppExtension::
+ VehicleInfoAppExtensionUID))
+ .WillByDefault(Return(vi_app_extension_ptr_));
+ }
+
+ MockAppPtr mock_app_;
+ application_manager::AppExtensionPtr vi_app_extension_ptr_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
+ vehicle_info_plugin::VehicleInfoPlugin vi_plugin_;
+};
+
+TEST_F(UnsubscribeVehicleRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>());
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_DataToUnsubscribeIsNotExisted_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ kVehicleType;
+
+ am::VehicleData data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data()).WillOnce(ReturnRef(data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_UnsubscribeFromSubscribedBeforeData_RequestSuccessfullySentToHmi) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_rpc_service_,
+ 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());
+ ASSERT_TRUE(vi_app_extension->subscribeToVehicleInfo(kVehicleType));
+ application_manager::ApplicationSet app_set = {mock_app_};
+ DataAccessor<application_manager::ApplicationSet> accessor(app_set,
+ app_set_lock_ptr_);
+ // Expectations
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_EmptyVehicleData_INVALID_DATA_SentToMobile) {
+ am::VehicleData vehicle_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = false;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_UnsubscribeFromNotSubscribedBeforeData_UNSUCCESS) {
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, Run_UnsubscribeDataDisabled_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+ command->Init();
+ command->Run();
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ message[am::strings::params][am::hmi_response::code] = hmi_result;
+ message[am::strings::msg_params][kMsgParamKey] = true;
+ test_event.set_smart_object(message);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ command->on_event(test_event);
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ message[am::strings::params][am::hmi_response::code] = hmi_result;
+ message[am::strings::msg_params][kMsgParamKey] = true;
+ test_event.set_smart_object(message);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command->on_event(test_event);
+}
+
+} // namespace unsubscribe_vehicle_data_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
new file mode 100644
index 0000000000..a0d4699de8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
@@ -0,0 +1,114 @@
+/*
+ * 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 "mobile/unsubscribe_vehicle_data_response.h"
+#include <stdint.h>
+#include <string>
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_response {
+
+namespace commands = ::application_manager::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+using vehicle_info_plugin::commands::UnsubscribeVehicleDataResponse;
+using commands::MessageSharedPtr;
+namespace am = ::application_manager;
+
+class UnsubscribeVehicleResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P(ResultCodeIs, result_code, "") {
+ return result_code ==
+ static_cast<mobile_apis::Result::eType>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendFalseResponseToMobile_SendInvalidEnum) {
+ MessageSharedPtr command_msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = false;
+
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
+ CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(ResultCodeIs(mobile_apis::Result::INVALID_ENUM), _));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendSuccessfulResponseToMobile_SUCCESS) {
+ MessageSharedPtr command_msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = true;
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
+ CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(ResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendResponseToMobile_SendCodeToMobile) {
+ MessageSharedPtr command_msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = true;
+
+ mobile_apis::Result::eType result_type = mobile_apis::Result::WARNINGS;
+ (*command_msg)[am::strings::msg_params][am::strings::result_code] =
+ result_type;
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
+ CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
+
+ command->Run();
+}
+
+} // namespace unsubscribe_vehicle_data_response
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
index 481635d8e6..8df3d436bd 100644
--- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
@@ -38,7 +38,6 @@
#include "connection_handler/connection_handler.h"
#include "application_manager/application.h"
#include "utils/timer_task_impl.h"
-#include "utils/make_shared.h"
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -60,7 +59,7 @@ void AppLaunchCtrlImpl::OnAppRegistered(
const application_manager::Application& app) {
LOG4CXX_AUTO_TRACE(logger_);
// TODO (AKutsan) : get device mac
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
app.policy_app_id(), app.bundle_id(), app.mac_address());
apps_launcher_.OnLaunched(app_data);
app_launch_data_.AddApplicationData(*app_data);
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
index f3adfc749b..393b01c952 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_db.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
@@ -37,7 +37,6 @@
#include "application_manager/app_launch/app_launch_sql_queries.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/message_helper.h"
-#include "utils/make_shared.h"
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -276,7 +275,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataDB::GetAppDataByDevMac(
const std::string device_mac = query.GetString(device_mac_index);
const std::string mobile_app_id = query.GetString(application_id_index);
const std::string bundle_id = query.GetString(bundle_id_index);
- dev_apps.push_back(utils::MakeShared<ApplicationData>(
+ dev_apps.push_back(std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac));
} while (query.Next());
LOG4CXX_DEBUG(logger_, "All application data has been successfully loaded");
@@ -384,7 +383,7 @@ bool AppLaunchDataDB::WriteDb() {
utils::dbms::SQLDatabase* AppLaunchDataDB::db() const {
#ifdef __QNX__
- std::auto_ptr<utils::dbms::SQLDatabase> db_qnx(
+ std::unique_ptr<utils::dbms::SQLDatabase> db_qnx(
new utils::dbms::SQLDatabase(kDatabaseName));
db_qnx.get()->Open();
return db_qnx.get();
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
index 7599dcccb3..d3e3b7d445 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
@@ -33,7 +33,7 @@
#include "application_manager/app_launch/app_launch_data_json.h"
#include "application_manager/smart_object_keys.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "utils/date_time.h"
#include "json/json.h"
@@ -43,9 +43,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
AppLaunchDataJson::AppLaunchDataJson(const AppLaunchSettings& settings,
resumption::LastState& last_state)
- : AppLaunchDataImpl(settings)
- , app_launch_json_lock_(true)
- , last_state_(last_state) {}
+ : AppLaunchDataImpl(settings), last_state_(last_state) {}
AppLaunchDataJson::~AppLaunchDataJson() {}
@@ -133,7 +131,7 @@ bool AppLaunchDataJson::RefreshAppSessionTime(const ApplicationData& app_data) {
if (index != NotFound) {
if (json_data_list.empty() == false) {
json_data_list[index][strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+ static_cast<Json::Value::UInt64>(getSecs(getCurrentTime()));
retVal = true;
}
}
@@ -152,7 +150,7 @@ bool AppLaunchDataJson::AddNewAppData(const ApplicationData& app_data) {
json_app_data[strings::app_id] = app_data.mobile_app_id_;
json_app_data[strings::bundle_id] = app_data.bundle_id_;
json_app_data[strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+ static_cast<Json::Value::UInt64>(getSecs(getCurrentTime()));
LOG4CXX_DEBUG(logger_,
"New application data saved. Detatils device_id: "
@@ -185,7 +183,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac(
if (deviceMac == dev_mac) {
dev_apps.push_back(
- utils::MakeShared<ApplicationData>(appID, bundleID, deviceMac));
+ std::make_shared<ApplicationData>(appID, bundleID, deviceMac));
}
}
}
diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc
index bf3ce1e0a9..f3851482c1 100644
--- a/src/components/application_manager/src/app_launch/apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/apps_launcher.cc
@@ -1,6 +1,6 @@
#include <algorithm>
#include "application_manager/app_launch/apps_launcher.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include <iostream>
@@ -15,7 +15,7 @@ struct LauncherGenerator {
, app_launch_max_retry_attempt_(app_launch_max_retry_attempt)
, app_launch_retry_wait_time_(app_launch_retry_wait_time) {}
AppsLauncher::LauncherPtr operator()() {
- return utils::MakeShared<AppsLauncher::Launcher>(
+ return std::make_shared<AppsLauncher::Launcher>(
apps_laucnher_,
connection_handler_,
app_launch_max_retry_attempt_,
diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
index 0eb9245cf8..a4468d87bc 100644
--- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
@@ -6,8 +6,7 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch/apps_launcher.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/timer.h"
#include "utils/timer_task_impl.h"
#include <iostream>
@@ -16,7 +15,7 @@ namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
typedef std::pair<std::string, std::vector<ApplicationDataPtr> > AppsOnDevice;
-typedef utils::SharedPtr<AppsOnDevice> AppsOnDevicePtr;
+typedef std::shared_ptr<AppsOnDevice> AppsOnDevicePtr;
class Launcher {
public:
@@ -61,7 +60,7 @@ class Launcher {
} else {
LOG4CXX_DEBUG(logger_,
"All Apps on " << apps_on_device_->first
- << " posponed launched");
+ << " postponed launched");
device_launcher_.StopLaunchingAppsOnDevice(apps_on_device_->first);
}
}
@@ -95,7 +94,7 @@ class Launcher {
AppsOnDevicePtr apps_on_device_;
};
-typedef utils::SharedPtr<Launcher> LauncherPtr;
+typedef std::shared_ptr<Launcher> LauncherPtr;
typedef std::vector<LauncherPtr> Launchers;
struct LauncherGenerator {
@@ -107,8 +106,7 @@ struct LauncherGenerator {
, apps_launcher_(apps_launcher) {}
LauncherPtr operator()() const {
- return utils::MakeShared<Launcher>(
- resume_ctrl_, interface_, apps_launcher_);
+ return std::make_shared<Launcher>(resume_ctrl_, interface_, apps_launcher_);
}
resumption::ResumeCtrl& resume_ctrl_;
@@ -116,71 +114,59 @@ struct LauncherGenerator {
AppsLauncher& apps_launcher_;
};
-class DeviceAppsLauncherImpl {
- public:
- DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
- AppsLauncher& apps_launcher)
- : interface_(interface) {
- sync_primitives::AutoLock lock(launchers_lock_);
- LauncherGenerator generate(
- interface.app_mngr_.resume_controller(), interface, apps_launcher);
- free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
- std::generate_n(std::back_inserter(free_launchers_),
- interface.settings_.max_number_of_ios_device(),
- generate);
- }
-
- bool LaunchAppsOnDevice(
- const std::string& device_mac,
- const std::vector<ApplicationDataPtr>& applications_to_launch) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "On Device " << device_mac << " will be launched "
- << applications_to_launch.size() << " apps");
- AppsOnDevicePtr apps_on_device =
- utils::MakeShared<AppsOnDevice>(device_mac, applications_to_launch);
- sync_primitives::AutoLock lock(launchers_lock_);
- DCHECK_OR_RETURN(!free_launchers_.empty(), false)
- const Launchers::iterator it = free_launchers_.begin();
- LauncherPtr launcher = *it;
- works_launchers_.push_back(launcher);
- free_launchers_.erase(it);
- launcher->Start(apps_on_device);
- return true;
- }
+// DeviceAppsLauncherImpl member function definitions
+DeviceAppsLauncherImpl::DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher)
+ : interface_(interface) {
+ sync_primitives::AutoLock lock(launchers_lock_);
+ LauncherGenerator generate(
+ interface.app_mngr_.resume_controller(), interface, apps_launcher);
+ free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
+ std::generate_n(std::back_inserter(free_launchers_),
+ interface.settings_.max_number_of_ios_device(),
+ generate);
+}
- struct LauncherFinder {
- LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+bool DeviceAppsLauncherImpl::LauncherFinder::operator()(
+ const std::shared_ptr<Launcher>& launcher) const {
+ return device_mac_ == launcher->apps_on_device_->first;
+}
- bool operator()(const LauncherPtr& launcher) const {
- return device_mac_ == launcher->apps_on_device_->first;
- }
+bool DeviceAppsLauncherImpl::LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "On Device " << device_mac << " will be launched "
+ << applications_to_launch.size() << " apps");
+ AppsOnDevicePtr apps_on_device =
+ std::make_shared<AppsOnDevice>(device_mac, applications_to_launch);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ DCHECK_OR_RETURN(!free_launchers_.empty(), false)
+ const Launchers::iterator it = free_launchers_.begin();
+ LauncherPtr launcher = *it;
+ works_launchers_.push_back(launcher);
+ free_launchers_.erase(it);
+ launcher->Start(apps_on_device);
+ return true;
+}
- std::string device_mac_;
- };
-
- bool StopLaunchingAppsOnDevice(const std::string& device_mac) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(launchers_lock_);
- const Launchers::iterator it = std::find_if(works_launchers_.begin(),
- works_launchers_.end(),
- LauncherFinder(device_mac));
- if (it == works_launchers_.end()) {
- return false;
- }
- LauncherPtr launcher = *it;
- launcher->Clear();
- free_launchers_.push_back(launcher);
- works_launchers_.erase(it);
- return true;
+bool DeviceAppsLauncherImpl::StopLaunchingAppsOnDevice(
+ const std::string& device_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ const Launchers::iterator it = std::find_if(works_launchers_.begin(),
+ works_launchers_.end(),
+ LauncherFinder(device_mac));
+ if (it == works_launchers_.end()) {
+ return false;
}
-
- private:
- sync_primitives::Lock launchers_lock_;
- Launchers free_launchers_;
- Launchers works_launchers_;
- DeviceAppsLauncher& interface_;
-};
+ LauncherPtr launcher = *it;
+ launcher->Clear();
+ free_launchers_.push_back(launcher);
+ works_launchers_.erase(it);
+ return true;
+}
bool DeviceAppsLauncher::LaunchAppsOnDevice(
const std::string& device_mac,
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index a81540708c..0636748977 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -44,6 +44,7 @@ InitialApplicationDataImpl::InitialApplicationDataImpl()
, vr_synonyms_(NULL)
, tts_name_(NULL)
, ngn_media_screen_name_(NULL)
+
, language_(mobile_api::Language::INVALID_ENUM)
, ui_language_(mobile_api::Language::INVALID_ENUM) {}
@@ -102,6 +103,10 @@ const mobile_api::Language::eType& InitialApplicationDataImpl::ui_language()
return ui_language_;
}
+const utils::SemanticVersion& InitialApplicationDataImpl::msg_version() const {
+ return msg_version_;
+}
+
void InitialApplicationDataImpl::set_app_types(
const smart_objects::SmartObject& app_types) {
if (app_types_) {
@@ -152,6 +157,11 @@ void InitialApplicationDataImpl::set_ui_language(
ui_language_ = ui_language;
}
+void InitialApplicationDataImpl::set_msg_version(
+ const utils::SemanticVersion& version) {
+ msg_version_ = version;
+}
+
void InitialApplicationDataImpl::set_perform_interaction_layout(
mobile_apis::LayoutMode::eType layout) {
perform_interaction_layout_ = layout;
@@ -173,12 +183,18 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl()
, menu_title_(NULL)
, menu_icon_(NULL)
, tbt_show_command_(NULL)
+ , day_color_scheme_(NULL)
+ , night_color_scheme_(NULL)
+ , display_layout_("")
, commands_()
- , commands_lock_(true)
+ , commands_lock_ptr_(std::make_shared<sync_primitives::RecursiveLock>())
, sub_menu_()
+ , sub_menu_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, choice_set_map_()
+ , choice_set_map_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, performinteraction_choice_set_map_()
- , performinteraction_choice_set_lock_(true)
+ , performinteraction_choice_set_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, is_perform_interaction_active_(false)
, is_reset_global_properties_active_(false)
, perform_interaction_mode_(-1) {}
@@ -214,6 +230,16 @@ DynamicApplicationDataImpl::~DynamicApplicationDataImpl() {
tbt_show_command_ = NULL;
}
+ if (day_color_scheme_) {
+ delete day_color_scheme_;
+ day_color_scheme_ = NULL;
+ }
+
+ if (night_color_scheme_) {
+ delete night_color_scheme_;
+ night_color_scheme_ = NULL;
+ }
+
for (CommandsMap::iterator command_it = commands_.begin();
commands_.end() != command_it;
++command_it) {
@@ -290,6 +316,20 @@ const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon()
return menu_icon_;
}
+const smart_objects::SmartObject* DynamicApplicationDataImpl::day_color_scheme()
+ const {
+ return day_color_scheme_;
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::night_color_scheme() const {
+ return night_color_scheme_;
+}
+
+const std::string& DynamicApplicationDataImpl::display_layout() const {
+ return display_layout_;
+}
+
void DynamicApplicationDataImpl::load_global_properties(
const smart_objects::SmartObject& properties_so) {
SetGlobalProperties(properties_so.getElement(strings::vr_help_title),
@@ -405,10 +445,32 @@ void DynamicApplicationDataImpl::set_menu_icon(
menu_icon_ = new smart_objects::SmartObject(menu_icon);
}
+void DynamicApplicationDataImpl::set_day_color_scheme(
+ const smart_objects::SmartObject& color_scheme) {
+ if (day_color_scheme_) {
+ delete day_color_scheme_;
+ }
+
+ day_color_scheme_ = new smart_objects::SmartObject(color_scheme);
+}
+
+void DynamicApplicationDataImpl::set_night_color_scheme(
+ const smart_objects::SmartObject& color_scheme) {
+ if (night_color_scheme_) {
+ delete night_color_scheme_;
+ }
+
+ night_color_scheme_ = new smart_objects::SmartObject(color_scheme);
+}
+
+void DynamicApplicationDataImpl::set_display_layout(const std::string& layout) {
+ display_layout_ = layout;
+}
+
void DynamicApplicationDataImpl::SetGlobalProperties(
const smart_objects::SmartObject& param,
void (DynamicApplicationData::*callback)(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&)) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject&)) {
smart_objects::SmartType so_type = param.getType();
if (so_type != smart_objects::SmartType::SmartType_Invalid &&
so_type != smart_objects::SmartType::SmartType_Null) {
@@ -422,7 +484,7 @@ void DynamicApplicationDataImpl::SetGlobalProperties(
void DynamicApplicationDataImpl::AddCommand(
uint32_t cmd_id, const smart_objects::SmartObject& command) {
- sync_primitives::AutoLock lock(commands_lock_);
+ sync_primitives::AutoLock lock(commands_lock_ptr_);
CommandsMap::const_iterator it = commands_.find(cmd_id);
if (commands_.end() == it) {
commands_[cmd_id] = new smart_objects::SmartObject(command);
@@ -430,7 +492,7 @@ void DynamicApplicationDataImpl::AddCommand(
}
void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
- sync_primitives::AutoLock lock(commands_lock_);
+ sync_primitives::AutoLock lock(commands_lock_ptr_);
CommandsMap::iterator it = commands_.find(cmd_id);
if (commands_.end() != it) {
delete it->second;
@@ -440,7 +502,7 @@ void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
uint32_t cmd_id) {
- sync_primitives::AutoLock lock(commands_lock_);
+ sync_primitives::AutoLock lock(commands_lock_ptr_);
CommandsMap::const_iterator it = commands_.find(cmd_id);
if (it != commands_.end()) {
return it->second;
@@ -452,7 +514,7 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
// TODO(VS): Create common functions for processing collections
void DynamicApplicationDataImpl::AddSubMenu(
uint32_t menu_id, const smart_objects::SmartObject& menu) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
if (sub_menu_.end() == it) {
sub_menu_[menu_id] = new smart_objects::SmartObject(menu);
@@ -460,7 +522,7 @@ void DynamicApplicationDataImpl::AddSubMenu(
}
void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
SubMenuMap::iterator it = sub_menu_.find(menu_id);
if (sub_menu_.end() != it) {
@@ -471,7 +533,7 @@ void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
uint32_t menu_id) const {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
if (it != sub_menu_.end()) {
return it->second;
@@ -482,7 +544,7 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
const std::string& name) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
for (SubMenuMap::iterator it = sub_menu_.begin(); sub_menu_.end() != it;
++it) {
smart_objects::SmartObject* menu = it->second;
@@ -495,7 +557,7 @@ bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
void DynamicApplicationDataImpl::AddChoiceSet(
uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
+ sync_primitives::AutoLock lock(choice_set_map_lock_ptr_);
ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id);
if (choice_set_map_.end() == it) {
choice_set_map_[choice_set_id] = new smart_objects::SmartObject(choice_set);
@@ -503,7 +565,7 @@ void DynamicApplicationDataImpl::AddChoiceSet(
}
void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
+ sync_primitives::AutoLock lock(choice_set_map_lock_ptr_);
ChoiceSetMap::iterator it = choice_set_map_.find(choice_set_id);
if (choice_set_map_.end() != it) {
@@ -514,7 +576,7 @@ void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindChoiceSet(
uint32_t choice_set_id) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
+ sync_primitives::AutoLock lock(choice_set_map_lock_ptr_);
ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id);
if (it != choice_set_map_.end()) {
return it->second;
@@ -527,14 +589,14 @@ void DynamicApplicationDataImpl::AddPerformInteractionChoiceSet(
uint32_t correlation_id,
uint32_t choice_set_id,
const smart_objects::SmartObject& vr_commands) {
- sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
+ sync_primitives::AutoLock lock(performinteraction_choice_set_lock_ptr_);
performinteraction_choice_set_map_[correlation_id].insert(std::make_pair(
choice_set_id, new smart_objects::SmartObject(vr_commands)));
}
void DynamicApplicationDataImpl::DeletePerformInteractionChoiceSet(
uint32_t correlation_id) {
- sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
+ sync_primitives::AutoLock lock(performinteraction_choice_set_lock_ptr_);
PerformChoice::iterator it =
performinteraction_choice_set_map_[correlation_id].begin();
for (; performinteraction_choice_set_map_[correlation_id].end() != it; ++it) {
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index ac21219d7d..8a611195c7 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/gen_hash.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl.h"
@@ -72,7 +71,7 @@ mobile_apis::FileType::eType StringToFileType(const char* str) {
return mobile_apis::FileType::BINARY;
}
}
-}
+} // namespace
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
@@ -83,8 +82,8 @@ void SwitchApplicationParameters(ApplicationSharedPtr app,
const size_t device_id,
const std::string& mac_address) {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<ApplicationImpl> application =
- ApplicationSharedPtr::dynamic_pointer_cast<ApplicationImpl>(app);
+ std::shared_ptr<ApplicationImpl> application =
+ std::dynamic_pointer_cast<ApplicationImpl>(app);
DCHECK_OR_RETURN_VOID(application);
application->app_id_ = app_id;
application->device_id_ = device_id;
@@ -97,7 +96,7 @@ ApplicationImpl::ApplicationImpl(
const std::string& mac_address,
const connection_handler::DeviceHandle device_id,
const custom_str::CustomString& app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager)
: grammar_id_(0)
, hmi_app_id_(0)
@@ -105,6 +104,7 @@ ApplicationImpl::ApplicationImpl(
, active_message_(NULL)
, is_media_(false)
, is_navi_(false)
+ , is_remote_control_supported_(false)
, mobile_projection_enabled_(false)
, video_streaming_approved_(false)
, audio_streaming_approved_(false)
@@ -116,6 +116,7 @@ ApplicationImpl::ApplicationImpl(
, has_been_activated_(false)
, tts_properties_in_none_(false)
, tts_properties_in_full_(false)
+ , keep_context_(false)
, is_foreground_(false)
, is_application_data_changed_(false)
, put_file_in_none_count_(0)
@@ -123,11 +124,14 @@ ApplicationImpl::ApplicationImpl(
, list_files_in_none_count_(0)
, mac_address_(mac_address)
, device_id_(device_id)
+ , secondary_device_id_(0)
, usage_report_(mobile_app_id, statistics_manager)
+ , help_prompt_manager_impl_(*this, application_manager)
, protocol_version_(
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3)
, is_voice_communication_application_(false)
, is_resuming_(false)
+ , deferred_resumption_hmi_level_(mobile_api::HMILevel::eType::INVALID_ENUM)
, is_hash_changed_during_suspend_(false)
, video_stream_retry_number_(0)
, audio_stream_retry_number_(0)
@@ -139,11 +143,13 @@ ApplicationImpl::ApplicationImpl(
"AudioStreamSuspend",
new ::timer::TimerTaskImpl<ApplicationImpl>(
this, &ApplicationImpl::OnAudioStreamSuspend))
+ , vi_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , button_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, application_manager_(application_manager) {
cmd_number_to_time_limits_[mobile_apis::FunctionID::ReadDIDID] = {
- date_time::DateTime::getCurrentTime(), 0};
+ date_time::getCurrentTime(), 0};
cmd_number_to_time_limits_[mobile_apis::FunctionID::GetVehicleDataID] = {
- date_time::DateTime::getCurrentTime(), 0};
+ date_time::getCurrentTime(), 0};
set_mobile_app_id(mobile_app_id);
set_name(app_name);
@@ -168,7 +174,6 @@ ApplicationImpl::~ApplicationImpl() {
}
subscribed_buttons_.clear();
- subscribed_vehicle_info_.clear();
if (is_perform_interaction_active()) {
set_perform_interaction_active(0);
set_perform_interaction_mode(-1);
@@ -220,6 +225,14 @@ void ApplicationImpl::set_is_navi(bool allow) {
is_navi_ = allow;
}
+bool ApplicationImpl::is_remote_control_supported() const {
+ return is_remote_control_supported_;
+}
+
+void ApplicationImpl::set_remote_control_supported(const bool allow) {
+ is_remote_control_supported_ = allow;
+}
+
bool ApplicationImpl::is_voice_communication_supported() const {
return is_voice_communication_application_;
}
@@ -230,7 +243,26 @@ void ApplicationImpl::set_voice_communication_supported(
}
bool ApplicationImpl::IsAudioApplication() const {
- return is_media_ || is_voice_communication_application_ || is_navi_;
+ const bool is_audio_app =
+ is_media_application() || is_voice_communication_supported() || is_navi();
+ LOG4CXX_DEBUG(logger_,
+ std::boolalpha << "is audio app --> ((is_media_app: "
+ << is_media_application() << ")"
+ << " || (is_voice_communication_app: "
+ << is_voice_communication_supported() << ")"
+ << " || (is_navi: " << is_navi() << ")) --> "
+ << is_audio_app);
+ return is_audio_app;
+}
+
+bool ApplicationImpl::IsVideoApplication() const {
+ const bool is_video_app = is_navi() || mobile_projection_enabled();
+ LOG4CXX_DEBUG(logger_,
+ std::boolalpha
+ << "is video app --> ((is_navi: " << is_navi() << ")"
+ << " || (mobile_projection: " << mobile_projection_enabled()
+ << ")) --> " << is_video_app);
+ return is_video_app;
}
void ApplicationImpl::SetRegularState(HmiStatePtr state) {
@@ -283,6 +315,13 @@ const HmiStatePtr ApplicationImpl::RegularHmiState() const {
return state_.GetState(HmiState::STATE_ID_REGULAR);
}
+bool ApplicationImpl::IsAllowedToChangeAudioSource() const {
+ if (is_remote_control_supported() && is_media_application()) {
+ return true;
+ }
+ return false;
+}
+
const HmiStatePtr ApplicationImpl::PostponedHmiState() const {
return state_.GetState(HmiState::STATE_ID_POSTPONED);
}
@@ -360,6 +399,10 @@ connection_handler::DeviceHandle ApplicationImpl::device() const {
return device_id_;
}
+connection_handler::DeviceHandle ApplicationImpl::secondary_device() const {
+ return secondary_device_id_;
+}
+
const std::string& ApplicationImpl::mac_address() const {
return mac_address_;
}
@@ -396,6 +439,14 @@ bool ApplicationImpl::tts_properties_in_full() {
return tts_properties_in_full_;
}
+void ApplicationImpl::set_keep_context(bool keep_context) {
+ keep_context_ = keep_context;
+}
+
+bool ApplicationImpl::keep_context() {
+ return keep_context_;
+}
+
void ApplicationImpl::set_video_streaming_approved(bool state) {
video_streaming_approved_ = state;
}
@@ -473,6 +524,9 @@ void ApplicationImpl::StopStreamingForce(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // see the comment in StopStreaming()
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
SuspendStreaming(service_type);
if (service_type == ServiceType::kMobileNav) {
@@ -487,6 +541,12 @@ void ApplicationImpl::StopStreaming(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // since WakeUpStreaming() is called from another thread, it is possible that
+ // the stream will be restarted after we call SuspendStreaming() and before
+ // we call StopXxxStreaming(). To avoid such timing issue, make sure that
+ // we run SuspendStreaming() and StopXxxStreaming() atomically.
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
SuspendStreaming(service_type);
if (service_type == ServiceType::kMobileNav && video_streaming_approved()) {
@@ -537,6 +597,10 @@ void ApplicationImpl::WakeUpStreaming(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // See the comment in StopStreaming(). Also, please make sure that we acquire
+ // streaming_stop_lock_ then xxx_streaming_suspended_lock_ in this order!
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
if (ServiceType::kMobileNav == service_type) {
sync_primitives::AutoLock lock(video_streaming_suspended_lock_);
if (video_streaming_suspended_) {
@@ -616,8 +680,9 @@ void ApplicationImpl::set_app_allowed(const bool allowed) {
is_app_allowed_ = allowed;
}
-void ApplicationImpl::set_device(connection_handler::DeviceHandle device) {
- device_id_ = device;
+void ApplicationImpl::set_secondary_device(
+ connection_handler::DeviceHandle secondary_device) {
+ secondary_device_id_ = secondary_device;
}
uint32_t ApplicationImpl::get_grammar_id() const {
@@ -665,6 +730,16 @@ bool ApplicationImpl::is_resuming() const {
return is_resuming_;
}
+void ApplicationImpl::set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) {
+ deferred_resumption_hmi_level_ = level;
+}
+
+mobile_api::HMILevel::eType ApplicationImpl::deferred_resumption_hmi_level()
+ const {
+ return deferred_resumption_hmi_level_;
+}
+
bool ApplicationImpl::AddFile(const AppFile& file) {
if (app_files_.count(file.file_name) == 0) {
LOG4CXX_INFO(logger_,
@@ -712,13 +787,13 @@ const AppFile* ApplicationImpl::GetFile(const std::string& file_name) {
bool ApplicationImpl::SubscribeToButton(
mobile_apis::ButtonName::eType btn_name) {
- sync_primitives::AutoLock lock(button_lock_);
+ sync_primitives::AutoLock lock(button_lock_ptr_);
return subscribed_buttons_.insert(btn_name).second;
}
bool ApplicationImpl::IsSubscribedToButton(
mobile_apis::ButtonName::eType btn_name) {
- sync_primitives::AutoLock lock(button_lock_);
+ sync_primitives::AutoLock lock(button_lock_ptr_);
std::set<mobile_apis::ButtonName::eType>::iterator it =
subscribed_buttons_.find(btn_name);
return (subscribed_buttons_.end() != it);
@@ -726,38 +801,21 @@ bool ApplicationImpl::IsSubscribedToButton(
bool ApplicationImpl::UnsubscribeFromButton(
mobile_apis::ButtonName::eType btn_name) {
- sync_primitives::AutoLock lock(button_lock_);
+ sync_primitives::AutoLock lock(button_lock_ptr_);
return subscribed_buttons_.erase(btn_name);
}
-bool ApplicationImpl::SubscribeToIVI(uint32_t vehicle_info_type) {
- sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_
- .insert(
- static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type))
- .second;
-}
-
-bool ApplicationImpl::IsSubscribedToIVI(uint32_t vehicle_info_type) const {
- sync_primitives::AutoLock lock(vi_lock_);
- VehicleInfoSubscriptions::const_iterator it = subscribed_vehicle_info_.find(
- static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type));
- return (subscribed_vehicle_info_.end() != it);
-}
-
-bool ApplicationImpl::UnsubscribeFromIVI(uint32_t vehicle_info_type) {
- sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_.erase(
- static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type));
-}
-
UsageStatistics& ApplicationImpl::usage_report() {
return usage_report_;
}
+HelpPromptManager& ApplicationImpl::help_prompt_manager() {
+ return help_prompt_manager_impl_;
+}
+
bool ApplicationImpl::AreCommandLimitsExceeded(
mobile_apis::FunctionID::eType cmd_id, TLimitSource source) {
- TimevalStruct current = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current = date_time::getCurrentTime();
switch (source) {
// In case of config file values there is COMMON limitations for number of
// commands per certain time in seconds, i.e. 5 requests per 10 seconds with
@@ -789,13 +847,14 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
LOG4CXX_INFO(logger_,
"Time Info: "
- << "\n Current: " << current.tv_sec << "\n Limit: ("
- << limit.first.tv_sec << "," << limit.second
- << ")"
- "\n frequency_restrictions: ("
+ << "\n Current: " << date_time::getSecs(current)
+ << "\n Limit: (" << date_time::getSecs(limit.first)
+ << "," << limit.second << ")"
+ "\n frequency_restrictions: ("
<< frequency_restrictions.first << ","
<< frequency_restrictions.second << ")");
- if (current.tv_sec < limit.first.tv_sec + frequency_restrictions.second) {
+ if (date_time::getSecs(current) <
+ date_time::getSecs(limit.first) + frequency_restrictions.second) {
if (limit.second < frequency_restrictions.first) {
++limit.second;
return false;
@@ -837,7 +896,8 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
TimeToNumberLimit& limit = it->second;
// Checking even limitation for command
- if (static_cast<uint32_t>(current.tv_sec - limit.first.tv_sec) <
+ if (static_cast<uint32_t>(date_time::getSecs(current) -
+ date_time::getSecs(limit.first)) <
minute / cmd_limit) {
return true;
}
@@ -857,12 +917,8 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
}
DataAccessor<ButtonSubscriptions> ApplicationImpl::SubscribedButtons() const {
- return DataAccessor<ButtonSubscriptions>(subscribed_buttons_, button_lock_);
-}
-
-DataAccessor<VehicleInfoSubscriptions> ApplicationImpl::SubscribedIVI() const {
- return DataAccessor<VehicleInfoSubscriptions>(subscribed_vehicle_info_,
- vi_lock_);
+ return DataAccessor<ButtonSubscriptions>(subscribed_buttons_,
+ button_lock_ptr_);
}
const std::string& ApplicationImpl::curHash() const {
@@ -1040,8 +1096,6 @@ void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) {
}
}
-#ifdef SDL_REMOTE_CONTROL
-
void ApplicationImpl::set_system_context(
const mobile_api::SystemContext::eType& system_context) {
const HmiStatePtr hmi_state = CurrentHmiState();
@@ -1077,10 +1131,6 @@ void ApplicationImpl::set_hmi_level(
usage_report_.RecordHmiStateChanged(new_hmi_level);
}
-const VehicleInfoSubscriptions& ApplicationImpl::SubscribesIVI() const {
- return subscribed_vehicle_info_;
-}
-
AppExtensionPtr ApplicationImpl::QueryInterface(AppExtensionUID uid) {
std::list<AppExtensionPtr>::const_iterator it = extensions_.begin();
for (; it != extensions_.end(); ++it) {
@@ -1101,21 +1151,17 @@ bool ApplicationImpl::AddExtension(AppExtensionPtr extension) {
}
bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) {
- for (std::list<AppExtensionPtr>::iterator it = extensions_.begin();
- extensions_.end() != it;
- ++it) {
- if ((*it)->uid() == uid) {
- extensions_.erase(it);
- return true;
- }
- }
- return false;
+ auto it = std::find_if(
+ extensions_.begin(),
+ extensions_.end(),
+ [uid](AppExtensionPtr extension) { return extension->uid() == uid; });
+
+ return it != extensions_.end();
}
-void ApplicationImpl::RemoveExtensions() {
- application_manager_.GetPluginManager().RemoveAppExtension(app_id_);
+const std::list<AppExtensionPtr>& ApplicationImpl::Extensions() const {
+ return extensions_;
}
-#endif // SDL_REMOTE_CONTROL
void ApplicationImpl::PushMobileMessage(
smart_objects::SmartObjectSPtr mobile_message) {
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 248b54fee5..24f27af2e2 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -39,10 +39,11 @@
#include <bson_object.h>
#include "application_manager/application_manager_impl.h"
-#include "application_manager/mobile_command_factory.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service_impl.h"
+#include "application_manager/rpc_handler_impl.h"
#include "application_manager/mobile_message_handler.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/hmi_capabilities_impl.h"
@@ -51,6 +52,7 @@
#include "application_manager/app_launch/app_launch_data_db.h"
#include "application_manager/app_launch/app_launch_data_json.h"
#include "application_manager/helpers/application_helper.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h"
#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_handler.h"
#include "application_manager/command_holder_impl.h"
@@ -63,7 +65,6 @@
#include "utils/threads/thread.h"
#include "utils/file_system.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
#include "utils/timer_task_impl.h"
#include "smart_objects/enum_schema_item.h"
#include "interfaces/HMI_API_schema.h"
@@ -73,17 +74,11 @@
#include "utils/custom_string.h"
#include <time.h>
-#ifdef SDL_REMOTE_CONTROL
-#include "policy/usage_statistics/counter.h"
-#include "functional_module/plugin_manager.h"
-#include "application_manager/core_service.h"
-#endif // SDL_REMOTE_CONTROL
-
namespace {
int get_rand_from_range(uint32_t from = 0, int to = RAND_MAX) {
return std::rand() % to + from;
}
-}
+} // namespace
namespace application_manager {
@@ -97,7 +92,13 @@ DeviceTypes devicesType = {
hmi_apis::Common_TransportType::BLUETOOTH),
std::make_pair(std::string("BLUETOOTH_IOS"),
hmi_apis::Common_TransportType::BLUETOOTH),
- std::make_pair(std::string("WIFI"), hmi_apis::Common_TransportType::WIFI)};
+ std::make_pair(std::string("WIFI"), hmi_apis::Common_TransportType::WIFI),
+ std::make_pair(std::string("USB_IOS_HOST_MODE"),
+ hmi_apis::Common_TransportType::USB_IOS),
+ std::make_pair(std::string("USB_IOS_DEVICE_MODE"),
+ hmi_apis::Common_TransportType::USB_IOS),
+ std::make_pair(std::string("CARPLAY_WIRELESS_IOS"),
+ hmi_apis::Common_TransportType::WIFI)};
}
/**
@@ -132,20 +133,21 @@ bool policy_app_id_comparator(const std::string& policy_app_id,
uint32_t ApplicationManagerImpl::corelation_id_ = 0;
const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
ApplicationManagerImpl::ApplicationManagerImpl(
const ApplicationManagerSettings& am_settings,
const policy::PolicySettings& policy_settings)
: settings_(am_settings)
- , applications_list_lock_(true)
+ , applications_list_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
+ , apps_to_register_list_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, audio_pass_thru_active_(false)
, audio_pass_thru_app_id_(0)
- , driver_distraction_state_(
- hmi_apis::Common_DriverDistractionState::INVALID_ENUM)
+ , driver_distraction_state_(hmi_apis::Common_DriverDistractionState::DD_OFF)
, is_vr_session_strated_(false)
, hmi_cooperating_(false)
, is_all_apps_allowed_(true)
@@ -157,22 +159,13 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, request_ctrl_(am_settings)
, hmi_so_factory_(NULL)
, mobile_so_factory_(NULL)
- , messages_from_mobile_("AM FromMobile", this)
- , messages_to_mobile_("AM ToMobile", this)
- , messages_from_hmi_("AM FromHMI", this)
- , messages_to_hmi_("AM ToHMI", this)
- , audio_pass_thru_messages_("AudioPassThru", this)
, hmi_capabilities_(new HMICapabilitiesImpl(*this))
, unregister_reason_(
mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM)
, resume_ctrl_(new resumption::ResumeCtrlImpl(*this))
, navi_close_app_timeout_(am_settings.stop_streaming_timeout())
, navi_end_stream_timeout_(am_settings.stop_streaming_timeout())
- , stopping_application_mng_lock_(true)
, state_ctrl_(*this)
-#ifdef TELEMETRY_MONITOR
- , metric_observer_(NULL)
-#endif // TELEMETRY_MONITOR
, application_list_update_timer_(
"AM ListUpdater",
new TimerTaskImpl<ApplicationManagerImpl>(
@@ -184,7 +177,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, is_low_voltage_(false)
, apps_size_(0)
, is_stopping_(false) {
- std::srand(std::time(0));
+ std::srand(std::time(nullptr));
AddPolicyObserver(this);
dir_type_to_string_map_ = {{TYPE_STORAGE, "Storage"},
@@ -192,14 +185,20 @@ ApplicationManagerImpl::ApplicationManagerImpl(
{TYPE_ICONS, "Icons"}};
sync_primitives::AutoLock lock(timer_pool_lock_);
- TimerSPtr clearing_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr clearing_timer(std::make_shared<timer::Timer>(
"ClearTimerPoolTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::ClearTimerPool)));
const uint32_t timeout_ms = 10000u;
clearing_timer->Start(timeout_ms, timer::kSingleShot);
timer_pool_.push_back(clearing_timer);
+ rpc_handler_.reset(new rpc_handler::RPCHandlerImpl(*this));
commands_holder_.reset(new CommandHolderImpl(*this));
+ rpc_service_.reset(new rpc_service::RPCServiceImpl(*this,
+ request_ctrl_,
+ protocol_handler_,
+ hmi_handler_,
+ *commands_holder_));
}
ApplicationManagerImpl::~ApplicationManagerImpl() {
@@ -227,10 +226,13 @@ ApplicationManagerImpl::~ApplicationManagerImpl() {
navi_app_to_stop_.clear();
navi_app_to_end_stream_.clear();
+
+ secondary_transport_devices_cache_.clear();
}
DataAccessor<ApplicationSet> ApplicationManagerImpl::applications() const {
- DataAccessor<ApplicationSet> accessor(applications_, applications_list_lock_);
+ DataAccessor<ApplicationSet> accessor(applications_,
+ applications_list_lock_ptr_);
return accessor;
}
@@ -352,8 +354,7 @@ struct IsApplication {
connection_handler::DeviceHandle device_handle_;
const std::string& policy_app_id_;
};
-
-std::vector<ApplicationSharedPtr> ApplicationManagerImpl::IviInfoUpdated(
+void ApplicationManagerImpl::IviInfoUpdated(
mobile_apis::VehicleDataType::eType vehicle_info, int value) {
// Notify Policy Manager if available about info it's interested in,
// i.e. odometer etc
@@ -364,19 +365,21 @@ std::vector<ApplicationSharedPtr> ApplicationManagerImpl::IviInfoUpdated(
default:
break;
}
-
- SubscribedToIVIPredicate finder(vehicle_info);
- DataAccessor<ApplicationSet> accessor = applications();
- return FindAllApps(accessor, finder);
}
void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- sync_primitives::AutoLock lock(applications_list_lock_);
+ sync_primitives::AutoLock lock(applications_list_lock_ptr_);
const mobile_apis::HMILevel::eType default_level = GetDefaultHmiLevel(app);
state_ctrl_.OnApplicationRegistered(app, default_level);
+ std::function<void(plugin_manager::RPCPlugin&)> on_app_registered =
+ [app](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationRegistered, app);
+ };
+ plugin_manager_->ForEachPlugin(on_app_registered);
+
// TODO(AOleynik): Is neccessary to be able to know that registration process
// has been completed and default HMI level is set, otherwise policy will
// block all the requests/notifications to mobile
@@ -401,13 +404,14 @@ void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) {
bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
ApplicationConstSharedPtr app) const {
+ LOG4CXX_AUTO_TRACE(logger_);
bool voice_state = app->is_voice_communication_supported();
bool media_state = app->is_media_application();
bool navi_state = app->is_navi();
bool mobile_projection_state = app->mobile_projection_enabled();
ApplicationSharedPtr active_app = active_application();
// Check app in FULL level
- if (active_app.valid()) {
+ if (active_app.use_count() != 0) {
// If checking app hmi level FULL, we return false
// because we couldn't have two applications with same HMIType in FULL and
// LIMITED HMI level
@@ -434,28 +438,28 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
// Check LIMITED apps
if (voice_state) {
- if (get_limited_voice_application().valid() &&
+ if ((get_limited_voice_application().use_count() != 0) &&
(get_limited_voice_application()->app_id() != app->app_id())) {
return true;
}
}
if (media_state) {
- if (get_limited_media_application().valid() &&
+ if ((get_limited_media_application().use_count() != 0) &&
(get_limited_media_application()->app_id() != app->app_id())) {
return true;
}
}
if (navi_state) {
- if (get_limited_navi_application().valid() &&
+ if ((get_limited_navi_application().use_count() != 0) &&
(get_limited_navi_application()->app_id() != app->app_id())) {
return true;
}
}
if (mobile_projection_state) {
- if (get_limited_mobile_projection_application().valid() &&
+ if ((get_limited_mobile_projection_application().use_count() != 0) &&
(get_limited_mobile_projection_application()->app_id() !=
app->app_id())) {
return true;
@@ -466,7 +470,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
}
ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
- const utils::SharedPtr<smart_objects::SmartObject>&
+ const std::shared_ptr<smart_objects::SmartObject>&
request_for_registration) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -484,18 +488,19 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
if (connection_handler().get_session_observer().GetDataOnSessionKey(
connection_key, &app_id, &sessions_list, &device_id) == -1) {
LOG4CXX_ERROR(logger_, "Failed to create application: no connection info.");
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
message[strings::params][strings::correlation_id].asUInt(),
mobile_apis::Result::GENERIC_ERROR));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL);
return ApplicationSharedPtr();
}
smart_objects::SmartObject& params = message[strings::msg_params];
- const std::string& policy_app_id = params[strings::app_id].asString();
+ const std::string& policy_app_id =
+ GetCorrectMobileIDFromMessage(request_for_registration);
const custom_str::CustomString& app_name =
message[strings::msg_params][strings::app_name].asCustomString();
std::string device_mac;
@@ -516,13 +521,13 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
if (!is_all_apps_allowed_) {
LOG4CXX_WARN(logger_,
"RegisterApplication: access to app's disabled by user");
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
message[strings::params][strings::correlation_id].asUInt(),
mobile_apis::Result::DISALLOWED));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL);
return ApplicationSharedPtr();
}
@@ -535,20 +540,21 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
GetPolicyHandler().GetStatisticManager(),
*this));
if (!application) {
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
message[strings::params][strings::correlation_id].asUInt(),
mobile_apis::Result::OUT_OF_MEMORY));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL);
return ApplicationSharedPtr();
}
HmiStatePtr initial_state =
- CreateRegularState(utils::SharedPtr<Application>(application),
+ CreateRegularState(std::shared_ptr<Application>(application),
mobile_apis::HMILevel::INVALID_ENUM,
mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_apis::VideoStreamingState::INVALID_ENUM,
mobile_api::SystemContext::SYSCTXT_MAIN);
application->SetInitialState(initial_state);
@@ -601,13 +607,13 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
}
// Keep HMI add id in case app is present in "waiting for registration" list
- apps_to_register_list_lock_.Acquire();
+ apps_to_register_list_lock_ptr_->Acquire();
AppsWaitRegistrationSet::iterator it = apps_to_register_.find(application);
if (apps_to_register_.end() != it) {
application->set_hmi_application_id((*it)->hmi_app_id());
apps_to_register_.erase(application);
}
- apps_to_register_list_lock_.Release();
+ apps_to_register_list_lock_ptr_->Release();
if (!application->hmi_app_id()) {
const bool is_saved =
@@ -623,7 +629,12 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
const std::string& bundle_id = app_info[strings::bundle_id].asString();
application->set_bundle_id(bundle_id);
}
- PutDriverDistractionMessageToPostponed(application);
+
+ const std::string app_icon_dir(settings_.app_icons_folder());
+ const std::string full_icon_path(app_icon_dir + "/" + policy_app_id);
+ if (file_system::FileExists(full_icon_path)) {
+ application->set_app_icon_path(full_icon_path);
+ }
// Stops timer of saving data to resumption in order to
// doesn't erase data from resumption storage.
@@ -633,23 +644,25 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
// Add application to registered app list and set appropriate mark.
// Lock has to be released before adding app to policy DB to avoid possible
// deadlock with simultaneous PTU processing
- applications_list_lock_.Acquire();
+ applications_list_lock_ptr_->Acquire();
application->MarkRegistered();
applications_.insert(application);
apps_size_ = applications_.size();
- applications_list_lock_.Release();
+ applications_list_lock_ptr_->Release();
- return application;
-}
-
-DEPRECATED bool ApplicationManagerImpl::RemoveAppDataFromHMI(
- ApplicationSharedPtr app) {
- return true;
-}
+ // It is possible that secondary transport of this app has been already
+ // established. Make sure that the information is reflected to application
+ // instance.
+ // Also, make sure that this is done *after* we updated applications_ list to
+ // avoid timing issues.
+ DeviceMap::iterator itr =
+ secondary_transport_devices_cache_.find(connection_key);
+ if (secondary_transport_devices_cache_.end() != itr) {
+ connection_handler::DeviceHandle secondary_device_handle = itr->second;
+ application->set_secondary_device(secondary_device_handle);
+ }
-DEPRECATED bool ApplicationManagerImpl::LoadAppDataToHMI(
- ApplicationSharedPtr app) {
- return true;
+ return application;
}
bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
@@ -657,13 +670,18 @@ bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(app, false);
+ LOG4CXX_DEBUG(logger_, "Activating application with id:" << app->app_id());
+
// remove from resumption if app was activated by user
resume_controller().OnAppActivated(app);
- HMILevel::eType hmi_level = HMILevel::HMI_FULL;
- AudioStreamingState::eType audio_state;
- app->IsAudioApplication() ? audio_state = AudioStreamingState::AUDIBLE
- : audio_state = AudioStreamingState::NOT_AUDIBLE;
- state_ctrl_.SetRegularState(app, hmi_level, audio_state, false);
+ const HMILevel::eType hmi_level = HMILevel::HMI_FULL;
+ const AudioStreamingState::eType audio_state =
+ app->IsAudioApplication() ? AudioStreamingState::AUDIBLE
+ : AudioStreamingState::NOT_AUDIBLE;
+ const VideoStreamingState::eType video_state =
+ app->IsVideoApplication() ? VideoStreamingState::STREAMABLE
+ : VideoStreamingState::NOT_STREAMABLE;
+ state_ctrl_.SetRegularState(app, hmi_level, audio_state, video_state, false);
return true;
}
@@ -675,10 +693,10 @@ mobile_api::HMILevel::eType ApplicationManagerImpl::IsHmiLevelFullAllowed(
NOTREACHED();
return mobile_api::HMILevel::INVALID_ENUM;
}
- bool is_audio_app = app->IsAudioApplication();
- bool does_audio_app_with_same_type_exist =
+ const bool is_audio_app = app->IsAudioApplication();
+ const bool does_audio_app_with_same_type_exist =
IsAppTypeExistsInFullOrLimited(app);
- bool is_active_app_exist = active_application().valid();
+ const bool is_active_app_exist = (active_application().use_count() != 0);
mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL;
if (is_audio_app && does_audio_app_with_same_type_exist) {
@@ -720,48 +738,46 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() {
hmi_cooperating_ = true;
MessageHelper::SendGetSystemInfoRequest(*this);
- utils::SharedPtr<smart_objects::SmartObject> is_vr_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_vr_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady,
*this));
- ManageHMICommand(is_vr_ready);
+ rpc_service_->ManageHMICommand(is_vr_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_tts_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_tts_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady,
*this));
- ManageHMICommand(is_tts_ready);
+ rpc_service_->ManageHMICommand(is_tts_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_ui_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_ui_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady,
*this));
- ManageHMICommand(is_ui_ready);
+ rpc_service_->ManageHMICommand(is_ui_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_navi_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_navi_ready(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Navigation_IsReady, *this));
- ManageHMICommand(is_navi_ready);
+ rpc_service_->ManageHMICommand(is_navi_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_ivi_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_ivi_ready(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::VehicleInfo_IsReady, *this));
- ManageHMICommand(is_ivi_ready);
+ rpc_service_->ManageHMICommand(is_ivi_ready);
-#ifdef SDL_REMOTE_CONTROL
- utils::SharedPtr<smart_objects::SmartObject> is_rc_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_rc_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady,
*this));
- ManageHMICommand(is_rc_ready);
-#endif
+ rpc_service_->ManageHMICommand(is_rc_ready);
- utils::SharedPtr<smart_objects::SmartObject> button_capabilities(
+ std::shared_ptr<smart_objects::SmartObject> button_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Buttons_GetCapabilities, *this));
- ManageHMICommand(button_capabilities);
+ rpc_service_->ManageHMICommand(button_capabilities);
- utils::SharedPtr<smart_objects::SmartObject> mixing_audio_supported_request(
+ std::shared_ptr<smart_objects::SmartObject> mixing_audio_supported_request(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
*this));
- ManageHMICommand(mixing_audio_supported_request);
+ rpc_service_->ManageHMICommand(mixing_audio_supported_request);
resume_controller().ResetLaunchTime();
}
@@ -775,16 +791,6 @@ uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() {
return corelation_id_;
}
-bool ApplicationManagerImpl::BeginAudioPassThrough() {
- sync_primitives::AutoLock lock(audio_pass_thru_lock_);
- if (audio_pass_thru_active_) {
- return false;
- } else {
- audio_pass_thru_active_ = true;
- return true;
- }
-}
-
bool ApplicationManagerImpl::BeginAudioPassThru(uint32_t app_id) {
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
if (audio_pass_thru_active_) {
@@ -796,16 +802,6 @@ bool ApplicationManagerImpl::BeginAudioPassThru(uint32_t app_id) {
}
}
-bool ApplicationManagerImpl::EndAudioPassThrough() {
- sync_primitives::AutoLock lock(audio_pass_thru_lock_);
- if (audio_pass_thru_active_) {
- audio_pass_thru_active_ = false;
- return true;
- } else {
- return false;
- }
-}
-
bool ApplicationManagerImpl::EndAudioPassThru(uint32_t app_id) {
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
if (audio_pass_thru_active_ && audio_pass_thru_app_id_ == app_id) {
@@ -827,45 +823,24 @@ void ApplicationManagerImpl::set_driver_distraction_state(
driver_distraction_state_ = state;
}
-DEPRECATED void ApplicationManagerImpl::set_vr_session_started(
- const bool state) {
- is_vr_session_strated_ = state;
-}
-
void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) {
is_all_apps_allowed_ = allowed;
}
HmiStatePtr ApplicationManagerImpl::CreateRegularState(
- utils::SharedPtr<Application> app,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context) const {
HmiStatePtr state(new HmiState(app, *this));
state->set_hmi_level(hmi_level);
state->set_audio_streaming_state(audio_state);
+ state->set_video_streaming_state(video_state);
state->set_system_context(system_context);
return state;
}
-HmiStatePtr ApplicationManagerImpl::CreateRegularState(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) const {
- HmiStatePtr state(new HmiState(app_id, *this));
- state->set_hmi_level(hmi_level);
- state->set_audio_streaming_state(audio_state);
- state->set_system_context(system_context);
- return state;
-}
-
-bool ApplicationManagerImpl::IsStateActive(HmiState::StateID state_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Checking for active state id " << state_id);
- return state_ctrl_.IsStateActive(state_id);
-}
-
void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
int32_t correlation_id,
int32_t max_duration,
@@ -879,23 +854,6 @@ void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
session_key, get_settings().recording_file_name(), max_duration);
}
-void ApplicationManagerImpl::SendAudioPassThroughNotification(
- uint32_t session_key, std::vector<uint8_t>& binary_data) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!audio_pass_thru_active_) {
- LOG4CXX_ERROR(logger_,
- "Trying to send PassThroughNotification"
- " when PassThrough is not active");
- return;
- }
-
- impl::AudioData data;
- data.session_key = session_key;
- data.binary_data = binary_data;
- audio_pass_thru_messages_.PostMessage(data);
-}
-
void ApplicationManagerImpl::StopAudioPassThru(int32_t application_key) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
@@ -933,43 +891,6 @@ ApplicationManagerImpl::GetDeviceTransportType(
return result;
}
-void ApplicationManagerImpl::OnMessageReceived(
- const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- utils::SharedPtr<Message> outgoing_message = ConvertRawMsgToMessage(message);
-
- if (outgoing_message) {
- LOG4CXX_DEBUG(logger_, "Posting new Message");
- messages_from_mobile_.PostMessage(
- impl::MessageFromMobile(outgoing_message));
- }
-}
-
-void ApplicationManagerImpl::OnMobileMessageSent(
- const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-void ApplicationManagerImpl::OnMessageReceived(
- hmi_message_handler::MessageSharedPointer message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- messages_from_hmi_.PostMessage(impl::MessageFromHmi(message));
-}
-
ApplicationConstSharedPtr ApplicationManagerImpl::WaitingApplicationByID(
const uint32_t hmi_id) const {
AppsWaitRegistrationSet app_list = AppsWaitingForRegistration().GetData();
@@ -988,12 +909,12 @@ ApplicationConstSharedPtr ApplicationManagerImpl::WaitingApplicationByID(
DataAccessor<AppsWaitRegistrationSet>
ApplicationManagerImpl::AppsWaitingForRegistration() const {
return DataAccessor<AppsWaitRegistrationSet>(apps_to_register_,
- apps_to_register_list_lock_);
+ apps_to_register_list_lock_ptr_);
}
bool ApplicationManagerImpl::IsAppsQueriedFrom(
const connection_handler::DeviceHandle handle) const {
- sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
AppsWaitRegistrationSet::iterator it = apps_to_register_.begin();
AppsWaitRegistrationSet::const_iterator it_end = apps_to_register_.end();
for (; it != it_end; ++it) {
@@ -1012,9 +933,25 @@ const ApplicationManagerSettings& ApplicationManagerImpl::get_settings() const {
return settings_;
}
+// Extract the app ID to use for policy based on the UseFullAppID .ini setting
+std::string ApplicationManagerImpl::GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const {
+ // If core is expecting a fullAppID
+ if (get_settings().use_full_app_id()) {
+ // fullAppID is present and core is configured to use it
+ if ((*message)[strings::msg_params].keyExists(strings::full_app_id)) {
+ return (*message)[strings::msg_params][strings::full_app_id].asString();
+ } else {
+ LOG4CXX_DEBUG(logger_, "UseFullAppID is on but only short ID given!");
+ }
+ }
+ // If core isn't using full or no full given, use regular appID
+ return (*message)[strings::msg_params][strings::app_id].asString();
+}
+
void application_manager::ApplicationManagerImpl::MarkAppsGreyOut(
const connection_handler::DeviceHandle handle, bool is_greyed_out) {
- sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
AppsWaitRegistrationSet::iterator it = apps_to_register_.begin();
AppsWaitRegistrationSet::const_iterator it_end = apps_to_register_.end();
for (; it != it_end; ++it) {
@@ -1023,10 +960,6 @@ void application_manager::ApplicationManagerImpl::MarkAppsGreyOut(
}
}
}
-void ApplicationManagerImpl::OnErrorSending(
- hmi_message_handler::MessageSharedPointer message) {
- return;
-}
void ApplicationManagerImpl::OnDeviceListUpdated(
const connection_handler::DeviceMap& device_list) {
@@ -1058,7 +991,8 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
return;
}
- smart_objects::SmartObjectSPtr update_list = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr update_list =
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& so_to_send = *update_list;
so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] =
hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList;
@@ -1068,7 +1002,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_TYPE] = 1;
so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
- ManageHMICommand(update_list);
+ rpc_service_->ManageHMICommand(update_list);
}
void ApplicationManagerImpl::OnFindNewApplicationsRequest() {
@@ -1097,7 +1031,7 @@ void ApplicationManagerImpl::SendUpdateAppList() {
PrepareApplicationListSO(applications_, applications, *this);
PrepareApplicationListSO(apps_to_register_, applications, *this);
- ManageHMICommand(request);
+ rpc_service_->ManageHMICommand(request);
}
void ApplicationManagerImpl::RemoveDevice(
@@ -1145,7 +1079,7 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart(
return;
}
- auto update_list = utils::MakeShared<smart_objects::SmartObject>();
+ auto update_list = std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& so_to_send = *update_list;
so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] =
hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList;
@@ -1155,7 +1089,7 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart(
so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_TYPE] = 1;
so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
- ManageHMICommand(update_list);
+ rpc_service_->ManageHMICommand(update_list);
}
void ApplicationManagerImpl::OnDeviceSwitchingFinish(
@@ -1184,7 +1118,7 @@ void ApplicationManagerImpl::SwitchApplication(ApplicationSharedPtr app,
const std::string& mac_address) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- sync_primitives::AutoLock lock(applications_list_lock_);
+ sync_primitives::AutoLock lock(applications_list_lock_ptr_);
DCHECK_OR_RETURN_VOID(1 == applications_.erase(app));
LOG4CXX_DEBUG(logger_,
@@ -1192,7 +1126,14 @@ void ApplicationManagerImpl::SwitchApplication(ApplicationSharedPtr app,
<< ". Changing device id to "
<< device_id);
+ bool is_subscribed_to_way_points = IsAppSubscribedForWayPoints(app);
+ if (is_subscribed_to_way_points) {
+ UnsubscribeAppFromWayPoints(app);
+ }
SwitchApplicationParameters(app, connection_key, device_id, mac_address);
+ if (is_subscribed_to_way_points) {
+ SubscribeAppForWayPoints(app);
+ }
// Normally this is done during registration, however since switched apps are
// not being registered again need to set protocol version on session.
@@ -1235,127 +1176,95 @@ mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
return default_hmi;
}
-uint32_t ApplicationManagerImpl::GenerateGrammarID() {
- return rand();
-}
-
-uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
+bool ApplicationManagerImpl::CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const {
+ using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
- uint32_t hmi_app_id = get_rand_from_range(1);
- LOG4CXX_DEBUG(logger_, "GenerateNewHMIAppID value is: " << hmi_app_id);
- while (resume_controller().IsHMIApplicationIdExist(hmi_app_id)) {
- LOG4CXX_DEBUG(logger_, "HMI appID " << hmi_app_id << " is exists.");
- hmi_app_id = get_rand_from_range(1);
- LOG4CXX_DEBUG(logger_, "Trying new value: " << hmi_app_id);
- }
+ const std::map<std::string, std::vector<std::string> >& transport_map =
+ get_settings().transport_required_for_resumption_map();
- return hmi_app_id;
-}
+ // retrieve transport type string used in .ini file
+ const std::string transport_type =
+ GetTransportTypeProfileString(application->device());
+ const std::string secondary_transport_type =
+ GetTransportTypeProfileString(application->secondary_device());
-void ApplicationManagerImpl::ReplaceMobileByHMIAppId(
- smart_objects::SmartObject& message) {
- MessageHelper::PrintSmartObject(message);
- if (message.keyExists(strings::app_id)) {
- ApplicationSharedPtr application_ptr =
- application(message[strings::app_id].asUInt());
- if (application_ptr.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceMobileByHMIAppId from "
- << message[strings::app_id].asInt() << " to "
- << application_ptr->hmi_app_id());
- message[strings::app_id] = application_ptr->hmi_app_id();
- }
- } else {
- switch (message.getType()) {
- case smart_objects::SmartType::SmartType_Array: {
- smart_objects::SmartArray* message_array = message.asArray();
- smart_objects::SmartArray::iterator it = message_array->begin();
- for (; it != message_array->end(); ++it) {
- ReplaceMobileByHMIAppId(*it);
- }
- break;
- }
- case smart_objects::SmartType::SmartType_Map: {
- std::set<std::string> keys = message.enumerate();
- std::set<std::string>::const_iterator key = keys.begin();
- for (; key != keys.end(); ++key) {
- std::string k = *key;
- ReplaceMobileByHMIAppId(message[*key]);
- }
- break;
- }
- default: { break; }
+ const smart_objects::SmartObject* app_types_array = application->app_types();
+ if (app_types_array == NULL || app_types_array->length() == 0) {
+ // This app does not have any AppHMIType. In this case, check "EMPTY_APP"
+ // entry
+ std::map<std::string, std::vector<std::string> >::const_iterator it =
+ transport_map.find(std::string("EMPTY_APP"));
+ if (it == transport_map.end()) {
+ // if "EMPTY_APP" is not specified, resumption is always enabled
+ return true;
}
- }
-}
+ const std::vector<std::string>& required_transport_list = it->second;
-void ApplicationManagerImpl::ReplaceHMIByMobileAppId(
- smart_objects::SmartObject& message) {
- if (message.keyExists(strings::app_id)) {
- ApplicationSharedPtr application =
- application_by_hmi_app(message[strings::app_id].asUInt());
-
- if (application.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceHMIByMobileAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->app_id());
- message[strings::app_id] = application->app_id();
+ for (std::vector<std::string>::const_iterator itr =
+ required_transport_list.begin();
+ itr != required_transport_list.end();
+ ++itr) {
+ if (transport_type == *itr || secondary_transport_type == *itr) {
+ return true;
+ }
}
+ return false;
} else {
- switch (message.getType()) {
- case smart_objects::SmartType::SmartType_Array: {
- smart_objects::SmartArray* message_array = message.asArray();
- smart_objects::SmartArray::iterator it = message_array->begin();
- for (; it != message_array->end(); ++it) {
- ReplaceHMIByMobileAppId(*it);
- }
- break;
+ // check all AppHMITypes that the app has
+ for (size_t i = 0; i < app_types_array->length(); i++) {
+ const std::string app_type_string =
+ AppHMITypeToString(static_cast<mobile_apis::AppHMIType::eType>(
+ app_types_array->getElement(i).asUInt()));
+ bool transport_is_found = false;
+
+ std::map<std::string, std::vector<std::string> >::const_iterator it =
+ transport_map.find(app_type_string);
+ if (it == transport_map.end()) {
+ // this AppHMIType is not listed in .ini file, so resumption is always
+ // enabled
+ continue;
}
- case smart_objects::SmartType::SmartType_Map: {
- std::set<std::string> keys = message.enumerate();
- std::set<std::string>::const_iterator key = keys.begin();
- for (; key != keys.end(); ++key) {
- ReplaceHMIByMobileAppId(message[*key]);
+
+ const std::vector<std::string>& required_transport_list = it->second;
+ for (std::vector<std::string>::const_iterator itr =
+ required_transport_list.begin();
+ itr != required_transport_list.end();
+ ++itr) {
+ if (transport_type == *itr || secondary_transport_type == *itr) {
+ transport_is_found = true;
+ break;
}
- break;
}
- default: { break; }
- }
- }
-}
-
-bool ApplicationManagerImpl::StartNaviService(
- uint32_t app_id, protocol_handler::ServiceType service_type) {
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
- if (HMILevelAllowsStreaming(app_id, service_type)) {
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it) {
- std::pair<NaviServiceStatusMap::iterator, bool> res =
- navi_service_status_.insert(
- std::pair<uint32_t, std::pair<bool, bool> >(
- app_id, std::make_pair(false, false)));
- if (!res.second) {
- LOG4CXX_WARN(logger_, "Navi service refused");
+ // if neither primary or secondary transport type is included in the list,
+ // then resumption will be disabled
+ if (!transport_is_found) {
return false;
}
- it = res.first;
}
- // Fill NaviServices map. Set true to first value of pair if
- // we've started video service or to second value if we've
- // started audio service
- service_type == ServiceType::kMobileNav ? it->second.first = true
- : it->second.second = true;
- application(app_id)->StartStreaming(service_type);
return true;
- } else {
- LOG4CXX_WARN(logger_, "Refused navi service by HMI level");
}
- return false;
+}
+
+uint32_t ApplicationManagerImpl::GenerateGrammarID() {
+ return rand();
+}
+
+uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t hmi_app_id = get_rand_from_range(1);
+ LOG4CXX_DEBUG(logger_, "GenerateNewHMIAppID value is: " << hmi_app_id);
+
+ while (resume_controller().IsHMIApplicationIdExist(hmi_app_id)) {
+ LOG4CXX_DEBUG(logger_, "HMI appID " << hmi_app_id << " is exists.");
+ hmi_app_id = get_rand_from_range(1);
+ LOG4CXX_DEBUG(logger_, "Trying new value: " << hmi_app_id);
+ }
+
+ return hmi_app_id;
}
bool ApplicationManagerImpl::StartNaviService(
@@ -1403,9 +1312,7 @@ bool ApplicationManagerImpl::StartNaviService(
return false;
} else if (!converted_params.empty()) {
LOG4CXX_INFO(logger_, "Sending video configuration params");
-#ifdef DEBUG
MessageHelper::PrintSmartObject(converted_params);
-#endif
bool request_sent =
application(app_id)->SetVideoConfig(service_type, converted_params);
if (request_sent) {
@@ -1497,46 +1404,6 @@ void ApplicationManagerImpl::StopNaviService(
app->StopStreaming(service_type);
}
-// Suppress warning for deprecated method used within another deprecated method
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-bool ApplicationManagerImpl::OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type) {
- using namespace helpers;
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "ServiceType = " << type << ". Session = " << std::hex
- << session_key);
-
- if (type == kRpc) {
- LOG4CXX_DEBUG(logger_, "RPC service is about to be started.");
- return true;
- }
- ApplicationSharedPtr app = application(session_key);
- if (!app) {
- LOG4CXX_WARN(logger_,
- "The application with id:" << session_key
- << " doesn't exists.");
- return false;
- }
-
- if (Compare<ServiceType, EQ, ONE>(
- type, ServiceType::kMobileNav, ServiceType::kAudio)) {
- if (app->is_navi()) {
- return StartNaviService(session_key, type);
- } else {
- LOG4CXX_WARN(logger_, "Refuse not navi application");
- }
- } else {
- LOG4CXX_WARN(logger_, "Refuse unknown service");
- }
- return false;
-}
-#pragma GCC diagnostic pop
-
void ApplicationManagerImpl::OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
@@ -1623,10 +1490,10 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
is_resuming = true;
is_unexpected_disconnect = false;
- ManageMobileCommand(
+ rpc_service_->ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
session_key, AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
break;
}
case CloseSessionReason::kMalformed: {
@@ -1659,6 +1526,79 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
}
}
+void ApplicationManagerImpl::OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (device_handle == 0) {
+ LOG4CXX_WARN(logger_,
+ "Invalid device handle passed for secondary transport of app "
+ << session_key);
+ return;
+ }
+
+ secondary_transport_devices_cache_[session_key] = device_handle;
+
+ {
+ sync_primitives::AutoLock auto_lock(applications_list_lock_ptr_);
+ ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ // It is possible that secondary transport is established prior to
+ // RegisterAppInterface request being processed. In this case, we will
+ // update the app's information during RegisterApplication().
+ LOG4CXX_DEBUG(logger_,
+ "Application with id: " << session_key << " is not found");
+ return;
+ }
+ app->set_secondary_device(device_handle);
+ }
+
+ // notify the event to HMI through BC.UpdateAppList request
+ SendUpdateAppList();
+
+ // if resumption has not been enabled, run it now
+ resume_controller().RetryResumption(session_key);
+}
+
+void ApplicationManagerImpl::OnSecondaryTransportEndedCallback(
+ const int32_t session_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ DeviceMap::iterator it = secondary_transport_devices_cache_.find(session_key);
+ if (it == secondary_transport_devices_cache_.end()) {
+ LOG4CXX_WARN(
+ logger_,
+ "Unknown session_key specified while removing secondary transport: "
+ << session_key);
+ } else {
+ secondary_transport_devices_cache_.erase(it);
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(applications_list_lock_ptr_);
+ ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ LOG4CXX_DEBUG(logger_,
+ "Application with id: " << session_key << " is not found");
+ return;
+ }
+
+ connection_handler::DeviceHandle device_handle = app->secondary_device();
+ if (device_handle == 0) {
+ LOG4CXX_WARN(logger_,
+ "Secondary transport of app " << session_key
+ << " is not found");
+ return;
+ }
+
+ app->set_secondary_device(0);
+ }
+
+ // notify the event to HMI through BC.UpdateAppList request
+ SendUpdateAppList();
+}
+
bool ApplicationManagerImpl::CheckAppIsNavi(const uint32_t app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
@@ -1691,6 +1631,11 @@ bool ApplicationManagerImpl::OnHandshakeDone(
return false;
}
+bool ApplicationManagerImpl::OnHandshakeFailed() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return false;
+}
+
void ApplicationManagerImpl::OnCertificateUpdateRequired() {
LOG4CXX_AUTO_TRACE(logger_);
GetPolicyHandler().OnPTExchangeNeeded();
@@ -1718,6 +1663,7 @@ ApplicationManagerImpl::GetHandshakeContext(uint32_t key) const {
void ApplicationManagerImpl::set_hmi_message_handler(
hmi_message_handler::HMIMessageHandler* handler) {
hmi_handler_ = handler;
+ rpc_service_->set_hmi_message_handler(handler);
}
void ApplicationManagerImpl::set_connection_handler(
@@ -1738,447 +1684,46 @@ protocol_handler::ProtocolHandler& ApplicationManagerImpl::protocol_handler()
void ApplicationManagerImpl::set_protocol_handler(
protocol_handler::ProtocolHandler* handler) {
protocol_handler_ = handler;
+ rpc_service_->set_protocol_handler(handler);
}
void ApplicationManagerImpl::StartDevicesDiscovery() {
connection_handler().get_device_discovery_starter().StartDevicesDiscovery();
}
-void ApplicationManagerImpl::SendMessageToMobile(
- const commands::MessageSharedPtr message, bool final_message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- if (!protocol_handler_) {
- LOG4CXX_WARN(logger_, "No Protocol Handler set");
- return;
- }
-
- ApplicationSharedPtr app = application(
- (*message)[strings::params][strings::connection_key].asUInt());
-
- const bool is_result_code_exists =
- (*message)[strings::msg_params].keyExists(strings::result_code);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with connection key");
- if (is_result_code_exists &&
- ((*message)[strings::msg_params][strings::result_code] ==
- NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION)) {
- (*message)[strings::params][strings::protocol_version] =
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1;
- } else {
- (*message)[strings::params][strings::protocol_version] =
- SupportedSDLVersion();
- }
- } else {
- (*message)[strings::params][strings::protocol_version] =
- app->protocol_version();
- }
-
- if (app && is_result_code_exists &&
- (*message)[strings::msg_params][strings::result_code] ==
- mobile_apis::Result::OUT_OF_MEMORY) {
- app->usage_report().RecordRejectionsSyncOutOfMemory();
- }
-
- mobile_so_factory().attachSchema(*message, false);
- LOG4CXX_DEBUG(
- logger_,
- "Attached schema to message, result if valid: " << message->isValid());
-
- // Messages to mobile are not yet prioritized so use default priority value
- utils::SharedPtr<Message> message_to_send(
- new Message(protocol_handler::MessagePriority::kDefault));
- if (!ConvertSOtoMessage((*message), (*message_to_send))) {
- LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
- return;
- }
-
- smart_objects::SmartObject& msg_to_mobile = *message;
- // If correlation_id is not present, it is from-HMI message which should be
- // checked against policy permissions
- if (msg_to_mobile[strings::params].keyExists(strings::correlation_id)) {
- request_ctrl_.OnMobileResponse(
- msg_to_mobile[strings::params][strings::correlation_id].asUInt(),
- msg_to_mobile[strings::params][strings::connection_key].asUInt(),
- msg_to_mobile[strings::params][strings::function_id].asInt());
-#ifdef SDL_REMOTE_CONTROL
- const mobile_apis::FunctionID::eType function_id =
- static_cast<mobile_apis::FunctionID::eType>(
- (*message)[strings::params][strings::function_id].asUInt());
- if (function_id == mobile_apis::FunctionID::RegisterAppInterfaceID &&
- (*message)[strings::msg_params][strings::success].asBool()) {
- LOG4CXX_INFO(logger_,
- "Registered app "
- << app->app_id() << " is "
- << (plugin_manager_.IsAppForPlugins(app) ? "" : "not ")
- << "for plugins.");
- }
-#endif // SDL_REMOTE_CONTROL
- } else if (app) {
- mobile_apis::FunctionID::eType function_id =
- static_cast<mobile_apis::FunctionID::eType>(
- (*message)[strings::params][strings::function_id].asUInt());
- RPCParams params;
-
- const smart_objects::SmartObject& s_map = (*message)[strings::msg_params];
- if (smart_objects::SmartType_Map == s_map.getType()) {
- smart_objects::SmartMap::iterator iter = s_map.map_begin();
- smart_objects::SmartMap::iterator iter_end = s_map.map_end();
-
- for (; iter != iter_end; ++iter) {
- if (true == iter->second.asBool()) {
- LOG4CXX_INFO(logger_, "Request's param: " << iter->first);
- params.insert(iter->first);
- }
- }
- }
- const std::string string_functionID =
- MessageHelper::StringifiedFunctionID(function_id);
- const mobile_apis::Result::eType check_result =
- CheckPolicyPermissions(app, string_functionID, params);
- if (mobile_apis::Result::SUCCESS != check_result) {
- LOG4CXX_WARN(logger_,
- "Function \"" << string_functionID << "\" (#" << function_id
- << ") not allowed by policy");
- return;
- }
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
- if (function_id == mobile_apis::FunctionID::OnSystemRequestID) {
- mobile_apis::RequestType::eType request_type =
- static_cast<mobile_apis::RequestType::eType>(
- (*message)[strings::msg_params][strings::request_type].asUInt());
- if (mobile_apis::RequestType::PROPRIETARY == request_type ||
- mobile_apis::RequestType::HTTP == request_type) {
- GetPolicyHandler().OnUpdateRequestSentToMobile();
- }
- }
-#endif // EXTERNAL_PROPRIETARY_MODE
- }
-
- if (message_to_send->binary_data()) {
- LOG4CXX_DEBUG(
- logger_,
- "Binary data size: " << message_to_send->binary_data()->size());
- }
- messages_to_mobile_.PostMessage(
- impl::MessageToMobile(message_to_send, final_message));
-}
-
void ApplicationManagerImpl::TerminateRequest(const uint32_t connection_key,
const uint32_t corr_id,
const int32_t function_id) {
request_ctrl_.TerminateRequest(corr_id, connection_key, function_id, true);
}
-bool ApplicationManagerImpl::ManageMobileCommand(
- const commands::MessageSharedPtr message,
- commands::Command::CommandOrigin origin) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!message) {
- LOG4CXX_WARN(logger_, "Null-pointer message received.");
- return false;
- }
-
- if (IsLowVoltage()) {
- LOG4CXX_WARN(logger_, "Low Voltage is active");
- return false;
- }
-#ifdef DEBUG
- MessageHelper::PrintSmartObject(*message);
-#endif
-
- LOG4CXX_DEBUG(logger_, "Trying to create message in mobile factory.");
- utils::SharedPtr<commands::Command> command(
- MobileCommandFactory::CreateCommand(message, origin, *this));
-
- if (!command) {
- LOG4CXX_WARN(logger_,
- "RET Failed to create mobile command from smart object");
- return false;
- }
-
- const uint32_t connection_key = static_cast<uint32_t>(
- (*message)[strings::params][strings::connection_key].asUInt());
-
- auto app_ptr = application(connection_key);
- if (app_ptr && IsAppInReconnectMode(app_ptr->policy_app_id())) {
- commands_holder_->Suspend(
- app_ptr, CommandHolder::CommandType::kMobileCommand, message);
- return true;
- }
-
- mobile_apis::FunctionID::eType function_id =
- static_cast<mobile_apis::FunctionID::eType>(
- (*message)[strings::params][strings::function_id].asInt());
-
- // Notifications from HMI have no such parameter
- uint32_t correlation_id =
- (*message)[strings::params].keyExists(strings::correlation_id)
- ? (*message)[strings::params][strings::correlation_id].asUInt()
- : 0;
-
- int32_t protocol_type =
- (*message)[strings::params][strings::protocol_type].asUInt();
-
- ApplicationSharedPtr app;
- int32_t message_type =
- (*message)[strings::params][strings::message_type].asInt();
-
- if (((mobile_apis::FunctionID::RegisterAppInterfaceID != function_id) &&
- (protocol_type == commands::CommandImpl::mobile_protocol_type_)) &&
- (mobile_apis::FunctionID::UnregisterAppInterfaceID != function_id)) {
- app = application(connection_key);
- if (!app) {
- LOG4CXX_ERROR(logger_, "RET APPLICATION_NOT_REGISTERED");
- smart_objects::SmartObjectSPtr response =
- MessageHelper::CreateNegativeResponse(
- connection_key,
- static_cast<int32_t>(function_id),
- correlation_id,
- static_cast<int32_t>(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED));
-
- SendMessageToMobile(response);
- return false;
- }
-
- // Message for "CheckPermission" must be with attached schema
- mobile_so_factory().attachSchema(*message, false);
- }
-
- if (message_type == mobile_apis::messageType::response) {
- if (command->Init()) {
- command->Run();
- command->CleanUp();
- }
- return true;
- }
- if (message_type == mobile_apis::messageType::notification) {
- request_ctrl_.addNotification(command);
- if (command->Init()) {
- command->Run();
- if (command->CleanUp()) {
- request_ctrl_.removeNotification(command.get());
- }
- // If CleanUp returned false notification should remove it self.
- }
- return true;
- }
-
- if (message_type == mobile_apis::messageType::request) {
- // commands will be launched from requesr_ctrl
- mobile_apis::HMILevel::eType app_hmi_level =
- mobile_apis::HMILevel::INVALID_ENUM;
- if (app) {
- app_hmi_level = app->hmi_level();
- }
-
- // commands will be launched from request_ctrl
-
- const request_controller::RequestController::TResult result =
- request_ctrl_.addMobileRequest(command, app_hmi_level);
-
- if (result == request_controller::RequestController::SUCCESS) {
- LOG4CXX_DEBUG(logger_, "Perform request");
- } else if (result == request_controller::RequestController::
- TOO_MANY_PENDING_REQUESTS) {
- LOG4CXX_ERROR(logger_,
- "RET Unable top perform request: "
- << "TOO_MANY_PENDING_REQUESTS");
-
- smart_objects::SmartObjectSPtr response =
- MessageHelper::CreateNegativeResponse(
- connection_key,
- static_cast<int32_t>(function_id),
- correlation_id,
- static_cast<int32_t>(
- mobile_apis::Result::TOO_MANY_PENDING_REQUESTS));
- ApplicationSharedPtr app_ptr = application(connection_key);
- if (app_ptr) {
- app_ptr->usage_report().RecordRemovalsForBadBehavior();
- }
-
- SendMessageToMobile(response);
- return false;
- } else if (result ==
- request_controller::RequestController::TOO_MANY_REQUESTS) {
- LOG4CXX_ERROR(logger_,
- "RET Unable to perform request: "
- << "TOO_MANY_REQUESTS");
-
- ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- connection_key,
- mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS),
- commands::Command::ORIGIN_SDL);
-
- UnregisterApplication(connection_key,
- mobile_apis::Result::TOO_MANY_PENDING_REQUESTS,
- false);
- ApplicationSharedPtr app_ptr = application(connection_key);
- if (app_ptr) {
- app_ptr->usage_report().RecordRemovalsForBadBehavior();
- }
- return false;
- } else if (result == request_controller::RequestController::
- NONE_HMI_LEVEL_MANY_REQUESTS) {
- LOG4CXX_ERROR(logger_,
- "RET Unable to perform request: "
- << "REQUEST_WHILE_IN_NONE_HMI_LEVEL");
-
- ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- connection_key,
- mobile_api::AppInterfaceUnregisteredReason::
- REQUEST_WHILE_IN_NONE_HMI_LEVEL),
- commands::Command::ORIGIN_SDL);
-
- ApplicationSharedPtr app_ptr = application(connection_key);
- if (app_ptr) {
- app_ptr->usage_report().RecordRemovalsForBadBehavior();
- }
- UnregisterApplication(
- connection_key, mobile_apis::Result::INVALID_ENUM, false);
- return false;
- } else {
- LOG4CXX_ERROR(logger_, "RET Unable to perform request: Unknown case");
- return false;
- }
- return true;
- }
-
- LOG4CXX_ERROR(logger_, "RET UNKNOWN MESSAGE TYPE " << message_type);
- return false;
-}
-
void ApplicationManagerImpl::RemoveHMIFakeParameters(
- application_manager::MessagePtr& message) {
+ application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id) {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace NsSmartDeviceLink::NsSmartObjects;
- using namespace NsSmartDeviceLink::NsJSONHandler;
- SmartObject so;
-
- Formatters::FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
- hmi_apis::messageType::eType>(
- message->json_message(), so);
-
- std::string formatted_message;
- namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
hmi_apis::HMI_API factory;
- factory.attachSchema(so, true);
- Formatters::FormatterJsonRpc::ToString(so, formatted_message);
- message->set_json_message(formatted_message);
-}
-
-void ApplicationManagerImpl::SendMessageToHMI(
- const commands::MessageSharedPtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_WARN(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- if (!hmi_handler_) {
- LOG4CXX_WARN(logger_, "No HMI Handler set");
- return;
- }
-
- // SmartObject |message| has no way to declare priority for now
- utils::SharedPtr<Message> message_to_send(
- new Message(protocol_handler::MessagePriority::kDefault));
- if (!message_to_send) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return;
- }
-
- hmi_so_factory().attachSchema(*message, false);
- LOG4CXX_INFO(
- logger_,
- "Attached schema to message, result if valid: " << message->isValid());
-
-#ifdef HMI_DBUS_API
- message_to_send->set_smart_object(*message);
-#else
- if (!ConvertSOtoMessage(*message, *message_to_send)) {
- LOG4CXX_WARN(logger_,
- "Cannot send message to HMI: failed to create string");
+ if (!(*message)[jhs::S_PARAMS].keyExists(jhs::S_FUNCTION_ID)) {
+ LOG4CXX_ERROR(logger_,
+ "RemoveHMIFakeParameters message missing function id");
return;
}
-#endif // HMI_DBUS_API
-
- messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send));
-}
-
-bool ApplicationManagerImpl::ManageHMICommand(
- const commands::MessageSharedPtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_WARN(logger_, "Null-pointer message received.");
- return false;
- }
-
- if (IsLowVoltage()) {
- LOG4CXX_WARN(logger_, "Low Voltage is active");
- return false;
- }
-
- MessageHelper::PrintSmartObject(*message);
-
- CommandSharedPtr command = HMICommandFactory::CreateCommand(message, *this);
- if (!command) {
- LOG4CXX_WARN(logger_, "Failed to create command from smart object");
- return false;
- }
-
- if ((*message).keyExists(strings::msg_params) &&
- (*message)[strings::msg_params].keyExists(strings::app_id)) {
- const auto connection_key =
- (*message)[strings::msg_params][strings::app_id].asUInt();
-
- auto app = application(static_cast<uint32_t>(connection_key));
- if (app && IsAppInReconnectMode(app->policy_app_id())) {
- commands_holder_->Suspend(
- app, CommandHolder::CommandType::kHmiCommand, message);
- return true;
- }
- }
-
- int32_t message_type =
- (*message)[strings::params][strings::message_type].asInt();
-
- if (kRequest == message_type) {
- LOG4CXX_DEBUG(logger_, "ManageHMICommand");
- request_ctrl_.addHMIRequest(command);
- }
-
- if (command->Init()) {
- command->Run();
- if (kResponse == message_type) {
- const uint32_t correlation_id =
- (*message)[strings::params][strings::correlation_id].asUInt();
- const int32_t function_id =
- (*message)[strings::params][strings::function_id].asInt();
- request_ctrl_.OnHMIResponse(correlation_id, function_id);
- }
- return true;
- }
- return false;
+ mobile_apis::FunctionID::eType mobile_function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+ (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = function_id;
+ factory.attachSchema(*message, true);
+ (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = mobile_function_id;
}
bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
media_manager::MediaManager* media_manager) {
LOG4CXX_TRACE(logger_, "Init application manager");
+ plugin_manager_.reset(new plugin_manager::RPCPluginManagerImpl(
+ *this, *rpc_service_, *hmi_capabilities_, *policy_handler_));
+ if (!plugin_manager_->LoadPlugins(get_settings().plugins_folder())) {
+ LOG4CXX_ERROR(logger_, "Plugins are not loaded");
+ return false;
+ }
const std::string app_storage_folder = get_settings().app_storage_folder();
if (!InitDirectory(app_storage_folder, TYPE_STORAGE) ||
!IsReadWriteAllowed(app_storage_folder, TYPE_STORAGE)) {
@@ -2234,18 +1779,6 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
}
app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl(
*app_launch_dto_.get(), *this, settings_));
-
-#ifdef SDL_REMOTE_CONTROL
- if (!hmi_handler_) {
- LOG4CXX_ERROR(logger_, "HMI message handler was not initialized");
- return false;
- }
- plugin_manager_.SetServiceHandler(utils::MakeShared<CoreService>(*this));
- plugin_manager_.LoadPlugins(settings_.plugins_folder());
- plugin_manager_.OnServiceStateChanged(
- functional_modules::ServiceState::HMI_ADAPTER_INITIALIZED);
-#endif // SDL_REMOTE_CONTROL
-
return true;
}
@@ -2256,6 +1789,8 @@ bool ApplicationManagerImpl::Stop() {
stopping_application_mng_lock_.Release();
application_list_update_timer_.Stop();
try {
+ SetUnregisterAllApplicationsReason(
+ mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF);
UnregisterAllApplications();
} catch (...) {
LOG4CXX_ERROR(logger_,
@@ -2270,155 +1805,6 @@ bool ApplicationManagerImpl::Stop() {
return true;
}
-bool ApplicationManagerImpl::ConvertMessageToSO(
- const Message& message, smart_objects::SmartObject& output) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "\t\t\tMessage to convert: protocol "
- << message.protocol_version() << "; json "
- << message.json_message());
-
- switch (message.protocol_version()) {
- case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5:
- case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4:
- case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3:
- case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2: {
- const bool conversion_result =
- formatters::CFormatterJsonSDLRPCv2::fromString(
- message.json_message(),
- output,
- message.function_id(),
- message.type(),
- message.correlation_id());
-
- rpc::ValidationReport report("RPC");
-
- if (!conversion_result ||
- !mobile_so_factory().attachSchema(output, true) ||
- ((output.validate(&report) != smart_objects::Errors::OK))) {
- LOG4CXX_WARN(logger_,
- "Failed to parse string to smart object :"
- << message.json_message());
- utils::SharedPtr<smart_objects::SmartObject> response(
- MessageHelper::CreateNegativeResponse(
- message.connection_key(),
- message.function_id(),
- message.correlation_id(),
- mobile_apis::Result::INVALID_DATA));
-
- (*response)[strings::msg_params][strings::info] =
- rpc::PrettyFormat(report);
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
- return false;
- }
- LOG4CXX_DEBUG(logger_,
- "Convertion result for sdl object is true function_id "
- << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
-
- output[strings::params][strings::connection_key] =
- message.connection_key();
- output[strings::params][strings::protocol_version] =
- message.protocol_version();
- if (message.binary_data()) {
- if (message.payload_size() < message.data_size()) {
- LOG4CXX_ERROR(logger_,
- "Incomplete binary"
- << " binary size should be " << message.data_size()
- << " payload data size is "
- << message.payload_size());
- utils::SharedPtr<smart_objects::SmartObject> response(
- MessageHelper::CreateNegativeResponse(
- message.connection_key(),
- message.function_id(),
- message.correlation_id(),
- mobile_apis::Result::INVALID_DATA));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
- return false;
- }
- output[strings::params][strings::binary_data] =
- *(message.binary_data());
- }
- break;
- }
- case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI: {
-#ifdef ENABLE_LOG
- int32_t result =
-#endif
- formatters::FormatterJsonRpc::FromString<
- hmi_apis::FunctionID::eType,
- hmi_apis::messageType::eType>(message.json_message(), output);
- LOG4CXX_DEBUG(logger_,
- "Convertion result: "
- << result << " function id "
- << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
- if (!hmi_so_factory().attachSchema(output, false)) {
- LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
- return false;
- }
-
- rpc::ValidationReport report("RPC");
-
- if (output.validate(&report) != smart_objects::Errors::OK) {
- LOG4CXX_ERROR(logger_,
- "Incorrect parameter from HMI"
- << rpc::PrettyFormat(report));
-
- output.erase(strings::msg_params);
- output[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::INVALID_DATA;
- output[strings::msg_params][strings::info] = rpc::PrettyFormat(report);
- return false;
- }
- break;
- }
- case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1: {
- static NsSmartDeviceLinkRPC::V1::v4_protocol_v1_2_no_extra v1_shema;
-
- if (message.function_id() == 0 || message.type() == kUnknownType) {
- LOG4CXX_ERROR(logger_, "Message received: UNSUPPORTED_VERSION");
-
- int32_t conversation_result =
- formatters::CFormatterJsonSDLRPCv1::fromString<
- NsSmartDeviceLinkRPC::V1::FunctionID::eType,
- NsSmartDeviceLinkRPC::V1::messageType::eType>(
- message.json_message(), output);
-
- if (formatters::CFormatterJsonSDLRPCv1::kSuccess ==
- conversation_result) {
- smart_objects::SmartObject params = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
-
- output[strings::params][strings::message_type] =
- NsSmartDeviceLinkRPC::V1::messageType::response;
- output[strings::params][strings::connection_key] =
- message.connection_key();
-
- output[strings::msg_params] = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
- output[strings::msg_params][strings::success] = false;
- output[strings::msg_params][strings::result_code] =
- NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION;
-
- smart_objects::SmartObjectSPtr msg_to_send =
- new smart_objects::SmartObject(output);
- v1_shema.attachSchema(*msg_to_send, false);
- SendMessageToMobile(msg_to_send);
- return false;
- }
- }
- break;
- }
- default:
- LOG4CXX_WARN(logger_,
- "Application used unsupported protocol :"
- << message.protocol_version() << ".");
- return false;
- }
-
- LOG4CXX_DEBUG(logger_, "Successfully parsed message into smart object");
- return true;
-}
-
bool ApplicationManagerImpl::ConvertSOtoMessage(
const smart_objects::SmartObject& message, Message& output) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2518,162 +1904,6 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
return true;
}
-MessageValidationResult ApplicationManagerImpl::ValidateMessageBySchema(
- const Message& message) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject so;
- using namespace protocol_handler;
- switch (message.protocol_version()) {
- case MajorProtocolVersion::PROTOCOL_VERSION_5:
- case MajorProtocolVersion::PROTOCOL_VERSION_4:
- case MajorProtocolVersion::PROTOCOL_VERSION_3:
- case MajorProtocolVersion::PROTOCOL_VERSION_2: {
- const bool conversion_result =
- formatters::CFormatterJsonSDLRPCv2::fromString(
- message.json_message(),
- so,
- message.function_id(),
- message.type(),
- message.correlation_id());
- if (!conversion_result) {
- return INVALID_JSON;
- }
-
- if (!mobile_so_factory().attachSchema(so, true)) {
- return INVALID_METADATA;
- }
- rpc::ValidationReport report("RPC");
- if (so.validate(&report) != smart_objects::Errors::OK) {
- LOG4CXX_WARN(logger_,
- "validate() failed for Mobile message - "
- << rpc::PrettyFormat(report));
- return SCHEMA_MISMATCH;
- }
- break;
- }
- case MajorProtocolVersion::PROTOCOL_VERSION_HMI: {
- const int32_t conversion_result = formatters::FormatterJsonRpc::
- FromString<hmi_apis::FunctionID::eType, hmi_apis::messageType::eType>(
- message.json_message(), so);
- if (0 != conversion_result) {
- LOG4CXX_WARN(logger_,
- "Failed to parse json from HMI: " << conversion_result);
- return INVALID_JSON;
- }
-
- if (!hmi_so_factory().attachSchema(so, true)) {
- return INVALID_METADATA;
- }
-
- rpc::ValidationReport report("RPC");
- if (so.validate(&report) != smart_objects::Errors::OK) {
- LOG4CXX_WARN(logger_,
- "validate() failed for HMI message - "
- << rpc::PrettyFormat(report));
- return SCHEMA_MISMATCH;
- }
- break;
- }
- default: { return UNSUPPORTED_PROTOCOL; }
- }
- return SUCCESS;
-}
-
-utils::SharedPtr<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
- const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(message);
- utils::SharedPtr<Message> outgoing_message;
-
- LOG4CXX_DEBUG(logger_, "Service type." << message->service_type());
- if (message->service_type() != protocol_handler::kRpc &&
- message->service_type() != protocol_handler::kBulk) {
- // skip this message, not under handling of ApplicationManager
- LOG4CXX_TRACE(logger_, "Skipping message; not the under AM handling.");
- return outgoing_message;
- }
-
- Message* convertion_result =
- MobileMessageHandler::HandleIncomingMessageProtocol(message);
-
- if (convertion_result) {
- outgoing_message = convertion_result;
- } else {
- LOG4CXX_ERROR(logger_, "Received invalid message");
- }
- return outgoing_message;
-}
-
-void ApplicationManagerImpl::ProcessMessageFromMobile(
- const utils::SharedPtr<Message> message) {
- LOG4CXX_AUTO_TRACE(logger_);
-#ifdef TELEMETRY_MONITOR
- AMTelemetryObserver::MessageMetricSharedPtr metric(
- new AMTelemetryObserver::MessageMetric());
- metric->begin = date_time::DateTime::getCurrentTime();
-#endif // TELEMETRY_MONITOR
- smart_objects::SmartObjectSPtr so_from_mobile =
- utils::MakeShared<smart_objects::SmartObject>();
-
- DCHECK_OR_RETURN_VOID(so_from_mobile);
- if (!so_from_mobile) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return;
- }
-
- if (!ConvertMessageToSO(*message, *so_from_mobile)) {
- LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
- return;
- }
-#ifdef TELEMETRY_MONITOR
- metric->message = so_from_mobile;
-#endif // TELEMETRY_MONITOR
-
- if (!ManageMobileCommand(so_from_mobile, commands::Command::ORIGIN_MOBILE)) {
- LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
- }
-#ifdef TELEMETRY_MONITOR
- metric->end = date_time::DateTime::getCurrentTime();
- if (metric_observer_) {
- metric_observer_->OnMessage(metric);
- }
-#endif // TELEMETRY_MONITOR
-}
-
-void ApplicationManagerImpl::ProcessMessageFromHMI(
- const utils::SharedPtr<Message> message) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr smart_object(new smart_objects::SmartObject);
-
- if (!smart_object) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return;
- }
-
-#ifdef HMI_DBUS_API
- *smart_object = message->smart_object();
-#else
- if (!ConvertMessageToSO(*message, *smart_object)) {
- if (application_manager::MessageType::kResponse ==
- (*smart_object)[strings::params][strings::message_type].asInt()) {
- (*smart_object).erase(strings::msg_params);
- (*smart_object)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::INVALID_DATA;
- (*smart_object)[strings::msg_params][strings::info] =
- std::string("Received invalid data on HMI response");
- } else {
- LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
- return;
- }
- }
-#endif // HMI_DBUS_API
-
- LOG4CXX_DEBUG(logger_, "Converted message, trying to create hmi command");
- if (!ManageHMICommand(smart_object)) {
- LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
- }
-}
-
hmi_apis::HMI_API& ApplicationManagerImpl::hmi_so_factory() {
if (!hmi_so_factory_) {
hmi_so_factory_ = new hmi_apis::HMI_API;
@@ -2855,7 +2085,7 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
app->set_vr_synonyms(vrSynonym);
app->set_tts_name(ttsName);
- sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
LOG4CXX_DEBUG(
logger_, "apps_to_register_ size before: " << apps_to_register_.size());
apps_to_register_.insert(app);
@@ -2899,7 +2129,7 @@ bool ApplicationManagerImpl::is_attenuated_supported() const {
#ifdef TELEMETRY_MONITOR
void ApplicationManagerImpl::SetTelemetryObserver(
AMTelemetryObserver* observer) {
- metric_observer_ = observer;
+ rpc_handler_->SetTelemetryObserver(observer);
}
#endif // TELEMETRY_MONITOR
@@ -2940,6 +2170,14 @@ void ApplicationManagerImpl::set_application_id(const int32_t correlation_id,
std::pair<const int32_t, const uint32_t>(correlation_id, app_id));
}
+uint32_t ApplicationManagerImpl::get_current_audio_source() const {
+ return current_audio_source_;
+}
+
+void ApplicationManagerImpl::set_current_audio_source(const uint32_t source) {
+ current_audio_source_ = source;
+}
+
void ApplicationManagerImpl::AddPolicyObserver(
policy::PolicyHandlerObserver* listener) {
GetPolicyHandler().add_listener(listener);
@@ -3032,10 +2270,14 @@ void ApplicationManagerImpl::ClearAppsPersistentData() {
void ApplicationManagerImpl::SendOnSDLClose() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ if (IsLowVoltage()) {
+ LOG4CXX_TRACE(logger_, "SDL is in Low Voltage State");
+ return;
+ }
// must be sent to PASA HMI on shutdown synchronously
smart_objects::SmartObjectSPtr msg =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*msg)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_OnSDLClose;
@@ -3052,7 +2294,7 @@ void ApplicationManagerImpl::SendOnSDLClose() {
}
// SmartObject |message| has no way to declare priority for now
- utils::SharedPtr<Message> message_to_send(
+ std::shared_ptr<Message> message_to_send(
new Message(protocol_handler::MessagePriority::kDefault));
hmi_so_factory().attachSchema(*msg, false);
@@ -3060,15 +2302,11 @@ void ApplicationManagerImpl::SendOnSDLClose() {
logger_,
"Attached schema to message, result if valid: " << msg->isValid());
-#ifdef HMI_DBUS_API
- message_to_send->set_smart_object(*msg);
-#else
if (!ConvertSOtoMessage(*msg, *message_to_send)) {
LOG4CXX_WARN(logger_,
"Cannot send message to HMI: failed to create string");
return;
}
-#endif // HMI_DBUS_API
if (!hmi_handler_) {
LOG4CXX_WARN(logger_, "No HMI Handler set");
@@ -3099,10 +2337,10 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
ApplicationSetConstIt it = accessor.GetData().begin();
while (it != accessor.GetData().end()) {
ApplicationSharedPtr app_to_remove = *it;
- ManageMobileCommand(
+ rpc_service_->ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app_to_remove->app_id(), unregister_reason_),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
UnregisterApplication(app_to_remove->app_id(),
mobile_apis::Result::INVALID_ENUM,
is_ignition_off,
@@ -3121,7 +2359,7 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
const connection_handler::DeviceHandle handle) {
DevicePredicate device_finder(handle);
- apps_to_register_list_lock_.Acquire();
+ apps_to_register_list_lock_ptr_->Acquire();
AppsWaitRegistrationSet::iterator it_app = std::find_if(
apps_to_register_.begin(), apps_to_register_.end(), device_finder);
@@ -3134,7 +2372,7 @@ void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
apps_to_register_.begin(), apps_to_register_.end(), device_finder);
}
- apps_to_register_list_lock_.Release();
+ apps_to_register_list_lock_ptr_->Release();
}
void ApplicationManagerImpl::UnregisterApplication(
@@ -3205,7 +2443,7 @@ void ApplicationManagerImpl::UnregisterApplication(
ApplicationSharedPtr app_to_remove;
connection_handler::DeviceHandle handle = 0;
{
- sync_primitives::AutoLock lock(applications_list_lock_);
+ sync_primitives::AutoLock lock(applications_list_lock_ptr_);
auto it_app = applications_.begin();
while (applications_.end() != it_app) {
if (app_id == (*it_app)->app_id()) {
@@ -3225,11 +2463,13 @@ void ApplicationManagerImpl::UnregisterApplication(
return;
}
+
if (is_resuming) {
resume_controller().SaveApplication(app_to_remove);
} else {
resume_controller().RemoveApplicationFromSaved(app_to_remove);
}
+
(hmi_capabilities_->get_hmi_language_handler())
.OnUnregisterApplication(app_id);
AppV4DevicePredicate finder(handle);
@@ -3250,12 +2490,12 @@ void ApplicationManagerImpl::UnregisterApplication(
StopAudioPassThru(app_id);
MessageHelper::SendStopAudioPathThru(*this);
}
-
-#ifdef SDL_REMOTE_CONTROL
- plugin_manager_.OnApplicationEvent(
- functional_modules::ApplicationEvent::kApplicationUnregistered,
- app_to_remove);
-#endif
+ auto on_app_unregistered =
+ [app_to_remove](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationUnregistered,
+ app_to_remove);
+ };
+ plugin_manager_->ForEachPlugin(on_app_unregistered);
MessageHelper::SendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect, *this);
@@ -3268,144 +2508,12 @@ void ApplicationManagerImpl::OnAppUnauthorized(const uint32_t& app_id) {
connection_handler::kUnauthorizedApp);
}
-void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- return;
- }
- sync_primitives::AutoLock lock(stopping_application_mng_lock_);
- if (is_stopping_) {
- LOG4CXX_INFO(logger_, "Application manager is stopping");
- return;
- }
-#ifdef SDL_REMOTE_CONTROL
- if (plugin_manager_.IsMessageForPlugin(message)) {
- if (functional_modules::ProcessResult::PROCESSED ==
- plugin_manager_.ProcessMessage(message)) {
- LOG4CXX_INFO(logger_, "Message is processed by plugin.");
- return;
- }
- }
-#endif
- ProcessMessageFromMobile(message);
-}
-
-void ApplicationManagerImpl::Handle(const impl::MessageToMobile message) {
- if (!protocol_handler_) {
- LOG4CXX_WARN(logger_,
- "Protocol Handler is not set; cannot send message to mobile.");
- return;
- }
-
- utils::SharedPtr<protocol_handler::RawMessage> rawMessage =
- MobileMessageHandler::HandleOutgoingMessageProtocol(message);
-
- if (!rawMessage) {
- LOG4CXX_ERROR(logger_, "Failed to create raw message.");
- return;
- }
-
- bool is_final = message.is_final;
- bool close_session = false;
- if (is_final) {
- if (1 < connection_handler().GetConnectionSessionsCount(
- message->connection_key())) {
- is_final = false;
- close_session = true;
- }
- }
-
- protocol_handler_->SendMessageToMobileApp(rawMessage, is_final);
- LOG4CXX_INFO(logger_, "Message for mobile given away");
-
- if (close_session) {
- connection_handler().CloseSession(message->connection_key(),
- connection_handler::kCommon);
- }
-}
-
-void ApplicationManagerImpl::Handle(const impl::MessageFromHmi message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- return;
- }
-
-#ifdef SDL_REMOTE_CONTROL
- if (plugin_manager_.IsHMIMessageForPlugin(message)) {
- functional_modules::ProcessResult result =
- plugin_manager_.ProcessHMIMessage(message);
- if (functional_modules::ProcessResult::PROCESSED == result ||
- functional_modules::ProcessResult::FAILED == result) {
- LOG4CXX_INFO(logger_, "Message is processed by plugin.");
- return;
- }
- }
-#endif
-
- ProcessMessageFromHMI(message);
-}
-
-void ApplicationManagerImpl::Handle(const impl::MessageToHmi message) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!hmi_handler_) {
- LOG4CXX_ERROR(logger_, "Observer is not set for HMIMessageHandler");
- return;
- }
-
- hmi_handler_->SendMessageToHMI(message);
- LOG4CXX_INFO(logger_, "Message for HMI given away");
-}
-
-void ApplicationManagerImpl::Handle(const impl::AudioData message) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr on_audio_pass =
- new smart_objects::SmartObject();
-
- if (!on_audio_pass) {
- LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer");
- return;
- }
-
- LOG4CXX_DEBUG(logger_, "Fill smart object");
-
- (*on_audio_pass)[strings::params][strings::message_type] =
- application_manager::MessageType::kNotification;
-
- (*on_audio_pass)[strings::params][strings::connection_key] =
- static_cast<int32_t>(message.session_key);
- (*on_audio_pass)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnAudioPassThruID;
-
- LOG4CXX_DEBUG(logger_, "Fill binary data");
- // binary data
- (*on_audio_pass)[strings::params][strings::binary_data] =
- smart_objects::SmartObject(message.binary_data);
-
- LOG4CXX_DEBUG(logger_, "After fill binary data");
- LOG4CXX_DEBUG(logger_, "Send data");
- CommandSharedPtr command(MobileCommandFactory::CreateCommand(
- on_audio_pass, commands::Command::ORIGIN_SDL, *this));
- if (!command) {
- LOG4CXX_WARN(logger_, "Failed to create mobile command from smart object");
- return;
- }
-
- if (command->Init()) {
- command->Run();
- command->CleanUp();
- }
-}
-
mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
const ApplicationSharedPtr app,
const std::string& function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions) {
- LOG4CXX_INFO(logger_, "CheckPolicyPermissions");
+ LOG4CXX_AUTO_TRACE(logger_);
// TODO(AOleynik): Remove check of policy_enable, when this flag will be
// unused in config file
if (!GetPolicyHandler().PolicyEnabled()) {
@@ -3453,17 +2561,36 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
return mobile_api::Result::SUCCESS;
}
+bool ApplicationManagerImpl::is_stopping() const {
+ sync_primitives::AutoLock lock(stopping_application_mng_lock_);
+ return is_stopping_;
+}
+
+bool ApplicationManagerImpl::is_audio_pass_thru_active() const {
+ return audio_pass_thru_active_;
+}
+
void ApplicationManagerImpl::OnLowVoltage() {
LOG4CXX_AUTO_TRACE(logger_);
is_low_voltage_ = true;
+ resume_ctrl_->SaveLowVoltageTime();
+ resume_ctrl_->StopSavePersistentDataTimer();
request_ctrl_.OnLowVoltage();
}
-bool ApplicationManagerImpl::IsLowVoltage() {
- LOG4CXX_TRACE(logger_, "result: " << is_low_voltage_);
+bool ApplicationManagerImpl::IsLowVoltage() const {
+ LOG4CXX_TRACE(logger_, "Result: " << is_low_voltage_);
return is_low_voltage_;
}
+void ApplicationManagerImpl::OnWakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_low_voltage_ = false;
+ resume_ctrl_->SaveWakeUpTime();
+ resume_ctrl_->StartSavePersistentDataTimer();
+ request_ctrl_.OnWakeUp();
+}
+
std::string ApplicationManagerImpl::GetHashedAppID(
uint32_t connection_key, const std::string& mobile_app_id) const {
connection_handler::DeviceHandle device_id = 0;
@@ -3548,10 +2675,10 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
}
}
if (unregister) {
- ManageMobileCommand(
+ rpc_service_->ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app_id, PROTOCOL_VIOLATION),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
UnregisterApplication(app_id, ABORTED);
return;
}
@@ -3560,7 +2687,6 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
void ApplicationManagerImpl::OnAppStreaming(
uint32_t app_id, protocol_handler::ServiceType service_type, bool state) {
- using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
@@ -3573,11 +2699,11 @@ void ApplicationManagerImpl::OnAppStreaming(
DCHECK_OR_RETURN_VOID(media_manager_);
if (state) {
- state_ctrl_.OnNaviStreamingStarted();
+ state_ctrl_.OnVideoStreamingStarted(app);
media_manager_->StartStreaming(app_id, service_type);
} else {
media_manager_->StopStreaming(app_id, service_type);
- state_ctrl_.OnNaviStreamingStopped();
+ state_ctrl_.OnVideoStreamingStopped(app);
}
}
@@ -3622,7 +2748,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
navi_app_to_stop_.push_back(app_id);
- TimerSPtr close_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr close_timer(std::make_shared<timer::Timer>(
"CloseNaviAppTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::CloseNaviApp)));
@@ -3652,21 +2778,20 @@ void ApplicationManagerImpl::ProcessPostponedMessages(const uint32_t app_id) {
}
MobileMessageQueue messages;
app->SwapMobileMessageQueue(messages);
- auto push_allowed_messages =
- [this, &app](smart_objects::SmartObjectSPtr message) {
- const std::string function_id = MessageHelper::StringifiedFunctionID(
- static_cast<mobile_apis::FunctionID::eType>(
- (*message)[strings::params][strings::function_id].asUInt()));
- const RPCParams params;
- const mobile_apis::Result::eType check_result =
- CheckPolicyPermissions(app, function_id, params);
- if (mobile_api::Result::SUCCESS == check_result) {
- ManageMobileCommand(message,
- commands::Command::CommandOrigin::ORIGIN_SDL);
- } else {
- app->PushMobileMessage(message);
- }
- };
+ auto push_allowed_messages = [this, &app](
+ smart_objects::SmartObjectSPtr message) {
+ const std::string function_id = MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asUInt()));
+ const RPCParams params;
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions(app, function_id, params);
+ if (mobile_api::Result::SUCCESS == check_result) {
+ rpc_service_->ManageMobileCommand(message, commands::Command::SOURCE_SDL);
+ } else {
+ app->PushMobileMessage(message);
+ }
+ };
std::for_each(messages.begin(), messages.end(), push_allowed_messages);
}
@@ -3698,7 +2823,7 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
if (from == HMI_FULL || from == HMI_LIMITED) {
LOG4CXX_TRACE(logger_, "HMILevel from FULL or LIMITED");
navi_app_to_end_stream_.push_back(app_id);
- TimerSPtr end_stream_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr end_stream_timer(std::make_shared<timer::Timer>(
"AppShouldFinishStreaming",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::EndNaviStreaming)));
@@ -3716,11 +2841,11 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
}
void ApplicationManagerImpl::SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) {
+ const std::shared_ptr<Application> app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
@@ -3738,10 +2863,14 @@ void ApplicationManagerImpl::SendHMIStatusNotification(
message[strings::msg_params][strings::audio_streaming_state] =
static_cast<int32_t>(app->audio_streaming_state());
+ message[strings::msg_params][strings::video_streaming_state] =
+ static_cast<int32_t>(app->video_streaming_state());
+
message[strings::msg_params][strings::system_context] =
static_cast<int32_t>(app->system_context());
- ManageMobileCommand(notification, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(notification,
+ commands::Command::SOURCE_SDL);
}
void ApplicationManagerImpl::ClearTimerPool() {
@@ -3784,10 +2913,10 @@ void ApplicationManagerImpl::CloseNaviApp() {
if (unregister) {
LOG4CXX_INFO(logger_,
"App haven't answered for EndService. Unregister it.");
- ManageMobileCommand(
+ rpc_service_->ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app_id, PROTOCOL_VIOLATION),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
UnregisterApplication(app_id, ABORTED);
}
}
@@ -3880,17 +3009,11 @@ policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice(
return GetPolicyHandler().GetUserConsentForDevice(device_id);
}
-void ApplicationManagerImpl::OnWakeUp() {
- LOG4CXX_AUTO_TRACE(logger_);
- is_low_voltage_ = false;
- request_ctrl_.OnWakeUp();
-}
-
mobile_apis::Result::eType ApplicationManagerImpl::SaveBinary(
const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset) {
+ const uint64_t offset) {
LOG4CXX_DEBUG(logger_,
"SaveBinaryWithOffset binary_size = "
<< binary_data.size() << " offset = " << offset);
@@ -3901,7 +3024,7 @@ mobile_apis::Result::eType ApplicationManagerImpl::SaveBinary(
}
const std::string full_file_path = file_path + "/" + file_name;
- const int64_t file_size = file_system::FileSize(full_file_path);
+ const uint64_t file_size = file_system::FileSize(full_file_path);
std::ofstream* file_stream;
if (offset != 0) {
if (file_size != offset) {
@@ -3969,9 +3092,9 @@ bool ApplicationManagerImpl::IsHMICooperating() const {
void ApplicationManagerImpl::OnApplicationListUpdateTimer() {
LOG4CXX_DEBUG(logger_, "Application list update timer finished");
- apps_to_register_list_lock_.Acquire();
+ apps_to_register_list_lock_ptr_->Acquire();
const bool trigger_ptu = apps_size_ != applications_.size();
- apps_to_register_list_lock_.Release();
+ apps_to_register_list_lock_ptr_->Release();
SendUpdateAppList();
GetPolicyHandler().OnAppsSearchCompleted(trigger_ptu);
}
@@ -3980,14 +3103,14 @@ void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() {
std::vector<uint32_t> app_list;
{
sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
- std::map<uint32_t, TimevalStruct>::iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it =
tts_global_properties_app_list_.begin();
- std::map<uint32_t, TimevalStruct>::iterator it_end =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it_end =
tts_global_properties_app_list_.end();
date_time::TimeCompare time_comp;
for (; it != it_end; ++it) {
- time_comp = date_time::DateTime::compareTime(
- date_time::DateTime::getCurrentTime(), it->second);
+ time_comp =
+ date_time::compareTime(date_time::getCurrentTime(), it->second);
if (date_time::GREATER == time_comp || date_time::EQUAL == time_comp) {
app_list.push_back(it->first);
}
@@ -4008,8 +3131,8 @@ void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
uint16_t timeout = get_settings().tts_global_properties_timeout();
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- current_time.tv_sec += timeout;
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
+ current_time += date_time::seconds(timeout);
// please avoid AutoLock usage to avoid deadlock
tts_global_properties_app_list_lock_.Acquire();
if (tts_global_properties_app_list_.end() ==
@@ -4032,7 +3155,7 @@ void ApplicationManagerImpl::RemoveAppFromTTSGlobalPropertiesList(
LOG4CXX_AUTO_TRACE(logger_);
// please avoid AutoLock usage to avoid deadlock
tts_global_properties_app_list_lock_.Acquire();
- std::map<uint32_t, TimevalStruct>::iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it =
tts_global_properties_app_list_.find(app_id);
if (tts_global_properties_app_list_.end() != it) {
tts_global_properties_app_list_.erase(it);
@@ -4060,6 +3183,8 @@ mobile_apis::AppHMIType::eType ApplicationManagerImpl::StringToAppHMIType(
return mobile_apis::AppHMIType::MESSAGING;
} else if ("NAVIGATION" == str) {
return mobile_apis::AppHMIType::NAVIGATION;
+ } else if ("PROJECTION" == str) {
+ return mobile_apis::AppHMIType::PROJECTION;
} else if ("INFORMATION" == str) {
return mobile_apis::AppHMIType::INFORMATION;
} else if ("SOCIAL" == str) {
@@ -4075,6 +3200,39 @@ mobile_apis::AppHMIType::eType ApplicationManagerImpl::StringToAppHMIType(
}
}
+const std::string ApplicationManagerImpl::AppHMITypeToString(
+ mobile_apis::AppHMIType::eType type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ switch (type) {
+ case mobile_apis::AppHMIType::DEFAULT:
+ return "DEFAULT";
+ case mobile_apis::AppHMIType::COMMUNICATION:
+ return "COMMUNICATION";
+ case mobile_apis::AppHMIType::MEDIA:
+ return "MEDIA";
+ case mobile_apis::AppHMIType::MESSAGING:
+ return "MESSAGING";
+ case mobile_apis::AppHMIType::NAVIGATION:
+ return "NAVIGATION";
+ case mobile_apis::AppHMIType::INFORMATION:
+ return "INFORMATION";
+ case mobile_apis::AppHMIType::SOCIAL:
+ return "SOCIAL";
+ case mobile_apis::AppHMIType::BACKGROUND_PROCESS:
+ return "BACKGROUND_PROCESS";
+ case mobile_apis::AppHMIType::TESTING:
+ return "TESTING";
+ case mobile_apis::AppHMIType::SYSTEM:
+ return "SYSTEM";
+ case mobile_apis::AppHMIType::PROJECTION:
+ return "PROJECTION";
+ case mobile_apis::AppHMIType::REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
+ default:
+ return "INVALID_ENUM";
+ }
+}
+
bool ApplicationManagerImpl::CompareAppHMIType(
const smart_objects::SmartObject& from_policy,
const smart_objects::SmartObject& from_application) {
@@ -4201,17 +3359,19 @@ void ApplicationManagerImpl::ProcessReconnection(
}
void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) {
-#ifdef SDL_REMOTE_CONTROL
+ LOG4CXX_AUTO_TRACE(logger_);
if (!ptu_result) {
return;
}
- plugin_manager_.OnPolicyEvent(
- functional_modules::PolicyEvent::kApplicationPolicyUpdated);
-#endif // SDL_REMOTE_CONTROL
+ auto on_app_policy_updated = [](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnPolicyEvent(plugin_manager::kApplicationPolicyUpdated);
+ };
+
+ plugin_manager_->ForEachPlugin(on_app_policy_updated);
}
-void ApplicationManagerImpl::PutDriverDistractionMessageToPostponed(
- ApplicationSharedPtr application) const {
+void ApplicationManagerImpl::SendDriverDistractionState(
+ ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
if (hmi_apis::Common_DriverDistractionState::INVALID_ENUM ==
driver_distraction_state()) {
@@ -4219,7 +3379,7 @@ void ApplicationManagerImpl::PutDriverDistractionMessageToPostponed(
return;
}
smart_objects::SmartObjectSPtr on_driver_distraction =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*on_driver_distraction)[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kNotification);
@@ -4229,7 +3389,20 @@ void ApplicationManagerImpl::PutDriverDistractionMessageToPostponed(
driver_distraction_state();
(*on_driver_distraction)[strings::params][strings::connection_key] =
application->app_id();
- application->PushMobileMessage(on_driver_distraction);
+
+ const std::string function_id = MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*on_driver_distraction)[strings::params][strings::function_id]
+ .asUInt()));
+ const RPCParams params;
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions(application, function_id, params);
+ if (mobile_api::Result::SUCCESS == check_result) {
+ rpc_service_->ManageMobileCommand(on_driver_distraction,
+ commands::Command::SOURCE_SDL);
+ } else {
+ application->PushMobileMessage(on_driver_distraction);
+ }
}
protocol_handler::MajorProtocolVersion
@@ -4299,37 +3472,13 @@ void ApplicationManagerImpl::ClearTTSGlobalPropertiesList() {
}
bool ApplicationManagerImpl::IsAppSubscribedForWayPoints(
- const uint32_t app_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- if (subscribed_way_points_apps_list_.find(app_id) ==
- subscribed_way_points_apps_list_.end()) {
- return false;
- }
- return true;
-}
-
-void ApplicationManagerImpl::SubscribeAppForWayPoints(const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.insert(app_id);
-}
-
-void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(
- const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.erase(app_id);
-}
-
-bool ApplicationManagerImpl::IsAppSubscribedForWayPoints(
ApplicationSharedPtr app) const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
LOG4CXX_DEBUG(logger_,
"There are applications subscribed: "
<< subscribed_way_points_apps_list_.size());
- if (subscribed_way_points_apps_list_.find(app) ==
+ if (subscribed_way_points_apps_list_.find(app->app_id()) ==
subscribed_way_points_apps_list_.end()) {
return false;
}
@@ -4340,7 +3489,8 @@ void ApplicationManagerImpl::SubscribeAppForWayPoints(
ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.insert(app);
+ LOG4CXX_DEBUG(logger_, "Subscribing " << app->app_id());
+ subscribed_way_points_apps_list_.insert(app->app_id());
LOG4CXX_DEBUG(logger_,
"There are applications subscribed: "
<< subscribed_way_points_apps_list_.size());
@@ -4350,7 +3500,8 @@ void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(
ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.erase(app);
+ LOG4CXX_DEBUG(logger_, "Unsubscribing " << app->app_id());
+ subscribed_way_points_apps_list_.erase(app->app_id());
LOG4CXX_DEBUG(logger_,
"There are applications subscribed: "
<< subscribed_way_points_apps_list_.size());
@@ -4365,13 +3516,23 @@ bool ApplicationManagerImpl::IsAnyAppSubscribedForWayPoints() const {
return !subscribed_way_points_apps_list_.empty();
}
-const std::set<int32_t> ApplicationManagerImpl::GetAppsSubscribedForWayPoints()
+const std::set<uint32_t> ApplicationManagerImpl::GetAppsSubscribedForWayPoints()
const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
return subscribed_way_points_apps_list_;
}
+// retrieve transport type string used in .ini file, e.g. "TCP_WIFI"
+const std::string ApplicationManagerImpl::GetTransportTypeProfileString(
+ connection_handler::DeviceHandle device_handle) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ return connection_handler()
+ .get_session_observer()
+ .TransportTypeProfileStringFromDeviceHandle(device_handle);
+}
+
static hmi_apis::Common_VideoStreamingProtocol::eType ConvertVideoProtocol(
const char* str) {
if (strcmp(str, "RAW") == 0) {
@@ -4456,12 +3617,29 @@ std::vector<std::string> ApplicationManagerImpl::ConvertRejectedParamList(
return output;
}
+bool ApplicationManagerImpl::IsSOStructValid(
+ const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities) {
+ smart_objects::SmartObject display_capabilities_so = display_capabilities;
+ if (hmi_so_factory().AttachSchema(struct_id, display_capabilities_so)) {
+ if (display_capabilities_so.isValid()) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Could not find struct id: " << struct_id);
+ return false;
+ }
+ return true;
+}
+
#ifdef BUILD_TESTS
void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) {
- applications_list_lock_.Acquire();
+ applications_list_lock_ptr_->Acquire();
applications_.insert(mock_app);
apps_size_ = applications_.size();
- applications_list_lock_.Release();
+ applications_list_lock_ptr_->Release();
}
void ApplicationManagerImpl::SetMockMediaManager(
@@ -4469,7 +3647,6 @@ void ApplicationManagerImpl::SetMockMediaManager(
media_manager_ = mock_media_manager;
}
#endif // BUILD_TESTS
-#ifdef SDL_REMOTE_CONTROL
struct MobileAppIdPredicate {
std::string policy_app_id_;
MobileAppIdPredicate(const std::string& policy_app_id)
@@ -4523,7 +3700,6 @@ std::vector<std::string> ApplicationManagerImpl::devices(
void ApplicationManagerImpl::ChangeAppsHMILevel(
uint32_t app_id, mobile_apis::HMILevel::eType level) {
- using namespace mobile_apis::HMILevel;
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "AppID to change: " << app_id << " -> " << level);
ApplicationSharedPtr app = application(app_id);
@@ -4531,26 +3707,13 @@ void ApplicationManagerImpl::ChangeAppsHMILevel(
LOG4CXX_ERROR(logger_, "There is no app with id: " << app_id);
return;
}
- eType old_level = app->hmi_level();
+ const mobile_apis::HMILevel::eType old_level = app->hmi_level();
if (old_level != level) {
app->set_hmi_level(level);
OnHMILevelChanged(app_id, old_level, level);
-
- plugin_manager_.OnAppHMILevelChanged(app, old_level);
} else {
- LOG4CXX_WARN(logger_, "Redudant changing HMI level : " << level);
+ LOG4CXX_WARN(logger_, "Redundant changing HMI level: " << level);
}
}
-void ApplicationManagerImpl::SendPostMessageToMobile(
- const MessagePtr& message) {
- messages_to_mobile_.PostMessage(impl::MessageToMobile(message, false));
-}
-
-void ApplicationManagerImpl::SendPostMessageToHMI(const MessagePtr& message) {
- messages_to_hmi_.PostMessage(impl::MessageToHmi(message));
-}
-
-#endif // SDL_REMOTE_CONTROL
-
} // namespace application_manager
diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc
index 101a565a8e..3f775ee4e2 100644
--- a/src/components/application_manager/src/application_state.cc
+++ b/src/components/application_manager/src/application_state.cc
@@ -101,7 +101,6 @@ void ApplicationState::RemoveState(HmiState::StateID state) {
}
HmiStatePtr ApplicationState::GetState(HmiState::StateID state_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
switch (state_id) {
case HmiState::StateID::STATE_ID_REGULAR:
LOG4CXX_DEBUG(logger_, "Getting regular state.");
diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc
index afdaa2f1f4..ea74e78f4e 100644
--- a/src/components/application_manager/src/command_holder_impl.cc
+++ b/src/components/application_manager/src/command_holder_impl.cc
@@ -43,7 +43,7 @@ CommandHolderImpl::CommandHolderImpl(ApplicationManager& app_manager)
void CommandHolderImpl::Suspend(
ApplicationSharedPtr application,
CommandType type,
- utils::SharedPtr<smart_objects::SmartObject> command) {
+ std::shared_ptr<smart_objects::SmartObject> command) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(application);
LOG4CXX_DEBUG(logger_,
@@ -114,7 +114,7 @@ void CommandHolderImpl::ResumeHmiCommand(ApplicationSharedPtr application) {
for (auto cmd : app_commands->second) {
(*cmd)[strings::msg_params][strings::app_id] = application->hmi_app_id();
- app_manager_.ManageHMICommand(cmd);
+ app_manager_.GetRPCService().ManageHMICommand(cmd);
}
app_hmi_commands_.erase(app_commands);
@@ -133,8 +133,8 @@ void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) {
for (auto cmd : app_commands->second) {
(*cmd)[strings::params][strings::connection_key] = application->app_id();
- app_manager_.ManageMobileCommand(
- cmd, commands::Command::CommandOrigin::ORIGIN_MOBILE);
+ app_manager_.GetRPCService().ManageMobileCommand(
+ cmd, commands::Command::CommandSource::SOURCE_MOBILE);
}
app_mobile_commands_.erase(app_commands);
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index b928184148..04fabfb2ec 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -35,6 +35,16 @@
#include "application_manager/application_manager.h"
namespace application_manager {
+
+namespace {
+struct AppExtensionPredicate {
+ AppExtensionUID uid;
+ bool operator()(const ApplicationSharedPtr app) {
+ return app ? (app->QueryInterface(uid).use_count() != 0) : false;
+ }
+};
+}
+
namespace commands {
CREATE_LOGGERPTR_LOCAL(CommandImpl::logger_, "Commands")
@@ -44,11 +54,17 @@ const int32_t CommandImpl::mobile_protocol_type_ = 0;
const int32_t CommandImpl::protocol_version_ = 3;
CommandImpl::CommandImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
: message_(message)
, default_timeout_(application_manager.get_settings().default_timeout())
, allowed_to_terminate_(true)
- , application_manager_(application_manager) {}
+ , application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
CommandImpl::~CommandImpl() {
CleanUp();
@@ -95,7 +111,7 @@ void CommandImpl::SetAllowedToTerminate(const bool allowed) {
}
bool CommandImpl::ReplaceMobileWithHMIAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& message) {
LOG4CXX_AUTO_TRACE(logger_);
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
@@ -139,15 +155,8 @@ bool CommandImpl::ReplaceMobileWithHMIAppId(
return true;
}
-DEPRECATED void CommandImpl::ReplaceMobileByHMIAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
- if (!ReplaceMobileWithHMIAppId(message)) {
- LOG4CXX_ERROR(logger_, "Substitution mobile --> HMI id is failed.");
- }
-}
-
bool CommandImpl::ReplaceHMIWithMobileAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& message) {
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
application_manager_.application_by_hmi_app(
@@ -191,12 +200,5 @@ bool CommandImpl::ReplaceHMIWithMobileAppId(
return true;
}
-DEPRECATED void CommandImpl::ReplaceHMIByMobileAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
- if (!ReplaceHMIWithMobileAppId(message)) {
- LOG4CXX_ERROR(logger_, "Substitution HMI --> mobile id is failed.");
- }
-}
-
} // namespace commands
} // namespace application_manager
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 5b44abeec9..4e9a2556de 100644
--- a/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
+++ b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
@@ -32,6 +32,7 @@
#include "application_manager/commands/command_notification_from_mobile_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
namespace application_manager {
@@ -39,8 +40,16 @@ namespace application_manager {
namespace commands {
CommandNotificationFromMobileImpl::CommandNotificationFromMobileImpl(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ 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) {}
CommandNotificationFromMobileImpl::~CommandNotificationFromMobileImpl() {}
@@ -63,7 +72,7 @@ void CommandNotificationFromMobileImpl::SendNotification() {
LOG4CXX_INFO(logger_, "SendNotification");
MessageHelper::PrintSmartObject(*message_);
- application_manager_.SendMessageToMobile(message_);
+ rpc_service_.SendMessageToMobile(message_);
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/command_notification_impl.cc b/src/components/application_manager/src/commands/command_notification_impl.cc
index b6b0e7d500..70df95986b 100644
--- a/src/components/application_manager/src/commands/command_notification_impl.cc
+++ b/src/components/application_manager/src/commands/command_notification_impl.cc
@@ -32,6 +32,7 @@
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
namespace application_manager {
@@ -39,8 +40,16 @@ namespace application_manager {
namespace commands {
CommandNotificationImpl::CommandNotificationImpl(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ 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) {}
CommandNotificationImpl::~CommandNotificationImpl() {}
@@ -63,7 +72,7 @@ void CommandNotificationImpl::SendNotification() {
LOG4CXX_INFO(logger_, "SendNotification");
MessageHelper::PrintSmartObject(*message_);
- application_manager_.SendMessageToMobile(message_);
+ rpc_service_.SendMessageToMobile(message_);
}
} // namespace commands
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 515d8a998c..68e8cfe6b4 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -34,11 +34,13 @@
#include <numeric>
#include <string>
#include "utils/macro.h"
-#include "utils/make_shared.h"
+
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
#include "smart_objects/smart_object.h"
+
namespace application_manager {
namespace commands {
@@ -143,7 +145,8 @@ struct DisallowedParamsInserter {
VehicleData::const_iterator it = vehicle_data.find(param);
if (vehicle_data.end() != it) {
smart_objects::SmartObjectSPtr disallowed_param =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*disallowed_param)[strings::data_type] = (*it).second;
(*disallowed_param)[strings::result_code] = code_;
response_[strings::msg_params][param.c_str()] = *disallowed_param;
@@ -193,9 +196,17 @@ ResponseInfo::ResponseInfo(const hmi_apis::Common_Result::eType result,
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code;
}
-CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager)
+CommandRequestImpl::CommandRequestImpl(
+ 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)
, EventObserver(application_manager.event_dispatcher())
, current_state_(kAwaitingHMIResponse)
, hash_update_mode_(kSkipHashUpdate)
@@ -241,7 +252,7 @@ void CommandRequestImpl::onTimeOut() {
correlation_id(),
mobile_api::Result::GENERIC_ERROR);
AddTimeOutComponentInfoToMessage(*response);
- application_manager_.ManageMobileCommand(response, ORIGIN_SDL);
+ rpc_service_.ManageMobileCommand(response, SOURCE_SDL);
}
void CommandRequestImpl::on_event(const event_engine::Event& event) {}
@@ -263,7 +274,7 @@ void CommandRequestImpl::SendResponse(
}
smart_objects::SmartObjectSPtr result =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& response = *result;
@@ -304,7 +315,7 @@ void CommandRequestImpl::SendResponse(
is_success_result_ = success;
- application_manager_.ManageMobileCommand(result, ORIGIN_SDL);
+ rpc_service_.ManageMobileCommand(result, SOURCE_SDL);
}
bool CommandRequestImpl::CheckSyntax(const std::string& str,
@@ -407,7 +418,8 @@ uint32_t CommandRequestImpl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params,
bool use_events) {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
const uint32_t hmi_correlation_id =
application_manager_.GetNextHMICorrelationID();
@@ -432,7 +444,7 @@ uint32_t CommandRequestImpl::SendHMIRequest(
subscribe_on_event(function_id, hmi_correlation_id);
}
if (ProcessHMIInterfacesAvailability(hmi_correlation_id, function_id)) {
- if (!application_manager_.ManageHMICommand(result)) {
+ if (!rpc_service_.ManageHMICommand(result)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
}
@@ -444,8 +456,9 @@ uint32_t CommandRequestImpl::SendHMIRequest(
void CommandRequestImpl::CreateHMINotification(
const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ const ns_smart::SmartObject& msg_params) const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
@@ -461,7 +474,7 @@ void CommandRequestImpl::CreateHMINotification(
notify[strings::params][strings::function_id] = function_id;
notify[strings::msg_params] = msg_params;
- if (!application_manager_.ManageHMICommand(result)) {
+ if (!rpc_service_.ManageHMICommand(result)) {
LOG4CXX_ERROR(logger_, "Unable to send HMI notification");
}
}
@@ -570,6 +583,10 @@ mobile_apis::Result::eType CommandRequestImpl::GetMobileResultCode(
mobile_result = mobile_apis::Result::SAVED;
break;
}
+ case hmi_apis::Common_Result::READ_ONLY: {
+ mobile_result = mobile_apis::Result::READ_ONLY;
+ break;
+ }
default: {
LOG4CXX_ERROR(logger_, "Unknown HMI result code " << hmi_code);
break;
@@ -605,10 +622,8 @@ bool CommandRequestImpl::CheckAllowedParameters() {
smart_objects::SmartMap::const_iterator iter_end = s_map.map_end();
for (; iter != iter_end; ++iter) {
- if (iter->second.asBool()) {
- LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first);
- params.insert(iter->first);
- }
+ LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first);
+ params.insert(iter->first);
}
mobile_apis::Result::eType check_result =
@@ -628,7 +643,7 @@ bool CommandRequestImpl::CheckAllowedParameters() {
correlation_id(),
app->app_id());
- application_manager_.SendMessageToMobile(response);
+ rpc_service_.SendMessageToMobile(response);
return false;
}
@@ -652,15 +667,13 @@ bool CommandRequestImpl::CheckHMICapabilities(
using namespace smart_objects;
using namespace mobile_apis;
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- if (!hmi_capabilities.is_ui_cooperating()) {
+ if (!hmi_capabilities_.is_ui_cooperating()) {
LOG4CXX_ERROR(logger_, "UI is not supported by HMI");
return false;
}
const SmartObject* button_capabilities_so =
- hmi_capabilities.button_capabilities();
+ hmi_capabilities_.button_capabilities();
if (!button_capabilities_so) {
LOG4CXX_ERROR(logger_, "Invalid button capabilities object");
return false;
@@ -946,7 +959,7 @@ const std::string InfoInterfaceSeparator(
void CommandRequestImpl::AddTimeOutComponentInfoToMessage(
smart_objects::SmartObject& response) const {
- using NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ using ns_smart_device_link::ns_smart_objects::SmartObject;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
if (awaiting_response_interfaces_.empty()) {
diff --git a/src/components/application_manager/src/commands/command_response_impl.cc b/src/components/application_manager/src/commands/command_response_impl.cc
index c3265230a8..b956a4c7a5 100644
--- a/src/components/application_manager/src/commands/command_response_impl.cc
+++ b/src/components/application_manager/src/commands/command_response_impl.cc
@@ -32,14 +32,23 @@
#include "application_manager/commands/command_response_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
namespace application_manager {
namespace commands {
CommandResponseImpl::CommandResponseImpl(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ 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) {}
CommandResponseImpl::~CommandResponseImpl() {}
@@ -80,7 +89,7 @@ void CommandResponseImpl::SendResponse(
}
}
- application_manager_.SendMessageToMobile(message_, final_message);
+ rpc_service_.SendMessageToMobile(message_, final_message);
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/src/commands/hmi/activate_app_request.cc
deleted file mode 100644
index ea36cd2b0a..0000000000
--- a/src/components/application_manager/src/commands/hmi/activate_app_request.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/activate_app_request.h"
-
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ActivateAppRequest::ActivateAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-ActivateAppRequest::~ActivateAppRequest() {
- LOG4CXX_TRACE(logger_, "~ActivateAppRequest");
-}
-
-void ActivateAppRequest::Run() {
- LOG4CXX_TRACE(logger_, "enter " << correlation_id());
- uint32_t app_id = RequestToHMI::application_id();
- application_manager_.set_application_id(correlation_id(), app_id);
-#ifdef ENABLE_LOG
- if ((*message_)[strings::msg_params].keyExists(
- strings::activate_app_hmi_level)) {
- mobile_apis::HMILevel::eType requested_hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- (*message_)[strings::msg_params][strings::activate_app_hmi_level]
- .asInt());
- LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level);
- }
-#endif
- SendRequest();
- LOG4CXX_TRACE(logger_, "exit");
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/src/commands/hmi/activate_app_response.cc
deleted file mode 100644
index 55e704b6c4..0000000000
--- a/src/components/application_manager/src/commands/hmi/activate_app_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/activate_app_response.h"
-
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ActivateAppResponse::ActivateAppResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-ActivateAppResponse::~ActivateAppResponse() {}
-
-void ActivateAppResponse::Run() {
- LOG4CXX_TRACE(logger_, "enter");
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_ActivateApp);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- LOG4CXX_TRACE(logger_, "exit");
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc
deleted file mode 100644
index ef75eba1e2..0000000000
--- a/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "application_manager/policies/policy_handler.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddStatisticsInfoNotification::AddStatisticsInfoNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {}
-
-void AddStatisticsInfoNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- int type = (*message_)[strings::msg_params][hmi_notification::statistic_type]
- .asInt();
-
- application_manager_.GetPolicyHandler().AddStatisticsInfo(type);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc
deleted file mode 100644
index 4e096a2cda..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAllAppsRequest::AllowAllAppsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-AllowAllAppsRequest::~AllowAllAppsRequest() {}
-
-void AllowAllAppsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc
deleted file mode 100644
index ed05c3ba83..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAllAppsResponse::AllowAllAppsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AllowAllAppsResponse::~AllowAllAppsResponse() {}
-
-void AllowAllAppsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SetAllAppsAllowed(
- (*message_)[strings::msg_params][hmi_response::allowed].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/src/commands/hmi/allow_app_request.cc
deleted file mode 100644
index 5176b3b4fe..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_app_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/allow_app_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAppRequest::AllowAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-AllowAppRequest::~AllowAppRequest() {}
-
-void AllowAppRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/src/commands/hmi/allow_app_response.cc
deleted file mode 100644
index 5fd9c702b4..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_app_response.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/allow_app_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAppResponse::AllowAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AllowAppResponse::~AllowAppResponse() {}
-
-void AllowAppResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t connection_key =
- (*message_)[strings::params][strings::connection_key].asInt();
-
- ApplicationSharedPtr app = application_manager_.application(connection_key);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- app->set_app_allowed(
- (*message_)[strings::msg_params][hmi_response::allowed].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
deleted file mode 100644
index c6c550a474..0000000000
--- a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/basic_communication_on_awake_sdl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/resumption/resume_ctrl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAwakeSDLNotification::OnAwakeSDLNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAwakeSDLNotification::~OnAwakeSDLNotification() {}
-
-void OnAwakeSDLNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!application_manager_.resume_controller().is_suspended()) {
- return;
- }
-
- {
- DataAccessor<ApplicationSet> accessor = application_manager_.applications();
- ApplicationSetIt itBegin = accessor.GetData().begin();
- ApplicationSetIt itEnd = accessor.GetData().end();
- for (; itBegin != itEnd; ++itBegin) {
- const ApplicationSharedPtr app = *itBegin;
- if (app && app->IsHashChangedDuringSuspend()) {
- MessageHelper::SendHashUpdateNotification(app->app_id(),
- application_manager_);
- app->SetHashChangedDuringSuspend(false);
- }
- }
- }
-
- application_manager_.resume_controller().OnAwake();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc
deleted file mode 100644
index 2499c21680..0000000000
--- a/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-BasicCommunicationSystemRequest::BasicCommunicationSystemRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {}
-
-void BasicCommunicationSystemRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc
deleted file mode 100644
index 16afce92e0..0000000000
--- a/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/basic_communication_system_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-BasicCommunicationSystemResponse::BasicCommunicationSystemResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {}
-
-void BasicCommunicationSystemResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_SystemRequest);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc
deleted file mode 100644
index e6b73879e5..0000000000
--- a/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "utils/logger.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {}
-
-void ButtonGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc
deleted file mode 100644
index a947fb7ba9..0000000000
--- a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-
-#include "utils/logger.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {}
-
-void ButtonGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS != code) {
- LOG4CXX_ERROR(logger_, "Error is returned. Capabilities won't be updated.");
- return;
- }
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_button_capabilities(
- (*message_)[strings::msg_params][hmi_response::capabilities]);
-
- hmi_capabilities.set_preset_bank_capabilities(
- (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/src/commands/hmi/close_popup_request.cc
deleted file mode 100644
index d628475438..0000000000
--- a/src/components/application_manager/src/commands/hmi/close_popup_request.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/close_popup_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ClosePopupRequest::ClosePopupRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-ClosePopupRequest::~ClosePopupRequest() {}
-
-void ClosePopupRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/src/commands/hmi/close_popup_response.cc
deleted file mode 100644
index 15adb2ee32..0000000000
--- a/src/components/application_manager/src/commands/hmi/close_popup_response.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/close_popup_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ClosePopupResponse::ClosePopupResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-ClosePopupResponse::~ClosePopupResponse() {}
-
-void ClosePopupResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(VS): Process response from HMI
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc
deleted file mode 100644
index a09fe71bf2..0000000000
--- a/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/decrypt_certificate_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DecryptCertificateRequest::DecryptCertificateRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-void DecryptCertificateRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t correlation_id = RequestToHMI::correlation_id();
- const uint32_t app_id = RequestToHMI::application_id();
- application_manager_.set_application_id(correlation_id, app_id);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc
deleted file mode 100644
index cea9290f7d..0000000000
--- a/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/decrypt_certificate_response.h"
-
-#include "application_manager/policies/policy_handler.h"
-#ifdef EXTERNAL_PROPRIETARY_MODE
-namespace application_manager {
-
-namespace commands {
-
-DecryptCertificateResponse::DecryptCertificateResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-DecryptCertificateResponse::~DecryptCertificateResponse() {}
-
-void DecryptCertificateResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- const bool is_succeeded = hmi_apis::Common_Result::SUCCESS == code;
-
- application_manager_.GetPolicyHandler().OnCertificateDecrypted(is_succeeded);
-}
-
-} // namespace commands
-} // namespace application_manager
-#endif // EXTERNAL_PROPRIETARY_MODE
diff --git a/src/components/application_manager/src/commands/hmi/dial_number_request.cc b/src/components/application_manager/src/commands/hmi/dial_number_request.cc
deleted file mode 100644
index b26541cb01..0000000000
--- a/src/components/application_manager/src/commands/hmi/dial_number_request.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/dial_number_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-DialNumberRequest::~DialNumberRequest() {}
-
-void DialNumberRequest::Run() {
- SendRequest();
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/dial_number_response.cc b/src/components/application_manager/src/commands/hmi/dial_number_response.cc
deleted file mode 100644
index 5511fa98f8..0000000000
--- a/src/components/application_manager/src/commands/hmi/dial_number_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/dial_number_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-DialNumberResponse::~DialNumberResponse() {}
-
-void DialNumberResponse::Run() {
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_DialNumber);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/src/commands/hmi/get_system_info_request.cc
deleted file mode 100644
index 379027c43a..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_system_info_request.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/get_system_info_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetSystemInfoRequest::GetSystemInfoRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-GetSystemInfoRequest::~GetSystemInfoRequest() {}
-
-void GetSystemInfoRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t correlation_id = RequestToHMI::correlation_id();
- uint32_t app_id = RequestToHMI::application_id();
- application_manager_.set_application_id(correlation_id, app_id);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc
deleted file mode 100644
index be6dabb292..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-namespace commands {
-
-GetSystemInfoResponse::GetSystemInfoResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-GetSystemInfoResponse::~GetSystemInfoResponse() {}
-
-void GetSystemInfoResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- const SystemInfo& info = GetSystemInfo(code);
-
- // We have to set preloaded flag as false in policy table on any response
- // of GetSystemInfo (SDLAQ-CRS-2365)
- application_manager_.GetPolicyHandler().OnGetSystemInfo(
- info.ccpu_version, info.wers_country_code, info.language);
-}
-
-const SystemInfo GetSystemInfoResponse::GetSystemInfo(
- const hmi_apis::Common_Result::eType code) const {
- SystemInfo info;
-
- if (hmi_apis::Common_Result::SUCCESS != code) {
- LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code);
- return info;
- }
- info.ccpu_version =
- (*message_)[strings::msg_params]["ccpu_version"].asString();
-
- info.wers_country_code =
- (*message_)[strings::msg_params]["wersCountryCode"].asString();
-
- const uint32_t lang_code =
- (*message_)[strings::msg_params]["language"].asUInt();
- info.language = application_manager::MessageHelper::CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code));
-
- application_manager_.hmi_capabilities().set_ccpu_version(info.ccpu_version);
-
- return info;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc
deleted file mode 100644
index bfcdf4985e..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_urls.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/get_urls.h"
-#include "application_manager/message.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-namespace commands {
-
-GetUrls::GetUrls(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-GetUrls::~GetUrls() {}
-
-void GetUrls::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- namespace Common_Result = hmi_apis::Common_Result;
- using policy::EndpointUrls;
-
- if (!application_manager_.GetPolicyHandler().PolicyEnabled()) {
- SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
- return;
- }
-
- const uint32_t service_to_check =
- (*message_)[strings::msg_params][hmi_request::service].asUInt();
-
- EndpointUrls endpoints;
- application_manager_.GetPolicyHandler().GetUpdateUrls(service_to_check,
- endpoints);
-
- if (endpoints.empty()) {
- LOG4CXX_ERROR(logger_, "No URLs for service " << service_to_check);
- SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
- return;
- }
-
-#ifdef PROPRIETARY_MODE
- const uint32_t policy_service = 7u;
-
- if (policy_service == service_to_check) {
- ProcessPolicyServiceURLs(endpoints);
- return;
- }
-#endif // PROPRIETARY_MODE
-
- ProcessServiceURLs(endpoints);
-}
-
-void GetUrls::ProcessServiceURLs(const policy::EndpointUrls& endpoints) {
- namespace Common_Result = hmi_apis::Common_Result;
- using smart_objects::SmartObject;
-
- (*message_)[strings::msg_params].erase(hmi_request::service);
- SmartObject& urls = (*message_)[strings::msg_params][hmi_response::urls];
-
- size_t index = 0;
- for (size_t e = 0; e < endpoints.size(); ++e) {
- ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(endpoints[e].app_id);
-
-#ifndef PROPRIETARY_MODE
- bool registered_not_default = false;
- if (policy::kDefaultId != endpoints[e].app_id) {
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Can't find application with policy id "
- << endpoints[e].app_id
- << " URLs adding for this application is skipped.");
- continue;
- }
- registered_not_default = true;
- }
-#endif // EXTERNAL_PROPRIETARY_MODE || HTTP
- for (size_t u = 0; u < endpoints[e].url.size(); ++u, ++index) {
- const std::string& app_url = endpoints[e].url[u];
- SmartObject& service_info = urls[index];
-
- service_info[strings::url] = app_url;
-#ifndef PROPRIETARY_MODE
- if (registered_not_default) {
- service_info[strings::app_id] = app->hmi_app_id();
- }
-#else // EXTERNAL_PROPRIETARY_MODE || HTTP
- service_info[hmi_response::policy_app_id] = endpoints[e].app_id;
-#endif
- }
- }
- SendResponseToHMI(Common_Result::SUCCESS);
-}
-
-void GetUrls::SendResponseToHMI(hmi_apis::Common_Result::eType result) {
- (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message_)[strings::params][hmi_response::code] = result;
- application_manager_.ManageHMICommand(message_);
-}
-
-#ifdef PROPRIETARY_MODE
-struct PolicyAppIdComparator {
- PolicyAppIdComparator(const std::string& policy_app_id)
- : policy_app_id_(policy_app_id) {}
-
- bool operator()(const policy::EndpointData& data) {
- return data.app_id == policy_app_id_;
- }
- std::string policy_app_id_;
-};
-
-void FillSODefaultUrls(smart_objects::SmartObject& urls,
- const policy::EndpointUrls& endpoints) {
- using smart_objects::SmartObject;
- PolicyAppIdComparator comparator(policy::kDefaultId);
- policy::EndpointUrls::const_iterator it =
- std::find_if(endpoints.begin(), endpoints.end(), comparator);
- if (it == endpoints.end()) {
- return;
- }
- SmartObject service_info = SmartObject(smart_objects::SmartType_Map);
- for (size_t i = 0; i < (*it).url.size(); ++i) {
- service_info[strings::url] = (*it).url[i];
- urls[i] = service_info;
- }
-}
-
-void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace smart_objects;
- using namespace application_manager;
- using namespace strings;
- using namespace hmi_apis;
-
- const uint32_t app_id_to_send_to =
- application_manager_.GetPolicyHandler().GetAppIdForSending();
-
- if (!app_id_to_send_to) {
- LOG4CXX_ERROR(logger_,
- "There are no available applications for processing.");
- SmartObject urls(SmartType_Array);
- FillSODefaultUrls(urls, endpoints);
- if (!urls.empty()) {
- (*message_)[msg_params][hmi_response::urls] = urls;
- }
- (*message_).erase(hmi_request::service);
- SendResponseToHMI(Common_Result::SUCCESS);
- return;
- }
-
- ApplicationSharedPtr app =
- application_manager_.application(app_id_to_send_to);
-
- if (!app.valid()) {
- LOG4CXX_WARN(logger_,
- "There is no registered application with "
- "connection key '"
- << app_id_to_send_to << "'");
- SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
- return;
- }
-
- SmartObject& object = *message_;
- object[msg_params].erase(hmi_request::service);
- object[msg_params][hmi_response::urls] = SmartObject(SmartType_Array);
- SmartObject& urls = object[msg_params][hmi_response::urls];
- const std::string mobile_app_id = app->policy_app_id();
-
- size_t index = 0;
- for (size_t i = 0; i < endpoints.size(); ++i) {
- using namespace helpers;
-
- const bool to_add = Compare<std::string, EQ, ONE>(
- endpoints[i].app_id, mobile_app_id, policy::kDefaultId);
- const bool is_default = policy::kDefaultId == endpoints[i].app_id;
-
- if (to_add) {
- for (size_t k = 0; k < endpoints[i].url.size(); ++k) {
- if (!is_default) {
- urls[index][strings::app_id] = app_id_to_send_to;
- }
- urls[index][strings::url] = endpoints[i].url[k];
- ++index;
- }
- }
- }
- SendResponseToHMI(Common_Result::SUCCESS);
- return;
-}
-#endif // PROPRIETARY_MODE
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/src/commands/hmi/get_urls_response.cc
deleted file mode 100644
index dd9686fbce..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_urls_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/get_urls_response.h"
-
-namespace application_manager {
-namespace commands {
-
-GetUrlsResponse::GetUrlsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-GetUrlsResponse::~GetUrlsResponse() {}
-
-void GetUrlsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc
deleted file mode 100644
index e38d1fc088..0000000000
--- a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-MixingAudioSupportedRequest::MixingAudioSupportedRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {}
-
-void MixingAudioSupportedRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc
deleted file mode 100644
index f8b58e6f35..0000000000
--- a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-MixingAudioSupportedResponse::MixingAudioSupportedResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {}
-
-void MixingAudioSupportedResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_attenuated_supported(
- (*message_)[strings::msg_params][hmi_response::attenuated_supported]
- .asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc
deleted file mode 100644
index 582caaa8f3..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviAlertManeuverRequest::NaviAlertManeuverRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {}
-
-void NaviAlertManeuverRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc
deleted file mode 100644
index 5f0422bf6a..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviAlertManeuverResponse::NaviAlertManeuverResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {}
-
-void NaviAlertManeuverResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_AlertManeuver);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
deleted file mode 100644
index 42b8c64fc0..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-
-#include "application_manager/message_helper.h"
-#include "protocol_handler/protocol_handler.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStartStreamRequest::AudioStartStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher())
- , retry_number_(0) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::pair<uint32_t, int32_t> stream_retry =
- application_manager_.get_settings().start_stream_retry_amount();
- default_timeout_ = stream_retry.second;
- retry_number_ = stream_retry.first;
- LOG4CXX_DEBUG(logger_,
- "default_timeout_ = " << default_timeout_
- << "; retry_number_ = " << retry_number_);
-}
-
-AudioStartStreamRequest::~AudioStartStreamRequest() {}
-
-void AudioStartStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Applcation with hmi_app_id " << application_id()
- << " does not exist");
- return;
- }
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
- correlation_id());
- app->set_audio_streaming_allowed(true);
- SendRequest();
-}
-
-void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "StartAudioStreamRequest aborted. Application not found");
- return;
- }
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_StartAudioStream: {
- LOG4CXX_DEBUG(logger_, "Received StartStream event");
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- LOG4CXX_INFO(logger_, "StartAudioStream response SUCCESS");
- if (application_manager_.HMILevelAllowsStreaming(app->app_id(),
- ServiceType::kAudio)) {
- app->set_audio_streaming_approved(true);
- } else {
- LOG4CXX_WARN(
- logger_,
- "StartAudioStreamRequest aborted. Application can not stream");
- }
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
- break;
- }
- if (hmi_apis::Common_Result::REJECTED == code) {
- LOG4CXX_INFO(logger_, "StartAudioStream response REJECTED");
- RetryStartSession();
- break;
- }
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void AudioStartStreamRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
- RetryStartSession();
-}
-
-void AudioStartStreamRequest::RetryStartSession() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "StartAudioStreamRequest aborted. Application not found");
- return;
- }
-
- if (!app->audio_streaming_allowed()) {
- LOG4CXX_WARN(logger_, "Audio streaming not allowed");
- return;
- }
-
- if (app->audio_streaming_approved()) {
- LOG4CXX_INFO(logger_,
- "AudioStartStream retry sequence stopped. "
- << "SUCCESS received");
- app->set_audio_stream_retry_number(0);
- return;
- }
-
- uint32_t curr_retry_number = app->audio_stream_retry_number();
- LOG4CXX_DEBUG(
- logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
-
- if (curr_retry_number < retry_number_) {
- LOG4CXX_DEBUG(logger_, "Send AudioStartStream retry");
- MessageHelper::SendAudioStartStream(app->app_id(), application_manager_);
- app->set_audio_stream_retry_number(++curr_retry_number);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Audio start stream retry sequence stopped. "
- << "Attempts expired.");
-
- application_manager_.EndNaviServices(app->app_id());
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc
deleted file mode 100644
index c7fc7365e7..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStartStreamResponse::AudioStartStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AudioStartStreamResponse::~AudioStartStreamResponse() {}
-
-void AudioStartStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_StartAudioStream);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
deleted file mode 100644
index f86ee8302a..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStopStreamRequest::AudioStopStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-AudioStopStreamRequest::~AudioStopStreamRequest() {}
-
-void AudioStopStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc
deleted file mode 100644
index c669d399f9..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStopStreamResponse::AudioStopStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AudioStopStreamResponse::~AudioStopStreamResponse() {}
-
-void AudioStopStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc b/src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc
deleted file mode 100644
index 51f862c957..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_get_way_points_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviGetWayPointsRequest::NaviGetWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviGetWayPointsRequest::~NaviGetWayPointsRequest() {}
-
-void NaviGetWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc
deleted file mode 100644
index f295845b24..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_get_way_points_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviGetWayPointsResponse::NaviGetWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviGetWayPointsResponse::~NaviGetWayPointsResponse() {}
-
-void NaviGetWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
deleted file mode 100644
index 4392258a31..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviIsReadyRequest::NaviIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-NaviIsReadyRequest::~NaviIsReadyRequest() {}
-
-void NaviIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_IsReady,
- correlation_id());
- SendRequest();
-}
-
-void NaviIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received Navigation_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::Navigation_IsReady);
- const bool is_available =
- ChangeInterfaceState(application_manager_,
- message,
- HmiInterfaces::HMI_INTERFACE_Navigation);
-
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_navi_cooperating(is_available);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
deleted file mode 100644
index 7daba4258b..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviIsReadyResponse::NaviIsReadyResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviIsReadyResponse::~NaviIsReadyResponse() {}
-
-void NaviIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::Navigation_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc
deleted file mode 100644
index ad878033ca..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_send_location_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSendLocationRequest::NaviSendLocationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviSendLocationRequest::~NaviSendLocationRequest() {}
-
-void NaviSendLocationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc
deleted file mode 100644
index a3d9f4c9e5..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_send_location_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSendLocationResponse::NaviSendLocationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviSendLocationResponse::~NaviSendLocationResponse() {}
-
-void NaviSendLocationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_SendLocation);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc
deleted file mode 100644
index d19db515ab..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the names of the copyright holders 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/hmi/navi_set_video_config_request.h"
-#include <string>
-#include <vector>
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSetVideoConfigRequest::NaviSetVideoConfigRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-NaviSetVideoConfigRequest::~NaviSetVideoConfigRequest() {}
-
-void NaviSetVideoConfigRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_WARN(logger_, "HMI interface Navigation is not supported");
- return;
- }
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with hmi_app_id " << application_id()
- << "does not exist");
- return;
- }
-
- subscribe_on_event(hmi_apis::FunctionID::Navigation_SetVideoConfig,
- correlation_id());
- SendRequest();
-}
-
-void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application is not found, abort NaviSetVideoConfigRequest");
- return;
- }
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- bool result = false;
- std::vector<std::string> rejected_params;
-
- if (code == hmi_apis::Common_Result::SUCCESS) {
- LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response");
- result = true;
- } else {
- LOG4CXX_DEBUG(logger_,
- "Received SetVideoConfig failure response (" << event.id()
- << ")");
- result = false;
- if (message[strings::msg_params].keyExists(strings::rejected_params)) {
- const smart_objects::SmartArray* list =
- message[strings::msg_params][strings::rejected_params].asArray();
- if (list != NULL) {
- for (unsigned int i = 0; i < list->size(); i++) {
- const std::string& param = (*list)[i].asString();
- // Make sure that we actually sent the parameter in the request
- if ((*message_)[strings::msg_params].keyExists(strings::config) &&
- (*message_)[strings::msg_params][strings::config].keyExists(
- param)) {
- rejected_params.push_back(param);
- }
- }
- }
- }
- }
- application_manager_.OnStreamingConfigured(
- app->app_id(),
- protocol_handler::ServiceType::kMobileNav,
- result,
- rejected_params);
- break;
- }
- default:
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
-}
-
-void NaviSetVideoConfigRequest::onTimeOut() {
- LOG4CXX_WARN(logger_, "Timed out while waiting for SetVideoConfig response");
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not found");
- return;
- }
-
- std::vector<std::string> empty;
- application_manager_.OnStreamingConfigured(
- app->app_id(), protocol_handler::ServiceType::kMobileNav, false, empty);
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc
deleted file mode 100644
index 03679eb3b1..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the names of the copyright holders 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/hmi/navi_set_video_config_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSetVideoConfigResponse::NaviSetVideoConfigResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviSetVideoConfigResponse::~NaviSetVideoConfigResponse() {}
-
-void NaviSetVideoConfigResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_SetVideoConfig);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc
deleted file mode 100644
index a92ef07d12..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviShowConstantTBTRequest::NaviShowConstantTBTRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {}
-
-void NaviShowConstantTBTRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc
deleted file mode 100644
index ede3272e8e..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviShowConstantTBTResponse::NaviShowConstantTBTResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {}
-
-void NaviShowConstantTBTResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
deleted file mode 100644
index ffc325b5e4..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-
-#include "application_manager/message_helper.h"
-#include "protocol_handler/protocol_handler.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStartStreamRequest::NaviStartStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher())
- , retry_number_(0) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::pair<uint32_t, int32_t> stream_retry =
- application_manager_.get_settings().start_stream_retry_amount();
- default_timeout_ = stream_retry.second;
- retry_number_ = stream_retry.first;
- LOG4CXX_DEBUG(logger_,
- "default_timeout_ = " << default_timeout_
- << "; retry_number_ = " << retry_number_);
-}
-
-NaviStartStreamRequest::~NaviStartStreamRequest() {}
-
-void NaviStartStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Applcation with hmi_app_id " << application_id()
- << "does not exist");
- return;
- }
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
- correlation_id());
- app->set_video_streaming_allowed(true);
- SendRequest();
-}
-
-void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "NaviStartStreamRequest aborted. Application not found");
- return;
- }
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_StartStream: {
- LOG4CXX_DEBUG(logger_, "Received StartStream event");
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- LOG4CXX_INFO(logger_, "NaviStartStreamResponse SUCCESS");
- if (application_manager_.HMILevelAllowsStreaming(
- app->app_id(), ServiceType::kMobileNav)) {
- app->set_video_streaming_approved(true);
- } else {
- LOG4CXX_DEBUG(
- logger_,
- "NaviStartStreamRequest aborted. Application can not stream");
- }
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
- break;
- }
- if (hmi_apis::Common_Result::REJECTED == code) {
- LOG4CXX_INFO(logger_, "StartStream response REJECTED ");
- RetryStartSession();
- break;
- }
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void NaviStartStreamRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
- RetryStartSession();
-}
-
-void NaviStartStreamRequest::RetryStartSession() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "NaviStartStreamRequest aborted. Application not found");
- return;
- }
-
- if (!app->video_streaming_allowed()) {
- LOG4CXX_WARN(logger_, "Video streaming not allowed");
- return;
- }
-
- if (app->video_streaming_approved()) {
- LOG4CXX_INFO(logger_,
- "NaviStartStream retry sequence stopped. "
- << "SUCCESS received");
- app->set_video_stream_retry_number(0);
- return;
- }
-
- uint32_t curr_retry_number = app->video_stream_retry_number();
- LOG4CXX_DEBUG(
- logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
-
- if (curr_retry_number < retry_number_) {
- LOG4CXX_DEBUG(logger_, "Send NaviStartStream retry");
- MessageHelper::SendNaviStartStream(app->app_id(), application_manager_);
- app->set_video_stream_retry_number(++curr_retry_number);
- } else {
- LOG4CXX_DEBUG(logger_,
- "NaviStartStream retry sequence stopped. "
- << "Attempts expired");
-
- application_manager_.EndNaviServices(app->app_id());
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc
deleted file mode 100644
index b0b9e672c3..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_start_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStartStreamResponse::NaviStartStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviStartStreamResponse::~NaviStartStreamResponse() {}
-
-void NaviStartStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_StartStream);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
deleted file mode 100644
index a40ee13b68..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStopStreamRequest::NaviStopStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviStopStreamRequest::~NaviStopStreamRequest() {}
-
-void NaviStopStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc
deleted file mode 100644
index 3a7fc75260..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_stop_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStopStreamResponse::NaviStopStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviStopStreamResponse::~NaviStopStreamResponse() {}
-
-void NaviStopStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc b/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc
deleted file mode 100644
index f2106c8724..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSubscribeWayPointsRequest::NaviSubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviSubscribeWayPointsRequest::~NaviSubscribeWayPointsRequest() {}
-
-void NaviSubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc
deleted file mode 100644
index f641051560..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_subscribe_way_points_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSubscribeWayPointsResponse::NaviSubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviSubscribeWayPointsResponse::~NaviSubscribeWayPointsResponse() {}
-
-void NaviSubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc
deleted file mode 100644
index e66069feef..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUnSubscribeWayPointsRequest::NaviUnSubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviUnSubscribeWayPointsRequest::~NaviUnSubscribeWayPointsRequest() {}
-
-void NaviUnSubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc
deleted file mode 100644
index 61216321e8..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUnsubscribeWayPointsResponse::NaviUnsubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviUnsubscribeWayPointsResponse::~NaviUnsubscribeWayPointsResponse() {}
-
-void NaviUnsubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc
deleted file mode 100644
index c37c3d12f9..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUpdateTurnListRequest::NaviUpdateTurnListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {}
-
-void NaviUpdateTurnListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc
deleted file mode 100644
index faf5719d05..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUpdateTurnListResponse::NaviUpdateTurnListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {}
-
-void NaviUpdateTurnListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
deleted file mode 100644
index 3c2d73b10c..0000000000
--- a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NotificationFromHMI::NotificationFromHMI(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace HMI app id with Mobile connection id
- ReplaceHMIWithMobileAppId(*message);
-}
-
-NotificationFromHMI::~NotificationFromHMI() {}
-
-bool NotificationFromHMI::Init() {
- return true;
-}
-
-bool NotificationFromHMI::CleanUp() {
- return true;
-}
-
-void NotificationFromHMI::Run() {}
-
-void NotificationFromHMI::SendNotificationToMobile(
- const MessageSharedPtr& message) {
- (*message)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- application_manager_.ManageMobileCommand(message, ORIGIN_SDL);
-}
-
-void NotificationFromHMI::CreateHMIRequest(
- const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
- if (!result) {
- LOG4CXX_ERROR(logger_, "Memory allocation failed.");
- return;
- }
-
- // get hmi correlation id for chaining further request from this object
- const uint32_t hmi_correlation_id_ =
- application_manager_.GetNextHMICorrelationID();
-
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
- request[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kRequest);
- request[strings::params][strings::function_id] =
- static_cast<int32_t>(function_id);
- request[strings::params][strings::correlation_id] = hmi_correlation_id_;
- request[strings::params][strings::protocol_version] =
- CommandImpl::protocol_version_;
- request[strings::params][strings::protocol_type] =
- CommandImpl::hmi_protocol_type_;
-
- request[strings::msg_params] = msg_params;
-
- if (!application_manager_.ManageHMICommand(result)) {
- LOG4CXX_ERROR(logger_, "Unable to send request");
- return;
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
deleted file mode 100644
index d52df950c3..0000000000
--- a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NotificationToHMI::NotificationToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
-
-NotificationToHMI::~NotificationToHMI() {}
-
-bool NotificationToHMI::Init() {
- // Replace Mobile connection id with HMI app id
- return ReplaceMobileWithHMIAppId(*message_);
-}
-
-bool NotificationToHMI::CleanUp() {
- return true;
-}
-
-void NotificationToHMI::Run() {}
-
-void NotificationToHMI::SendNotification() {
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc
deleted file mode 100644
index 70e5e7cefd..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {}
-
-void OnAllowSDLFunctionalityNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- std::string device_id;
- if ((*message_)[strings::msg_params].keyExists("device")) {
- device_id = (*message_)[strings::msg_params]["device"]["id"].asString();
- }
- application_manager_.GetPolicyHandler().OnAllowSDLFunctionalityNotification(
- (*message_)[strings::msg_params][hmi_response::allowed].asBool(),
- device_id);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc
deleted file mode 100644
index 76252a50fd..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-
-#include "application_manager/message_helper.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppActivatedNotification::OnAppActivatedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAppActivatedNotification::~OnAppActivatedNotification() {}
-
-void OnAppActivatedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppActivated);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc
deleted file mode 100644
index 86ce6a830c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppDeactivatedNotification::OnAppDeactivatedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {}
-
-void OnAppDeactivatedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc
deleted file mode 100644
index fa7293513a..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppPermissionChangedNotification::OnAppPermissionChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {}
-
-void OnAppPermissionChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc
deleted file mode 100644
index 19577f0127..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-#include <algorithm>
-#include <functional>
-#include <string>
-#include "policy/policy_types.h"
-#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
-
-namespace {
-
-/**
- * @brief Converts SmartObject data to group permission status and appends to
- * collection
- */
-struct PermissionsAppender
- : public std::unary_function<void,
- const smart_objects::SmartArray::value_type&> {
- PermissionsAppender(policy::PermissionConsent& consents)
- : allowed_key_(application_manager::hmi_response::allowed)
- , consents_(consents) {}
- void operator()(const smart_objects::SmartArray::value_type& item) const {
- using namespace policy;
- using namespace application_manager;
-
- FunctionalGroupPermission permissions;
-
- permissions.group_id = static_cast<int32_t>(item[strings::id].asInt());
- permissions.group_alias = item[strings::name].asString();
-
- if (item.keyExists(allowed_key_)) {
- permissions.state =
- item[allowed_key_].asBool() ? kGroupAllowed : kGroupDisallowed;
- }
-
- consents_.group_permissions.push_back(permissions);
- }
-
- private:
- const std::string allowed_key_;
- policy::PermissionConsent& consents_;
-};
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
-/**
- * @brief Converts SmartObject data to customer connectivity status item and
- * appends to collection
- */
-struct ExternalConsentStatusAppender
- : std::unary_function<void, const smart_objects::SmartArray::value_type&> {
- ExternalConsentStatusAppender(
- policy::ExternalConsentStatus& external_consent_status)
- : external_consent_status_(external_consent_status) {}
- void operator()(const smart_objects::SmartArray::value_type& item) const {
- using namespace policy;
- using namespace hmi_apis;
- using namespace application_manager;
-
- ExternalConsentStatusItem status_item(
- static_cast<uint32_t>(item[strings::entity_type].asUInt()),
- static_cast<uint32_t>(item[strings::entity_id].asUInt()),
- static_cast<Common_EntityStatus::eType>(
- item[strings::status].asUInt()) == Common_EntityStatus::ON
- ? policy::kStatusOn
- : policy::kStatusOff);
-
- external_consent_status_.insert(status_item);
- }
-
- private:
- policy::ExternalConsentStatus& external_consent_status_;
-};
-#endif
-} // namespace
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppPermissionConsentNotification::OnAppPermissionConsentNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {}
-
-void OnAppPermissionConsentNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
-
- uint32_t connection_key = 0;
-
- policy::PermissionConsent permission_consent;
-
- // If user defined group permissions for specific app
- if (msg_params.keyExists(strings::app_id)) {
- connection_key = msg_params[strings::app_id].asUInt();
- }
-
- if (msg_params.keyExists(strings::consented_functions)) {
- const smart_objects::SmartArray* user_consent =
- msg_params[strings::consented_functions].asArray();
-
- smart_objects::SmartArray::const_iterator it = user_consent->begin();
- smart_objects::SmartArray::const_iterator it_end = user_consent->end();
- for (; it != it_end; ++it) {
- policy::FunctionalGroupPermission permissions;
- permissions.group_id = (*it)["id"].asInt();
- permissions.group_alias = (*it)["name"].asString();
- if ((*it).keyExists("allowed")) {
- permissions.state = (*it)["allowed"].asBool()
- ? policy::kGroupAllowed
- : policy::kGroupDisallowed;
- } else {
- permissions.state = policy::kGroupUndefined;
- }
-
- permission_consent.group_permissions.push_back(permissions);
- }
-
- permission_consent.consent_source = msg_params[strings::source].asString();
- }
-#ifdef EXTERNAL_PROPRIETARY_MODE
- policy::ExternalConsentStatus external_consent_status;
- if (msg_params.keyExists(strings::external_consent_status)) {
- const smart_objects::SmartArray* system_external_consent_status =
- msg_params[strings::external_consent_status].asArray();
- ExternalConsentStatusAppender status_appender(external_consent_status);
- std::for_each(system_external_consent_status->begin(),
- system_external_consent_status->end(),
- status_appender);
- }
- application_manager_.GetPolicyHandler().OnAppPermissionConsent(
- connection_key, permission_consent, external_consent_status);
-#else
- application_manager_.GetPolicyHandler().OnAppPermissionConsent(
- connection_key, permission_consent);
-#endif
-}
-} // commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc
deleted file mode 100644
index a97e19b556..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppRegisteredNotification::OnAppRegisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAppRegisteredNotification::~OnAppRegisteredNotification() {}
-
-void OnAppRegisteredNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- // SDL must notify system about app registration before any dependent actions
- // will be started
- SendNotification();
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc
deleted file mode 100644
index f64e3e111b..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppUnregisteredNotification::OnAppUnregisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {}
-
-bool OnAppUnregisteredNotification::Init() {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Replacement of hmi id is skipped.");
- return true;
-}
-
-void OnAppUnregisteredNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // sending event for delete VRCommand on PerformInteraction
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc
deleted file mode 100644
index c3e81bdc30..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAudioDataStreamingNotification::OnAudioDataStreamingNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAudioDataStreamingNotification::~OnAudioDataStreamingNotification() {}
-
-void OnAudioDataStreamingNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc
deleted file mode 100644
index fc8d5989a1..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "utils/logger.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnButtonEventNotification::OnButtonEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-void OnButtonEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc
deleted file mode 100644
index abff87c962..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "utils/logger.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnButtonPressNotification::OnButtonPressNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-void OnButtonPressNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::Buttons_OnButtonPress);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- (*message_)[strings::params][strings::function_id] =
- static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID);
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc
deleted file mode 100644
index aae994ea34..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnButtonSubscriptionNotification::OnButtonSubscriptionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() {}
-
-void OnButtonSubscriptionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc
deleted file mode 100644
index 83ec785a9d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnDeviceChosenNotification::OnDeviceChosenNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnDeviceChosenNotification::~OnDeviceChosenNotification() {}
-
-void OnDeviceChosenNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
- application_manager_.ConnectToDevice(
- (*message_)[strings::msg_params][strings::device_info][strings::id]
- .asString());
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc
deleted file mode 100644
index 346c05032b..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/HMI_API.h"
-#include "encryption/hashing.h"
-
-namespace {
-// TODO(AOleynik) : replace this !!!
-void check_zero(const char& a, const char& b, std::string& bt_mac) {
- if ('0' != a && '0' == b) {
- bt_mac.push_back(a);
- bt_mac.push_back(b);
- } else if ('0' == a) {
- bt_mac.push_back(b);
- } else {
- bt_mac.push_back(a);
- bt_mac.push_back(b);
- }
-}
-
-std::string convert_to_bt_mac(std::string& deviceInternalId) {
- std::transform(deviceInternalId.begin(),
- deviceInternalId.end(),
- deviceInternalId.begin(),
- ::tolower);
-
- std::string bt_mac;
- check_zero(deviceInternalId[10], deviceInternalId[11], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[8], deviceInternalId[9], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[6], deviceInternalId[7], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[4], deviceInternalId[5], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[2], deviceInternalId[3], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[0], deviceInternalId[1], bt_mac);
-
- return bt_mac;
-}
-}
-
-namespace application_manager {
-
-namespace commands {
-
-OnDeviceStateChangedNotification::OnDeviceStateChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {}
-
-void OnDeviceStateChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if ((*message_)[strings::msg_params]["deviceState"] ==
- hmi_apis::Common_DeviceState::UNPAIRED) {
- // It is expected, that "deviceInternalId" is the device MAC address in
- // form XXXXXXXXXX
- std::string device_id =
- (*message_)[strings::msg_params]["deviceInternalId"].asString();
- if (device_id.empty()) {
- if ((*message_)[strings::msg_params].keyExists("deviceId")) {
- device_id =
- (*message_)[strings::msg_params]["deviceId"]["id"].asString();
- }
- } else {
- // Policy uses hashed MAC address as device_id
- LOG4CXX_DEBUG(logger_, "Device_id from HMI: " << device_id);
- std::string bt_mac = convert_to_bt_mac(device_id);
- LOG4CXX_DEBUG(logger_, "Device_id as BT MAC: " << bt_mac);
- device_id = encryption::MakeHash(bt_mac);
- LOG4CXX_DEBUG(logger_, "Device_id hashed as BT MAC : " << device_id);
- }
- application_manager_.GetPolicyHandler().RemoveDevice(device_id);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc
deleted file mode 100644
index a895d353ce..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <set>
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/make_shared.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-namespace {
-struct OnDriverDistractionProcessor {
- OnDriverDistractionProcessor(
- OnDriverDistractionNotification& command,
- smart_objects::SmartObjectSPtr on_driver_distraction_so,
- ApplicationManager& application_manager)
- : command_(command)
- , on_driver_distraction_so_(on_driver_distraction_so)
- , application_manager_(application_manager)
- , stringified_function_id_(MessageHelper::StringifiedFunctionID(
- mobile_api::FunctionID::OnDriverDistractionID)) {}
-
- void operator()(ApplicationSharedPtr application) {
- if (application) {
- (*on_driver_distraction_so_)[strings::params][strings::connection_key] =
- application->app_id();
- const RPCParams params;
- policy::CheckPermissionResult result;
- application_manager_.GetPolicyHandler().CheckPermissions(
- application, stringified_function_id_, params, result);
- if (result.hmi_level_permitted != policy::kRpcAllowed) {
- MobileMessageQueue messages;
- application->SwapMobileMessageQueue(messages);
- messages.erase(
- std::remove_if(
- messages.begin(),
- messages.end(),
- [this](smart_objects::SmartObjectSPtr message) {
- return (*message)[strings::params][strings::function_id]
- .asString() == stringified_function_id_;
- }),
- messages.end());
- application->PushMobileMessage(on_driver_distraction_so_);
- return;
- }
- command_.SendNotificationToMobile(on_driver_distraction_so_);
- }
- }
-
- private:
- OnDriverDistractionNotification& command_;
- smart_objects::SmartObjectSPtr on_driver_distraction_so_;
- ApplicationManager& application_manager_;
- std::string stringified_function_id_;
-};
-}
-
-OnDriverDistractionNotification::OnDriverDistractionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
-
-void OnDriverDistractionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_DriverDistractionState::eType state =
- static_cast<hmi_apis::Common_DriverDistractionState::eType>(
- (*message_)[strings::msg_params][hmi_notification::state].asInt());
- application_manager_.set_driver_distraction_state(state);
-
- smart_objects::SmartObjectSPtr on_driver_distraction =
- utils::MakeShared<smart_objects::SmartObject>();
-
- if (!on_driver_distraction) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- (*on_driver_distraction)[strings::params][strings::function_id] =
- mobile_api::FunctionID::OnDriverDistractionID;
- (*on_driver_distraction)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
- state;
-
- const ApplicationSet applications =
- application_manager_.applications().GetData();
-
- OnDriverDistractionProcessor processor(
- *this, on_driver_distraction, application_manager_);
- std::for_each(applications.begin(), applications.end(), processor);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc
deleted file mode 100644
index c211ffde50..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnEventChangedNotification::OnEventChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnEventChangedNotification::~OnEventChangedNotification() {}
-
-void OnEventChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnEventChanged);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
deleted file mode 100644
index cb68b21263..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
-
-#include "application_manager/application_manager.h"
-#include "application_manager/resumption/resume_ctrl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnExitAllApplicationsNotification::OnExitAllApplicationsNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {}
-
-void OnExitAllApplicationsNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_ApplicationsCloseReason::eType reason =
- static_cast<hmi_apis::Common_ApplicationsCloseReason::eType>(
- (*message_)[strings::msg_params][hmi_request::reason].asInt());
- LOG4CXX_DEBUG(logger_, "Reason " << reason);
-
- mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
- mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM;
-
- switch (reason) {
- case hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF: {
- mob_reason = mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF;
- break;
- }
- case hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET: {
- mob_reason = mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET;
- break;
- }
- case hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS: {
- mob_reason = mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS;
- break;
- }
- case hmi_apis::Common_ApplicationsCloseReason::SUSPEND: {
- application_manager_.resume_controller().OnSuspend();
- SendOnSDLPersistenceComplete();
- return;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason);
- return;
- }
- }
-
- application_manager_.SetUnregisterAllApplicationsReason(mob_reason);
-
- if (mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET == mob_reason ||
- mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS ==
- mob_reason) {
- application_manager_.HeadUnitReset(mob_reason);
- }
- kill(getpid(), SIGINT);
-}
-
-void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObjectSPtr message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
- (*message)[strings::params][strings::function_id] =
- hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
- (*message)[strings::params][strings::message_type] =
- MessageType::kNotification;
- (*message)[strings::params][strings::correlation_id] =
- application_manager_.GetNextHMICorrelationID();
-
- application_manager_.ManageHMICommand(message);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
deleted file mode 100644
index efdfaf8f3e..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#ifdef SDL_REMOTE_CONTROL
-#include "functional_module/plugin_manager.h"
-#endif // SDL_REMOTE_CONTROL
-
-namespace application_manager {
-
-namespace commands {
-
-OnExitApplicationNotification::OnExitApplicationNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnExitApplicationNotification::~OnExitApplicationNotification() {}
-
-void OnExitApplicationNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- using namespace mobile_apis;
- using namespace hmi_apis;
-
- uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt();
- ApplicationSharedPtr app_impl = application_manager_.application(app_id);
-
- if (!(app_impl.valid())) {
- LOG4CXX_ERROR(logger_, "Application does not exist");
- return;
- }
-
-#ifdef SDL_REMOTE_CONTROL
- application_manager_.GetPluginManager().OnApplicationEvent(
- functional_modules::ApplicationEvent::kApplicationExit, app_impl);
-#endif // SDL_REMOTE_CONTROL
-
- Common_ApplicationExitReason::eType reason;
- reason = static_cast<Common_ApplicationExitReason::eType>(
- (*message_)[strings::msg_params][strings::reason].asInt());
-
- switch (reason) {
- case Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION: {
- break;
- }
- case Common_ApplicationExitReason::USER_EXIT: {
- break;
- }
- case Common_ApplicationExitReason::UNAUTHORIZED_TRANSPORT_REGISTRATION: {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
- commands::Command::ORIGIN_SDL);
- // HMI rejects registration for navi application
- application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
- return;
- }
- case Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE: {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
- return;
- }
- default: {
- LOG4CXX_WARN(logger_, "Unhandled reason");
- return;
- }
- }
-
- application_manager_.state_controller().SetRegularState(
- app_impl, HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE, false);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc
deleted file mode 100644
index e69d111d2c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnFileRemovedNotification::OnFileRemovedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnFileRemovedNotification::~OnFileRemovedNotification() {}
-
-void OnFileRemovedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/src/commands/hmi/on_find_applications.cc
deleted file mode 100644
index 9d3633ba6d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_find_applications.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_find_applications.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnFindApplications::OnFindApplications(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnFindApplications::~OnFindApplications() {}
-
-void OnFindApplications::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(PV): add UpdateAppsOnDevice to ApplicationManager
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc
deleted file mode 100644
index 8c772d6dcd..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {}
-
-void OnIgnitionCycleOverNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.GetPolicyHandler().OnIgnitionCycleOver();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc
deleted file mode 100644
index e25de1f3a9..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {}
-
-void OnNaviTBTClientStateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc
deleted file mode 100644
index 17d1b420be..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnNaviWayPointChangeNotification::OnNaviWayPointChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& app_man)
- : NotificationFromHMI(message, app_man) {}
-
-OnNaviWayPointChangeNotification::~OnNaviWayPointChangeNotification() {}
-
-void OnNaviWayPointChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_policy_update.cc
deleted file mode 100644
index 39b179f967..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_policy_update.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_policy_update.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-OnPolicyUpdate::OnPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnPolicyUpdate::~OnPolicyUpdate() {}
-
-void OnPolicyUpdate::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.GetPolicyHandler().OnPTExchangeNeeded();
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc
deleted file mode 100644
index 596b7d4549..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnPutFileNotification::OnPutFileNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnPutFileNotification::~OnPutFileNotification() {}
-
-void OnPutFileNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
deleted file mode 100644
index 3a45e0f934..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ready_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnReadyNotification::OnReadyNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnReadyNotification::~OnReadyNotification() {}
-
-void OnReadyNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.OnHMIStartedCooperation();
- event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
deleted file mode 100644
index 8724a072ed..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/hmi/on_received_policy_update.h"
-#include "application_manager/application_manager.h"
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnReceivedPolicyUpdate::OnReceivedPolicyUpdate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {}
-
-void OnReceivedPolicyUpdate::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
- const std::string& file_path =
- (*message_)[strings::msg_params][hmi_notification::policyfile].asString();
- policy::BinaryMessage file_content;
- if (!file_system::ReadBinaryFile(file_path, file_content)) {
- LOG4CXX_ERROR(logger_, "Failed to read Update file.");
- return;
- }
- application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(file_path,
- file_content);
-#else
- LOG4CXX_WARN(logger_,
- "This RPC is part of extended policy flow."
- "Please re-build with extended policy mode enabled.");
-#endif
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc
deleted file mode 100644
index 4d126ac67d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnRecordStartdNotification::OnRecordStartdNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnRecordStartdNotification::~OnRecordStartdNotification() {}
-
-void OnRecordStartdNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc
deleted file mode 100644
index ce3c371cf8..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnResumeAudioSourceNotification::OnResumeAudioSourceNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {}
-
-void OnResumeAudioSourceNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc
deleted file mode 100644
index 0517ea8d24..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSDLCloseNotification::OnSDLCloseNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnSDLCloseNotification::~OnSDLCloseNotification() {}
-
-void OnSDLCloseNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc
deleted file mode 100644
index a9c36813f6..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSDLConsentNeededNotification::OnSDLConsentNeededNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {}
-
-void OnSDLConsentNeededNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc
deleted file mode 100644
index e30a0fb902..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() {}
-
-void OnSDLPersistenceCompleteNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc
deleted file mode 100644
index 8e94b2b004..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnStartDeviceDiscovery::OnStartDeviceDiscovery(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {}
-
-void OnStartDeviceDiscovery::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.StartDevicesDiscovery();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc
deleted file mode 100644
index 78a6b68324..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnStatusUpdateNotification::OnStatusUpdateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnStatusUpdateNotification::~OnStatusUpdateNotification() {}
-
-void OnStatusUpdateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc
deleted file mode 100644
index 887aacf5b9..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-namespace commands {
-
-OnSystemContextNotification::OnSystemContextNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemContextNotification::~OnSystemContextNotification() {}
-
-void OnSystemContextNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- mobile_api::SystemContext::eType system_context =
- static_cast<mobile_api::SystemContext::eType>(
- (*message_)[strings::msg_params][hmi_notification::system_context]
- .asInt());
-
- ApplicationSharedPtr app;
- if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_MENU == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED == system_context)) {
- app = application_manager_.active_application();
- } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) {
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
- }
- }
-
- if (app && mobile_api::SystemContext::INVALID_ENUM != system_context) {
- application_manager_.state_controller().SetRegularState(app,
- system_context);
- } else {
- LOG4CXX_ERROR(logger_, "Application does not exist");
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc
deleted file mode 100644
index 4885420f1c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/application_manager.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSystemErrorNotification::OnSystemErrorNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemErrorNotification::~OnSystemErrorNotification() {}
-
-void OnSystemErrorNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const int code =
- (*message_)[strings::msg_params][hmi_notification::error].asInt();
-
- application_manager_.GetPolicyHandler().OnSystemError(code);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc
deleted file mode 100644
index 00b3649284..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSystemInfoChangedNotification::OnSystemInfoChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {}
-
-void OnSystemInfoChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t lang_code =
- (*message_)[strings::msg_params][strings::language].asUInt();
- const std::string language =
- application_manager::MessageHelper::CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code));
-
- application_manager_.GetPolicyHandler().OnSystemInfoChanged(language);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
deleted file mode 100644
index ea91dca5f1..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/application_impl.h"
-
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-using policy::PolicyHandlerInterface;
-
-namespace application_manager {
-
-namespace commands {
-
-OnSystemRequestNotification::OnSystemRequestNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemRequestNotification::~OnSystemRequestNotification() {}
-
-void OnSystemRequestNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& params = (*message_)[strings::params];
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
-
- params[strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
-
- // According to HMI API, this should be HMI unique id, but during processing
- // messages from HMI this param is replaced by connection key, so below it
- // will be treated as connection key
- ApplicationSharedPtr app;
- if (msg_params.keyExists(strings::app_id)) {
- const uint32_t app_id = msg_params[strings::app_id].asUInt();
- LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for appID " << app_id);
- LOG4CXX_DEBUG(logger_, "Searching app to send OnSystemRequest by appID.");
- app = application_manager_.application(app_id);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Received OnSystemRequest without appID."
- " One of registered apps will be used.");
- LOG4CXX_DEBUG(logger_, "Searching registered app to send OnSystemRequest.");
- const PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- const uint32_t selected_app_id = policy_handler.GetAppIdForSending();
- if (0 == selected_app_id) {
- LOG4CXX_WARN(logger_,
- "Can't select application to forward OnSystemRequest.");
- return;
- }
- app = application_manager_.application(selected_app_id);
- }
-
- if (!app.valid()) {
- LOG4CXX_WARN(logger_,
- "No valid application found to forward OnSystemRequest.");
- return;
- }
-
- std::string device_mac;
- application_manager_.connection_handler()
- .get_session_observer()
- .GetDataOnDeviceID(app->device(), NULL, NULL, &device_mac, NULL);
-
- if (policy::kDeviceAllowed !=
- application_manager_.GetPolicyHandler().GetUserConsentForDevice(
- device_mac)) {
- LOG4CXX_WARN(logger_,
- "Application "
- << app->policy_app_id()
- << " is registered from non-consented device."
- "Can't forward notification to application.");
- return;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Sending request with application id " << app->policy_app_id());
-
- params[strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc
deleted file mode 100644
index bd152c2af0..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {}
-
-void OnTTSLanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_active_tts_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- /* need to clarify, because unchanged VR
- cause WRONG_LANGUAGE on Register */
- hmi_capabilities.set_active_vr_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- (*message_)[strings::msg_params][strings::hmi_display_language] =
- hmi_capabilities.active_ui_language();
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
-
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
- ApplicationSetIt it = accessor.begin();
- for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
-
- if (static_cast<int>(app->language()) !=
- (*message_)[strings::msg_params][strings::language].asInt()) {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app->app_id(),
- mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(
- app->app_id(), mobile_apis::Result::SUCCESS, false);
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc
deleted file mode 100644
index 283e2056ba..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {}
-
-void OnTTSResetTimeoutNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc
deleted file mode 100644
index 317465f354..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTTSStartedNotification::OnTTSStartedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSStartedNotification::~OnTTSStartedNotification() {}
-
-void OnTTSStartedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::TTS_Started);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc
deleted file mode 100644
index 7f763d8598..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTTSStoppedNotification::OnTTSStoppedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSStoppedNotification::~OnTTSStoppedNotification() {}
-
-void OnTTSStoppedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_Stopped);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc
deleted file mode 100644
index 9f91d99a85..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnUICommandNotification::OnUICommandNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUICommandNotification::~OnUICommandNotification() {}
-
-void OnUICommandNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
-
- (*message_)[strings::msg_params][strings::trigger_source] =
- static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU);
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc
deleted file mode 100644
index 117fec5741..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {}
-
-void OnUIKeyBoardInputNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnKeyboardInputID;
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc
deleted file mode 100644
index 6e8e38f757..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnUILanguageChangeNotification::OnUILanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {}
-
-void OnUILanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_active_ui_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- (*message_)[strings::msg_params][strings::hmi_display_language] =
- (*message_)[strings::msg_params][strings::language];
-
- (*message_)[strings::msg_params][strings::language] =
- hmi_capabilities.active_vr_language();
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
-
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
-
- if (app->ui_language() !=
- (*message_)[strings::msg_params][strings::hmi_display_language]
- .asInt()) {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app->app_id(),
- mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(
- app->app_id(), mobile_apis::Result::SUCCESS, false);
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc
deleted file mode 100644
index a5fea7bf8d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnUIResetTimeoutNotification::OnUIResetTimeoutNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {}
-
-void OnUIResetTimeoutNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc
deleted file mode 100644
index 7709af8720..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnUITouchEventNotification::OnUITouchEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUITouchEventNotification::~OnUITouchEventNotification() {}
-
-void OnUITouchEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnTouchEventID;
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/src/commands/hmi/on_update_device_list.cc
deleted file mode 100644
index b245ea21aa..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_update_device_list.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/on_update_device_list.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnUpdateDeviceList::OnUpdateDeviceList(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUpdateDeviceList::~OnUpdateDeviceList() {}
-
-void OnUpdateDeviceList::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
deleted file mode 100644
index 9b10055e2c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {}
-
-void OnVIAccPedalPositionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc
deleted file mode 100644
index 58f9add514..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIBeltStatusNotification::OnVIBeltStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {}
-
-void OnVIBeltStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc
deleted file mode 100644
index 33f2944c38..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIBodyInformationNotification::OnVIBodyInformationNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {}
-
-void OnVIBodyInformationNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc
deleted file mode 100644
index 9cbf612be1..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIDeviceStatusNotification::OnVIDeviceStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {}
-
-void OnVIDeviceStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc
deleted file mode 100644
index e521ac3a37..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIDriverBrakingNotification::OnVIDriverBrakingNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {}
-
-void OnVIDriverBrakingNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc
deleted file mode 100644
index ebed955270..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIEngineTorqueNotification::OnVIEngineTorqueNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {}
-
-void OnVIEngineTorqueNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc
deleted file mode 100644
index 9f0696fdc6..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {}
-
-void OnVIExternalTemperatureNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc
deleted file mode 100644
index ef650a9f99..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIFuelLevelNotification::OnVIFuelLevelNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {}
-
-void OnVIFuelLevelNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc
deleted file mode 100644
index a5267d8dac..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {}
-
-void OnVIFuelLevelStateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc
deleted file mode 100644
index 63b95bf6dc..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIGpsDataNotification::OnVIGpsDataNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIGpsDataNotification::~OnVIGpsDataNotification() {}
-
-void OnVIGpsDataNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc
deleted file mode 100644
index 7d494f02d3..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {}
-
-void OnVIHeadLampStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
deleted file mode 100644
index a62f4cacea..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIInstantFuelConsumptionNotification::
- ~OnVIInstantFuelConsumptionNotification() {}
-
-void OnVIInstantFuelConsumptionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc
deleted file mode 100644
index 229d50667b..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIMyKeyNotification::OnVIMyKeyNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIMyKeyNotification::~OnVIMyKeyNotification() {}
-
-void OnVIMyKeyNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc
deleted file mode 100644
index 10f236539c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIOdometerNotification::OnVIOdometerNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIOdometerNotification::~OnVIOdometerNotification() {}
-
-void OnVIOdometerNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc
deleted file mode 100644
index 81585eabca..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIPrndlNotification::OnVIPrndlNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIPrndlNotification::~OnVIPrndlNotification() {}
-
-void OnVIPrndlNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc
deleted file mode 100644
index b5c0703917..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIRpmNotification::OnVIRpmNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIRpmNotification::~OnVIRpmNotification() {}
-
-void OnVIRpmNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc
deleted file mode 100644
index aacafb71c9..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVISpeedNotification::OnVISpeedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVISpeedNotification::~OnVISpeedNotification() {}
-
-void OnVISpeedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
deleted file mode 100644
index af102ea926..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {}
-
-void OnVISteeringWheelAngleNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc
deleted file mode 100644
index 99506e6171..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVITirePressureNotification::OnVITirePressureNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVITirePressureNotification::~OnVITirePressureNotification() {}
-
-void OnVITirePressureNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
deleted file mode 100644
index bba7e2f3ff..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIVehicleDataNotification::OnVIVehicleDataNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {}
-
-void OnVIVehicleDataNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
- if (msg_params.keyExists(strings::odometer)) {
- application_manager_.IviInfoUpdated(
- mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER,
- msg_params[strings::odometer].asInt());
- }
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc
deleted file mode 100644
index c360e41dff..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIVinNotification::OnVIVinNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIVinNotification::~OnVIVinNotification() {}
-
-void OnVIVinNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc
deleted file mode 100644
index 08fb3f31d4..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIWiperStatusNotification::OnVIWiperStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {}
-
-void OnVIWiperStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc
deleted file mode 100644
index ee0a91f5ef..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVideoDataStreamingNotification::OnVideoDataStreamingNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnVideoDataStreamingNotification::~OnVideoDataStreamingNotification() {}
-
-void OnVideoDataStreamingNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc
deleted file mode 100644
index c609e2dc0a..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/state_controller.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRCommandNotification::OnVRCommandNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRCommandNotification::~OnVRCommandNotification() {}
-
-void OnVRCommandNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t cmd_id =
- (*message_)[strings::msg_params][strings::cmd_id].asUInt();
- uint32_t max_cmd_id = application_manager_.get_settings().max_cmd_id();
-
- // Check if this is one of standart VR commands (i.e. "Help")
- if (cmd_id > max_cmd_id + 1) {
- LOG4CXX_INFO(logger_, "Switched App");
- const uint32_t app_id = cmd_id - max_cmd_id;
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (app) {
- application_manager_.state_controller().SetRegularState(
- app, mobile_apis::HMILevel::HMI_FULL, true);
- } else {
- LOG4CXX_ERROR(logger_, "Unable to find appication " << app_id);
- }
- return;
- }
-
- // Check if this is "Help"
- if (cmd_id == max_cmd_id + 1) {
- return;
- }
- const uint32_t app_id =
- (*message_)[strings::msg_params][strings::app_id].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- /* check if perform interaction is active
- * if it is active we should sent to HMI DeleteCommand request
- * and PerformInterActionResponse to mobile
- */
- if (0 != app->is_perform_interaction_active()) {
- event_engine::Event event(hmi_apis::FunctionID::VR_OnCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- } else {
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
-
- (*message_)[strings::msg_params][strings::trigger_source] =
- static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR);
- SendNotificationToMobile(message_);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc
deleted file mode 100644
index bbdb55cde6..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRLanguageChangeNotification::OnVRLanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {}
-
-void OnVRLanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_active_vr_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- (*message_)[strings::msg_params][strings::hmi_display_language] =
- hmi_capabilities.active_ui_language();
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
-
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
- if (static_cast<int32_t>(app->language()) !=
- (*message_)[strings::msg_params][strings::language].asInt()) {
- application_manager_.state_controller().SetRegularState(
- app, mobile_api::HMILevel::HMI_NONE, false);
-
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app->app_id(),
- mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(
- app->app_id(), mobile_apis::Result::SUCCESS, false);
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc
deleted file mode 100644
index 68942fcf01..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRStartedNotification::OnVRStartedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRStartedNotification::~OnVRStartedNotification() {}
-
-void OnVRStartedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_Started);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc
deleted file mode 100644
index e8f9fab847..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRStoppedNotification::OnVRStoppedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRStoppedNotification::~OnVRStoppedNotification() {}
-
-void OnVRStoppedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_Stopped);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc
deleted file mode 100644
index 32b296a3b9..0000000000
--- a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/rc_get_capabilities_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-RCGetCapabilitiesRequest::RCGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-RCGetCapabilitiesRequest::~RCGetCapabilitiesRequest() {}
-
-void RCGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc
deleted file mode 100644
index 82cbd7f128..0000000000
--- a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-RCGetCapabilitiesResponse::RCGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-RCGetCapabilitiesResponse::~RCGetCapabilitiesResponse() {}
-
-void RCGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- bool capability_exists =
- (*message_)[strings::msg_params].keyExists(strings::rc_capability);
-
- if (capability_exists) {
- hmi_capabilities.set_rc_capability(
- (*message_)[strings::msg_params][strings::rc_capability]);
- }
- hmi_capabilities.set_rc_supported(capability_exists);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc
deleted file mode 100644
index a976ce1044..0000000000
--- a/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/rc_is_ready_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-RCIsReadyRequest::RCIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-RCIsReadyRequest::~RCIsReadyRequest() {}
-
-void RCIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::RC_IsReady, correlation_id());
- SendRequest();
-}
-
-void RCIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::RC_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received RC_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::RC_IsReady);
- const bool is_available = ChangeInterfaceState(
- application_manager_, message, HmiInterfaces::HMI_INTERFACE_RC);
-
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_rc_cooperating(is_available);
- if (!is_available) {
- hmi_capabilities.set_rc_supported(false);
- }
-
- if (!CheckAvailabilityHMIInterfaces(application_manager_,
- HmiInterfaces::HMI_INTERFACE_RC)) {
- LOG4CXX_INFO(logger_,
- "HmiInterfaces::HMI_INTERFACE_RC isn't available");
- return;
- }
- SendMessageToHMI();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void RCIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void RCIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::RC_GetCapabilities, application_manager_));
- application_manager_.ManageHMICommand(get_capabilities);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc
deleted file mode 100644
index 6756b294f3..0000000000
--- a/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/rc_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-RCIsReadyResponse::RCIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-RCIsReadyResponse::~RCIsReadyResponse() {}
-
-void RCIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::RC_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
deleted file mode 100644
index 5a4e7b149e..0000000000
--- a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "application_manager/application_manager.h"
-#include "utils/make_shared.h"
-
-namespace application_manager {
-
-namespace commands {
-
-RequestFromHMI::RequestFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {
- // Replace HMI app id with Mobile connection id
- ReplaceHMIWithMobileAppId(*message);
-}
-
-RequestFromHMI::~RequestFromHMI() {}
-
-bool RequestFromHMI::Init() {
- return true;
-}
-
-bool RequestFromHMI::CleanUp() {
- return true;
-}
-
-void RequestFromHMI::Run() {}
-
-void RequestFromHMI::on_event(const event_engine::Event& 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) {
- smart_objects::SmartObjectSPtr message =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- FillCommonParametersOfSO(*message, correlation_id, function_id);
- (*message)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message)[strings::params][hmi_response::code] = 0;
- (*message)[strings::msg_params][strings::success] = success;
- (*message)[strings::msg_params][strings::result_code] = result_code;
-
- application_manager_.ManageHMICommand(message);
-}
-
-void RequestFromHMI::SendErrorResponse(
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code,
- const std::string error_message) {
- smart_objects::SmartObjectSPtr message =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- FillCommonParametersOfSO(*message, correlation_id, function_id);
- (*message)[strings::params][strings::message_type] =
- MessageType::kErrorResponse;
- (*message)[strings::params][hmi_response::code] = result_code;
- (*message)[strings::params][strings::error_msg] = error_message;
-
- application_manager_.ManageHMICommand(message);
-}
-
-void RequestFromHMI::FillCommonParametersOfSO(
- smart_objects::SmartObject& message,
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id) {
- (message)[strings::params][strings::function_id] = function_id;
- (message)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (message)[strings::params][strings::protocol_version] = protocol_version_;
- (message)[strings::params][strings::correlation_id] = correlation_id;
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc b/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
deleted file mode 100644
index 6905e7cdef..0000000000
--- a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
- HmiInterfaces::InterfaceID interface) {
- const HmiInterfaces::InterfaceState state =
- application_manager.hmi_interfaces().GetInterfaceState(interface);
- return HmiInterfaces::STATE_NOT_AVAILABLE != state;
-}
-
-bool ChangeInterfaceState(ApplicationManager& application_manager,
- const smart_objects::SmartObject& response_from_hmi,
- HmiInterfaces::InterfaceID interface) {
- if (response_from_hmi[strings::msg_params].keyExists(strings::available)) {
- const bool is_available =
- response_from_hmi[strings::msg_params][strings::available].asBool();
- const HmiInterfaces::InterfaceState interface_state =
- is_available ? HmiInterfaces::STATE_AVAILABLE
- : HmiInterfaces::STATE_NOT_AVAILABLE;
- application_manager.hmi_interfaces().SetInterfaceState(interface,
- interface_state);
- return is_available;
- }
- return false;
-}
-
-RequestToHMI::RequestToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
-
-RequestToHMI::~RequestToHMI() {}
-
-bool RequestToHMI::Init() {
- // Replace Mobile connection id with HMI app id
- return ReplaceMobileWithHMIAppId(*message_);
-}
-
-bool RequestToHMI::CleanUp() {
- return true;
-}
-
-void RequestToHMI::Run() {}
-
-void RequestToHMI::SendRequest() {
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
deleted file mode 100644
index d6d5d95d07..0000000000
--- a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // If it is error response, shift info
- if ((*message)[strings::params].keyExists(hmi_response::message)) {
- (*message)[strings::msg_params][strings::info] =
- (*message)[strings::params][hmi_response::message];
- }
-
- // Replace HMI app id with Mobile connection id
- ReplaceHMIWithMobileAppId(*message);
-}
-
-ResponseFromHMI::~ResponseFromHMI() {}
-
-bool ResponseFromHMI::Init() {
- return true;
-}
-
-bool ResponseFromHMI::CleanUp() {
- return true;
-}
-
-void ResponseFromHMI::Run() {}
-
-void ResponseFromHMI::SendResponseToMobile(
- const MessageSharedPtr& message, ApplicationManager& application_manager) {
- (*message)[strings::params][strings::message_type] = MessageType::kResponse;
-
- application_manager_.ManageMobileCommand(message, ORIGIN_SDL);
-}
-
-void ResponseFromHMI::CreateHMIRequest(
- const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
-
- if (!result) {
- LOG4CXX_ERROR(logger_, "Memory allocation failed.");
- return;
- }
-
- // get hmi correlation id for chaining further request from this object
- const uint32_t hmi_correlation_id_ =
- application_manager_.GetNextHMICorrelationID();
-
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
- request[strings::params][strings::message_type] = MessageType::kRequest;
- request[strings::params][strings::function_id] = function_id;
- request[strings::params][strings::correlation_id] = hmi_correlation_id_;
- request[strings::params][strings::protocol_version] =
- CommandImpl::protocol_version_;
- request[strings::params][strings::protocol_type] =
- CommandImpl::hmi_protocol_type_;
-
- request[strings::msg_params] = msg_params;
-
- if (!application_manager_.ManageHMICommand(result)) {
- LOG4CXX_ERROR(logger_, "Unable to send request");
- return;
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
deleted file mode 100644
index de1e1e0fde..0000000000
--- a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResponseToHMI::ResponseToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
-
-ResponseToHMI::~ResponseToHMI() {}
-
-bool ResponseToHMI::Init() {
- // Replace Mobile connection id with HMI app id
- return ReplaceMobileWithHMIAppId(*message_);
-}
-
-bool ResponseToHMI::CleanUp() {
- return true;
-}
-
-void ResponseToHMI::Run() {
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
deleted file mode 100644
index 6961c15f76..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace {
-struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> {
- connection_handler::DeviceHandle handle_;
- ProtoV4AppsOnDevice(const connection_handler::DeviceHandle handle)
- : handle_(handle) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app
- ? handle_ == app->device() &&
- Message::is_sufficient_version(
- protocol_handler::MajorProtocolVersion::
- PROTOCOL_VERSION_4,
- app->protocol_version())
- : false;
- }
-};
-
-struct ForegroundApp
- : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
- bool> {
- bool operator()(
- const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
- return ptr ? ptr->is_foreground() : false;
- }
-};
-
-struct SendLaunchApp
- : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
- void> {
- ApplicationConstSharedPtr app_to_launch_;
- ApplicationManager& application_manager_;
- SendLaunchApp(ApplicationConstSharedPtr app_to_launch, ApplicationManager& am)
- : app_to_launch_(app_to_launch), application_manager_(am) {}
- void operator()(
- const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
- MessageHelper::SendLaunchApp((*ptr).app_id(),
- app_to_launch_->SchemaUrl(),
- app_to_launch_->PackageName(),
- application_manager_);
- return;
- }
-};
-}
-
-SDLActivateAppRequest::SDLActivateAppRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLActivateAppRequest::~SDLActivateAppRequest() {}
-
-uint32_t SDLActivateAppRequest::app_id() const {
- using namespace strings;
- if (!(*message_).keyExists(msg_params)) {
- LOG4CXX_DEBUG(logger_, msg_params << " section is absent in the message.");
- return 0;
- }
- if (!(*message_)[msg_params].keyExists(strings::app_id)) {
- LOG4CXX_DEBUG(logger_,
- strings::app_id << " section is absent in the message.");
- return 0;
- }
- return (*message_)[msg_params][strings::app_id].asUInt();
-}
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
-void SDLActivateAppRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis::FunctionID;
-
- if (application_manager_.state_controller().IsStateActive(
- HmiState::STATE_ID_DEACTIVATE_HMI)) {
- LOG4CXX_DEBUG(logger_,
- "DeactivateHmi state is active. "
- "Sends response with result code REJECTED");
- SendErrorResponse(correlation_id(),
- static_cast<eType>(function_id()),
- hmi_apis::Common_Result::REJECTED,
- "HMIDeactivate is active");
- } else {
- const uint32_t application_id = app_id();
- application_manager_.GetPolicyHandler().OnActivateApp(application_id,
- correlation_id());
- }
-}
-
-#else // EXTERNAL_PROPRIETARY_MODE
-void SDLActivateAppRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis::FunctionID;
- using namespace hmi_apis::Common_Result;
-
- const uint32_t application_id = app_id();
-
- ApplicationConstSharedPtr app_to_activate =
- application_manager_.application(application_id);
-
- if (!app_to_activate) {
- LOG4CXX_WARN(
- logger_,
- "Can't find application within regular apps: " << application_id);
-
- // Here is the hack - in fact SDL gets hmi_app_id in appID field and
- // replaces it with connection_key only for normally registered apps, but
- // for apps_to_be_registered (waiting) it keeps original value (hmi_app_id)
- // so method does lookup for hmi_app_id
- app_to_activate =
- application_manager_.WaitingApplicationByID(application_id);
-
- if (!app_to_activate) {
- LOG4CXX_WARN(
- logger_,
- "Can't find application within waiting apps: " << application_id);
- return;
- }
- }
-
- LOG4CXX_DEBUG(logger_,
- "Found application to activate. Application id is "
- << app_to_activate->app_id());
-
- if (application_manager_.state_controller().IsStateActive(
- HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) {
- LOG4CXX_WARN(logger_,
- "DeactivateHmi state is active. "
- "Sends response with result code REJECTED");
- SendErrorResponse(correlation_id(),
- static_cast<hmi_apis::FunctionID::eType>(function_id()),
- hmi_apis::Common_Result::REJECTED,
- "HMIDeactivate is active");
- return;
- }
-
- if (app_to_activate->IsRegistered()) {
- LOG4CXX_DEBUG(logger_, "Application is registered. Activating.");
- application_manager_.GetPolicyHandler().OnActivateApp(application_id,
- correlation_id());
- return;
- }
-
- connection_handler::DeviceHandle device_handle = app_to_activate->device();
- ApplicationSharedPtr foreground_v4_app = get_foreground_app(device_handle);
- V4ProtoApps v4_proto_apps = get_v4_proto_apps(device_handle);
-
- if (!foreground_v4_app && v4_proto_apps.empty()) {
- LOG4CXX_ERROR(logger_,
- "Can't find regular foreground app with the same "
- "connection id:"
- << device_handle);
- SendErrorResponse(
- correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED, "");
- return;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Application is not registered yet. "
- "Sending launch request.");
-
- if (foreground_v4_app) {
- LOG4CXX_DEBUG(logger_, "Sending request to foreground application.");
- MessageHelper::SendLaunchApp(foreground_v4_app->app_id(),
- app_to_activate->SchemaUrl(),
- app_to_activate->PackageName(),
- application_manager_);
- } else {
- LOG4CXX_DEBUG(logger_,
- "No preffered (foreground) application is found. "
- "Sending request to all v4 applications.");
- std::for_each(v4_proto_apps.begin(),
- v4_proto_apps.end(),
- SendLaunchApp(app_to_activate, application_manager_));
- }
-
- subscribe_on_event(BasicCommunication_OnAppRegistered);
-}
-
-#endif // EXTERNAL_PROPRIETARY_MODE
-void SDLActivateAppRequest::onTimeOut() {
- using namespace hmi_apis::FunctionID;
- using namespace hmi_apis::Common_Result;
- using namespace application_manager;
- unsubscribe_from_event(BasicCommunication_OnAppRegistered);
- SendErrorResponse(
- correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED, "");
-}
-
-void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
- using namespace hmi_apis::FunctionID;
- if (event.id() != BasicCommunication_OnAppRegistered) {
- return;
- }
- unsubscribe_from_event(BasicCommunication_OnAppRegistered);
-
- // Have to use HMI app id from event, since HMI app id from original request
- // message will be changed after app, initially requested for launch via
- // SDL.ActivateApp, will be registered
- const uint32_t hmi_application_id = hmi_app_id(event.smart_object());
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(hmi_application_id);
- if (!app) {
- LOG4CXX_ERROR(
- logger_, "Application not found by HMI app id: " << hmi_application_id);
- return;
- }
- application_manager_.GetPolicyHandler().OnActivateApp(app->app_id(),
- correlation_id());
-}
-
-uint32_t SDLActivateAppRequest::hmi_app_id(
- const smart_objects::SmartObject& so) const {
- using namespace strings;
- if (!so.keyExists(params)) {
- LOG4CXX_DEBUG(logger_, params << " section is absent in the message.");
- return 0;
- }
- if (!so[msg_params].keyExists(application)) {
- LOG4CXX_DEBUG(logger_, application << " section is absent in the message.");
- return 0;
- }
- if (so[msg_params][application].keyExists(strings::app_id)) {
- LOG4CXX_DEBUG(logger_,
- strings::app_id << " section is absent in the message.");
- return 0;
- }
- return so[msg_params][application][strings::app_id].asUInt();
-}
-
-SDLActivateAppRequest::V4ProtoApps SDLActivateAppRequest::get_v4_proto_apps(
- const connection_handler::DeviceHandle handle) const {
- const ApplicationSet app_list = application_manager_.applications().GetData();
- V4ProtoApps v4_proto_apps;
- std::copy_if(app_list.begin(),
- app_list.end(),
- std::back_inserter(v4_proto_apps),
- ProtoV4AppsOnDevice(handle));
- return v4_proto_apps;
-}
-
-ApplicationSharedPtr SDLActivateAppRequest::get_foreground_app(
- const connection_handler::DeviceHandle handle) const {
- V4ProtoApps v4_proto_apps = get_v4_proto_apps(handle);
- V4ProtoApps::iterator foreground_app =
- std::find_if(v4_proto_apps.begin(), v4_proto_apps.end(), ForegroundApp());
- return foreground_app != v4_proto_apps.end() ? *foreground_app
- : ApplicationSharedPtr();
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc
deleted file mode 100644
index 75a8c0b241..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLActivateAppResponse::SDLActivateAppResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLActivateAppResponse::~SDLActivateAppResponse() {}
-
-void SDLActivateAppResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc
deleted file mode 100644
index 4b150cda60..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {}
-
-void SDLGetListOfPermissionsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t connection_key = 0;
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- connection_key = (*message_)[strings::msg_params][strings::app_id].asUInt();
- }
- application_manager_.GetPolicyHandler().OnGetListOfPermissions(
- connection_key,
- (*message_)[strings::params][strings::correlation_id].asUInt());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc
deleted file mode 100644
index 521b59a0ec..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {}
-
-void SDLGetListOfPermissionsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc
deleted file mode 100644
index afa7569746..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {}
-
-void SDLGetStatusUpdateRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.GetPolicyHandler().OnGetStatusUpdate(
- (*message_)[strings::params][strings::correlation_id].asUInt());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc
deleted file mode 100644
index 0af7e0217a..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {}
-
-void SDLGetStatusUpdateResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc
deleted file mode 100644
index ea959389ef..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {}
-
-void SDLGetUserFriendlyMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const std::string messageCodes = "messageCodes";
- if (!(*message_)[strings::msg_params].keyExists(messageCodes)) {
- LOG4CXX_WARN(logger_,
- "Mandatory parameter '" + messageCodes + "'' is missing");
- return;
- }
- smart_objects::SmartArray* msg =
- (*message_)[strings::msg_params][messageCodes].asArray();
-
- std::vector<std::string> msg_codes;
-
- smart_objects::SmartArray::const_iterator it = msg->begin();
- smart_objects::SmartArray::const_iterator it_end = msg->end();
- for (; it != it_end; ++it) {
- msg_codes.push_back((*it).asString());
- }
-
- std::string required_language;
- if ((*message_)[strings::msg_params].keyExists(strings::language)) {
- uint32_t lang_code =
- (*message_)[strings::msg_params][strings::language].asUInt();
- required_language =
- application_manager::MessageHelper::CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code));
- } else {
- hmi_apis::Common_Language::eType ui_language =
- application_manager_.hmi_capabilities().active_ui_language();
-
- required_language =
- application_manager::MessageHelper::CommonLanguageToString(ui_language);
- }
-
- application_manager_.GetPolicyHandler().OnGetUserFriendlyMessage(
- msg_codes,
- required_language,
- (*message_)[strings::params][strings::correlation_id].asInt());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc
deleted file mode 100644
index c693625dbb..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {}
-
-void SDLGetUserFriendlyMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
deleted file mode 100644
index f1fb9ccead..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_policy_update.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLPolicyUpdate::SDLPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-SDLPolicyUpdate::~SDLPolicyUpdate() {}
-
-void SDLPolicyUpdate::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
- SendRequest();
-#else
- LOG4CXX_WARN(logger_,
- "This RPC is part of extended policy flow."
- "Please re-build with extended policy mode enabled.");
-#endif
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc
deleted file mode 100644
index 38b57a5b9f..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_policy_update_response.h"
-
-namespace application_manager {
-
-namespace commands {
-SDLPolicyUpdateResponse::SDLPolicyUpdateResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {}
-
-void SDLPolicyUpdateResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- // TODO(PV): add some logic here
-}
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc
deleted file mode 100644
index bb1f29d889..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_change_registration_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSChangeRegistrationRequest::TTSChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {}
-
-void TTSChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc
deleted file mode 100644
index e63ee5f74d..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_change_registration_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSChangeRegistratioResponse::TTSChangeRegistratioResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {}
-
-void TTSChangeRegistratioResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_ChangeRegistration);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc
deleted file mode 100644
index 4dbf5e8ee7..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {}
-
-void TTSGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc
deleted file mode 100644
index ce629b36d7..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {}
-
-void TTSGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::speech_capabilities)) {
- hmi_capabilities.set_speech_capabilities(
- (*message_)[strings::msg_params][hmi_response::speech_capabilities]);
- }
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::prerecorded_speech_capabilities)) {
- hmi_capabilities.set_prerecorded_speech(
- (*message_)[strings::msg_params]
- [hmi_response::prerecorded_speech_capabilities]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc
deleted file mode 100644
index c44667a223..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_get_language_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetLanguageRequest::TTSGetLanguageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSGetLanguageRequest::~TTSGetLanguageRequest() {}
-
-void TTSGetLanguageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc
deleted file mode 100644
index 37aed2c6cb..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetLanguageResponse::TTSGetLanguageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSGetLanguageResponse::~TTSGetLanguageResponse() {}
-
-void TTSGetLanguageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
-
- Common_Language::eType language = Common_Language::INVALID_ENUM;
-
- if ((*message_).keyExists(strings::msg_params) &&
- (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
- language = static_cast<Common_Language::eType>(
- (*message_)[strings::msg_params][hmi_response::language].asInt());
- }
-
- application_manager_.hmi_capabilities().set_active_tts_language(language);
-
- LOG4CXX_DEBUG(logger_,
- "Raising event for function_id " << function_id()
- << " and correlation_id "
- << correlation_id());
- event_engine::Event event(FunctionID::TTS_GetLanguage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc
deleted file mode 100644
index 941adca01d..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {}
-
-void TTSGetSupportedLanguagesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc
deleted file mode 100644
index 79af1d3cc2..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {}
-
-void TTSGetSupportedLanguagesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_tts_supported_languages(
- (*message_)[strings::msg_params][hmi_response::languages]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
deleted file mode 100644
index 71e89dd9b9..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSIsReadyRequest::TTSIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-TTSIsReadyRequest::~TTSIsReadyRequest() {}
-
-void TTSIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::TTS_IsReady, correlation_id());
- SendRequest();
-}
-
-void TTSIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::TTS_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received TTS_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::TTS_IsReady);
- const bool is_available = ChangeInterfaceState(
- application_manager_, message, HmiInterfaces::HMI_INTERFACE_TTS);
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_tts_cooperating(is_available);
- if (!CheckAvailabilityHMIInterfaces(application_manager_,
- HmiInterfaces::HMI_INTERFACE_TTS)) {
- LOG4CXX_INFO(logger_,
- "HmiInterfaces::HMI_INTERFACE_TTS isn't available");
- return;
- }
- SendMessageToHMI();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void TTSIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void TTSIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage,
- application_manager_));
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_handle_response_for(*get_language);
- application_manager_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::TTS_GetSupportedLanguages,
- application_manager_));
- application_manager_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::TTS_GetCapabilities, application_manager_));
- application_manager_.ManageHMICommand(get_capabilities);
-}
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
deleted file mode 100644
index 30e2f4816b..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSIsReadyResponse::TTSIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSIsReadyResponse::~TTSIsReadyResponse() {}
-
-void TTSIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::TTS_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc
deleted file mode 100644
index bf035ffe23..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {}
-
-void TTSSetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc
deleted file mode 100644
index f494fb1a8e..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {}
-
-void TTSSetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
deleted file mode 100644
index 2e386449d0..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_speak_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSpeakRequest::TTSSpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSSpeakRequest::~TTSSpeakRequest() {}
-
-void TTSSpeakRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
deleted file mode 100644
index 5cffdccf34..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_speak_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSpeakResponse::TTSSpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSSpeakResponse::~TTSSpeakResponse() {}
-
-void TTSSpeakResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc
deleted file mode 100644
index c2275dda72..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSStopSpeakingRequest::TTSStopSpeakingRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {}
-
-void TTSStopSpeakingRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc
deleted file mode 100644
index 67d747f464..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSStopSpeakingResponse::TTSStopSpeakingResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {}
-
-void TTSStopSpeakingResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_StopSpeaking);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc
deleted file mode 100644
index c0edad3f80..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_add_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddCommandRequest::UIAddCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIAddCommandRequest::~UIAddCommandRequest() {}
-
-void UIAddCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc
deleted file mode 100644
index a7eaabc91e..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_add_command_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddCommandResponse::UIAddCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIAddCommandResponse::~UIAddCommandResponse() {}
-
-void UIAddCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_AddCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc
deleted file mode 100644
index f0a233853c..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_add_submenu_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddSubmenuRequest::UIAddSubmenuRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIAddSubmenuRequest::~UIAddSubmenuRequest() {}
-
-void UIAddSubmenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc
deleted file mode 100644
index 6c6c18cbad..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_add_submenu_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddSubmenuResponse::UIAddSubmenuResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIAddSubmenuResponse::~UIAddSubmenuResponse() {}
-
-void UIAddSubmenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_AddSubMenu);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
deleted file mode 100644
index 44673d4981..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_alert_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAlertRequest::UIAlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIAlertRequest::~UIAlertRequest() {}
-
-void UIAlertRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
deleted file mode 100644
index 6d552a1eb7..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_alert_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAlertResponse::UIAlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIAlertResponse::~UIAlertResponse() {}
-
-void UIAlertResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_Alert);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc
deleted file mode 100644
index dcc88125fc..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_change_registration_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIChangeRegistrationRequest::UIChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {}
-
-void UIChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc
deleted file mode 100644
index 52805a93c8..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_change_registration_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIChangeRegistratioResponse::UIChangeRegistratioResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {}
-
-void UIChangeRegistratioResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_ChangeRegistration);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc
deleted file mode 100644
index 7bd529e8dc..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_delete_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteCommandRequest::UIDeleteCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIDeleteCommandRequest::~UIDeleteCommandRequest() {}
-
-void UIDeleteCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc
deleted file mode 100644
index 74a1bd64c2..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_delete_command_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteCommandResponse::UIDeleteCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIDeleteCommandResponse::~UIDeleteCommandResponse() {}
-
-void UIDeleteCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_DeleteCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc
deleted file mode 100644
index 335d97eee4..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteSubmenuRequest::UIDeleteSubmenuRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {}
-
-void UIDeleteSubmenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc
deleted file mode 100644
index 302343da5e..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteSubmenuResponse::UIDeleteSubmenuResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {}
-
-void UIDeleteSubmenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc
deleted file mode 100644
index e1cd11f922..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIEndAudioPassThruRequest::UIEndAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {}
-
-void UIEndAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc
deleted file mode 100644
index e9eb596b85..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIEndAudioPassThruResponse::UIEndAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {}
-
-void UIEndAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc
deleted file mode 100644
index 0ae4258d6b..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetCapabilitiesRequest::UIGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {}
-
-void UIGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
deleted file mode 100644
index 3b5aeac639..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetCapabilitiesResponse::UIGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {}
-
-void UIGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- if (msg_params.keyExists(hmi_response::display_capabilities)) {
- hmi_capabilities.set_display_capabilities(
- msg_params[hmi_response::display_capabilities]);
- }
-
- if (msg_params.keyExists(hmi_response::hmi_zone_capabilities)) {
- hmi_capabilities.set_hmi_zone_capabilities(
- msg_params[hmi_response::hmi_zone_capabilities]);
- }
-
- if (msg_params.keyExists(hmi_response::soft_button_capabilities)) {
- hmi_capabilities.set_soft_button_capabilities(
- msg_params[hmi_response::soft_button_capabilities]);
- }
-
- if (msg_params.keyExists(strings::audio_pass_thru_capabilities)) {
- hmi_capabilities.set_audio_pass_thru_capabilities(
- msg_params[strings::audio_pass_thru_capabilities]);
- }
-
- if (msg_params.keyExists(strings::hmi_capabilities)) {
- if (msg_params[strings::hmi_capabilities].keyExists(strings::navigation)) {
- hmi_capabilities.set_navigation_supported(
- msg_params[strings::hmi_capabilities][strings::navigation].asBool());
- }
- if (msg_params[strings::hmi_capabilities].keyExists(strings::phone_call)) {
- hmi_capabilities.set_phone_call_supported(
- msg_params[strings::hmi_capabilities][strings::phone_call].asBool());
- }
- if (msg_params[strings::hmi_capabilities].keyExists(
- strings::video_streaming)) {
- hmi_capabilities.set_video_streaming_supported(
- msg_params[strings::hmi_capabilities][strings::video_streaming]
- .asBool());
- }
- }
-
- if (msg_params.keyExists(strings::system_capabilities)) {
- if (msg_params[strings::system_capabilities].keyExists(
- strings::navigation_capability)) {
- hmi_capabilities.set_navigation_capability(
- msg_params[strings::system_capabilities]
- [strings::navigation_capability]);
- }
- if (msg_params[strings::system_capabilities].keyExists(
- strings::phone_capability)) {
- hmi_capabilities.set_phone_capability(
- msg_params[strings::system_capabilities][strings::phone_capability]);
- }
- if (msg_params[strings::system_capabilities].keyExists(
- strings::video_streaming_capability)) {
- hmi_capabilities.set_video_streaming_capability(
- msg_params[strings::system_capabilities]
- [strings::video_streaming_capability]);
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc
deleted file mode 100644
index 59d9eef6e3..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_get_language_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetLanguageRequest::UIGetLanguageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIGetLanguageRequest::~UIGetLanguageRequest() {}
-
-void UIGetLanguageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc
deleted file mode 100644
index dfbdb89804..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetLanguageResponse::UIGetLanguageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIGetLanguageResponse::~UIGetLanguageResponse() {}
-
-void UIGetLanguageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
-
- Common_Language::eType language = Common_Language::INVALID_ENUM;
-
- if ((*message_).keyExists(strings::msg_params) &&
- (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
- language = static_cast<Common_Language::eType>(
- (*message_)[strings::msg_params][hmi_response::language].asInt());
- }
-
- application_manager_.hmi_capabilities().set_active_ui_language(language);
-
- LOG4CXX_DEBUG(logger_,
- "Raising event for function_id " << function_id()
- << " and correlation_id "
- << correlation_id());
- event_engine::Event event(FunctionID::UI_GetLanguage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc
deleted file mode 100644
index 598ff39f79..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {}
-
-void UIGetSupportedLanguagesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc
deleted file mode 100644
index e5849f5f63..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {}
-
-void UIGetSupportedLanguagesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_ui_supported_languages(
- (*message_)[strings::msg_params][hmi_response::languages]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
deleted file mode 100644
index 9e27e23d34..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIIsReadyRequest::UIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-UIIsReadyRequest::~UIIsReadyRequest() {}
-
-void UIIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::UI_IsReady, correlation_id());
- SendRequest();
-}
-
-void UIIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received UI_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::UI_IsReady);
- const bool is_available = ChangeInterfaceState(
- application_manager_, message, HmiInterfaces::HMI_INTERFACE_UI);
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_ui_cooperating(is_available);
- if (!CheckAvailabilityHMIInterfaces(application_manager_,
- HmiInterfaces::HMI_INTERFACE_UI)) {
- LOG4CXX_INFO(logger_,
- "HmiInterfaces::HMI_INTERFACE_UI isn't available");
- return;
- }
- SendMessageToHMI();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void UIIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void UIIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage,
- application_manager_));
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_handle_response_for(*get_language);
- application_manager_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::UI_GetSupportedLanguages,
- application_manager_));
- application_manager_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::UI_GetCapabilities, application_manager_));
- application_manager_.ManageHMICommand(get_capabilities);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
deleted file mode 100644
index 088baeb8b2..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIIsReadyResponse::UIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIIsReadyResponse::~UIIsReadyResponse() {}
-
-void UIIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
deleted file mode 100644
index a88719d303..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {}
-
-void UIPerformAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
deleted file mode 100644
index 0736cca526..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {}
-
-void UIPerformAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc
deleted file mode 100644
index 82a900f1ae..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformInteractionRequest::UIPerformInteractionRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIPerformInteractionRequest::~UIPerformInteractionRequest() {}
-
-void UIPerformInteractionRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc
deleted file mode 100644
index ea78c0cd66..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformInteractionResponse::UIPerformInteractionResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIPerformInteractionResponse::~UIPerformInteractionResponse() {}
-
-void UIPerformInteractionResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::UI_PerformInteraction);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc
deleted file mode 100644
index 006944d404..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIScrollableMessageRequest::UIScrollableMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIScrollableMessageRequest::~UIScrollableMessageRequest() {}
-
-void UIScrollableMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc
deleted file mode 100644
index c39a99fc61..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIScrollableMessageResponse::UIScrollableMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIScrollableMessageResponse::~UIScrollableMessageResponse() {}
-
-void UIScrollableMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc
deleted file mode 100644
index 9484906a17..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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/hmi/ui_send_haptic_data_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISendHapticDataRequest::UISendHapticDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISendHapticDataRequest::~UISendHapticDataRequest() {}
-
-void UISendHapticDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc
deleted file mode 100644
index a8239a40e8..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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/hmi/ui_send_haptic_data_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISendHapticDataResponse::UISendHapticDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISendHapticDataResponse::~UISendHapticDataResponse() {}
-
-void UISendHapticDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::UI_SendHapticData);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc
deleted file mode 100644
index 2666eedfc8..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetAppIconRequest::UISetAppIconRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetAppIconRequest::~UISetAppIconRequest() {}
-
-void UISetAppIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc
deleted file mode 100644
index 18fc5a5761..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_set_app_icon_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetAppIconResponse::UISetAppIconResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISetAppIconResponse::~UISetAppIconResponse() {}
-
-void UISetAppIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetAppIcon);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc
deleted file mode 100644
index cd69c9c8e6..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {}
-
-void UiSetDisplayLayoutRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc
deleted file mode 100644
index c5a439636f..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {}
-
-void UiSetDisplayLayoutResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc
deleted file mode 100644
index 8658a043b0..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {}
-
-void UISetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc
deleted file mode 100644
index d10c206a7c..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {}
-
-void UISetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
deleted file mode 100644
index 1653ec0744..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_icon_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetIconRequest::UISetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetIconRequest::~UISetIconRequest() {}
-
-void UISetIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc
deleted file mode 100644
index 955cb1d57b..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetMediaClockTimerRequest::UISetMediaClockTimerRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {}
-
-void UISetMediaClockTimerRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc
deleted file mode 100644
index 32acef4994..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetMediaClockTimerResponse::UISetMediaClockTimerResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {}
-
-void UISetMediaClockTimerResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/src/commands/hmi/ui_show_request.cc
deleted file mode 100644
index 9c0e90feff..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_show_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_show_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIShowRequest::UIShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIShowRequest::~UIShowRequest() {}
-
-void UIShowRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/src/commands/hmi/ui_show_response.cc
deleted file mode 100644
index 333d9e96c5..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_show_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_show_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIShowResponse::UIShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIShowResponse::~UIShowResponse() {}
-
-void UIShowResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_Show);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
deleted file mode 100644
index 26e6ed76b0..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_slider_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISliderRequest::UISliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISliderRequest::~UISliderRequest() {}
-
-void UISliderRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
deleted file mode 100644
index 091eb50e0d..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_slider_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISliderResponse::UISliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISliderResponse::~UISliderResponse() {}
-
-void UISliderResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_Slider);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/src/commands/hmi/update_app_list_request.cc
deleted file mode 100644
index 286d269727..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_app_list_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_app_list_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateAppListRequest::UpdateAppListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UpdateAppListRequest::~UpdateAppListRequest() {}
-
-void UpdateAppListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/src/commands/hmi/update_app_list_response.cc
deleted file mode 100644
index 6546d03805..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_app_list_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_app_list_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateAppListResponse::UpdateAppListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UpdateAppListResponse::~UpdateAppListResponse() {}
-
-void UpdateAppListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(PV): add check
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/src/commands/hmi/update_device_list_request.cc
deleted file mode 100644
index 74d104b36d..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_device_list_request.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_device_list_request.h"
-
-#include "interfaces/HMI_API.h"
-
-#include <unistd.h>
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateDeviceListRequest::UpdateDeviceListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager_.event_dispatcher()) {}
-
-UpdateDeviceListRequest::~UpdateDeviceListRequest() {}
-
-void UpdateDeviceListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(wait_hmi_lock);
- // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
- // Flag conditional compilation for specific customer is used in order to
- // exclude
- // hit code to RTC
- if (true == application_manager_.get_settings().launch_hmi()) {
- if (!application_manager_.IsHMICooperating()) {
- LOG4CXX_INFO(logger_, "Wait for HMI Cooperation");
- subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
- termination_condition_.Wait(auto_lock);
- LOG4CXX_DEBUG(logger_, "HMI Cooperation OK");
- }
- }
-
- SendRequest();
-}
-
-void UpdateDeviceListRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(wait_hmi_lock);
- switch (event.id()) {
- case hmi_apis::FunctionID::BasicCommunication_OnReady: {
- LOG4CXX_INFO(logger_, "received OnReady");
- unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
- termination_condition_.Broadcast();
- break;
- };
- default: {
- LOG4CXX_ERROR(logger_, "Unknown event ");
- break;
- };
- }
-}
-
-bool UpdateDeviceListRequest::CleanUp() {
- sync_primitives::AutoLock auto_lock(wait_hmi_lock);
- termination_condition_.Broadcast();
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/src/commands/hmi/update_device_list_response.cc
deleted file mode 100644
index 6d9dec92f8..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_device_list_response.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/update_device_list_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateDeviceListResponse::UpdateDeviceListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UpdateDeviceListResponse::~UpdateDeviceListResponse() {}
-
-void UpdateDeviceListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(PV): add check for correctness.
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
deleted file mode 100644
index 44f7547964..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_sdl_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateSDLRequest::UpdateSDLRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UpdateSDLRequest::~UpdateSDLRequest() {}
-
-void UpdateSDLRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.GetPolicyHandler().PTExchangeAtUserRequest(
- (*message_)[strings::params][strings::correlation_id].asInt());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
deleted file mode 100644
index 0e8978fe89..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/update_sdl_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateSDLResponse::UpdateSDLResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UpdateSDLResponse::~UpdateSDLResponse() {}
-
-void UpdateSDLResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc
deleted file mode 100644
index 5fe81fcbd8..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIDiagnosticMessageRequest::VIDiagnosticMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {}
-
-void VIDiagnosticMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc
deleted file mode 100644
index e19af75b54..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIDiagnosticMessageResponse::VIDiagnosticMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {}
-
-void VIDiagnosticMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc
deleted file mode 100644
index b373471c43..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetDTCsRequest::VIGetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIGetDTCsRequest::~VIGetDTCsRequest() {}
-
-void VIGetDTCsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc
deleted file mode 100644
index 3e720f9dbc..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetDTCsResponse::VIGetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIGetDTCsResponse::~VIGetDTCsResponse() {}
-
-void VIGetDTCsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc
deleted file mode 100644
index 05424c4967..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetVehicleDataRequest::VIGetVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {}
-
-void VIGetVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc
deleted file mode 100644
index 2794f6eddd..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-namespace commands {
-
-VIGetVehicleDataResponse::VIGetVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {}
-
-void VIGetVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
-
- if ((*message_)[strings::params][strings::message_type] ==
- static_cast<int32_t>(hmi_apis::messageType::error_response)) {
- smart_objects::SmartObject result(smart_objects::SmartType_Map);
-
- if ((*message_)[strings::params].keyExists(strings::data)) {
- result[strings::msg_params] = (*message_)[strings::params][strings::data];
- result[strings::params][hmi_response::code] =
- (*message_)[strings::params][hmi_response::code];
- result[strings::params][strings::correlation_id] =
- (*message_)[strings::params][strings::correlation_id];
- result[strings::params][strings::error_msg] =
- (*message_)[strings::params][strings::error_msg];
- result[strings::params][strings::message_type] =
- (*message_)[strings::params][strings::message_type];
- result[strings::params][strings::protocol_type] =
- (*message_)[strings::params][strings::protocol_type];
- result[strings::params][strings::protocol_version] =
- (*message_)[strings::params][strings::protocol_version];
- }
-
- event.set_smart_object(result);
- } else {
- event.set_smart_object(*message_);
- application_manager_.GetPolicyHandler().OnVehicleDataUpdated(*message_);
- }
-
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc
deleted file mode 100644
index 64a3831e1c..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetVehicleTypeRequest::VIGetVehicleTypeRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {}
-
-void VIGetVehicleTypeRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc
deleted file mode 100644
index 2369eb7eee..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetVehicleTypeResponse::VIGetVehicleTypeResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {}
-
-void VIGetVehicleTypeResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_vehicle_type(
- (*message_)[strings::msg_params][hmi_response::vehicle_type]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
deleted file mode 100644
index ddd08695a0..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIIsReadyRequest::VIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-VIIsReadyRequest::~VIIsReadyRequest() {}
-
-void VIIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::VehicleInfo_IsReady,
- correlation_id());
- SendRequest();
-}
-
-void VIIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_IsReady: {
- LOG4CXX_DEBUG(logger_, "VehicleInfo_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_IsReady);
- const bool is_available =
- ChangeInterfaceState(application_manager_,
- message,
- HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_ivi_cooperating(is_available);
- application_manager_.GetPolicyHandler().OnVIIsReady();
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
- LOG4CXX_INFO(
- logger_,
- "HmiInterfaces::HMI_INTERFACE_VehicleInfo isn't available");
- return;
- }
- SendMessageToHMI();
-
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void VIIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void VIIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_type(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
- application_manager_));
- application_manager_.ManageHMICommand(get_type);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
deleted file mode 100644
index 2f84190494..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIIsReadyResponse::VIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIIsReadyResponse::~VIIsReadyResponse() {}
-
-void VIIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc
deleted file mode 100644
index d72fcb8157..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_read_did_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIReadDIDRequest::VIReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIReadDIDRequest::~VIReadDIDRequest() {}
-
-void VIReadDIDRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc
deleted file mode 100644
index 568a573f88..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_read_did_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIReadDIDResponse::VIReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIReadDIDResponse::~VIReadDIDResponse() {}
-
-void VIReadDIDResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_ReadDID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
deleted file mode 100644
index 5c953334bb..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {}
-
-void VISubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
deleted file mode 100644
index 4df2d9190a..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {}
-
-void VISubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
deleted file mode 100644
index 2211cde19c..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {}
-
-void VIUnsubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
deleted file mode 100644
index 5044f0ef43..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {}
-
-void VIUnsubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc
deleted file mode 100644
index 04af05d4e7..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_add_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRAddCommandRequest::VRAddCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRAddCommandRequest::~VRAddCommandRequest() {}
-
-void VRAddCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc
deleted file mode 100644
index 496bd47605..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_add_command_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRAddCommandResponse::VRAddCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRAddCommandResponse::~VRAddCommandResponse() {}
-
-void VRAddCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc
deleted file mode 100644
index e64e7cc388..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_change_registration_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRChangeRegistrationRequest::VRChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {}
-
-void VRChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc
deleted file mode 100644
index 8084688c15..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_change_registration_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRChangeRegistrationResponse::VRChangeRegistrationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRChangeRegistrationResponse::~VRChangeRegistrationResponse() {}
-
-void VRChangeRegistrationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_ChangeRegistration);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc
deleted file mode 100644
index 1db85529da..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_delete_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRDeleteCommandRequest::VRDeleteCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRDeleteCommandRequest::~VRDeleteCommandRequest() {}
-
-void VRDeleteCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc
deleted file mode 100644
index 08711be2c8..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_delete_command_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRDeleteCommandResponse::VRDeleteCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRDeleteCommandResponse::~VRDeleteCommandResponse() {}
-
-void VRDeleteCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_DeleteCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
deleted file mode 100644
index 3159380c17..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetCapabilitiesRequest::VRGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {}
-
-void VRGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
deleted file mode 100644
index 9aa0fc6668..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetCapabilitiesResponse::VRGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {}
-
-void VRGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_vr_capabilities(
- (*message_)[strings::msg_params][strings::vr_capabilities]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc
deleted file mode 100644
index baf34c8017..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_get_language_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetLanguageRequest::VRGetLanguageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRGetLanguageRequest::~VRGetLanguageRequest() {}
-
-void VRGetLanguageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc
deleted file mode 100644
index a55dca44a3..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetLanguageResponse::VRGetLanguageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRGetLanguageResponse::~VRGetLanguageResponse() {}
-
-void VRGetLanguageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
-
- Common_Language::eType language = Common_Language::INVALID_ENUM;
-
- if ((*message_).keyExists(strings::msg_params) &&
- (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
- language = static_cast<Common_Language::eType>(
- (*message_)[strings::msg_params][hmi_response::language].asInt());
- }
-
- application_manager_.hmi_capabilities().set_active_vr_language(language);
-
- LOG4CXX_DEBUG(logger_,
- "Raising event for function_id " << function_id()
- << " and correlation_id "
- << correlation_id());
- event_engine::Event event(FunctionID::VR_GetLanguage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc
deleted file mode 100644
index def4a64699..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {}
-
-void VRGetSupportedLanguagesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc
deleted file mode 100644
index e5a6ed0b86..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {}
-
-void VRGetSupportedLanguagesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_vr_supported_languages(
- (*message_)[strings::msg_params][hmi_response::languages]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
deleted file mode 100644
index 086b5d4490..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRIsReadyRequest::VRIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-VRIsReadyRequest::~VRIsReadyRequest() {}
-
-void VRIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::VR_IsReady, correlation_id());
- SendRequest();
-}
-
-void VRIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::VR_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received VR_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::VR_IsReady);
- const bool is_available = ChangeInterfaceState(
- application_manager_, message, HmiInterfaces::HMI_INTERFACE_VR);
-
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_vr_cooperating(is_available);
- if (!CheckAvailabilityHMIInterfaces(application_manager_,
- HmiInterfaces::HMI_INTERFACE_VR)) {
- LOG4CXX_INFO(logger_,
- "HmiInterfaces::HMI_INTERFACE_VR isn't available");
- return;
- }
- SendMessageToHMI();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void VRIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void VRIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,
- application_manager_));
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_handle_response_for(*get_language);
- application_manager_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VR_GetSupportedLanguages,
- application_manager_));
- application_manager_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VR_GetCapabilities, application_manager_));
- application_manager_.ManageHMICommand(get_capabilities);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
deleted file mode 100644
index 78e2dae23b..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRIsReadyResponse::VRIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRIsReadyResponse::~VRIsReadyResponse() {}
-
-void VRIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::VR_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc
deleted file mode 100644
index c4646e59f4..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRPerformInteractionRequest::VRPerformInteractionRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRPerformInteractionRequest::~VRPerformInteractionRequest() {}
-
-void VRPerformInteractionRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc
deleted file mode 100644
index bb5ceb3755..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRPerformInteractionResponse::VRPerformInteractionResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRPerformInteractionResponse::~VRPerformInteractionResponse() {}
-
-void VRPerformInteractionResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::VR_PerformInteraction);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc
deleted file mode 100644
index 69948b8122..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_command_request.cc
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/add_command_request.h"
-
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-AddCommandRequest::AddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , send_ui_(false)
- , send_vr_(false)
- , is_ui_received_(false)
- , is_vr_received_(false)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-AddCommandRequest::~AddCommandRequest() {}
-
-void AddCommandRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
- RemoveCommand();
- CommandRequestImpl::onTimeOut();
-}
-
-bool AddCommandRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-void AddCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
- mobile_apis::Result::eType verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::cmd_icon],
- app,
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(
- logger_, "MessageHelper::VerifyImage return " << verification_result);
- SendResponse(false, verification_result);
- return;
- }
- }
-
- if (!((*message_)[strings::msg_params].keyExists(strings::cmd_id))) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (app->FindCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt())) {
- LOG4CXX_ERROR(logger_, "INVALID_ID");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- bool data_exist = false;
-
- if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
- if (!CheckCommandName(app)) {
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
- if (((*message_)[strings::msg_params][strings::menu_params].keyExists(
- hmi_request::parent_id)) &&
- (0 !=
- (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asUInt())) {
- if (!CheckCommandParentId(app)) {
- SendResponse(
- false, mobile_apis::Result::INVALID_ID, "Parent ID doesn't exist");
- return;
- }
- }
- data_exist = true;
- }
-
- if (((*message_)[strings::msg_params].keyExists(strings::vr_commands)) &&
- ((*message_)[strings::msg_params][strings::vr_commands].length() > 0)) {
- if (!CheckCommandVRSynonym(app)) {
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
-
- data_exist = true;
- }
-
- if (!data_exist) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "Incoming add command has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- app->AddCommand((*message_)[strings::msg_params][strings::cmd_id].asUInt(),
- (*message_)[strings::msg_params]);
-
- smart_objects::SmartObject ui_msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
- ui_msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- ui_msg_params[strings::menu_params] =
- (*message_)[strings::msg_params][strings::menu_params];
-
- ui_msg_params[strings::app_id] = app->app_id();
-
- if (((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) &&
- ((*message_)[strings::msg_params][strings::cmd_icon].keyExists(
- strings::value)) &&
- (0 < (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
- .length())) {
- ui_msg_params[strings::cmd_icon] =
- (*message_)[strings::msg_params][strings::cmd_icon];
- }
-
- send_ui_ = true;
- }
-
- smart_objects::SmartObject vr_msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
- vr_msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- vr_msg_params[strings::vr_commands] =
- (*message_)[strings::msg_params][strings::vr_commands];
- vr_msg_params[strings::app_id] = app->app_id();
-
- vr_msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
- vr_msg_params[strings::grammar_id] = app->get_grammar_id();
-
- send_vr_ = true;
- }
-
- if (send_ui_) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
- }
-
- if (send_vr_) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
- }
-}
-
-bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
- if (!app) {
- return false;
- }
-
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator i = commands.begin();
- uint32_t saved_parent_id = 0;
- uint32_t parent_id = 0;
- if ((*message_)[strings::msg_params][strings::menu_params].keyExists(
- hmi_request::parent_id)) {
- parent_id = (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asUInt();
- }
-
- for (; commands.end() != i; ++i) {
- if (!(*i->second).keyExists(strings::menu_params)) {
- continue;
- }
-
- saved_parent_id = 0;
- if ((*i->second)[strings::menu_params].keyExists(hmi_request::parent_id)) {
- saved_parent_id =
- (*i->second)[strings::menu_params][hmi_request::parent_id].asUInt();
- }
- if (((*i->second)[strings::menu_params][strings::menu_name].asString() ==
- (*message_)[strings::msg_params][strings::menu_params]
- [strings::menu_name].asString()) &&
- (saved_parent_id == parent_id)) {
- LOG4CXX_INFO(logger_,
- "AddCommandRequest::CheckCommandName received"
- " command name already exist in same level menu");
- return false;
- }
- }
- return true;
-}
-
-bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) {
- if (!app) {
- return false;
- }
-
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator it = commands.begin();
-
- for (; commands.end() != it; ++it) {
- if (!(*it->second).keyExists(strings::vr_commands)) {
- continue;
- }
-
- for (size_t i = 0; i < (*it->second)[strings::vr_commands].length(); ++i) {
- for (size_t j = 0;
- j < (*message_)[strings::msg_params][strings::vr_commands].length();
- ++j) {
- const custom_str::CustomString& vr_cmd_i =
- (*it->second)[strings::vr_commands][i].asCustomString();
- const custom_str::CustomString& vr_cmd_j =
- (*message_)[strings::msg_params][strings::vr_commands][j]
- .asCustomString();
-
- if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
- LOG4CXX_INFO(logger_,
- "AddCommandRequest::CheckCommandVRSynonym"
- " received command vr synonym already exist");
- return false;
- }
- }
- }
- }
- return true;
-}
-
-bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
- if (!app) {
- return false;
- }
-
- const int32_t parent_id =
- (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asInt();
- smart_objects::SmartObject* parent = app->FindSubMenu(parent_id);
-
- if (!parent) {
- LOG4CXX_INFO(logger_,
- "AddCommandRequest::CheckCommandParentId received"
- " submenu doesn't exist");
- return false;
- }
- return true;
-}
-
-// TODO(AKUTSAN) APPLINK-26973: Refactor AddCommandRequest
-void AddCommandRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
- msg_param[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_param[strings::app_id] = application->app_id();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_AddCommand: {
- LOG4CXX_INFO(logger_, "Received UI_AddCommand event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_info_);
- if (hmi_apis::Common_Result::SUCCESS != ui_result_) {
- (*message_)[strings::msg_params].erase(strings::menu_params);
- }
- break;
- }
- case hmi_apis::FunctionID::VR_AddCommand: {
- LOG4CXX_INFO(logger_, "Received VR_AddCommand event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- is_vr_received_ = true;
- vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, vr_info_);
- if (hmi_apis::Common_Result::SUCCESS != vr_result_) {
- (*message_)[strings::msg_params].erase(strings::vr_commands);
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- return;
- }
-
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_params[strings::app_id] = application->app_id();
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
-
- const bool is_vr_invalid_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- vr_result_,
- hmi_apis::Common_Result::INVALID_ENUM,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_ui_invalid_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::INVALID_ENUM,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
- const bool is_vr_unsupported =
- vr_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- const bool is_ui_unsupported =
- ui_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
-
- const bool is_no_ui_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_no_vr_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- vr_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- bool result = (is_no_ui_error && is_no_vr_error) ||
- (is_no_ui_error && is_vr_invalid_unsupported) ||
- (is_no_vr_error && is_ui_invalid_unsupported);
-
- LOG4CXX_DEBUG(logger_,
- "calculated result " << ui_result_ << " " << is_no_ui_error
- << " " << is_no_vr_error);
- const bool is_vr_or_ui_warning =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
-
- const bool is_vr_or_ui_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- ui_result_,
- vr_result_);
-
- const bool is_vr_and_ui_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- ui_result_,
- vr_result_);
-
- if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) {
- result_code = MessageHelper::HMIToMobileResult(ui_result_);
- } else if (result && is_vr_or_ui_unsupported) {
- result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- } else if (is_vr_or_ui_warning) {
- result_code = mobile_apis::Result::WARNINGS;
- } else {
- result_code =
- MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_));
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_) {
- result_code = MessageHelper::HMIToMobileResult(vr_result_);
- }
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == vr_result_) {
- result_code = MessageHelper::HMIToMobileResult(ui_result_);
- }
- LOG4CXX_DEBUG(logger_, "HMIToMobileResult " << result_code);
- }
-
- if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) {
- const bool is_ui_not_ok = Compare<hmi_apis::Common_Result::eType, NEQ, ALL>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- if (is_ui_not_ok) {
- result_code = ui_result_ == hmi_apis::Common_Result::REJECTED
- ? mobile_apis::Result::REJECTED
- : mobile_apis::Result::GENERIC_ERROR;
-
- msg_params[strings::grammar_id] = application->get_grammar_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
-
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- application->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
- result = false;
- LOG4CXX_DEBUG(logger_, "Result " << result);
- }
- }
-
- if (BothSend() && hmi_apis::Common_Result::SUCCESS == ui_result_ &&
- !is_no_vr_error &&
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
- result_code = vr_result_ == hmi_apis::Common_Result::REJECTED
- ? mobile_apis::Result::REJECTED
- : mobile_apis::Result::GENERIC_ERROR;
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
-
- application->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
- result = false;
- LOG4CXX_DEBUG(logger_, "Result " << result);
- }
-
- HmiInterfaces::InterfaceState ui_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_UI);
- HmiInterfaces::InterfaceState vr_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VR);
-
- if (!BothSend() &&
- ((is_vr_unsupported &&
- HmiInterfaces::STATE_NOT_AVAILABLE == vr_interface_state) ||
- (is_ui_unsupported &&
- HmiInterfaces::STATE_NOT_AVAILABLE == ui_interface_state))) {
- LOG4CXX_DEBUG(logger_, "!BothSend() && is_vr_or_ui_unsupported");
- result = false;
- }
-
- if (is_vr_and_ui_unsupported) {
- LOG4CXX_DEBUG(logger_, "UI and VR interface both unsupported");
- result = false;
- }
-
- if (!result) {
- RemoveCommand();
- }
-
- const std::string info = GenerateMobileResponseInfo();
- SendResponse(result,
- result_code,
- info.empty() ? NULL : info.c_str(),
- &(message[strings::msg_params]));
-}
-
-bool AddCommandRequest::IsPendingResponseExist() {
- return send_ui_ != is_ui_received_ || send_vr_ != is_vr_received_;
-}
-
-bool AddCommandRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
- str = (*message_)[strings::msg_params][strings::menu_params]
- [strings::menu_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed.");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
- const size_t len =
- (*message_)[strings::msg_params][strings::vr_commands].length();
-
- for (size_t i = 0; i < len; ++i) {
- str = (*message_)[strings::msg_params][strings::vr_commands][i]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
- str = (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid cmd_icon value syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-bool AddCommandRequest::BothSend() const {
- return send_vr_ && send_ui_;
-}
-
-const std::string AddCommandRequest::GenerateMobileResponseInfo() {
- // In case if vr_result_ is UNSUPPORTED_RESOURCE vr_info should be on the
- // first place
- // In case if ui_result_ is UNSUPPORTED_RESOURCE ui_info should be on the
- // first place
- // Other way order is doesn't matter
-
- HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- HmiInterfaces::InterfaceState ui_interface_state =
- hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_UI);
-
- HmiInterfaces::InterfaceState vr_interface_state =
- hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_VR);
-
- if ((ui_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
- (vr_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
- !vr_info_.empty()) {
- return vr_info_;
- }
-
- if ((vr_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
- (ui_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
- !ui_info_.empty()) {
- return ui_info_;
- }
-
- return MergeInfos(ui_info_, vr_info_);
-}
-
-void AddCommandRequest::RemoveCommand() {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- return;
- }
-
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_params[strings::app_id] = app->app_id();
-
- app->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
-
- if (BothSend() && !(is_vr_received_ || is_ui_received_)) {
- // in case we have send bth UI and VR and no one respond
- // we have nothing to remove from HMI so no DeleteCommand expected
- return;
- }
-
- if (BothSend() && !is_vr_received_) {
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
- }
-
- if (BothSend() && !is_ui_received_) {
- msg_params[strings::grammar_id] = app->get_grammar_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_command_response.cc b/src/components/application_manager/src/commands/mobile/add_command_response.cc
deleted file mode 100644
index fc468f9c57..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_command_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/add_command_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddCommandResponse::AddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AddCommandResponse::~AddCommandResponse() {}
-
-void AddCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc
deleted file mode 100644
index fe44e5a41f..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/add_sub_menu_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddSubMenuRequest::AddSubMenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-AddSubMenuRequest::~AddSubMenuRequest() {}
-
-void AddSubMenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const int32_t menu_id =
- (*message_)[strings::msg_params][strings::menu_id].asInt();
- if (app->FindSubMenu(menu_id)) {
- LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- const std::string& menu_name =
- (*message_)[strings::msg_params][strings::menu_name].asString();
-
- if (app->IsSubMenuNameAlreadyExist(menu_name)) {
- LOG4CXX_ERROR(logger_, "Menu name " << menu_name << " is duplicated.");
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
-
- if (!CheckSubMenuName()) {
- LOG4CXX_ERROR(logger_, "Sub-menu name is not valid.");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::menu_id] =
- (*message_)[strings::msg_params][strings::menu_id];
- if ((*message_)[strings::msg_params].keyExists(strings::position)) {
- msg_params[strings::menu_params][strings::position] =
- (*message_)[strings::msg_params][strings::position];
- }
- msg_params[strings::menu_params][strings::menu_name] =
- (*message_)[strings::msg_params][strings::menu_name];
- msg_params[strings::app_id] = app->app_id();
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
-}
-
-void AddSubMenuRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_AddSubMenu: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (result) {
- application->AddSubMenu(
- (*message_)[strings::msg_params][strings::menu_id].asInt(),
- (*message_)[strings::msg_params]);
- }
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-bool AddSubMenuRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-bool AddSubMenuRequest::CheckSubMenuName() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::menu_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_INFO(logger_, "Invalid subMenu name.");
- return false;
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc
deleted file mode 100644
index 1fbdb4e66c..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/add_sub_menu_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddSubMenuResponse::AddSubMenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AddSubMenuResponse::~AddSubMenuResponse() {}
-
-void AddSubMenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
deleted file mode 100644
index d5767690d7..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cstring>
-#include <string>
-#include "application_manager/commands/mobile/alert_maneuver_request.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertManeuverRequest::AlertManeuverRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , tts_speak_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
- , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
-
-AlertManeuverRequest::~AlertManeuverRequest() {}
-
-void AlertManeuverRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if ((!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
- (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) {
- LOG4CXX_ERROR(logger_, "AlertManeuverRequest::Request without parameters!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (NULL == app.get()) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming alert maneuver has contains \\t\\n \\\\t \\\\n"
- "text contains only whitespace in ttsChunks");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
- SendResponse(false, processing_result);
- return;
- }
-
- // Checking parameters and how many HMI requests should be sent
- bool tts_is_ok = false;
-
- // check TTSChunk parameter
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- if (0 < (*message_)[strings::msg_params][strings::tts_chunks].length()) {
- pending_requests_.Add(hmi_apis::FunctionID::TTS_Speak);
- tts_is_ok = true;
- }
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[hmi_request::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
-
- pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver);
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_AlertManeuver, &msg_params, true);
-
- if (tts_is_ok) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[hmi_request::tts_chunks] =
- (*message_)[strings::msg_params][strings::tts_chunks];
- msg_params[hmi_request::speak_type] =
- hmi_apis::Common_MethodName::ALERT_MANEUVER;
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
- }
-}
-
-void AlertManeuverRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- hmi_apis::FunctionID::eType event_id = event.id();
- switch (event_id) {
- case hmi_apis::FunctionID::Navigation_AlertManeuver: {
- LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- pending_requests_.Remove(event_id);
- navi_alert_maneuver_result_code_ =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, info_navi_);
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- pending_requests_.Remove(event_id);
- tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, info_tts_);
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
-
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- SendResponse(
- false, mobile_apis::Result::INVALID_ENUM, "Received unknown event");
- return;
- }
- }
-
- if (!pending_requests_.IsFinal(event_id)) {
- LOG4CXX_DEBUG(logger_,
- "There are some pending responses from HMI."
- "AlertManeuverRequest still waiting.");
- return;
- }
- std::string return_info;
- mobile_apis::Result::eType result_code;
- const bool result = PrepareResponseParameters(result_code, return_info);
- bool must_be_empty_info = false;
- if (return_info.find("\n") != std::string::npos ||
- return_info.find("\t") != std::string::npos) {
- must_be_empty_info = true;
- }
- SendResponse(result,
- result_code,
- (must_be_empty_info) ? NULL : return_info.c_str(),
- &(message[strings::msg_params]));
-}
-
-bool AlertManeuverRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& return_info) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- application_manager::commands::ResponseInfo navigation_alert_info(
- navi_alert_maneuver_result_code_,
- HmiInterfaces::HMI_INTERFACE_Navigation,
- application_manager_);
-
- application_manager::commands::ResponseInfo tts_alert_info(
- tts_speak_result_code_,
- HmiInterfaces::HMI_INTERFACE_TTS,
- application_manager_);
- const bool result =
- PrepareResultForMobileResponse(navigation_alert_info, tts_alert_info);
-
- if (result && (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
- tts_speak_result_code_ &&
- (HmiInterfaces::STATE_AVAILABLE ==
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_TTS)))) {
- result_code = mobile_apis::Result::WARNINGS;
- return_info = std::string("Unsupported phoneme type sent in a prompt");
- return result;
- }
- result_code =
- PrepareResultCodeForResponse(navigation_alert_info, tts_alert_info);
- return_info =
- MergeInfos(navigation_alert_info, info_navi_, tts_alert_info, info_tts_);
- return result;
-}
-
-bool AlertManeuverRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- using smart_objects::SmartArray;
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- const SmartArray* tts_chunks_arr =
- (*message_)[strings::msg_params][strings::tts_chunks].asArray();
-
- SmartArray::const_iterator it_tts_chunk = tts_chunks_arr->begin();
-
- for (; it_tts_chunk != tts_chunks_arr->end(); ++it_tts_chunk) {
- const char* tts_chunk_text = (*it_tts_chunk)[strings::text].asCharArray();
- if (strlen(tts_chunk_text) && !CheckSyntax(tts_chunk_text)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
- return true;
- }
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- DCHECK_OR_RETURN(
- (*message_)[strings::msg_params][strings::soft_buttons].getType() ==
- smart_objects::SmartType_Array,
- true);
- const smart_objects::SmartArray* soft_button_array =
- (*message_)[strings::msg_params][strings::soft_buttons].asArray();
-
- SmartArray::const_iterator it_soft_button = soft_button_array->begin();
-
- for (; it_soft_button != soft_button_array->end(); ++it_soft_button) {
- const char* soft_button_text =
- (*it_soft_button)[strings::text].asCharArray();
- if (!CheckSyntax(soft_button_text)) {
- LOG4CXX_ERROR(logger_, "Invalid soft_buttons syntax check failed");
- return true;
- }
- }
- }
-
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
deleted file mode 100644
index 2f441594c2..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/alert_maneuver_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertManeuverResponse::AlertManeuverResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AlertManeuverResponse::~AlertManeuverResponse() {}
-
-void AlertManeuverResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_request.cc b/src/components/application_manager/src/commands/mobile/alert_request.cc
deleted file mode 100644
index 3c42e43767..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_request.cc
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/alert_request.h"
-
-#include <string.h>
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "utils/helpers.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertRequest::AlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , awaiting_ui_alert_response_(false)
- , awaiting_tts_speak_response_(false)
- , awaiting_tts_stop_speaking_response_(false)
- , is_alert_succeeded_(false)
- , is_ui_alert_sent_(false)
- , alert_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
-
-AlertRequest::~AlertRequest() {}
-
-bool AlertRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::duration)) {
- default_timeout_ =
- (*message_)[strings::msg_params][strings::duration].asUInt();
- } else {
- const int32_t def_value = 5000;
- default_timeout_ = def_value;
- }
-
- // If soft buttons are present, SDL will not use initiate timeout tracking for
- // response.
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- LOG4CXX_INFO(logger_,
- "Request contains soft buttons - request timeout "
- "will be set to 0.");
- default_timeout_ = 0;
- }
-
- return true;
-}
-
-void AlertRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asInt();
-
- if (!Validate(app_id)) {
- // Invalid command, abort execution
- return;
- }
- bool tts_chunks_exists =
- (*message_)[strings::msg_params].keyExists(strings::tts_chunks);
- size_t length_tts_chunks = 0;
-
- if (tts_chunks_exists) {
- length_tts_chunks =
- (*message_)[strings::msg_params][strings::tts_chunks].length();
- }
-
- if ((tts_chunks_exists && length_tts_chunks) ||
- ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
- (*message_)[strings::msg_params][strings::play_tone].asBool())) {
- awaiting_tts_speak_response_ = true;
- }
-
- SendAlertRequest(app_id);
- if (awaiting_tts_speak_response_) {
- SendSpeakRequest(app_id, tts_chunks_exists, length_tts_chunks);
- }
-}
-
-void AlertRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::TTS_OnResetTimeout:
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- LOG4CXX_INFO(logger_,
- "Received UI_OnResetTimeout event "
- " or TTS_OnResetTimeout event"
- << awaiting_tts_speak_response_ << " "
- << awaiting_tts_stop_speaking_response_ << " "
- << awaiting_ui_alert_response_);
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- case hmi_apis::FunctionID::UI_Alert: {
- LOG4CXX_INFO(logger_, "Received UI_Alert event");
- // Unsubscribe from event to avoid unwanted messages
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert);
- awaiting_ui_alert_response_ = false;
- HmiInterfaces::InterfaceState ui_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_UI);
-
- if (awaiting_tts_speak_response_ &&
- HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state) {
- awaiting_tts_stop_speaking_response_ = true;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true);
- }
- alert_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- // Mobile Alert request is successful when UI_Alert is successful
- alert_response_params_ = message[strings::msg_params];
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- // Unsubscribe from event to avoid unwanted messages
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak);
- awaiting_tts_speak_response_ = false;
- tts_speak_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_StopSpeaking: {
- LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- // Unsubscribe from event to avoid unwanted messages
- unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking);
- awaiting_tts_stop_speaking_response_ = false;
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (HasHmiResponsesToWait()) {
- return;
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string info;
- const bool result = PrepareResponseParameters(result_code, info);
- SendResponse(result,
- result_code,
- info.empty() ? NULL : info.c_str(),
- &alert_response_params_);
-}
-
-bool AlertRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
- ResponseInfo ui_alert_info(
- alert_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
- ResponseInfo tts_alert_info(tts_speak_result_,
- HmiInterfaces::HMI_INTERFACE_TTS,
- application_manager_);
-
- bool result = PrepareResultForMobileResponse(ui_alert_info, tts_alert_info);
-
- /* result=false if UI interface is ok and TTS interface = UNSUPPORTED_RESOURCE
- * and sdl receive TTS.IsReady=true or SDL doesn't receive responce for
- * TTS.IsReady.
- */
- if (result && ui_alert_info.is_ok && tts_alert_info.is_unsupported_resource &&
- HmiInterfaces::STATE_NOT_AVAILABLE != tts_alert_info.interface_state) {
- result = false;
- }
- result_code = mobile_apis::Result::WARNINGS;
- if ((ui_alert_info.is_ok || ui_alert_info.is_not_used) &&
- tts_alert_info.is_unsupported_resource &&
- HmiInterfaces::STATE_AVAILABLE == tts_alert_info.interface_state) {
- tts_response_info_ = "Unsupported phoneme type sent in a prompt";
- info = MergeInfos(
- ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
- return result;
- }
- result_code = PrepareResultCodeForResponse(ui_alert_info, tts_alert_info);
- info = MergeInfos(
- ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
- // Mobile Alert request is successful when UI_Alert is successful
- if (is_ui_alert_sent_ && !ui_alert_info.is_ok) {
- return false;
- }
- return result;
-}
-
-bool AlertRequest::Validate(uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
-
- if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() &&
- app->AreCommandLimitsExceeded(
- static_cast<mobile_apis::FunctionID::eType>(function_id()),
- application_manager::TLimitSource::POLICY_TABLE)) {
- LOG4CXX_ERROR(logger_, "Alert frequency is too high.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return false;
- }
-
- if (!CheckStringsOfAlertRequest()) {
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return false;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, processing_result);
- return false;
- }
-
- // check if mandatory params(alertText1 and TTSChunk) specified
- if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1)) &&
- (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) &&
- (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks) &&
- (1 > (*message_)[strings::msg_params][strings::tts_chunks].length()))) {
- LOG4CXX_ERROR(logger_, "Mandatory parameters are missing");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "Mandatory parameters are missing");
- return false;
- }
-
- return true;
-}
-
-void AlertRequest::SendAlertRequest(int32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[hmi_request::alert_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t index = 0;
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
- msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
- hmi_apis::Common_TextFieldName::alertText1;
- msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::alert_text1];
- index++;
- }
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
- msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
- hmi_apis::Common_TextFieldName::alertText2;
- msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::alert_text2];
- index++;
- }
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
- msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
- hmi_apis::Common_TextFieldName::alertText3;
- msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::alert_text3];
- }
-
- // softButtons
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[hmi_request::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
- // app_id
- msg_params[strings::app_id] = app_id;
- msg_params[strings::duration] = default_timeout_;
-
- // NAVI platform progressIndicator
- if ((*message_)[strings::msg_params].keyExists(strings::progress_indicator)) {
- msg_params[strings::progress_indicator] =
- (*message_)[strings::msg_params][strings::progress_indicator];
- }
-
- // PASA Alert type
- msg_params[strings::alert_type] = hmi_apis::Common_AlertType::UI;
- if (awaiting_tts_speak_response_) {
- msg_params[strings::alert_type] = hmi_apis::Common_AlertType::BOTH;
- }
-
- // check out if there are alert strings or soft buttons
- if (msg_params[hmi_request::alert_strings].length() > 0 ||
- msg_params.keyExists(hmi_request::soft_buttons)) {
- awaiting_ui_alert_response_ = true;
- is_ui_alert_sent_ = true;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true);
- }
-}
-
-void AlertRequest::SendSpeakRequest(int32_t app_id,
- bool tts_chunks_exists,
- size_t length_tts_chunks) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- using namespace smart_objects;
- // crate HMI speak request
- SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
- if (tts_chunks_exists && length_tts_chunks) {
- msg_params[hmi_request::tts_chunks] =
- smart_objects::SmartObject(SmartType_Array);
- msg_params[hmi_request::tts_chunks] =
- (*message_)[strings::msg_params][strings::tts_chunks];
- }
- if ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
- (*message_)[strings::msg_params][strings::play_tone].asBool()) {
- msg_params[strings::play_tone] = true;
- }
- msg_params[strings::app_id] = app_id;
- msg_params[hmi_request::speak_type] = Common_MethodName::ALERT;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
-}
-
-bool AlertRequest::CheckStringsOfAlertRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
- str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
- str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
- str = (*message_)[strings::msg_params][strings::alert_text3].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid alert_text_3 syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- smart_objects::SmartObject& tts_chunks_array =
- (*message_)[strings::msg_params][strings::tts_chunks];
- for (size_t i = 0; i < tts_chunks_array.length(); ++i) {
- str = tts_chunks_array[i][strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_chunks text syntax check failed");
- return false;
- }
- }
- }
- return true;
-}
-
-bool AlertRequest::HasHmiResponsesToWait() {
- LOG4CXX_AUTO_TRACE(logger_);
- return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ ||
- awaiting_tts_stop_speaking_response_;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_response.cc b/src/components/application_manager/src/commands/mobile/alert_response.cc
deleted file mode 100644
index f8ca487eae..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_response.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/alert_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertResponse::AlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AlertResponse::~AlertResponse() {}
-
-void AlertResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/src/commands/mobile/change_registration_request.cc
deleted file mode 100644
index f55767c723..0000000000
--- a/src/components/application_manager/src/commands/mobile/change_registration_request.cc
+++ /dev/null
@@ -1,661 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include <algorithm>
-#include "application_manager/commands/mobile/change_registration_request.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace {
-namespace custom_str = utils::custom_string;
-struct IsSameNickname {
- IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
- bool operator()(const policy::StringArray::value_type& nickname) const {
- return app_id_.CompareIgnoreCase(nickname.c_str());
- }
-
- private:
- const custom_str::CustomString& app_id_;
-};
-}
-
-namespace application_manager {
-
-namespace commands {
-
-ChangeRegistrationRequest::ChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , vr_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-ChangeRegistrationRequest::~ChangeRegistrationRequest() {}
-
-void ChangeRegistrationRequest::SendVRRequest(
- ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- auto function = hmi_apis::FunctionID::VR_ChangeRegistration;
- pending_requests_.Add(function);
- smart_objects::SmartObject vr_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- vr_params[strings::language] = msg_params[strings::language];
-
- vr_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::vr_synonyms)) {
- vr_params[strings::vr_synonyms] = msg_params[strings::vr_synonyms];
- app->set_vr_synonyms(msg_params[strings::vr_synonyms]);
- }
- StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
- SendHMIRequest(function, &vr_params, true);
-}
-
-void ChangeRegistrationRequest::SendTTSRequest(
- ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- auto function = hmi_apis::FunctionID::TTS_ChangeRegistration;
- pending_requests_.Add(function);
-
- smart_objects::SmartObject tts_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- tts_params[strings::language] = msg_params[strings::language];
-
- tts_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::tts_name)) {
- tts_params[strings::tts_name] = msg_params[strings::tts_name];
- app->set_tts_name(msg_params[strings::tts_name]);
- }
- StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
- SendHMIRequest(function, &tts_params, true);
-}
-
-void ChangeRegistrationRequest::SendUIRequest(
- ApplicationSharedPtr app,
- smart_objects::SmartObject& msg_params,
- const int32_t hmi_language) {
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- auto function = hmi_apis::FunctionID::UI_ChangeRegistration;
- pending_requests_.Add(function);
- // UI processing
- smart_objects::SmartObject ui_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- ui_params[strings::language] = hmi_language;
- ui_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::app_name)) {
- ui_params[strings::app_name] = msg_params[strings::app_name];
- app->set_name(msg_params[strings::app_name].asCustomString());
- }
- if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
- ui_params[strings::ngn_media_screen_app_name] =
- msg_params[strings::ngn_media_screen_app_name];
- app->set_ngn_media_screen_name(
- msg_params[strings::ngn_media_screen_app_name]);
- }
-
- StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
- SendHMIRequest(function, &ui_params, true);
-}
-
-void ChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace smart_objects;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_INFO(logger_,
- "Incoming request contains \t\n \\t \\n or whitespace");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (mobile_apis::Result::SUCCESS != CheckCoincidence()) {
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
-
- SmartObject& msg_params = (*message_)[strings::msg_params];
-
- const int32_t hmi_language =
- msg_params[strings::hmi_display_language].asInt();
-
- const int32_t language = msg_params[strings::language].asInt();
-
- if (false == (IsLanguageSupportedByUI(hmi_language) &&
- IsLanguageSupportedByVR(language) &&
- IsLanguageSupportedByTTS(language))) {
- LOG4CXX_ERROR(logger_, "Language is not supported");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (msg_params.keyExists(strings::app_name) &&
- !IsNicknameAllowed(msg_params[strings::app_name].asCustomString())) {
- LOG4CXX_ERROR(logger_, "Nickname is not allowed.");
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- return;
- }
-
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
-
- const HmiInterfaces::InterfaceState vr_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
- const HmiInterfaces::InterfaceState ui_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
- const HmiInterfaces::InterfaceState tts_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
-
- using helpers::Compare;
- using helpers::EQ;
- using helpers::ALL;
-
- if (Compare<HmiInterfaces::InterfaceState, EQ, ALL>(
- HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE,
- vr_state,
- tts_state,
- ui_state)) {
- SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
- return;
- }
- if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != vr_state) {
- // VR processing
- SendVRRequest(app, msg_params);
- }
- if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != tts_state) {
- // TTS processing
- SendTTSRequest(app, msg_params);
- }
-
- if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != ui_state) {
- SendUIRequest(app, msg_params, hmi_language);
- }
-}
-
-void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- hmi_apis::FunctionID::eType event_id = event.id();
-
- switch (event_id) {
- case hmi_apis::FunctionID::UI_ChangeRegistration: {
- LOG4CXX_INFO(logger_, "Received UI_ChangeRegistration event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- pending_requests_.Remove(event_id);
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::VR_ChangeRegistration: {
- LOG4CXX_INFO(logger_, "Received VR_ChangeRegistration event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- pending_requests_.Remove(event_id);
- vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, vr_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_ChangeRegistration: {
- LOG4CXX_INFO(logger_, "Received TTS_ChangeRegistration event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- pending_requests_.Remove(event_id);
- tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event_id);
- return;
- }
- }
-
- if (pending_requests_.IsFinal(event_id)) {
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (hmi_apis::Common_Result::SUCCESS == ui_result_) {
- application->set_ui_language(static_cast<mobile_api::Language::eType>(
- (*message_)[strings::msg_params][strings::hmi_display_language]
- .asInt()));
- }
-
- if (hmi_apis::Common_Result::SUCCESS == vr_result_ ||
- hmi_apis::Common_Result::SUCCESS == tts_result_) {
- application->set_language(static_cast<mobile_api::Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string response_info;
- const bool result = PrepareResponseParameters(result_code, response_info);
-
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::eType::ChangeRegistrationID;
-
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- } else {
- LOG4CXX_INFO(logger_,
- "There are some pending responses from HMI."
- "ChangeRegistrationRequest still waiting.");
- }
-}
-
-namespace {
-void CheckInfo(std::string& str) {
- if (std::string::npos != str.find("is not supported by system")) {
- str.clear();
- }
-}
-} // namespace
-
-bool ChangeRegistrationRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& response_info) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- const bool is_tts_succeeded_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- tts_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_ui_succeeded_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_vr_succeeded_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- vr_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_tts_ui_vr_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- tts_result_,
- ui_result_,
- vr_result_);
-
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- const HmiInterfaces::InterfaceState tts_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
- const HmiInterfaces::InterfaceState vr_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
- const HmiInterfaces::InterfaceState ui_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
-
- ResponseInfo ui_properties_info(
- ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
-
- ResponseInfo tts_properties_info(
- tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
-
- ResponseInfo vr_properties_info(
- ui_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
-
- bool result = ((!is_tts_ui_vr_unsupported) && is_tts_succeeded_unsupported &&
- is_ui_succeeded_unsupported && is_vr_succeeded_unsupported);
-
- const bool is_tts_or_ui_or_vr_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- tts_result_,
- ui_result_,
- vr_result_);
-
- if ((result && is_tts_or_ui_or_vr_unsupported)) {
- result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- result =
- PrepareResultForMobileResponse(ui_properties_info,
- tts_properties_info) &&
- PrepareResultForMobileResponse(tts_properties_info, vr_properties_info);
- } else {
- // If response contains erroneous result code SDL need return erroneus
- // result code.
- hmi_apis::Common_Result::eType ui_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- hmi_apis::Common_Result::eType vr_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- hmi_apis::Common_Result::eType tts_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != ui_result_) {
- ui_result = ui_result_;
- }
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
- vr_result = vr_result_;
- }
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != tts_result_) {
- tts_result = tts_result_;
- }
- result_code = MessageHelper::HMIToMobileResult(
- std::max(std::max(ui_result, vr_result), tts_result));
- if (mobile_api::Result::INVALID_ENUM == result_code) {
- result_code = mobile_api::Result::UNSUPPORTED_RESOURCE;
- }
- }
-
- const bool is_tts_state_available =
- tts_state == HmiInterfaces::STATE_AVAILABLE;
- const bool is_vr_state_available = vr_state == HmiInterfaces::STATE_AVAILABLE;
- const bool is_ui_state_available = ui_state == HmiInterfaces::STATE_AVAILABLE;
-
- const bool is_tts_hmi_info =
- is_tts_state_available && !tts_response_info_.empty();
- const bool is_vr_hmi_info =
- is_vr_state_available && !vr_response_info_.empty();
- const bool is_ui_hmi_info =
- is_ui_state_available && !ui_response_info_.empty();
-
- if (is_tts_hmi_info || is_vr_hmi_info || is_ui_hmi_info) {
- if (!is_tts_hmi_info)
- CheckInfo(tts_response_info_);
- if (!is_vr_hmi_info)
- CheckInfo(ui_response_info_);
- if (!is_ui_hmi_info)
- CheckInfo(vr_response_info_);
- }
-
- response_info =
- MergeInfos(ui_response_info_, vr_response_info_, tts_response_info_);
- return result;
-}
-
-bool ChangeRegistrationRequest::IsLanguageSupportedByUI(
- const int32_t& hmi_display_lang) {
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- const smart_objects::SmartObject* ui_languages =
- hmi_capabilities.ui_supported_languages();
-
- if (!ui_languages) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- for (size_t i = 0; i < ui_languages->length(); ++i) {
- if (hmi_display_lang == ui_languages->getElement(i).asInt()) {
- return true;
- }
- }
-
- LOG4CXX_ERROR(logger_, "Language isn't supported by UI");
-
- return false;
-}
-
-bool ChangeRegistrationRequest::IsLanguageSupportedByVR(
- const int32_t& hmi_display_lang) {
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- const smart_objects::SmartObject* vr_languages =
- hmi_capabilities.vr_supported_languages();
-
- if (!vr_languages) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- for (size_t i = 0; i < vr_languages->length(); ++i) {
- if (hmi_display_lang == vr_languages->getElement(i).asInt()) {
- return true;
- }
- }
-
- LOG4CXX_ERROR(logger_, "Language isn't supported by VR");
-
- return false;
-}
-
-bool ChangeRegistrationRequest::IsLanguageSupportedByTTS(
- const int32_t& hmi_display_lang) {
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- const smart_objects::SmartObject* tts_languages =
- hmi_capabilities.tts_supported_languages();
-
- if (!tts_languages) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- for (size_t i = 0; i < tts_languages->length(); ++i) {
- if (hmi_display_lang == tts_languages->getElement(i).asInt()) {
- return true;
- break;
- }
- }
-
- LOG4CXX_ERROR(logger_, "Language isn't supported by TTS");
- return false;
-}
-
-bool ChangeRegistrationRequest::IsWhiteSpaceExist() {
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::app_name)) {
- str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
- const smart_objects::SmartArray* tn_array =
- (*message_)[strings::msg_params][strings::tts_name].asArray();
-
- smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
- smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
-
- for (; it_tn != it_tn_end; ++it_tn) {
- str = (*it_tn)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::ngn_media_screen_app_name)) {
- str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid ngn_media_screen_app_name syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
- const smart_objects::SmartArray* vs_array =
- (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
-
- smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
- smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
-
- for (; it_vs != it_vs_end; ++it_vs) {
- str = (*it_vs).asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- ApplicationSet accessor = application_manager_.applications().GetData();
- custom_str::CustomString app_name;
- uint32_t app_id = connection_key();
- if (msg_params.keyExists(strings::app_name)) {
- app_name = msg_params[strings::app_name].asCustomString();
- }
-
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it; ++it) {
- if (app_id == (*it)->app_id()) {
- continue;
- }
-
- const custom_str::CustomString& cur_name = (*it)->name();
- if (msg_params.keyExists(strings::app_name)) {
- if (app_name.CompareIgnoreCase(cur_name)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
-
- const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
- const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
- if (NULL != vr) {
- curr_vr = vr->asArray();
- CoincidencePredicateVR v(app_name);
-
- if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- }
- }
-
- // vr check
- if (msg_params.keyExists(strings::vr_synonyms)) {
- const std::vector<smart_objects::SmartObject>* new_vr =
- msg_params[strings::vr_synonyms].asArray();
-
- CoincidencePredicateVR v(cur_name);
- if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- } // end vr check
- } // application for end
- return mobile_apis::Result::SUCCESS;
-}
-
-bool ChangeRegistrationRequest::IsNicknameAllowed(
- const custom_str::CustomString& app_name) const {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Can't find appication with connection key "
- << connection_key());
- return false;
- }
-
- const std::string policy_app_id = app->policy_app_id();
-
- policy::StringArray app_nicknames;
- policy::StringArray app_hmi_types;
-
- bool init_result = application_manager_.GetPolicyHandler().GetInitialAppData(
- policy_app_id, &app_nicknames, &app_hmi_types);
-
- if (!init_result) {
- LOG4CXX_ERROR(logger_,
- "Error during getting of nickname list for application "
- << policy_app_id);
- return false;
- }
-
- if (!app_nicknames.empty()) {
- IsSameNickname compare(app_name);
- policy::StringArray::const_iterator it =
- std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
- if (app_nicknames.end() == it) {
- LOG4CXX_WARN(logger_,
- "Application name was not found in nicknames list.");
-
- usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
- application_manager_.GetPolicyHandler().GetStatisticManager(),
- policy_app_id,
- usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
- ++count_of_rejections_nickname_mismatch;
-
- return false;
- }
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/src/commands/mobile/change_registration_response.cc
deleted file mode 100644
index 210cae64c5..0000000000
--- a/src/components/application_manager/src/commands/mobile/change_registration_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/change_registration_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ChangeRegistrationResponse::ChangeRegistrationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ChangeRegistrationResponse::~ChangeRegistrationResponse() {}
-
-void ChangeRegistrationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc
deleted file mode 100644
index 20387ef230..0000000000
--- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include <cstring>
-#include <algorithm>
-#include <vector>
-#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/gen_hash.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , choice_set_id_(0)
- , expected_chs_count_(0)
- , received_chs_count_(0)
- , error_from_hmi_(false)
- , is_timed_out_(false)
- , vr_commands_lock_(true) {}
-
-CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-void CreateInteractionChoiceSetRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace mobile_apis;
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- for (uint32_t i = 0;
- i < (*message_)[strings::msg_params][strings::choice_set].length();
- ++i) {
- Result::eType verification_result_image = Result::SUCCESS;
- Result::eType verification_result_secondary_image = Result::SUCCESS;
- if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
- strings::image)) {
- verification_result_image = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::choice_set][i]
- [strings::image],
- app,
- application_manager_);
- }
- if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
- strings::secondary_image)) {
- verification_result_secondary_image = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::choice_set][i]
- [strings::secondary_image],
- app,
- application_manager_);
- }
- if (verification_result_image == Result::INVALID_DATA ||
- verification_result_secondary_image == Result::INVALID_DATA) {
- LOG4CXX_ERROR(logger_, "Image verification failed.");
- SendResponse(false, Result::INVALID_DATA);
- return;
- }
- }
-
- choice_set_id_ =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asInt();
-
- if (app->FindChoiceSet(choice_set_id_)) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id_ << " is not found.");
- SendResponse(false, Result::INVALID_ID);
- return;
- }
-
- Result::eType result = CheckChoiceSet(app);
- if (Result::SUCCESS != result) {
- SendResponse(false, result);
- return;
- }
- uint32_t grammar_id = application_manager_.GenerateGrammarID();
- (*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
- app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]);
- SendVRAddCommandRequests(app);
-}
-
-mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
- ApplicationConstSharedPtr app) {
- using namespace smart_objects;
- LOG4CXX_AUTO_TRACE(logger_);
-
- std::set<uint32_t> choice_id_set;
-
- const SmartArray* choice_set =
- (*message_)[strings::msg_params][strings::choice_set].asArray();
-
- SmartArray::const_iterator current_choice_set_it = choice_set->begin();
- SmartArray::const_iterator next_choice_set_it;
-
- for (; choice_set->end() != current_choice_set_it; ++current_choice_set_it) {
- std::pair<std::set<uint32_t>::iterator, bool> ins_res =
- choice_id_set.insert(
- (*current_choice_set_it)[strings::choice_id].asInt());
- if (!ins_res.second) {
- LOG4CXX_ERROR(logger_,
- "Choise with ID "
- << (*current_choice_set_it)[strings::choice_id].asInt()
- << " already exists");
- return mobile_apis::Result::INVALID_ID;
- }
-
- if (IsWhiteSpaceExist(*current_choice_set_it)) {
- LOG4CXX_ERROR(logger_, "Incoming choice set has contains \t\n \\t \\n");
- return mobile_apis::Result::INVALID_DATA;
- }
- for (next_choice_set_it = current_choice_set_it + 1;
- choice_set->end() != next_choice_set_it;
- ++next_choice_set_it) {
- if (compareSynonyms(*current_choice_set_it, *next_choice_set_it)) {
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- }
- }
- return mobile_apis::Result::SUCCESS;
-}
-
-bool CreateInteractionChoiceSetRequest::compareSynonyms(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) {
- smart_objects::SmartArray* vr_cmds_1 =
- choice1[strings::vr_commands].asArray();
- DCHECK(vr_cmds_1 != NULL);
- smart_objects::SmartArray* vr_cmds_2 =
- choice2[strings::vr_commands].asArray();
- DCHECK(vr_cmds_2 != NULL);
-
- smart_objects::SmartArray::iterator it;
- it = std::find_first_of(vr_cmds_1->begin(),
- vr_cmds_1->end(),
- vr_cmds_2->begin(),
- vr_cmds_2->end(),
- CreateInteractionChoiceSetRequest::compareStr);
-
- if (it != vr_cmds_1->end()) {
- LOG4CXX_INFO(logger_,
- "Incoming choice set has duplicated VR synonyms "
- << it->asString());
- return true;
- }
-
- return false;
-}
-
-bool CreateInteractionChoiceSetRequest::compareStr(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2) {
- return 0 == strcasecmp(str1.asCharArray(), str2.asCharArray());
-}
-
-bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist(
- const smart_objects::SmartObject& choice_set) {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = choice_set[strings::menu_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu_name syntax check failed");
- return true;
- }
-
- if (choice_set.keyExists(strings::secondary_text)) {
- str = choice_set[strings::secondary_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid secondary_text syntax check failed");
- return true;
- }
- }
-
- if (choice_set.keyExists(strings::tertiary_text)) {
- str = choice_set[strings::tertiary_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tertiary_text syntax check failed");
- return true;
- }
- }
-
- if (choice_set.keyExists(strings::vr_commands)) {
- const size_t len = choice_set[strings::vr_commands].length();
-
- for (size_t i = 0; i < len; ++i) {
- str = choice_set[strings::vr_commands][i].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
- return true;
- }
- }
- }
-
- if (choice_set.keyExists(strings::image)) {
- str = choice_set[strings::image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid image value syntax check failed");
- return true;
- }
- }
-
- if (choice_set.keyExists(strings::secondary_image)) {
- str = choice_set[strings::secondary_image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid secondary_image value. "
- "Syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& choice_set = (*message_)[strings::msg_params];
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::grammar_id] = choice_set[strings::grammar_id];
- const uint32_t choice_count = choice_set[strings::choice_set].length();
- SetAllowedToTerminate(false);
-
- expected_chs_count_ = choice_count;
- size_t chs_num = 0;
- for (; chs_num < choice_count; ++chs_num) {
- {
- sync_primitives::AutoLock error_lock(error_from_hmi_lock_);
- if (error_from_hmi_) {
- LOG4CXX_WARN(logger_,
- "Error from HMI received. Stop sending VRCommands");
- break;
- }
- }
-
- msg_params[strings::cmd_id] =
- choice_set[strings::choice_set][chs_num][strings::choice_id];
- msg_params[strings::vr_commands] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- msg_params[strings::vr_commands] =
- choice_set[strings::choice_set][chs_num][strings::vr_commands];
-
- sync_primitives::AutoLock commands_lock(vr_commands_lock_);
- const uint32_t vr_cmd_id = msg_params[strings::cmd_id].asUInt();
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- const uint32_t vr_corr_id =
- SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params, true);
-
- VRCommandInfo vr_command(vr_cmd_id);
- sent_commands_map_[vr_corr_id] = vr_command;
- LOG4CXX_DEBUG(logger_,
- "VR_command sent corr_id " << vr_corr_id << " cmd_id "
- << vr_corr_id);
- }
- expected_chs_count_ = chs_num;
- LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_);
-}
-
-void CreateInteractionChoiceSetRequest::ProcessHmiError(
- const hmi_apis::Common_Result::eType vr_result) {
- LOG4CXX_DEBUG(logger_,
- "Hmi response is not Success: "
- << vr_result << ". Stop sending VRAddCommand requests");
- if (!error_from_hmi_) {
- error_from_hmi_ = true;
- std::string info =
- vr_result == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE
- ? "VR is not supported by system"
- : "";
- SendResponse(false, GetMobileResultCode(vr_result), info.c_str());
- }
-}
-
-bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse(
- const uint32_t corr_id) {
- SentCommandsMap::iterator it = sent_commands_map_.find(corr_id);
- if (sent_commands_map_.end() == it) {
- LOG4CXX_WARN(logger_, "HMI response for unknown VR command received");
- return false;
- }
- VRCommandInfo& vr_command = it->second;
- vr_command.succesful_response_received_ = true;
- return true;
-}
-
-void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() {
- received_chs_count_++;
- LOG4CXX_DEBUG(logger_,
- "Got VR.AddCommand response, there are "
- << expected_chs_count_ - received_chs_count_
- << " more to wait.");
- if (received_chs_count_ < expected_chs_count_) {
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- LOG4CXX_DEBUG(logger_, "Timeout for request was updated");
- } else {
- OnAllHMIResponsesReceived();
- }
-}
-
-void CreateInteractionChoiceSetRequest::on_event(
- const event_engine::Event& event) {
- using namespace hmi_apis;
- using namespace helpers;
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- const Common_Result::eType result = static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool is_no_error = Compare<Common_Result::eType, EQ, ONE>(
- result, Common_Result::SUCCESS, Common_Result::WARNINGS);
- uint32_t corr_id = static_cast<uint32_t>(
- message[strings::params][strings::correlation_id].asUInt());
- if (event.id() == hmi_apis::FunctionID::VR_AddCommand) {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- {
- sync_primitives::AutoLock commands_lock(vr_commands_lock_);
- if (is_no_error) {
- if (!ProcessSuccesfulHMIResponse(corr_id)) {
- return;
- }
- } else {
- ProcessHmiError(result);
- }
- }
- CountReceivedVRResponses();
- }
-}
-
-void CreateInteractionChoiceSetRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!error_from_hmi_) {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- }
- CommandRequestImpl::onTimeOut();
- DeleteChoices();
-
- // We have to keep request alive until receive all responses from HMI
- // according to SDLAQ-CRS-2976
- sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_);
- is_timed_out_ = true;
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-bool CreateInteractionChoiceSetRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-void CreateInteractionChoiceSetRequest::DeleteChoices() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- application->RemoveChoiceSet(choice_set_id_);
-
- smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
- msg_param[strings::app_id] = application->app_id();
-
- sync_primitives::AutoLock commands_lock(vr_commands_lock_);
- SentCommandsMap::const_iterator it = sent_commands_map_.begin();
- for (; it != sent_commands_map_.end(); ++it) {
- const VRCommandInfo& vr_command_info = it->second;
- if (vr_command_info.succesful_response_received_) {
- msg_param[strings::cmd_id] = vr_command_info.cmd_id_;
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_param);
- } else {
- LOG4CXX_WARN(logger_,
- "succesful response has not been received for cmd_id = "
- << vr_command_info.cmd_id_);
- }
- }
- sent_commands_map_.clear();
-}
-
-void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!error_from_hmi_) {
- SendResponse(true, mobile_apis::Result::SUCCESS);
- } else {
- DeleteChoices();
- }
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc
deleted file mode 100644
index 0cc137d6a0..0000000000
--- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {}
-
-void CreateInteractionChoiceSetResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- SendResponse(true);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/src/commands/mobile/delete_command_request.cc
deleted file mode 100644
index f894ed452c..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_command_request.cc
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_command_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteCommandRequest::DeleteCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , is_ui_send_(false)
- , is_vr_send_(false)
- , is_ui_received_(false)
- , is_vr_received_(false)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-DeleteCommandRequest::~DeleteCommandRequest() {}
-
-void DeleteCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const int32_t cmd_id =
- (*message_)[strings::msg_params][strings::cmd_id].asInt();
-
- smart_objects::SmartObject* command = application->FindCommand(cmd_id);
-
- if (!command) {
- LOG4CXX_ERROR(logger_, "Command with id " << cmd_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_params[strings::app_id] = application->app_id();
-
- // we should specify amount of required responses in the 1st request
- uint32_t chaining_counter = 0;
- if ((*command).keyExists(strings::menu_params)) {
- ++chaining_counter;
- }
-
- if ((*command).keyExists(strings::vr_commands)) {
- ++chaining_counter;
- }
- /* Need to set all flags before sending request to HMI
- * for correct processing this flags in method on_event */
- if ((*command).keyExists(strings::menu_params)) {
- is_ui_send_ = true;
- }
- // check vr params
- if ((*command).keyExists(strings::vr_commands)) {
- is_vr_send_ = true;
- }
- if (is_ui_send_) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true);
- }
- if (is_vr_send_) {
- // VR params
- msg_params[strings::grammar_id] = application->get_grammar_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true);
- }
-}
-
-bool DeleteCommandRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
- using namespace helpers;
- ResponseInfo ui_delete_info(
- ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
- ResponseInfo vr_delete_info(
- vr_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
- const bool result =
- PrepareResultForMobileResponse(ui_delete_info, vr_delete_info);
-
- const bool is_vr_or_ui_warning =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
- info = MergeInfos(ui_delete_info, ui_info_, vr_delete_info, vr_info_);
- if (is_vr_or_ui_warning && !ui_delete_info.is_unsupported_resource &&
- !vr_delete_info.is_unsupported_resource) {
- LOG4CXX_DEBUG(logger_, "VR or UI result is warning");
- result_code = mobile_apis::Result::WARNINGS;
- return result;
- }
- result_code = PrepareResultCodeForResponse(ui_delete_info, vr_delete_info);
- LOG4CXX_DEBUG(logger_, "Result is " << (result ? "true" : "false"));
- return result;
-}
-
-void DeleteCommandRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_DeleteCommand: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- LOG4CXX_DEBUG(logger_,
- "Received UI_DeleteCommand event with result "
- << MessageHelper::HMIResultToString(ui_result_));
- GetInfo(message, ui_info_);
- break;
- }
- case hmi_apis::FunctionID::VR_DeleteCommand: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- is_vr_received_ = true;
- vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- LOG4CXX_DEBUG(logger_,
- "Received VR_DeleteCommand event with result "
- << MessageHelper::HMIResultToString(vr_result_));
- GetInfo(message, vr_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- LOG4CXX_DEBUG(logger_, "Still awaiting for other responses.");
- return;
- }
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
-
- const int32_t cmd_id = msg_params[strings::cmd_id].asInt();
-
- smart_objects::SmartObject* command = application->FindCommand(cmd_id);
-
- if (!command) {
- LOG4CXX_ERROR(logger_,
- "Command id " << cmd_id << " not found for "
- "application with connection key "
- << connection_key());
- return;
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string info;
- const bool result = PrepareResponseParameters(result_code, info);
- if (result) {
- application->RemoveCommand(msg_params[strings::cmd_id].asInt());
- }
- SendResponse(
- result, result_code, info.empty() ? NULL : info.c_str(), &msg_params);
-}
-
-bool DeleteCommandRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-bool DeleteCommandRequest::IsPendingResponseExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- return is_ui_send_ != is_ui_received_ || is_vr_send_ != is_vr_received_;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/src/commands/mobile/delete_command_response.cc
deleted file mode 100644
index 7abc1c11d4..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_command_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_command_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteCommandResponse::DeleteCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteCommandResponse::~DeleteCommandResponse() {}
-
-void DeleteCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/src/commands/mobile/delete_file_request.cc
deleted file mode 100644
index 984c7a1725..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_file_request.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_file_request.h"
-
-#include "application_manager/application_impl.h"
-
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteFileRequest::DeleteFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DeleteFileRequest::~DeleteFileRequest() {}
-
-void DeleteFileRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
- (application_manager_.get_settings().delete_file_in_none() <=
- application->delete_file_in_none_count())) {
- // If application is in the HMI_NONE level the quantity of allowed
- // DeleteFile request is limited by the configuration profile
- LOG4CXX_ERROR(logger_,
- "Too many requests from the app with HMILevel HMI_NONE ");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- if (!file_system::IsFileNameValid(sync_file_name)) {
- const std::string err_msg = "Sync file name contains forbidden symbols.";
- LOG4CXX_ERROR(logger_, err_msg);
- SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
- return;
- }
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += application->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (file_system::FileExists(full_file_path)) {
- if (file_system::DeleteFile(full_file_path)) {
- const AppFile* file = application->GetFile(full_file_path);
- if (file) {
- SendFileRemovedNotification(file);
- }
-
- application->DeleteFile(full_file_path);
- application->increment_delete_file_in_none_count();
- SendResponse(true, mobile_apis::Result::SUCCESS);
- } else {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- }
- } else {
- SendResponse(false, mobile_apis::Result::REJECTED);
- }
-}
-
-void DeleteFileRequest::SendFileRemovedNotification(const AppFile* file) const {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::file_name] = file->file_name;
- msg_params[strings::file_type] = file->file_type;
-
- CreateHMINotification(hmi_apis::FunctionID::BasicCommunication_OnFileRemoved,
- msg_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/src/commands/mobile/delete_file_response.cc
deleted file mode 100644
index 8ed6f7ba2e..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_file_response.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_file_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteFileResponse::~DeleteFileResponse() {}
-
-void DeleteFileResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- (*message_)[strings::msg_params][strings::space_available] =
- static_cast<uint32_t>(app->GetAvailableDiskSpace());
- SendResponse((*message_)[strings::msg_params][strings::success].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc
deleted file mode 100644
index bfbb2429ac..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_interaction_choice_set_request.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {}
-
-void DeleteInteractionChoiceSetRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "No application associated with connection key "
- << connection_key());
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const int32_t choice_set_id =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asInt();
-
- if (!app->FindChoiceSet(choice_set_id)) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- if (ChoiceSetInUse(app)) {
- LOG4CXX_ERROR(logger_, "Choice set currently in use.");
- SendResponse(false, mobile_apis::Result::IN_USE);
- return;
- }
- SendVrDeleteCommand(app);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::interaction_choice_set_id] = choice_set_id;
- msg_params[strings::app_id] = app->app_id();
-
- app->RemoveChoiceSet(choice_set_id);
-
- // Checking of HMI responses will be implemented with APPLINK-14600
- const bool result = true;
- SendResponse(result, mobile_apis::Result::SUCCESS);
-}
-
-bool DeleteInteractionChoiceSetRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(
- ApplicationConstSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!app->is_perform_interaction_active()) {
- return false;
- }
- const DataAccessor<PerformChoiceSetMap> accessor =
- app->performinteraction_choice_set_map();
- const PerformChoiceSetMap& choice_set_map = accessor.GetData();
-
- const uint32_t choice_set_id =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asUInt();
-
- PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
- for (; choice_set_map.end() != it; ++it) {
- const PerformChoice& choice = it->second;
- PerformChoice::const_iterator choice_it = choice.begin();
- for (; choice.end() != choice_it; ++choice_it) {
- if (choice_it->first == choice_set_id) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id << " is in use.");
- return true;
- }
- }
- }
- return true;
-}
-
-void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand(
- application_manager::ApplicationSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const uint32_t choice_set_id =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asUInt();
-
- smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_set_id);
-
- if (!choice_set) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id << " is not found.");
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
- msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id];
- choice_set = &((*choice_set)[strings::choice_set]);
- for (uint32_t i = 0; i < (*choice_set).length(); ++i) {
- msg_params[strings::cmd_id] = (*choice_set)[i][strings::choice_id];
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc
deleted file mode 100644
index 97e07529af..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_interaction_choice_set_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {}
-
-void DeleteInteractionChoiceSetResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- const int32_t code =
- (*message_)[strings::msg_params][strings::result_code].asInt();
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- SendResponse(true);
- } else {
- // TODO(DK): Some logic
- SendResponse(false);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc
deleted file mode 100644
index 09f3139245..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_sub_menu_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteSubMenuRequest::DeleteSubMenuRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DeleteSubMenuRequest::~DeleteSubMenuRequest() {}
-
-void DeleteSubMenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- const int32_t menu_id =
- (*message_)[strings::msg_params][strings::menu_id].asInt();
-
- if (!app->FindSubMenu(menu_id)) {
- LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::menu_id] =
- (*message_)[strings::msg_params][strings::menu_id];
- msg_params[strings::app_id] = app->app_id();
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
-}
-
-void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
- ApplicationConstSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator it = commands.begin();
-
- for (; commands.end() != it; ++it) {
- if (!(*it->second).keyExists(strings::vr_commands)) {
- continue;
- }
-
- if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
- (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::grammar_id] = app->get_grammar_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
-
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- }
- }
-}
-
-void DeleteSubMenuRequest::DeleteSubMenuUICommands(
- ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const DataAccessor<CommandsMap> accessor(app->commands_map());
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator it = commands.begin();
-
- while (commands.end() != it) {
- if (!(*it->second).keyExists(strings::menu_params)) {
- LOG4CXX_ERROR(logger_, "menu_params not exist");
- ++it;
- continue;
- }
-
- if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
- (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
- app->RemoveCommand((*it->second)[strings::cmd_id].asInt());
- it = commands.begin(); // Can not relay on
- // iterators after erase was called
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
- } else {
- ++it;
- }
- }
-}
-
-void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_DeleteSubMenu: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (result) {
- // delete sub menu items from SDL and HMI
- DeleteSubMenuVRCommands(application);
- DeleteSubMenuUICommands(application);
- application->RemoveSubMenu(
- (*message_)[strings::msg_params][strings::menu_id].asInt());
- }
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-bool DeleteSubMenuRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc
deleted file mode 100644
index ad9d2ad858..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_sub_menu_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteSubMenuResponse::DeleteSubMenuResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteSubMenuResponse::~DeleteSubMenuResponse() {}
-
-void DeleteSubMenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
deleted file mode 100644
index 7704d700f9..0000000000
--- a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/mobile/diagnostic_message_request.h"
-
-#include "application_manager/application_impl.h"
-
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DiagnosticMessageRequest::DiagnosticMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DiagnosticMessageRequest::~DiagnosticMessageRequest() {}
-
-void DiagnosticMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::vector<uint32_t>& supported_diag_modes =
- application_manager_.get_settings().supported_diag_modes();
-
- smart_objects::SmartObject& msg_data =
- (*message_)[strings::msg_params][strings::message_data];
-
- const uint8_t mode_position = 0;
- const uint32_t msg_diagnostic_mode = msg_data[mode_position].asUInt();
- if (supported_diag_modes.end() == std::find(supported_diag_modes.begin(),
- supported_diag_modes.end(),
- msg_diagnostic_mode)) {
- LOG4CXX_ERROR(logger_,
- "Received diagnostic mode " << msg_diagnostic_mode
- << " is not supported.");
- SendResponse(false,
- mobile_apis::Result::REJECTED,
- "Received diagnostic mode is not supported.");
- return;
- }
-
- // Add app_id for HMI request
- (*message_)[strings::msg_params][strings::app_id] = app->app_id();
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
- &(*message_)[strings::msg_params],
- true);
-}
-
-void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
deleted file mode 100644
index 8c59a97a8b..0000000000
--- a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/diagnostic_message_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DiagnosticMessageResponse::DiagnosticMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DiagnosticMessageResponse::~DiagnosticMessageResponse() {}
-
-void DiagnosticMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/src/commands/mobile/dial_number_request.cc
deleted file mode 100644
index d0ab42e266..0000000000
--- a/src/components/application_manager/src/commands/mobile/dial_number_request.cc
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include <string>
-#include "application_manager/commands/mobile/dial_number_request.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DialNumberRequest::~DialNumberRequest() {}
-
-bool DialNumberRequest::Init() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- default_timeout_ = 0;
-
- return true;
-}
-
-void DialNumberRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- std::string number =
- (*message_)[strings::msg_params][strings::number].asString();
- if (!CheckSyntax(number)) {
- LOG4CXX_ERROR(logger_, "Invalid incoming data");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- StripNumberParam(number);
- if (number.empty()) {
- LOG4CXX_ERROR(logger_,
- "After strip number param is empty. Invalid incoming data");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::number] =
- (*message_)[strings::msg_params][strings::number].asString();
- msg_params[strings::app_id] = application->hmi_app_id();
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
- SendHMIRequest(
- hmi_apis::FunctionID::BasicCommunication_DialNumber, &msg_params, true);
-}
-
-void DialNumberRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- const smart_objects::SmartObject& message = event.smart_object();
- mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
- switch (event.id()) {
- case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
- LOG4CXX_INFO(logger_, "Received DialNumber event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
- result_code = CommandRequestImpl::GetMobileResultCode(
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt()));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- const bool is_success = mobile_apis::Result::SUCCESS == result_code;
- const bool is_info_valid =
- message[strings::msg_params].keyExists(strings::info);
-
- if (is_info_valid) {
- const char* info_char_array =
- message[strings::msg_params][strings::info].asCharArray();
- SendResponse(is_success, result_code, info_char_array);
- return;
- }
-
- SendResponse(is_success, result_code);
-}
-
-void DialNumberRequest::StripNumberParam(std::string& number) {
- std::size_t found = 0;
- while (std::string::npos !=
- (found = number.find_first_not_of("0123456789*#,;+"))) {
- number.erase(number.begin() + found);
- }
- (*message_)[strings::msg_params][strings::number] = number;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/src/commands/mobile/dial_number_response.cc
deleted file mode 100644
index 750dcf25c4..0000000000
--- a/src/components/application_manager/src/commands/mobile/dial_number_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/dial_number_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DialNumberResponse::~DialNumberResponse() {}
-
-void DialNumberResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc
deleted file mode 100644
index fb168e4256..0000000000
--- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-EndAudioPassThruRequest::EndAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-EndAudioPassThruRequest::~EndAudioPassThruRequest() {}
-
-void EndAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true);
-}
-
-void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_EndAudioPassThru: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- if (result) {
- uint32_t app_id = connection_key();
- bool ended_successfully = application_manager_.EndAudioPassThru(app_id);
- if (ended_successfully) {
- application_manager_.StopAudioPassThru(app_id);
- }
- }
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc
deleted file mode 100644
index bb477f5083..0000000000
--- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/end_audio_pass_thru_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-EndAudioPassThruResponse::EndAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-EndAudioPassThruResponse::~EndAudioPassThruResponse() {}
-
-void EndAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/generic_response.cc b/src/components/application_manager/src/commands/mobile/generic_response.cc
deleted file mode 100644
index 20f6931bb9..0000000000
--- a/src/components/application_manager/src/commands/mobile/generic_response.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/generic_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void GenericResponse::Run() {
- /*NsSmartDeviceLink::NsSmartObjects::SmartObject response;
-
- response[strings::params][strings::correlation_id] =
- (*message_)[strings::params][strings::correlation_id];
- response[strings::params][strings::protocol_version] =
- (*message_)[strings::params][strings::protocol_version];
- response[strings::params][strings::connection_key] =
- (*message_)[strings::params][strings::connection_key];
-
- response[strings::msg_params][strings::success] = false;
- */
-
- (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message_)[strings::msg_params][strings::success] = false;
- (*message_)[strings::msg_params][strings::result_code] =
- mobile_apis::Result::INVALID_DATA;
-
- SendResponse(false);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
deleted file mode 100644
index 88fd07234a..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/get_dtcs_request.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetDTCsRequest::GetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetDTCsRequest::~GetDTCsRequest() {}
-
-void GetDTCsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::ecu_name] =
- (*message_)[strings::msg_params][strings::ecu_name];
-
- if ((*message_)[strings::msg_params].keyExists(strings::dtc_mask)) {
- msg_params[strings::dtc_mask] =
- (*message_)[strings::msg_params][strings::dtc_mask];
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetDTCs, &msg_params, true);
-}
-
-void GetDTCsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
deleted file mode 100644
index ecaf5c3d8f..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/get_dtcs_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetDTCsResponse::GetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-GetDTCsResponse::~GetDTCsResponse() {}
-
-void GetDTCsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc
deleted file mode 100644
index 71cde5158d..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "application_manager/commands/mobile/get_system_capability_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetSystemCapabilityRequest::GetSystemCapabilityRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetSystemCapabilityRequest::~GetSystemCapabilityRequest() {}
-
-void GetSystemCapabilityRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if ((*message_)[strings::msg_params].empty()) {
- LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- mobile_apis::SystemCapabilityType::eType response_type =
- static_cast<mobile_apis::SystemCapabilityType::eType>(
- (*message_)[strings::msg_params][strings::system_capability_type]
- .asInt());
- response_params[strings::system_capability][strings::system_capability_type] =
- response_type;
-
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
-
- switch (response_type) {
- case mobile_apis::SystemCapabilityType::NAVIGATION: {
- if (hmi_capabilities.navigation_capability()) {
- response_params[strings::system_capability]
- [strings::navigation_capability] =
- *hmi_capabilities.navigation_capability();
- } else {
- SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
- return;
- }
- break;
- }
- case mobile_apis::SystemCapabilityType::PHONE_CALL: {
- if (hmi_capabilities.phone_capability()) {
- response_params[strings::system_capability][strings::phone_capability] =
- *hmi_capabilities.phone_capability();
- } else {
- SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
- return;
- }
- break;
- }
- case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: {
- if (hmi_capabilities.rc_capability()) {
- response_params[strings::system_capability][strings::rc_capability] =
- *hmi_capabilities.rc_capability();
- } else {
- SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
- return;
- }
- break;
- }
- case mobile_apis::SystemCapabilityType::VIDEO_STREAMING:
- if (hmi_capabilities.video_streaming_capability()) {
- response_params[strings::system_capability]
- [strings::video_streaming_capability] =
- *hmi_capabilities.video_streaming_capability();
- } else {
- SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
- return;
- }
- break;
- default: // Return unsupported resource
- SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
- return;
- }
- SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
-}
-
-void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest on_event");
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc
deleted file mode 100644
index 91c2562cd3..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/get_system_capability_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetSystemCapabilityResponse::GetSystemCapabilityResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-GetSystemCapabilityResponse::~GetSystemCapabilityResponse() {}
-
-void GetSystemCapabilityResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc
deleted file mode 100644
index f81d0a8c2a..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/get_vehicle_data_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-#ifdef HMI_DBUS_API
-GetVehicleDataRequest::GetVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetVehicleDataRequest::~GetVehicleDataRequest() {}
-
-void GetVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- int32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- for (; vehicle_data.end() != it; ++it) {
- if (true == (*message_)[str::msg_params].keyExists(it->first) &&
- true == (*message_)[str::msg_params][it->first].asBool()) {
- SendRequestsToHmi(app->app_id());
- return;
- }
- }
-
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
-}
-
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_GetGpsData, str::gps},
- {hmi_apis::FunctionID::VehicleInfo_GetSpeed, str::speed},
- {hmi_apis::FunctionID::VehicleInfo_GetRpm, str::rpm},
- {hmi_apis::FunctionID::VehicleInfo_GetFuelLevel, str::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
- str::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
- str::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
- str::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_GetVin, str::vin},
- {hmi_apis::FunctionID::VehicleInfo_GetPrndl, str::prndl},
- {hmi_apis::FunctionID::VehicleInfo_GetTirePressure, str::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_GetOdometer, str::odometer},
- {hmi_apis::FunctionID::VehicleInfo_GetBeltStatus, str::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
- str::body_information},
- {hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus, str::device_status},
- {hmi_apis::FunctionID::VehicleInfo_GetDriverBraking, str::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_GetWiperStatus, str::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
- str::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_GetEngineTorque, str::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition, str::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
- str::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_GetECallInfo, str::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus, str::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent, str::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
- str::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_GetMyKey, str::my_key},
-};
-}
-
-void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) {
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app_id;
-
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[str::msg_params].keyExists(sr.str) &&
- true == (*message_)[str::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
-
- LOG4CXX_INFO(logger_,
- hmi_requests_.size() << " requests are going to be sent to HMI");
-
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- SendHMIRequest(it->func_id, &msg_params, true);
- }
-}
-
-void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "GetVehicleDataRequest::on_event " << event.id());
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[str::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
-
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
-
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
- LOG4CXX_INFO(logger_, "All HMI requests are complete");
- const char* info = NULL;
- std::string error_message;
- if (true == message[strings::params].keyExists(strings::error_msg)) {
- error_message = message[strings::params][strings::error_msg].asString();
- info = error_message.c_str();
- }
- SendResponse(any_arg_success, status, info, &response_params);
- }
-}
-#else
-GetVehicleDataRequest::GetVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetVehicleDataRequest::~GetVehicleDataRequest() {}
-
-void GetVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- int32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (app->AreCommandLimitsExceeded(
- static_cast<mobile_apis::FunctionID::eType>(function_id()),
- application_manager::TLimitSource::CONFIG_FILE)) {
- LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- const uint32_t min_length_msg_params = 1;
- for (; vehicle_data.end() != it; ++it) {
- if (true == (*message_)[str::msg_params].keyExists(it->first) &&
- true == (*message_)[str::msg_params][it->first].asBool()) {
- msg_params[it->first] = (*message_)[strings::msg_params][it->first];
- }
- }
- if (msg_params.length() > min_length_msg_params) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- SendHMIRequest(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData, &msg_params, true);
- return;
- } else if (HasDisallowedParams()) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- } else {
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- }
-}
-
-void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
- result = result ||
- ((hmi_apis::Common_Result::DATA_NOT_AVAILABLE == result_code) &&
- (message[strings::msg_params].length() > 1));
-
- if (true ==
- message[strings::msg_params].keyExists(hmi_response::method)) {
- message[strings::msg_params].erase(hmi_response::method);
- }
- if (true == message[strings::params].keyExists(strings::error_msg)) {
- response_info = message[strings::params][strings::error_msg].asString();
- }
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-#endif // #ifdef HMI_DBUS_API
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc
deleted file mode 100644
index 1e64746262..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/get_vehicle_data_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetVehicleDataResponse::GetVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-GetVehicleDataResponse::~GetVehicleDataResponse() {}
-
-void GetVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc
deleted file mode 100644
index da4ce38646..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/get_way_points_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetWayPointsRequest::GetWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
-
-GetWayPointsRequest::~GetWayPointsRequest() {}
-
-void GetWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params = (*message_)[strings::msg_params];
- msg_params[strings::app_id] = app->app_id();
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(hmi_apis::FunctionID::Navigation_GetWayPoints,
- msg_params.empty() ? NULL : &msg_params,
- true);
-}
-
-void GetWayPointsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- case hmi_apis::FunctionID::Navigation_GetWayPoints: {
- LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- const hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/src/commands/mobile/get_way_points_response.cc
deleted file mode 100644
index 7956b34cae..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_way_points_response.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/get_way_points_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetWayPointsResponse::GetWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-GetWayPointsResponse::~GetWayPointsResponse() {}
-
-void GetWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/list_files_request.cc b/src/components/application_manager/src/commands/mobile/list_files_request.cc
deleted file mode 100644
index 794fba631d..0000000000
--- a/src/components/application_manager/src/commands/mobile/list_files_request.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/list_files_request.h"
-
-#include "application_manager/application_impl.h"
-
-#include "application_manager/mobile_command_factory.h"
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ListFilesRequest::ListFilesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-ListFilesRequest::~ListFilesRequest() {}
-
-void ListFilesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
- (application_manager_.get_settings().list_files_in_none() <=
- application->list_files_in_none_count())) {
- // If application is in the HMI_NONE level the quantity of allowed
- // DeleteFile request is limited by the configuration profile
- LOG4CXX_ERROR(logger_,
- "Too many requests from the app with HMILevel HMI_NONE ");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- application->increment_list_files_in_none_count();
-
- (*message_)[strings::msg_params][strings::space_available] =
- static_cast<int32_t>(application->GetAvailableDiskSpace());
- // Enumarating through File system
- uint32_t i = 0;
- std::string directory_name =
- application_manager_.get_settings().app_storage_folder();
- directory_name += "/" + application->folder_name();
- std::vector<std::string> persistent_files =
- file_system::ListFiles(directory_name);
- std::vector<std::string>::const_iterator it = persistent_files.begin();
- for (; it != persistent_files.end(); ++it) {
- if (i < application_manager_.get_settings().list_files_response_size()) {
- LOG4CXX_DEBUG(logger_, "File " + *it + " added to ListFiles response");
- (*message_)[strings::msg_params][strings::filenames][i++] = *it;
- } else {
- LOG4CXX_DEBUG(logger_,
- "File " + *it + " not added to ListFiles response");
- }
- }
- (*message_)[strings::params][strings::message_type] =
- application_manager::MessageType::kResponse;
- SendResponse(true,
- mobile_apis::Result::SUCCESS,
- NULL,
- &(*message_)[strings::msg_params]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/list_files_response.cc b/src/components/application_manager/src/commands/mobile/list_files_response.cc
deleted file mode 100644
index fde15a94ef..0000000000
--- a/src/components/application_manager/src/commands/mobile/list_files_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/list_files_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ListFilesResponse::ListFilesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ListFilesResponse::~ListFilesResponse() {}
-
-void ListFilesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc
deleted file mode 100644
index 6064374dab..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_app_interface_unregistered_notification.h"
-#include "application_manager/message.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-OnAppInterfaceUnregisteredNotification::OnAppInterfaceUnregisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnAppInterfaceUnregisteredNotification::
- ~OnAppInterfaceUnregisteredNotification() {}
-
-void OnAppInterfaceUnregisteredNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc
deleted file mode 100644
index d0fa3597bc..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_audio_pass_thru_notification.h"
-
-namespace application_manager {
-namespace commands {
-
-OnAudioPassThruNotification::OnAudioPassThruNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnAudioPassThruNotification::~OnAudioPassThruNotification() {}
-
-void OnAudioPassThruNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc
deleted file mode 100644
index 7c631d6d4b..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_button_event_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnButtonEventNotification::OnButtonEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnButtonEventNotification::~OnButtonEventNotification() {}
-
-void OnButtonEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const uint32_t btn_id = static_cast<uint32_t>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- const bool is_app_id_exists =
- (*message_)[strings::msg_params].keyExists(strings::app_id);
- ApplicationSharedPtr app;
-
- // CUSTOM_BUTTON notification
- if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
- // app_id is mandatory for CUSTOM_BUTTON notification
- if (!is_app_id_exists) {
- LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonEvent without app_id.");
- return;
- }
-
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
-
- // custom_button_id is mandatory for CUSTOM_BUTTON notification
- if (false ==
- (*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- LOG4CXX_ERROR(logger_,
- "CUSTOM_BUTTON OnButtonEvent without custom_button_id.");
- return;
- }
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application doesn't exist.");
- return;
- }
-
- uint32_t custom_btn_id = 0;
- custom_btn_id =
- (*message_)[strings::msg_params][hmi_response::custom_button_id]
- .asUInt();
-
- if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Application doesn't subscribed to this custom_button_id.");
- return;
- }
-
- if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "CUSTOM_BUTTON OnButtonEvent notification is allowed only "
- << "in FULL or LIMITED hmi level");
- return;
- }
-
- SendButtonEvent(app);
- return;
- }
-
- const std::vector<ApplicationSharedPtr>& subscribed_apps =
- application_manager_.applications_by_button(btn_id);
-
- std::vector<ApplicationSharedPtr>::const_iterator it =
- subscribed_apps.begin();
- for (; subscribed_apps.end() != it; ++it) {
- ApplicationSharedPtr subscribed_app = *it;
- if (!subscribed_app) {
- LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
- continue;
- }
-
- // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "OnButtonEvent notification is allowed only"
- << "in FULL or LIMITED hmi level");
- continue;
- }
- // if "app_id" absent send notification only in HMI_FULL mode
- if (is_app_id_exists || subscribed_app->IsFullscreen()) {
- SendButtonEvent(subscribed_app);
- }
- }
-}
-
-void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
- return;
- }
-
- smart_objects::SmartObjectSPtr on_btn_event =
- new smart_objects::SmartObject();
-
- if (!on_btn_event) {
- LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
- return;
- }
-
- (*on_btn_event)[strings::params][strings::connection_key] = app->app_id();
-
- (*on_btn_event)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID);
-
- (*on_btn_event)[strings::msg_params][strings::button_name] =
- (*message_)[strings::msg_params][hmi_response::button_name];
- (*on_btn_event)[strings::msg_params][strings::button_event_mode] =
- (*message_)[strings::msg_params][hmi_response::button_mode];
-
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- (*on_btn_event)[strings::msg_params][strings::custom_button_id] =
- (*message_)[strings::msg_params][strings::custom_button_id];
- }
-
- message_ = on_btn_event;
- SendNotification();
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc
deleted file mode 100644
index ae6658b93a..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_button_press_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnButtonPressNotification::OnButtonPressNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnButtonPressNotification::~OnButtonPressNotification() {}
-
-void OnButtonPressNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const uint32_t btn_id = static_cast<uint32_t>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- const bool is_app_id_exists =
- (*message_)[strings::msg_params].keyExists(strings::app_id);
- ApplicationSharedPtr app;
-
- // CUSTOM_BUTTON notification
- if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
- // app_id is mandatory for CUSTOM_BUTTON notification
- if (!is_app_id_exists) {
- LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonPress without app_id.");
- return;
- }
-
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
-
- // custom_button_id is mandatory for CUSTOM_BUTTON notification
- if (false ==
- (*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- LOG4CXX_ERROR(logger_,
- "CUSTOM_BUTTON OnButtonPress without custom_button_id.");
- return;
- }
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application doesn't exist.");
- return;
- }
-
- uint32_t custom_btn_id = 0;
- custom_btn_id =
- (*message_)[strings::msg_params][hmi_response::custom_button_id]
- .asUInt();
-
- if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Application doesn't subscribed to this custom_button_id.");
- return;
- }
-
- // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "CUSTOM_BUTTON OnButtonPress notification is allowed only "
- << "in FULL or LIMITED hmi level");
- return;
- }
-
- SendButtonPress(app);
- return;
- }
-
- const std::vector<ApplicationSharedPtr>& subscribed_apps =
- application_manager_.applications_by_button(btn_id);
-
- std::vector<ApplicationSharedPtr>::const_iterator it =
- subscribed_apps.begin();
- for (; subscribed_apps.end() != it; ++it) {
- ApplicationSharedPtr subscribed_app = *it;
- if (!subscribed_app) {
- LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
- continue;
- }
-
- // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "OnButtonPress notification is allowed only"
- << "in FULL or LIMITED hmi level");
- continue;
- }
- // if "appID" is present, send it to named app only if its FULL or
- // LIMITED
- if (app.valid()) {
- if (app->app_id() == subscribed_app->app_id()) {
- SendButtonPress(subscribed_app);
- }
- } else if (subscribed_app->IsFullscreen()) {
- // if No "appID" - send it FULL apps only.
- SendButtonPress(subscribed_app);
- }
- }
-}
-
-void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
- return;
- }
-
- smart_objects::SmartObjectSPtr on_btn_press =
- new smart_objects::SmartObject();
-
- if (!on_btn_press) {
- LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
- return;
- }
-
- (*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
-
- (*on_btn_press)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonPressID);
-
- (*on_btn_press)[strings::msg_params][strings::button_name] =
- (*message_)[strings::msg_params][hmi_response::button_name];
- (*on_btn_press)[strings::msg_params][strings::button_press_mode] =
- (*message_)[strings::msg_params][hmi_response::button_mode];
-
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- (*on_btn_press)[strings::msg_params][strings::custom_button_id] =
- (*message_)[strings::msg_params][strings::custom_button_id];
- }
-
- message_ = on_btn_press;
- SendNotification();
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/src/commands/mobile/on_command_notification.cc
deleted file mode 100644
index ae8aeff771..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_command_notification.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_command_notification.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnCommandNotification::OnCommandNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnCommandNotification::~OnCommandNotification() {}
-
-void OnCommandNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- return;
- }
-
- const uint32_t cmd_id =
- (*message_)[strings::msg_params][strings::cmd_id].asUInt();
-
- if (!app->FindCommand(cmd_id)) {
- LOG4CXX_ERROR(logger_, " No applications found for the command " << cmd_id);
- return;
- }
-
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- // remove app_id from notification
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- (*message_)[strings::msg_params].erase(strings::app_id);
- }
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc
deleted file mode 100644
index 44ed2cf3b7..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_driver_distraction_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnDriverDistractionNotification::OnDriverDistractionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
-
-void OnDriverDistractionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc
deleted file mode 100644
index 19b93f2cbf..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_hash_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include <string>
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnHashChangeNotification::OnHashChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnHashChangeNotification::~OnHashChangeNotification() {}
-
-void OnHashChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
-
- int32_t app_id;
- app_id = (*message_)[strings::params][strings::connection_key].asInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (app) {
- (*message_)[strings::msg_params][strings::hash_id] = app->curHash();
- SendNotification();
- } else {
- LOG4CXX_WARN(logger_,
- "Application with app_id " << app_id << " does not exist");
- }
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc
deleted file mode 100644
index 5225002652..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_hmi_status_notification.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/message.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-OnHMIStatusNotification::OnHMIStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnHMIStatusNotification::~OnHMIStatusNotification() {}
-
-void OnHMIStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist");
- return;
- }
-
- mobile_apis::HMILevel::eType hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- (*message_)[strings::msg_params][strings::hmi_level].asInt());
- if ((mobile_apis::HMILevel::HMI_BACKGROUND == hmi_level) ||
- (mobile_apis::HMILevel::HMI_NONE == hmi_level)) {
- if (!(app->tts_properties_in_none())) {
- app->set_tts_properties_in_none(true);
- LOG4CXX_INFO(logger_,
- "OnHMIStatusNotification::Send TTS GlobalProperties"
- " with empty array to HMI");
- MessageHelper::SendTTSGlobalProperties(app, false, application_manager_);
- }
- } else if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) ||
- (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) {
- if (!(app->tts_properties_in_full())) {
- app->set_tts_properties_in_full(true);
- LOG4CXX_INFO(logger_,
- "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList");
- application_manager_.AddAppToTTSGlobalPropertiesList(app->app_id());
- }
- }
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
deleted file mode 100644
index 4bb6cfe9d5..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/message.h"
-
-namespace application_manager {
-namespace commands {
-
-OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationFromMobileImpl(message, application_manager) {}
-
-OnHMIStatusNotificationFromMobile::~OnHMIStatusNotificationFromMobile() {}
-
-void OnHMIStatusNotificationFromMobile::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app.valid()) {
- LOG4CXX_ERROR(
- logger_, "OnHMIStatusNotificationFromMobile application doesn't exist");
- return;
- }
-
- mobile_apis::HMILevel::eType current_hmi_state =
- static_cast<mobile_apis::HMILevel::eType>(
- (*message_)[strings::msg_params][strings::hmi_level].asUInt());
-
- bool is_current_state_foreground =
- mobile_apis::HMILevel::HMI_FULL == current_hmi_state;
-
- app->set_foreground(is_current_state_foreground);
-
- connection_handler::DeviceHandle handle = app->device();
- bool is_apps_requested_before =
- application_manager_.IsAppsQueriedFrom(handle);
-
- LOG4CXX_DEBUG(logger_,
- "Mobile HMI state notication came for connection key:"
- << connection_key() << " and handle: " << handle);
-
- if (!is_apps_requested_before &&
- Message::is_sufficient_version(
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
- app->protocol_version()) &&
- app->is_foreground()) {
- // In case this notification will be received from mobile side with
- // foreground level for app on mobile, this should trigger remote
- // apps list query for SDL 4.0+ app
- MessageHelper::SendQueryApps(connection_key(), application_manager_);
- return;
- }
-
- if (is_apps_requested_before) {
- LOG4CXX_DEBUG(logger_,
- "Remote apps list had been requested already "
- " for handle: "
- << handle);
-
- if (Message::is_sufficient_version(
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
- app->protocol_version())) {
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
-
- bool is_another_foreground_sdl4_app = false;
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it; ++it) {
- if (connection_key() != (*it)->app_id() &&
- Message::is_sufficient_version(
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
- (*it)->protocol_version()) &&
- (*it)->is_foreground()) {
- is_another_foreground_sdl4_app = true;
- break;
- }
- }
-
- if (!is_another_foreground_sdl4_app) {
- application_manager_.MarkAppsGreyOut(handle,
- !is_current_state_foreground);
- application_manager_.SendUpdateAppList();
- }
- }
- return;
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc
deleted file mode 100644
index 427f52c12b..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnKeyBoardInputNotification::OnKeyBoardInputNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnKeyBoardInputNotification::~OnKeyBoardInputNotification() {}
-
-void OnKeyBoardInputNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app_to_notify;
-
- DataAccessor<ApplicationSet> accessor = application_manager_.applications();
- ApplicationSetIt it = accessor.GetData().begin();
- for (; accessor.GetData().end() != it; ++it) {
- // if there is app with active perform interaction use it for notification
- ApplicationSharedPtr app = *it;
- if (app->is_perform_interaction_active() &&
- (*it)->perform_interaction_layout() ==
- mobile_apis::LayoutMode::KEYBOARD) {
- LOG4CXX_INFO(logger_,
- "There is application with active PerformInteraction");
- app_to_notify = app;
- break;
- }
-
- if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level()) {
- LOG4CXX_INFO(logger_, "There is application in HMI_FULL level");
- app_to_notify = app;
- }
- }
-
- if (app_to_notify.valid()) {
- (*message_)[strings::params][strings::connection_key] =
- app_to_notify->app_id();
- SendNotification();
- }
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc
deleted file mode 100644
index 76420b85b6..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_language_change_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnLanguageChangeNotification::OnLanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnLanguageChangeNotification::~OnLanguageChangeNotification() {}
-
-void OnLanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
deleted file mode 100644
index 09c407b8b5..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_permissions_change_notification.h"
-#include "application_manager/message.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnPermissionsChangeNotification::OnPermissionsChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {}
-
-void OnPermissionsChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
deleted file mode 100644
index c29ff3e2d3..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cstring>
-#include <cstdio>
-#include <string>
-#include "application_manager/commands/mobile/on_system_request_notification.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/file_system.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnSystemRequestNotification::OnSystemRequestNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnSystemRequestNotification::~OnSystemRequestNotification() {}
-
-void OnSystemRequestNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace application_manager;
- using namespace mobile_apis;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_,
- "Application with connection key " << connection_key()
- << " is not registered.");
- return;
- }
-
- RequestType::eType request_type = static_cast<RequestType::eType>(
- (*message_)[strings::msg_params][strings::request_type].asInt());
- const policy::PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- if (!policy_handler.IsRequestTypeAllowed(app->policy_app_id(),
- request_type)) {
- LOG4CXX_WARN(logger_,
- "Request type " << request_type
- << " is not allowed by policies");
- return;
- }
-
- if (RequestType::PROPRIETARY == request_type) {
- /* According to requirements:
- "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
- If the requestType = HTTP, add to mobile API fileType = BINARY"
- Also in Genivi SDL we don't save the PT to file - we put it directly in
- binary_data */
-
- const std::string filename =
- (*message_)[strings::msg_params][strings::file_name].asString();
- BinaryMessage binary_data;
- file_system::ReadBinaryFile(filename, binary_data);
-#if defined(PROPRIETARY_MODE)
- AddHeader(binary_data);
-#endif // PROPRIETARY_MODE
-
-#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
- (*message_)[strings::params][strings::binary_data] = binary_data;
-#endif // PROPRIETARY_MODE
-
- (*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
- } else if (RequestType::HTTP == request_type) {
- (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
- if ((*message_)[strings::msg_params].keyExists(strings::url)) {
- (*message_)[strings::msg_params][strings::timeout] =
- policy_handler.TimeoutExchangeSec();
- }
- }
-
- SendNotification();
-}
-
-#ifdef PROPRIETARY_MODE
-void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
- LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t timeout =
- application_manager_.GetPolicyHandler().TimeoutExchangeSec();
-
- size_t content_length;
- char size_str[24];
-
- if (0 > sprintf(size_str, "%zu", static_cast<size_t>(message.size()))) {
- memset(size_str, 0, sizeof(size_str));
- }
-
- char timeout_str[24];
- if (0 > sprintf(timeout_str, "%d", timeout)) {
- memset(timeout_str, 0, sizeof(timeout_str));
- }
-
- std::string policy_table_string = std::string(message.begin(), message.end());
-
- /* The Content-Length to be sent in the HTTP Request header should be
- calculated before additional escape characters are added to the
- policy table string. The mobile proxy will remove the escape
- characters after receiving this request. */
-
- content_length = ParsePTString(policy_table_string);
-
- if (0 > sprintf(size_str, "%zu", content_length)) {
- memset(size_str, 0, sizeof(size_str));
- }
-
- const std::string header =
-
- "{"
- " \"HTTPRequest\": {"
- "\"headers\": {"
- "\"ContentType\": \"application/json\","
- "\"ConnectTimeout\": " +
- std::string(timeout_str) +
- ","
- "\"DoOutput\": true,"
- "\"DoInput\": true,"
- "\"UseCaches\": false,"
- "\"RequestMethod\": \"POST\","
- "\"ReadTimeout\":" +
- std::string(timeout_str) +
- ","
- "\"InstanceFollowRedirects\": false,"
- "\"charset\": \"utf-8\","
- "\"Content-Length\": " +
- std::string(size_str) +
- "},"
- "\"body\": \"" +
- policy_table_string +
- "\""
- "}"
- "}";
-
- message.clear();
- message.assign(header.begin(), header.end());
-
- LOG4CXX_DEBUG(
- logger_, "Header added: " << std::string(message.begin(), message.end()));
-}
-
-size_t OnSystemRequestNotification::ParsePTString(
- std::string& pt_string) const {
- std::string result;
- size_t length = pt_string.length();
- size_t result_length = length;
- result.reserve(length * 2);
- for (size_t i = 0; i < length; ++i) {
- if (pt_string[i] == '\"' || pt_string[i] == '\\') {
- result += '\\';
- } else if (pt_string[i] == '\n') {
- result_length--; // contentLength is adjusted when this character is not
- // copied to result.
- continue;
- }
- result += pt_string[i];
- }
- pt_string = result;
- return result_length;
-}
-#endif // PROPRIETARY_MODE
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc
deleted file mode 100644
index 894469ac34..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTBTClientStateNotification::OnTBTClientStateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnTBTClientStateNotification::~OnTBTClientStateNotification() {}
-
-void OnTBTClientStateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
-
- const std::vector<ApplicationSharedPtr>& applications =
- application_manager_.applications_with_navi();
-
- std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
- for (; applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
- if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotification();
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
deleted file mode 100644
index 2a9969eac4..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_touch_event_notification.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnTouchEventNotification::OnTouchEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnTouchEventNotification::~OnTouchEventNotification() {}
-
-void OnTouchEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const std::vector<ApplicationSharedPtr>& applications_with_navi =
- application_manager_.applications_with_navi();
-
- const std::vector<ApplicationSharedPtr>& projection_applications =
- application_manager_.applications_with_mobile_projection();
-
- std::vector<ApplicationSharedPtr>::const_iterator nav_it =
- applications_with_navi.begin();
-
- for (; applications_with_navi.end() != nav_it; ++nav_it) {
- ApplicationSharedPtr app = *nav_it;
- if (app->IsFullscreen()) {
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotification();
- }
- }
-
- std::vector<ApplicationSharedPtr>::const_iterator projection_it =
- projection_applications.begin();
-
- for (; projection_applications.end() != projection_it; ++projection_it) {
- ApplicationSharedPtr projection_app = *projection_it;
- if (projection_app->IsFullscreen()) {
- (*message_)[strings::params][strings::connection_key] =
- projection_app->app_id();
- SendNotification();
- }
- }
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc
deleted file mode 100644
index 37abbab351..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVehicleDataNotification::OnVehicleDataNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnVehicleDataNotification::~OnVehicleDataNotification() {}
-
-void OnVehicleDataNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- std::vector<ApplicationSharedPtr> appNotification;
- std::vector<ApplicationSharedPtr>::iterator appNotification_it =
- appNotification.begin();
- std::vector<smart_objects::SmartObject> appSO;
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- for (; vehicle_data.end() != it; ++it) {
- if (true == (*message_)[strings::msg_params].keyExists(it->first)) {
- const std::vector<ApplicationSharedPtr>& applications =
- application_manager_.IviInfoUpdated(
- it->second, (*message_)[strings::msg_params][it->first].asInt());
-
- 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;
- }
-
- appNotification_it =
- find(appNotification.begin(), appNotification.end(), app);
- if (appNotification_it == appNotification.end()) {
- appNotification.push_back(app);
- smart_objects::SmartObject msg_param =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_param[it->first] = (*message_)[strings::msg_params][it->first];
- appSO.push_back(msg_param);
- } else {
- size_t idx =
- std::distance(appNotification.begin(), appNotification_it);
- appSO[idx][it->first] = (*message_)[strings::msg_params][it->first];
- }
- }
- }
- }
-
- LOG4CXX_DEBUG(
- logger_,
- "Number of Notifications to be send: " << appNotification.size());
-
- for (size_t idx = 0; idx < appNotification.size(); idx++) {
- LOG4CXX_INFO(logger_,
- "Send OnVehicleData PRNDL notification to "
- << appNotification[idx]->name().c_str()
- << " application id " << appNotification[idx]->app_id());
- (*message_)[strings::params][strings::connection_key] =
- appNotification[idx]->app_id();
- (*message_)[strings::msg_params] = appSO[idx];
- SendNotification();
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc
deleted file mode 100644
index 0b24228810..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_way_point_change_notification.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-OnWayPointChangeNotification::OnWayPointChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnWayPointChangeNotification::~OnWayPointChangeNotification() {}
-
-void OnWayPointChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- std::set<int32_t> subscribed_for_way_points =
- application_manager_.GetAppsSubscribedForWayPoints();
-
- for (std::set<int32_t>::const_iterator app_id =
- subscribed_for_way_points.begin();
- app_id != subscribed_for_way_points.end();
- ++app_id) {
- (*message_)[strings::params][strings::connection_key] = *app_id;
- SendNotification();
- }
-}
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
deleted file mode 100644
index 20076ac50c..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cstring>
-#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-PerformAudioPassThruRequest::PerformAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , result_tts_speak_(hmi_apis::Common_Result::INVALID_ENUM)
- , result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
-
-PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {}
-
-void PerformAudioPassThruRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- FinishTTSSpeak();
- CommandRequestImpl::onTimeOut();
-}
-
-bool PerformAudioPassThruRequest::Init() {
- default_timeout_ +=
- (((*message_)[str::msg_params][str::max_duration].asUInt()));
- return true;
-}
-
-void PerformAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
- LOG4CXX_ERROR(logger_, "application isn't activated");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming perform audio pass thru has contains "
- "\\t\\n \\\\t \\\\n"
- " text contains only whitespace in initialPrompt");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- // According with new implementation processing of UNSUPPORTE_RESOURCE
- // need set flag before sending to hmi
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
- (0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
- // In case TTS Speak, subscribe on notification
- SendSpeakRequest();
- SendPerformAudioPassThruRequest();
- } else {
- SendPerformAudioPassThruRequest();
- SendRecordStartNotification();
- StartMicrophoneRecording();
- }
-}
-
-void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
- LOG4CXX_TRACE(logger_, "Received UI_PerformAudioPassThru");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
-
- result_ui_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, ui_info_);
-
- // in case perform audio is started by other request skip stopping
- if (hmi_apis::Common_Result::REJECTED == result_ui_) {
- LOG4CXX_ERROR(logger_, "Request was rejected");
- SendResponse(false,
- MessageHelper::HMIToMobileResult(result_ui_),
- NULL,
- &(message[strings::msg_params]));
- return;
- }
- FinishTTSSpeak();
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- result_tts_speak_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, tts_info_);
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- const bool is_tts_speak_success_unsuported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- result_tts_speak_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- if (is_tts_speak_success_unsuported) {
- SendRecordStartNotification();
- StartMicrophoneRecording();
-
- // update request timeout to get time for perform audio recording
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
-
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
- if (IsWaitingHMIResponse()) {
- return;
- }
-
- const ResponseParams response_params = PrepareResponseParameters();
-
- SendResponse(
- response_params.success,
- response_params.result_code,
- response_params.info.empty() ? NULL : response_params.info.c_str(),
- &(message[strings::msg_params]));
-}
-
-const PerformAudioPassThruRequest::ResponseParams&
-PerformAudioPassThruRequest::PrepareResponseParameters() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ResponseInfo ui_perform_info(
- result_ui_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
- ResponseInfo tts_perform_info(result_tts_speak_,
- HmiInterfaces::HMI_INTERFACE_TTS,
- application_manager_);
-
- // Note(dtrunov): According to requirment "WARNINGS, success:true on getting
- // UNSUPPORTED_RESOURCE for "ttsChunks"
- if (ui_perform_info.is_ok && tts_perform_info.is_unsupported_resource &&
- HmiInterfaces::STATE_AVAILABLE == tts_perform_info.interface_state) {
- response_params_.result_code = mobile_apis::Result::WARNINGS;
- tts_info_ = "Unsupported phoneme type sent in a prompt";
- response_params_.info =
- MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
- response_params_.success = true;
- return response_params_;
- }
-
- response_params_.success =
- PrepareResultForMobileResponse(ui_perform_info, tts_perform_info);
- if (IsResultCodeUnsupported(ui_perform_info, tts_perform_info)) {
- response_params_.result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- } else {
- AudioPassThruResults results = PrepareAudioPassThruResultCodeForResponse(
- ui_perform_info, tts_perform_info);
- response_params_.success = results.second;
- response_params_.result_code = results.first;
- }
- response_params_.info =
- MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
-
- return response_params_;
-}
-
-bool PerformAudioPassThruRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
- LOG4CXX_AUTO_TRACE(logger_);
- NOTREACHED();
- return false;
-}
-
-void PerformAudioPassThruRequest::SendSpeakRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- using namespace hmi_apis;
- using namespace smart_objects;
-
- SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
- for (uint32_t i = 0;
- i < (*message_)[str::msg_params][str::initial_prompt].length();
- ++i) {
- msg_params[hmi_request::tts_chunks][i][str::text] =
- (*message_)[str::msg_params][str::initial_prompt][i][str::text];
- msg_params[hmi_request::tts_chunks][i][str::type] =
- (*message_)[str::msg_params][str::initial_prompt][i][str::type];
- }
- // app_id
- msg_params[strings::app_id] = connection_key();
- msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
-}
-
-void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[str::app_id] = connection_key();
-
- msg_params[hmi_request::max_duration] =
- (*message_)[str::msg_params][str::max_duration];
-
- msg_params[hmi_request::audio_pass_display_texts] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text1)) {
- msg_params[hmi_request::audio_pass_display_texts][0]
- [hmi_request::field_name] = static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText1);
- msg_params[hmi_request::audio_pass_display_texts][0]
- [hmi_request::field_text] =
- (*message_)[str::msg_params][str::audio_pass_display_text1];
- }
-
- if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text2)) {
- msg_params[hmi_request::audio_pass_display_texts][1]
- [hmi_request::field_name] = static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText2);
- msg_params[hmi_request::audio_pass_display_texts][1]
- [hmi_request::field_text] =
- (*message_)[str::msg_params][str::audio_pass_display_text2];
- }
-
- if ((*message_)[str::msg_params].keyExists(str::mute_audio)) {
- msg_params[str::mute_audio] =
- (*message_)[str::msg_params][str::mute_audio].asBool();
- } else {
- // If omitted, the value is set to true
- msg_params[str::mute_audio] = true;
- }
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(
- hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true);
-}
-
-void PerformAudioPassThruRequest::SendRecordStartNotification() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = connection_key();
-
- CreateHMINotification(hmi_apis::FunctionID::UI_OnRecordStart, msg_params);
-}
-
-void PerformAudioPassThruRequest::StartMicrophoneRecording() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t app_id = connection_key();
- application_manager_.BeginAudioPassThru(app_id);
-
- application_manager_.StartAudioPassThruThread(
- connection_key(),
- correlation_id(),
- (*message_)[str::msg_params][str::max_duration].asInt(),
- (*message_)[str::msg_params][str::sampling_rate].asInt(),
- (*message_)[str::msg_params][str::bits_per_sample].asInt(),
- (*message_)[str::msg_params][str::audio_type].asInt());
-}
-
-bool PerformAudioPassThruRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
- const smart_objects::SmartArray* ip_array =
- (*message_)[strings::msg_params][strings::initial_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
- smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
-
- for (; it_ip != it_ip_end; ++it_ip) {
- str = (*it_ip)[strings::text].asCharArray();
- if (std::strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::audio_pass_display_text1)) {
- str = (*message_)[strings::msg_params][strings::audio_pass_display_text1]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_,
- "Invalid audio_pass_display_text1 value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::audio_pass_display_text2)) {
- str = (*message_)[strings::msg_params][strings::audio_pass_display_text2]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_,
- "Invalid audio_pass_display_text2 value syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-void PerformAudioPassThruRequest::FinishTTSSpeak() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t app_id = connection_key();
- if (application_manager_.EndAudioPassThru(app_id)) {
- LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
- application_manager_.StopAudioPassThru(app_id);
- }
- if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) {
- LOG4CXX_WARN(logger_, "TTS Speak is inactive.");
- return;
- }
- SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL);
-}
-
-PerformAudioPassThruRequest::AudioPassThruResults
-PerformAudioPassThruRequest::PrepareAudioPassThruResultCodeForResponse(
- const ResponseInfo& ui_response, const ResponseInfo& tts_response) {
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
-
- hmi_apis::Common_Result::eType common_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- const hmi_apis::Common_Result::eType ui_result = ui_response.result_code;
- const hmi_apis::Common_Result::eType tts_result = tts_response.result_code;
- bool result = false;
-
- if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
- (tts_result == hmi_apis::Common_Result::SUCCESS)) {
- result = true;
- }
-
- if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
- (tts_result == hmi_apis::Common_Result::INVALID_ENUM)) {
- result = true;
- }
-
- if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
- (tts_result != hmi_apis::Common_Result::SUCCESS) &&
- (tts_result != hmi_apis::Common_Result::INVALID_ENUM)) {
- common_result = hmi_apis::Common_Result::WARNINGS;
- result = true;
- } else if (ui_response.is_ok &&
- tts_result == hmi_apis::Common_Result::WARNINGS) {
- common_result = hmi_apis::Common_Result::WARNINGS;
- result = true;
- } else if (ui_result == hmi_apis::Common_Result::INVALID_ENUM) {
- common_result = tts_result;
- } else {
- common_result = ui_result;
- }
- result_code = MessageHelper::HMIToMobileResult(common_result);
- return std::make_pair(result_code, result);
-}
-
-bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
- LOG4CXX_AUTO_TRACE(logger_);
- return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
- IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc
deleted file mode 100644
index e8a638c076..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/perform_audio_pass_thru_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PerformAudioPassThruResponse::PerformAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {}
-
-void PerformAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
deleted file mode 100644
index 68940158b9..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
+++ /dev/null
@@ -1,953 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include <string>
-#include "application_manager/commands/mobile/perform_interaction_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-#include "utils/custom_string.h"
-#include "utils/gen_hash.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-uint32_t PerformInteractionRequest::pi_requests_count_ = 0;
-
-PerformInteractionRequest::PerformInteractionRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM)
- , ui_response_received_(false)
- , vr_response_received_(false)
- , app_pi_was_active_before_(false)
- , vr_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
- , ui_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
- subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
- subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress);
-}
-
-PerformInteractionRequest::~PerformInteractionRequest() {}
-
-bool PerformInteractionRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
- default_timeout_ =
- (*message_)[strings::msg_params][strings::timeout].asUInt();
- }
-
- interaction_mode_ = static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt());
-
- if (mobile_apis::InteractionMode::BOTH == interaction_mode_ ||
- mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) {
- default_timeout_ *= 2;
- }
- return true;
-}
-
-void PerformInteractionRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (app->is_perform_interaction_active()) {
- LOG4CXX_DEBUG(logger_, "Application has active PerformInteraction");
- app_pi_was_active_before_ = true;
- }
-
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
- mobile_apis::LayoutMode::eType interaction_layout =
- mobile_apis::LayoutMode::INVALID_ENUM;
-
- if (msg_params.keyExists(hmi_request::interaction_layout)) {
- interaction_layout = static_cast<mobile_apis::LayoutMode::eType>(
- msg_params[hmi_request::interaction_layout].asInt());
- }
-
- if ((mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) &&
- (mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) {
- LOG4CXX_ERROR(logger_,
- "PerformInteraction contains InteractionMode"
- "=VR_ONLY and interactionLayout=KEYBOARD");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- const size_t choice_set_id_list_length =
- msg_params[strings::interaction_choice_set_id_list].length();
-
- if (0 == choice_set_id_list_length) {
- if (mobile_apis::LayoutMode::KEYBOARD == interaction_layout) {
- if (mobile_apis::InteractionMode::BOTH == interaction_mode_) {
- LOG4CXX_ERROR(logger_,
- "interactionChoiceSetIDList is empty,"
- " InteractionMode=BOTH and"
- " interactionLayout=KEYBOARD");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- } else {
- LOG4CXX_ERROR(logger_,
- "interactionChoiceSetIDList is empty"
- " and interactionLayout!=KEYBOARD");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
-
- if (!CheckChoiceIDFromRequest(
- app,
- choice_set_id_list_length,
- msg_params[strings::interaction_choice_set_id_list])) {
- LOG4CXX_ERROR(logger_,
- "PerformInteraction has choice sets with "
- "duplicated IDs or application does not have choice sets");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- if (msg_params.keyExists(strings::vr_help)) {
- if (mobile_apis::Result::SUCCESS !=
- MessageHelper::VerifyImageVrHelpItems(
- msg_params[strings::vr_help], app, application_manager_)) {
- LOG4CXX_ERROR(logger_,
- "Verification of " << strings::vr_help << " failed.");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming perform interaction has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- switch (interaction_mode_) {
- case mobile_apis::InteractionMode::BOTH: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
- if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
- !CheckVrHelpItemPositions(app)) {
- return;
- }
- break;
- }
- case mobile_apis::InteractionMode::MANUAL_ONLY: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: MANUAL_ONLY");
- if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
- !CheckVrHelpItemPositions(app)) {
- return;
- }
- break;
- }
- case mobile_apis::InteractionMode::VR_ONLY: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
- if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app)) {
- return;
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Unknown interaction mode");
- return;
- }
- }
-
- app->set_perform_interaction_mode(static_cast<int32_t>(interaction_mode_));
- app->set_perform_interaction_active(true);
- app->set_perform_interaction_layout(interaction_layout);
- // increment amount of active requests
- ++pi_requests_count_;
- SendVRPerformInteractionRequest(app);
- SendUIPerformInteractionRequest(app);
-}
-
-void PerformInteractionRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- smart_objects::SmartObject msg_param =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- LOG4CXX_DEBUG(logger_, "Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- case hmi_apis::FunctionID::UI_PerformInteraction: {
- LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- ui_response_received_ = true;
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, ui_info_);
- ProcessUIResponse(event.smart_object(), msg_param);
- break;
- }
- case hmi_apis::FunctionID::VR_PerformInteraction: {
- LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- vr_response_received_ = true;
- unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction);
- vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, vr_info_);
- if (ProcessVRResponse(event.smart_object(), msg_param)) {
- return;
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-
- if (!HasHMIResponsesToWait()) {
- LOG4CXX_DEBUG(logger_, "Send response in BOTH iteraction mode");
- SendBothModeResponse(msg_param);
- }
-}
-
-void PerformInteractionRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- switch (interaction_mode_) {
- case mobile_apis::InteractionMode::BOTH: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
- if (true == vr_response_received_) {
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
- } else {
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- }
- break;
- }
- case mobile_apis::InteractionMode::VR_ONLY: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
- break;
- }
- case mobile_apis::InteractionMode::MANUAL_ONLY: {
- LOG4CXX_DEBUG(logger_, "InteractionMode: MANUAL_ONLY");
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "INVALID ENUM");
- return;
- }
- };
-}
-
-bool PerformInteractionRequest::ProcessVRResponse(
- const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- using namespace mobile_apis;
- using namespace smart_objects;
- using namespace helpers;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- msg_params[strings::trigger_source] =
- static_cast<int32_t>(TriggerSource::TS_VR);
-
- const bool is_vr_aborted_timeout = Compare<Common_Result::eType, EQ, ONE>(
- vr_result_code_, Common_Result::ABORTED, Common_Result::TIMED_OUT);
-
- if (is_vr_aborted_timeout) {
- LOG4CXX_DEBUG(logger_, "VR response aborted");
- if (InteractionMode::VR_ONLY == interaction_mode_) {
- LOG4CXX_DEBUG(logger_, "Aborted or Timeout Send Close Popup");
- TerminatePerformInteraction();
- SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_));
- return true;
- }
- LOG4CXX_DEBUG(logger_, "Update timeout for UI");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- return false;
- }
-
- if (Common_Result::SUCCESS == vr_result_code_ &&
- InteractionMode::MANUAL_ONLY == interaction_mode_) {
- LOG4CXX_DEBUG(logger_,
- "VR response SUCCESS in MANUAL_ONLY mode "
- << "Wait for UI response");
- // in case MANUAL_ONLY mode VR.PI SUCCESS just return
- return false;
- }
-
- const SmartObject& hmi_msg_params = message[strings::msg_params];
- if (hmi_msg_params.keyExists(strings::choice_id)) {
- const int choise_id = hmi_msg_params[strings::choice_id].asInt();
- if (!CheckChoiceIDFromResponse(app, choise_id)) {
- LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
- TerminatePerformInteraction();
- SendResponse(
- false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI");
- return true;
- }
- msg_params[strings::choice_id] = choise_id;
- }
- return false;
-}
-
-void PerformInteractionRequest::ProcessUIResponse(
- const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- using namespace smart_objects;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- HmiInterfaces::InterfaceState ui_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_UI);
- bool result = false;
- result = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_code_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS);
-
- result = result ||
- (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_code_ &&
- HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state);
-
- const bool is_pi_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_code_, hmi_apis::Common_Result::WARNINGS);
-
- const bool is_pi_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_code_, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- if (result) {
- if (is_pi_warning) {
- ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
- ui_info_ = message[strings::msg_params][strings::info].asString();
- if (message.keyExists(strings::params) &&
- message[strings::params].keyExists(strings::data)) {
- msg_params = message[strings::params][strings::data];
- }
- } else if (is_pi_unsupported) {
- ui_result_code_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- ui_info_ = message[strings::msg_params][strings::info].asString();
- } else if (message.keyExists(strings::msg_params)) {
- msg_params = message[strings::msg_params];
- }
- // result code must be GENERIC_ERROR in case wrong choice_id
- if (msg_params.keyExists(strings::choice_id)) {
- if (!CheckChoiceIDFromResponse(app,
- msg_params[strings::choice_id].asInt())) {
- ui_result_code_ = hmi_apis::Common_Result::GENERIC_ERROR;
- ui_info_ = "Wrong choiceID was received from HMI";
- } else {
- msg_params[strings::trigger_source] =
- mobile_apis::TriggerSource::TS_MENU;
- }
- } else if (msg_params.keyExists(strings::manual_text_entry)) {
- msg_params[strings::trigger_source] =
- mobile_apis::TriggerSource::TS_KEYBOARD;
- if (msg_params[strings::manual_text_entry].empty()) {
- msg_params.erase(strings::manual_text_entry);
- }
- }
- }
-}
-
-void PerformInteractionRequest::SendUIPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& choice_set_id_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- mobile_apis::InteractionMode::eType mode =
- static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt());
-
- if (mobile_apis::InteractionMode::VR_ONLY != mode) {
- msg_params[hmi_request::initial_text][hmi_request::field_name] =
- static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::initialInteractionText);
- msg_params[hmi_request::initial_text][hmi_request::field_text] =
- (*message_)[strings::msg_params][hmi_request::initial_text];
- }
- bool is_vr_help_item = false;
- if (mobile_apis::InteractionMode::MANUAL_ONLY != mode) {
- msg_params[strings::vr_help_title] =
- (*message_)[strings::msg_params][strings::initial_text].asString();
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- is_vr_help_item = true;
- msg_params[strings::vr_help] =
- (*message_)[strings::msg_params][strings::vr_help];
- }
- }
-
- if (mobile_apis::InteractionMode::BOTH == mode ||
- mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
- msg_params[strings::timeout] = default_timeout_ / 2;
- } else {
- msg_params[strings::timeout] = default_timeout_;
- }
- msg_params[strings::app_id] = app->app_id();
- if (mobile_apis::InteractionMode::VR_ONLY != mode) {
- msg_params[strings::choice_set] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- }
- int32_t index_array_of_vr_help = 0;
- for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
- smart_objects::SmartObject* choice_set =
- app->FindChoiceSet(choice_set_id_list[i].asInt());
- if (choice_set) {
- // save perform interaction choice set
- app->AddPerformInteractionChoiceSet(
- correlation_id(), choice_set_id_list[i].asInt(), *choice_set);
- for (size_t j = 0; j < (*choice_set)[strings::choice_set].length(); ++j) {
- if (mobile_apis::InteractionMode::VR_ONLY != mode) {
- size_t index = msg_params[strings::choice_set].length();
- msg_params[strings::choice_set][index] =
- (*choice_set)[strings::choice_set][j];
- // vrCommands should be added via VR.AddCommand only
- msg_params[strings::choice_set][index].erase(strings::vr_commands);
- }
- if (mobile_apis::InteractionMode::MANUAL_ONLY != mode &&
- !is_vr_help_item) {
- smart_objects::SmartObject& vr_commands =
- (*choice_set)[strings::choice_set][j][strings::vr_commands];
- if (0 < vr_commands.length()) {
- // copy only first synonym
- smart_objects::SmartObject item(smart_objects::SmartType_Map);
- item[strings::text] = vr_commands[0].asString();
- item[strings::position] = index_array_of_vr_help + 1;
- msg_params[strings::vr_help][index_array_of_vr_help++] = item;
- }
- }
- }
- }
- }
- if ((*message_)[strings::msg_params].keyExists(
- hmi_request::interaction_layout) &&
- mobile_apis::InteractionMode::VR_ONLY != mode) {
- msg_params[hmi_request::interaction_layout] =
- (*message_)[strings::msg_params][hmi_request::interaction_layout]
- .asInt();
- }
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(
- hmi_apis::FunctionID::UI_PerformInteraction, &msg_params, true);
-}
-
-void PerformInteractionRequest::SendVRPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& choice_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- if (mobile_apis::InteractionMode::MANUAL_ONLY != interaction_mode_) {
- msg_params[strings::grammar_id] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t grammar_id_index = 0;
- for (uint32_t i = 0; i < choice_list.length(); ++i) {
- smart_objects::SmartObject* choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
- if (!choice_set) {
- LOG4CXX_WARN(logger_, "Couldn't found choiset");
- continue;
- }
- msg_params[strings::grammar_id][grammar_id_index++] =
- (*choice_set)[strings::grammar_id].asUInt();
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
- msg_params[strings::help_prompt] =
- (*message_)[strings::msg_params][strings::help_prompt];
- } else {
- if (choice_list.length() != 0) {
- msg_params[strings::help_prompt] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- }
- int32_t index = 0;
- for (uint32_t i = 0; i < choice_list.length(); ++i) {
- smart_objects::SmartObject* choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
-
- if (choice_set) {
- for (uint32_t j = 0; j < (*choice_set)[strings::choice_set].length();
- ++j) {
- smart_objects::SmartObject& vr_commands =
- (*choice_set)[strings::choice_set][j][strings::vr_commands];
- if (0 < vr_commands.length()) {
- // copy only first synonym
- smart_objects::SmartObject item(smart_objects::SmartType_Map);
- // Since there is no custom data from application side, SDL should
- // construct prompt and append delimiter to each item
- item[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
- item[strings::text] =
- vr_commands[0].asString() +
- application_manager_.get_settings().tts_delimiter();
- msg_params[strings::help_prompt][index++] = item;
- }
- }
- } else {
- LOG4CXX_ERROR(logger_, "Can't found choiceSet!");
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
- msg_params[strings::timeout_prompt] =
- (*message_)[strings::msg_params][strings::timeout_prompt];
- } else {
- if (msg_params.keyExists(strings::help_prompt)) {
- msg_params[strings::timeout_prompt] = msg_params[strings::help_prompt];
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
- msg_params[strings::initial_prompt] =
- (*message_)[strings::msg_params][strings::initial_prompt];
- }
-
- mobile_apis::InteractionMode::eType mode =
- static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt());
-
- if (mobile_apis::InteractionMode::BOTH == mode ||
- mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
- msg_params[strings::timeout] = default_timeout_ / 2;
- } else {
- msg_params[strings::timeout] = default_timeout_;
- }
- msg_params[strings::app_id] = app->app_id();
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
- SendHMIRequest(
- hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, true);
-}
-
-bool PerformInteractionRequest::CheckChoiceSetMenuNames(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& choice_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- for (size_t i = 0; i < choice_list.length(); ++i) {
- // choice_set contains SmartObject msg_params
- smart_objects::SmartObject* i_choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
-
- for (size_t j = 0; j < choice_list.length(); ++j) {
- smart_objects::SmartObject* j_choice_set =
- app->FindChoiceSet(choice_list[j].asInt());
-
- if (i == j) {
- // skip check the same element
- continue;
- }
-
- if (!i_choice_set || !j_choice_set) {
- LOG4CXX_ERROR(logger_, "Invalid ID");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return false;
- }
-
- size_t ii = 0;
- size_t jj = 0;
- for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
- for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
- const std::string& ii_menu_name =
- (*i_choice_set)[strings::choice_set][ii][strings::menu_name]
- .asString();
- const std::string& jj_menu_name =
- (*j_choice_set)[strings::choice_set][jj][strings::menu_name]
- .asString();
-
- if (ii_menu_name == jj_menu_name) {
- LOG4CXX_ERROR(logger_, "Choice set has duplicated menu name");
- SendResponse(false,
- mobile_apis::Result::DUPLICATE_NAME,
- "Choice set has duplicated menu name");
- return false;
- }
- }
- }
- }
- }
-
- return true;
-}
-
-bool PerformInteractionRequest::CheckChoiceSetVRSynonyms(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& choice_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- for (size_t i = 0; i < choice_list.length(); ++i) {
- // choice_set contains SmartObject msg_params
- smart_objects::SmartObject* i_choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
-
- for (size_t j = 0; j < choice_list.length(); ++j) {
- smart_objects::SmartObject* j_choice_set =
- app->FindChoiceSet(choice_list[j].asInt());
-
- if (i == j) {
- // skip check the same element
- continue;
- }
-
- if ((!i_choice_set) || (!j_choice_set)) {
- LOG4CXX_ERROR(logger_, "Invalid ID");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return false;
- }
-
- size_t ii = 0;
- size_t jj = 0;
- for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
- for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
- // choice_set pointer contains SmartObject msg_params
- smart_objects::SmartObject& ii_vr_commands =
- (*i_choice_set)[strings::choice_set][ii][strings::vr_commands];
-
- smart_objects::SmartObject& jj_vr_commands =
- (*j_choice_set)[strings::choice_set][jj][strings::vr_commands];
-
- for (size_t iii = 0; iii < ii_vr_commands.length(); ++iii) {
- for (size_t jjj = 0; jjj < jj_vr_commands.length(); ++jjj) {
- const custom_str::CustomString& vr_cmd_i =
- ii_vr_commands[iii].asCustomString();
- const custom_str::CustomString& vr_cmd_j =
- jj_vr_commands[jjj].asCustomString();
- if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
- LOG4CXX_ERROR(logger_, "Choice set has duplicated VR synonym");
- SendResponse(false,
- mobile_apis::Result::DUPLICATE_NAME,
- "Choice set has duplicated VR synonym");
- return false;
- }
- }
- }
- }
- }
- }
- }
- return true;
-}
-
-bool PerformInteractionRequest::CheckVrHelpItemPositions(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!(*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- LOG4CXX_DEBUG(logger_, strings::vr_help << " is omitted.");
- return true;
- }
-
- smart_objects::SmartObject& vr_help =
- (*message_)[strings::msg_params][strings::vr_help];
-
- int32_t position = 1;
- for (size_t i = 0; i < vr_help.length(); ++i) {
- if (position != vr_help[i][strings::position].asInt()) {
- LOG4CXX_ERROR(logger_, "Non-sequential vrHelp item position");
- SendResponse(false,
- mobile_apis::Result::REJECTED,
- "Non-sequential vrHelp item position");
- return false;
- }
- ++position;
- }
- return true;
-}
-
-void PerformInteractionRequest::DisablePerformInteraction() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (app->is_perform_interaction_active()) {
- // decrease amount of active requests
- --pi_requests_count_;
- if (!pi_requests_count_) {
- app->set_perform_interaction_active(false);
- app->set_perform_interaction_mode(-1);
- }
- }
- app->DeletePerformInteractionChoiceSet(correlation_id());
-}
-
-bool PerformInteractionRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::initial_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid initial_text syntax check failed");
- return true;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
- const smart_objects::SmartArray* ip_array =
- (*message_)[strings::msg_params][strings::initial_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
- smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
-
- for (; it_ip != it_ip_end; ++it_ip) {
- str = (*it_ip)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
- const smart_objects::SmartArray* hp_array =
- (*message_)[strings::msg_params][strings::help_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
- smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
-
- for (; it_hp != it_hp_end; ++it_hp) {
- str = (*it_hp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
- const smart_objects::SmartArray* tp_array =
- (*message_)[strings::msg_params][strings::timeout_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
- smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
-
- for (; it_tp != it_tp_end; ++it_tp) {
- str = (*it_tp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- const smart_objects::SmartArray* vh_array =
- (*message_)[strings::msg_params][strings::vr_help].asArray();
-
- smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
- smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
-
- for (; it_vh != it_vh_end; ++it_vh) {
- str = (*it_vh)[strings::text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_help syntax check failed");
- return true;
- }
-
- if ((*it_vh).keyExists(strings::image)) {
- str = (*it_vh)[strings::image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid vr_help image value syntax check failed");
- return true;
- }
- }
- }
- }
- return false;
-}
-
-void PerformInteractionRequest::TerminatePerformInteraction() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[hmi_request::method_name] = "UI.PerformInteraction";
- SendHMIRequest(hmi_apis::FunctionID::UI_ClosePopUp, &msg_params);
- DisablePerformInteraction();
-}
-
-bool PerformInteractionRequest::CheckChoiceIDFromResponse(
- ApplicationSharedPtr app, int32_t choice_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- const DataAccessor<PerformChoiceSetMap> accessor =
- app->performinteraction_choice_set_map();
- const PerformChoiceSetMap& choice_set_map = accessor.GetData();
-
- PerformChoiceSetMap::const_iterator choice_set_map_it =
- choice_set_map.find(correlation_id());
- if (choice_set_map.end() != choice_set_map_it) {
- const PerformChoice& choice = choice_set_map_it->second;
- PerformChoice::const_iterator it = choice.begin();
- for (; choice.end() != it; ++it) {
- const smart_objects::SmartObject& choice_set =
- (*it->second).getElement(strings::choice_set);
- for (size_t j = 0; j < choice_set.length(); ++j) {
- if (choice_id ==
- choice_set.getElement(j).getElement(strings::choice_id).asInt()) {
- return true;
- }
- }
- }
- }
- return false;
-}
-
-bool PerformInteractionRequest::CheckChoiceIDFromRequest(
- ApplicationSharedPtr app,
- const size_t choice_set_id_list_length,
- const smart_objects::SmartObject& choice_set_id_list) const {
- LOG4CXX_AUTO_TRACE(logger_);
-
- size_t choice_list_length = 0;
- std::set<uint32_t> choice_id_set;
- smart_objects::SmartObject* choice_set = 0;
- std::pair<std::set<uint32_t>::iterator, bool> ins_res;
-
- for (size_t i = 0; i < choice_set_id_list_length; ++i) {
- choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt());
- if (!choice_set) {
- LOG4CXX_ERROR(
- logger_,
- "Couldn't find choiset_id = " << choice_set_id_list[i].asInt());
- return false;
- }
- choice_list_length = (*choice_set)[strings::choice_set].length();
- const smart_objects::SmartObject& choices_list =
- (*choice_set)[strings::choice_set];
- for (size_t k = 0; k < choice_list_length; ++k) {
- ins_res =
- choice_id_set.insert(choices_list[k][strings::choice_id].asInt());
- if (!ins_res.second) {
- LOG4CXX_ERROR(logger_,
- "Choise with ID "
- << choices_list[k][strings::choice_id].asInt()
- << " already exists");
- return false;
- }
- }
- }
- return true;
-}
-
-const bool PerformInteractionRequest::HasHMIResponsesToWait() const {
- LOG4CXX_AUTO_TRACE(logger_);
- return !ui_response_received_ || !vr_response_received_;
-}
-
-void PerformInteractionRequest::SendBothModeResponse(
- const smart_objects::SmartObject& msg_param) {
- LOG4CXX_AUTO_TRACE(logger_);
- mobile_apis::Result::eType perform_interaction_result_code =
- mobile_apis::Result::INVALID_ENUM;
- ResponseInfo ui_perform_info(
- ui_result_code_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
- ResponseInfo vr_perform_info(
- vr_result_code_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
- const bool result =
- PrepareResultForMobileResponse(ui_perform_info, vr_perform_info);
- perform_interaction_result_code =
- PrepareResultCodeForResponse(ui_perform_info, vr_perform_info);
- const smart_objects::SmartObject* response_params =
- msg_param.empty() ? NULL : &msg_param;
- std::string info =
- MergeInfos(ui_perform_info, ui_info_, vr_perform_info, vr_info_);
- DisablePerformInteraction();
- SendResponse(result,
- perform_interaction_result_code,
- info.empty() ? NULL : info.c_str(),
- response_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
deleted file mode 100644
index 6003751669..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/perform_interaction_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PerformInteractionResponse::PerformInteractionResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-PerformInteractionResponse::~PerformInteractionResponse() {}
-
-void PerformInteractionResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/put_file_request.cc b/src/components/application_manager/src/commands/mobile/put_file_request.cc
deleted file mode 100644
index 602b420ba0..0000000000
--- a/src/components/application_manager/src/commands/mobile/put_file_request.cc
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/mobile/put_file_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application_impl.h"
-
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PutFileRequest::PutFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , offset_(0)
- , sync_file_name_()
- , length_(0)
- , file_type_(mobile_apis::FileType::INVALID_ENUM)
- , is_persistent_file_(false) {}
-
-PutFileRequest::~PutFileRequest() {}
-
-void PutFileRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- smart_objects::SmartObject response_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (mobile_api::HMILevel::HMI_NONE == application->hmi_level() &&
- application_manager_.get_settings().put_file_in_none() <=
- application->put_file_in_none_count()) {
- // If application is in the HMI_NONE level the quantity of allowed
- // PutFile request is limited by the configuration profile
- LOG4CXX_ERROR(logger_,
- "Too many requests from the app with HMILevel HMI_NONE ");
- SendResponse(false,
- mobile_apis::Result::REJECTED,
- "Too many requests from the app with HMILevel HMI_NONE",
- &response_params);
- return;
- }
-
- if (!(*message_)[strings::params].keyExists(strings::binary_data)) {
- LOG4CXX_ERROR(logger_, "Binary data empty");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "Binary data empty",
- &response_params);
- return;
- }
-
- if (!(*message_)[strings::msg_params].keyExists(strings::sync_file_name)) {
- LOG4CXX_ERROR(logger_, "No file name");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "No file name",
- &response_params);
- return;
- }
-
- if (!(*message_)[strings::msg_params].keyExists(strings::file_type)) {
- LOG4CXX_ERROR(logger_, "No file type");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "No file type",
- &response_params);
- return;
- }
- sync_file_name_ =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- if (!file_system::IsFileNameValid(sync_file_name_)) {
- const std::string err_msg = "Sync file name contains forbidden symbols.";
- LOG4CXX_ERROR(logger_, err_msg);
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- err_msg.c_str(),
- &response_params);
- return;
- }
-
- file_type_ = static_cast<mobile_apis::FileType::eType>(
- (*message_)[strings::msg_params][strings::file_type].asInt());
- const std::vector<uint8_t> binary_data =
- (*message_)[strings::params][strings::binary_data].asBinary();
-
- // Policy table update in json format is currently to be received via PutFile
- // TODO(PV): after latest discussion has to be changed
- if (mobile_apis::FileType::JSON == file_type_) {
- application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(
- sync_file_name_, binary_data);
- }
-
- offset_ = 0;
- is_persistent_file_ = false;
- bool is_system_file = false;
- length_ = binary_data.size();
- bool is_download_compleate = true;
- bool offset_exist =
- (*message_)[strings::msg_params].keyExists(strings::offset);
-
- if (offset_exist) {
- offset_ = (*message_)[strings::msg_params][strings::offset].asInt();
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::persistent_file)) {
- is_persistent_file_ =
- (*message_)[strings::msg_params][strings::persistent_file].asBool();
- }
- if ((*message_)[strings::msg_params].keyExists(strings::system_file)) {
- is_system_file =
- (*message_)[strings::msg_params][strings::system_file].asBool();
- }
-
- std::string file_path;
-
- if (is_system_file) {
- response_params[strings::space_available] = 0;
- file_path = application_manager_.get_settings().system_files_path();
- } else {
- file_path = application_manager_.get_settings().app_storage_folder();
- file_path += "/" + application->folder_name();
-
- uint32_t space_available = application->GetAvailableDiskSpace();
-
- if (binary_data.size() > space_available) {
- response_params[strings::space_available] =
- static_cast<uint32_t>(space_available);
-
- LOG4CXX_ERROR(logger_, "Out of memory");
- SendResponse(false,
- mobile_apis::Result::OUT_OF_MEMORY,
- "Out of memory",
- &response_params);
- return;
- }
- }
-
- if (!file_system::CreateDirectoryRecursively(file_path)) {
- LOG4CXX_ERROR(logger_, "Can't create folder");
- SendResponse(false,
- mobile_apis::Result::GENERIC_ERROR,
- "Can't create folder.",
- &response_params);
- return;
- }
- const std::string full_path = file_path + "/" + sync_file_name_;
- UNUSED(full_path);
- LOG4CXX_DEBUG(logger_,
- "Wrtiting " << binary_data.size() << "bytes to " << full_path
- << " (current size is"
- << file_system::FileSize(full_path) << ")");
-
- mobile_apis::Result::eType save_result = application_manager_.SaveBinary(
- binary_data, file_path, sync_file_name_, offset_);
-
- LOG4CXX_DEBUG(logger_,
- "New size of " << full_path << " is "
- << file_system::FileSize(full_path) << " bytes");
- if (!is_system_file) {
- response_params[strings::space_available] =
- static_cast<uint32_t>(application->GetAvailableDiskSpace());
- }
-
- sync_file_name_ = file_path + "/" + sync_file_name_;
- switch (save_result) {
- case mobile_apis::Result::SUCCESS: {
- LOG4CXX_INFO(logger_, "PutFile is successful");
- if (!is_system_file) {
- AppFile file(sync_file_name_,
- is_persistent_file_,
- is_download_compleate,
- file_type_);
-
- if (0 == offset_) {
- LOG4CXX_INFO(logger_, "New file downloading");
- if (!application->AddFile(file)) {
- LOG4CXX_INFO(logger_,
- "Couldn't add file to application (File already Exist"
- << " in application and was rewritten on FS)");
- /* It can be first part of new big file, so we need to update
- information about it's downloading status and persistence */
- if (!application->UpdateFile(file)) {
- LOG4CXX_ERROR(logger_, "Couldn't update file");
- /* If it is impossible to update file, application doesn't
- know about existing this file */
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "Couldn't update file",
- &response_params);
- return;
- }
- } else {
- /* if file added - increment it's count
- ( may be application->AddFile have to incapsulate it? )
- Any way now this method evals not only in "none"*/
- application->increment_put_file_in_none_count();
- }
- }
- }
-
- SendResponse(true, save_result, "File was downloaded", &response_params);
- if (is_system_file) {
- SendOnPutFileNotification();
- }
- break;
- }
- default:
- LOG4CXX_WARN(logger_,
- "PutFile is unsuccessful. Result = " << save_result);
- SendResponse(false, save_result, "Can't save file", &response_params);
- break;
- }
-}
-
-void PutFileRequest::SendOnPutFileNotification() {
- LOG4CXX_INFO(logger_, "SendOnPutFileNotification");
- smart_objects::SmartObjectSPtr notification =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& message = *notification;
- message[strings::params][strings::function_id] =
- hmi_apis::FunctionID::BasicCommunication_OnPutFile;
-
- message[strings::params][strings::message_type] = MessageType::kNotification;
- message[strings::msg_params][strings::app_id] = connection_key();
- message[strings::msg_params][strings::sync_file_name] = sync_file_name_;
- message[strings::msg_params][strings::offset] = offset_;
- if (0 == offset_) {
- message[strings::msg_params][strings::file_size] =
- (*message_)[strings::msg_params][strings::length];
- }
- message[strings::msg_params][strings::length] = length_;
- message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
- message[strings::msg_params][strings::file_type] = file_type_;
- application_manager_.ManageHMICommand(notification);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/put_file_response.cc b/src/components/application_manager/src/commands/mobile/put_file_response.cc
deleted file mode 100644
index 50c62aef7f..0000000000
--- a/src/components/application_manager/src/commands/mobile/put_file_response.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/put_file_response.h"
-#include "utils/file_system.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PutFileResponse::PutFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-PutFileResponse::~PutFileResponse() {}
-
-void PutFileResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- SendResponse((*message_)[strings::msg_params][strings::success].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/read_did_request.cc b/src/components/application_manager/src/commands/mobile/read_did_request.cc
deleted file mode 100644
index c51f545e7e..0000000000
--- a/src/components/application_manager/src/commands/mobile/read_did_request.cc
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/read_did_request.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ReadDIDRequest::ReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-ReadDIDRequest::~ReadDIDRequest() {}
-
-void ReadDIDRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
-
- ApplicationSharedPtr app = application_manager_.application(app_id);
- LOG4CXX_INFO(
- logger_,
- "Correlation_id :"
- << (*message_)[strings::params][strings::correlation_id].asUInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "An application is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (app->AreCommandLimitsExceeded(
- static_cast<mobile_apis::FunctionID::eType>(function_id()),
- application_manager::TLimitSource::CONFIG_FILE)) {
- LOG4CXX_ERROR(logger_, "ReadDID frequency is too high.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if ((*message_)[strings::msg_params][strings::did_location].empty()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::ecu_name] =
- (*message_)[strings::msg_params][strings::ecu_name];
- msg_params[strings::did_location] =
- (*message_)[strings::msg_params][strings::did_location];
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_ReadDID, &msg_params, true);
-}
-
-void ReadDIDRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/read_did_response.cc b/src/components/application_manager/src/commands/mobile/read_did_response.cc
deleted file mode 100644
index e54c4ba005..0000000000
--- a/src/components/application_manager/src/commands/mobile/read_did_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/read_did_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ReadDIDResponse::ReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ReadDIDResponse::~ReadDIDResponse() {}
-
-void ReadDIDResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
deleted file mode 100644
index a3a30ddb20..0000000000
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
+++ /dev/null
@@ -1,1287 +0,0 @@
-/*
-
- Copyright (c) 2015, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/register_app_interface_request.h"
-
-#include <unistd.h>
-#include <algorithm>
-#include <map>
-#include <string.h>
-
-#include <utils/make_shared.h>
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/app_launch/app_launch_ctrl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/helpers/application_helper.h"
-#include "config_profile/profile.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/generated_msg_version.h"
-
-namespace {
-namespace custom_str = utils::custom_string;
-
-mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
- if ("DEFAULT" == str) {
- return mobile_apis::AppHMIType::DEFAULT;
- } else if ("COMMUNICATION" == str) {
- return mobile_apis::AppHMIType::COMMUNICATION;
- } else if ("MEDIA" == str) {
- return mobile_apis::AppHMIType::MEDIA;
- } else if ("MESSAGING" == str) {
- return mobile_apis::AppHMIType::MESSAGING;
- } else if ("NAVIGATION" == str) {
- return mobile_apis::AppHMIType::NAVIGATION;
- } else if ("INFORMATION" == str) {
- return mobile_apis::AppHMIType::INFORMATION;
- } else if ("SOCIAL" == str) {
- return mobile_apis::AppHMIType::SOCIAL;
- } else if ("BACKGROUND_PROCESS" == str) {
- return mobile_apis::AppHMIType::BACKGROUND_PROCESS;
- } else if ("TESTING" == str) {
- return mobile_apis::AppHMIType::TESTING;
- } else if ("SYSTEM" == str) {
- return mobile_apis::AppHMIType::SYSTEM;
- } else if ("PROJECTION" == str) {
- return mobile_apis::AppHMIType::PROJECTION;
-#ifdef SDL_REMOTE_CONTROL
- } else if ("REMOTE_CONTROL" == str) {
- return mobile_apis::AppHMIType::REMOTE_CONTROL;
-#endif
- } else {
- return mobile_apis::AppHMIType::INVALID_ENUM;
- }
-}
-
-std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) {
- const std::map<mobile_apis::AppHMIType::eType, std::string> app_hmi_type_map =
- {{mobile_apis::AppHMIType::DEFAULT, "DEFAULT"},
-#ifdef SDL_REMOTE_CONTROL
- {mobile_apis::AppHMIType::REMOTE_CONTROL, "REMOTE_CONTROL"},
-#endif // SDL_REMOTE_CONTROL
- {mobile_apis::AppHMIType::COMMUNICATION, "COMMUNICATION"},
- {mobile_apis::AppHMIType::MEDIA, "MEDIA"},
- {mobile_apis::AppHMIType::MESSAGING, "MESSAGING"},
- {mobile_apis::AppHMIType::NAVIGATION, "NAVIGATION"},
- {mobile_apis::AppHMIType::INFORMATION, "INFORMATION"},
- {mobile_apis::AppHMIType::SOCIAL, "SOCIAL"},
- {mobile_apis::AppHMIType::BACKGROUND_PROCESS, "BACKGROUND_PROCESS"},
- {mobile_apis::AppHMIType::TESTING, "TESTING"},
- {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"},
- {mobile_apis::AppHMIType::PROJECTION, "PROJECTION"}};
-
- std::map<mobile_apis::AppHMIType::eType, std::string>::const_iterator iter =
- app_hmi_type_map.find(type);
-
- return app_hmi_type_map.end() != iter ? iter->second : std::string("");
-}
-
-struct AppHMITypeInserter {
- AppHMITypeInserter(smart_objects::SmartObject& so_array)
- : index_(0), so_array_(so_array) {}
-
- bool operator()(const std::string& app_hmi_type) {
- so_array_[index_] = StringToAppHMIType(app_hmi_type);
- ++index_;
- return true;
- }
-
- private:
- uint32_t index_;
- smart_objects::SmartObject& so_array_;
-};
-
-struct CheckMissedTypes {
- CheckMissedTypes(const policy::StringArray& policy_app_types,
- std::string& log)
- : policy_app_types_(policy_app_types), log_(log) {}
-
- bool operator()(const smart_objects::SmartArray::value_type& value) {
- std::string app_type_str = AppHMITypeToString(
- static_cast<mobile_apis::AppHMIType::eType>(value.asInt()));
- if (!app_type_str.empty()) {
- policy::StringArray::const_iterator it = policy_app_types_.begin();
- policy::StringArray::const_iterator it_end = policy_app_types_.end();
- for (; it != it_end; ++it) {
- if (app_type_str == *it) {
- return true;
- }
- }
- }
-
- log_ += app_type_str;
- log_ += ",";
-
- return true;
- }
-
- private:
- const policy::StringArray& policy_app_types_;
- std::string& log_;
-};
-
-class SmartArrayValueExtractor {
- public:
- AppHmiType operator()(const smart_objects::SmartObject& so) const {
- return static_cast<AppHmiType>(so.asInt());
- }
-};
-
-struct IsSameNickname {
- IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
- bool operator()(const policy::StringArray::value_type& nickname) const {
- return app_id_.CompareIgnoreCase(nickname.c_str());
- }
-
- private:
- const custom_str::CustomString& app_id_;
-};
-}
-
-namespace application_manager {
-
-namespace commands {
-
-RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , result_checking_app_hmi_type_(mobile_apis::Result::INVALID_ENUM) {}
-
-RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {}
-
-bool RegisterAppInterfaceRequest::Init() {
- LOG4CXX_AUTO_TRACE(logger_);
- return true;
-}
-
-void RegisterAppInterfaceRequest::Run() {
- using namespace helpers;
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Connection key is " << connection_key());
-
- // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
- // Flag conditional compilation specific to customer is used in order to
- // exclude hit code
- // to RTC
- // FIXME(EZamakhov): on shutdown - get freez
-
- // wait till HMI started
- while (!application_manager_.IsStopping() &&
- !application_manager_.IsHMICooperating()) {
- LOG4CXX_DEBUG(logger_,
- "Waiting for the HMI... conn_key="
- << connection_key()
- << ", correlation_id=" << correlation_id()
- << ", default_timeout=" << default_timeout()
- << ", thread=" << pthread_self());
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- sleep(1);
- // TODO(DK): timer_->StartWait(1);
- }
-
- if (application_manager_.IsStopping()) {
- LOG4CXX_WARN(logger_, "The ApplicationManager is stopping!");
- return;
- }
-
- if (IsApplicationSwitched()) {
- return;
- }
-
- const std::string mobile_app_id =
- (*message_)[strings::msg_params][strings::app_id].asString();
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (application) {
- SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
- return;
- }
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- const std::string policy_app_id = msg_params[strings::app_id].asString();
- std::string new_policy_app_id = policy_app_id;
- std::transform(policy_app_id.begin(),
- policy_app_id.end(),
- new_policy_app_id.begin(),
- ::tolower);
- (*message_)[strings::msg_params][strings::app_id] = new_policy_app_id;
-
- if (application_manager_.IsApplicationForbidden(connection_key(),
- policy_app_id)) {
- SendResponse(false, mobile_apis::Result::TOO_MANY_PENDING_REQUESTS);
- return;
- }
-
- if (IsApplicationWithSameAppIdRegistered()) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- return;
- }
-
- mobile_apis::Result::eType policy_result = CheckWithPolicyData();
-
- if (Compare<mobile_apis::Result::eType, NEQ, ALL>(
- policy_result,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::WARNINGS)) {
- SendResponse(false, policy_result);
- return;
- }
-
- mobile_apis::Result::eType coincidence_result = CheckCoincidence();
-
- if (mobile_apis::Result::SUCCESS != coincidence_result) {
- LOG4CXX_ERROR(logger_, "Coincidence check failed.");
- if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) {
- usage_statistics::AppCounter count_of_rejections_duplicate_name(
- GetPolicyHandler().GetStatisticManager(),
- policy_app_id,
- usage_statistics::REJECTIONS_DUPLICATE_NAME);
- ++count_of_rejections_duplicate_name;
- }
- SendResponse(false, coincidence_result);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_INFO(logger_,
- "Incoming register app interface has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- application = application_manager_.RegisterApplication(message_);
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application hasn't been registered!");
- return;
- }
- // For resuming application need to restore hmi_app_id from resumeCtrl
- resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
- const std::string& device_mac = application->mac_address();
-
- // there is side affect with 2 mobile app with the same mobile app_id
- if (resumer.IsApplicationSaved(policy_app_id, device_mac)) {
- application->set_hmi_application_id(
- resumer.GetHMIApplicationID(policy_app_id, device_mac));
- } else {
- application->set_hmi_application_id(
- application_manager_.GenerateNewHMIAppID());
- }
-
- application->set_is_media_application(
- msg_params[strings::is_media_application].asBool());
-
- if (msg_params.keyExists(strings::vr_synonyms)) {
- application->set_vr_synonyms(msg_params[strings::vr_synonyms]);
- }
-
- if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
- application->set_ngn_media_screen_name(
- msg_params[strings::ngn_media_screen_app_name]);
- }
-
- if (msg_params.keyExists(strings::tts_name)) {
- application->set_tts_name(msg_params[strings::tts_name]);
- }
-
- if (msg_params.keyExists(strings::app_hmi_type)) {
- application->set_app_types(msg_params[strings::app_hmi_type]);
-
- // check app type
- const smart_objects::SmartObject& app_type =
- msg_params.getElement(strings::app_hmi_type);
-
- for (size_t i = 0; i < app_type.length(); ++i) {
- if (mobile_apis::AppHMIType::NAVIGATION ==
- static_cast<mobile_apis::AppHMIType::eType>(
- app_type.getElement(i).asUInt())) {
- application->set_is_navi(true);
- }
- if (mobile_apis::AppHMIType::COMMUNICATION ==
- static_cast<mobile_apis::AppHMIType::eType>(
- app_type.getElement(i).asUInt())) {
- application->set_voice_communication_supported(true);
- }
- if (mobile_apis::AppHMIType::PROJECTION ==
- static_cast<mobile_apis::AppHMIType::eType>(
- app_type.getElement(i).asUInt())) {
- application->set_mobile_projection_enabled(true);
- }
- }
- }
-
- // Add device to policy table and set device info, if any
- policy::DeviceParams dev_params;
- if (-1 ==
- application_manager_.connection_handler()
- .get_session_observer()
- .GetDataOnDeviceID(application->device(),
- &dev_params.device_name,
- NULL,
- &dev_params.device_mac_address,
- &dev_params.device_connection_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device "
- << application->device());
- }
- policy::DeviceInfo device_info;
- device_info.AdoptDeviceType(dev_params.device_connection_type);
- if (msg_params.keyExists(strings::device_info)) {
- FillDeviceInfo(&device_info);
- }
-
- GetPolicyHandler().SetDeviceInfo(device_mac, device_info);
-
- SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
- smart_objects::SmartObjectSPtr so =
- GetLockScreenIconUrlNotification(connection_key(), application);
- application_manager_.ManageMobileCommand(so, commands::Command::ORIGIN_SDL);
-}
-
-smart_objects::SmartObjectSPtr
-RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification(
- const uint32_t connection_key, ApplicationSharedPtr app) {
- DCHECK_OR_RETURN(app.get(), smart_objects::SmartObjectSPtr());
- smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- (*message)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnSystemRequestID;
- (*message)[strings::params][strings::connection_key] = connection_key;
- (*message)[strings::params][strings::message_type] =
- mobile_apis::messageType::notification;
- (*message)[strings::params][strings::protocol_type] =
- commands::CommandImpl::mobile_protocol_type_;
- (*message)[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- (*message)[strings::msg_params][strings::request_type] =
- mobile_apis::RequestType::LOCK_SCREEN_ICON_URL;
- (*message)[strings::msg_params][strings::url] =
- GetPolicyHandler().GetLockScreenIconUrl();
- return message;
-}
-
-void FillVRRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- response_params[strings::language] = hmi_capabilities.active_vr_language();
- if (hmi_capabilities.vr_capabilities()) {
- response_params[strings::vr_capabilities] =
- *hmi_capabilities.vr_capabilities();
- }
-}
-
-void FillVIRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- if (hmi_capabilities.vehicle_type()) {
- response_params[hmi_response::vehicle_type] =
- *hmi_capabilities.vehicle_type();
- }
-}
-
-void FillTTSRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- response_params[strings::language] = hmi_capabilities.active_tts_language();
- if (hmi_capabilities.speech_capabilities()) {
- response_params[strings::speech_capabilities] =
- *hmi_capabilities.speech_capabilities();
- }
- if (hmi_capabilities.prerecorded_speech()) {
- response_params[strings::prerecorded_speech] =
- *(hmi_capabilities.prerecorded_speech());
- }
-}
-
-void FillUIRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- response_params[strings::hmi_display_language] =
- hmi_capabilities.active_ui_language();
- if (hmi_capabilities.display_capabilities()) {
- response_params[hmi_response::display_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& display_caps =
- response_params[hmi_response::display_capabilities];
-
- display_caps[hmi_response::display_type] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::display_type);
-
- display_caps[hmi_response::text_fields] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::text_fields);
-
- display_caps[hmi_response::image_fields] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::image_fields);
-
- display_caps[hmi_response::media_clock_formats] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::media_clock_formats);
-
- display_caps[hmi_response::templates_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::templates_available);
-
- display_caps[hmi_response::screen_params] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::screen_params);
-
- display_caps[hmi_response::num_custom_presets_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::num_custom_presets_available);
-
- display_caps[hmi_response::graphic_supported] =
- (hmi_capabilities.display_capabilities()
- ->getElement(hmi_response::image_capabilities)
- .length() > 0);
-
- display_caps[hmi_response::templates_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::templates_available);
-
- display_caps[hmi_response::screen_params] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::screen_params);
-
- display_caps[hmi_response::num_custom_presets_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::num_custom_presets_available);
- }
-
- if (hmi_capabilities.audio_pass_thru_capabilities()) {
- if (smart_objects::SmartType_Array ==
- hmi_capabilities.audio_pass_thru_capabilities()->getType()) {
- // hmi_capabilities json contains array and HMI response object
- response_params[strings::audio_pass_thru_capabilities] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- } else {
- response_params[strings::audio_pass_thru_capabilities][0] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- }
- }
- response_params[strings::hmi_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- response_params[strings::hmi_capabilities][strings::navigation] =
- hmi_capabilities.navigation_supported();
- response_params[strings::hmi_capabilities][strings::phone_call] =
- hmi_capabilities.phone_call_supported();
- response_params[strings::hmi_capabilities][strings::video_streaming] =
- hmi_capabilities.video_streaming_supported();
- response_params[strings::hmi_capabilities][strings::remote_control] =
- hmi_capabilities.rc_supported();
-}
-
-void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
- ApplicationType app_type) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
-
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
-
- const uint32_t key = connection_key();
- ApplicationSharedPtr application = application_manager_.application(key);
-
- resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
-
- if (!application) {
- LOG4CXX_ERROR(logger_,
- "There is no application for such connection key" << key);
- LOG4CXX_DEBUG(logger_, "Need to start resume data persistent timer");
- resumer.OnAppRegistrationEnd();
- return;
- }
-
- response_params[strings::sync_msg_version][strings::major_version] =
- major_version; // From generated file interfaces/generated_msg_version.h
- response_params[strings::sync_msg_version][strings::minor_version] =
- minor_version; // From generated file interfaces/generated_msg_version.h
- response_params[strings::sync_msg_version][strings::patch_version] =
- patch_version; // From generated file interfaces/generated_msg_version.h
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- if (msg_params[strings::language_desired].asInt() !=
- hmi_capabilities.active_vr_language() ||
- msg_params[strings::hmi_display_language_desired].asInt() !=
- hmi_capabilities.active_ui_language()) {
- LOG4CXX_WARN(logger_,
- "Wrong language on registering application "
- << application->name().c_str());
-
- LOG4CXX_ERROR(
- logger_,
- "VR language desired code is "
- << msg_params[strings::language_desired].asInt()
- << " , active VR language code is "
- << hmi_capabilities.active_vr_language() << ", UI language code is "
- << msg_params[strings::hmi_display_language_desired].asInt()
- << " , active UI language code is "
- << hmi_capabilities.active_ui_language());
-
- result_code = mobile_apis::Result::WRONG_LANGUAGE;
- }
-
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_TTS)) {
- FillTTSRelatedFields(response_params, hmi_capabilities);
- }
-
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VR)) {
- FillVRRelatedFields(response_params, hmi_capabilities);
- }
-
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_UI)) {
- FillUIRelatedFields(response_params, hmi_capabilities);
- }
-
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
- FillVIRelatedFields(response_params, hmi_capabilities);
- }
-
- if (hmi_capabilities.button_capabilities()) {
- response_params[hmi_response::button_capabilities] =
- *hmi_capabilities.button_capabilities();
- }
-
- if (hmi_capabilities.soft_button_capabilities()) {
- response_params[hmi_response::soft_button_capabilities] =
- *hmi_capabilities.soft_button_capabilities();
- }
-
- if (hmi_capabilities.preset_bank_capabilities()) {
- response_params[hmi_response::preset_bank_capabilities] =
- *hmi_capabilities.preset_bank_capabilities();
- }
-
- if (hmi_capabilities.hmi_zone_capabilities()) {
- if (smart_objects::SmartType_Array ==
- hmi_capabilities.hmi_zone_capabilities()->getType()) {
- // hmi_capabilities json contains array and HMI response object
- response_params[hmi_response::hmi_zone_capabilities] =
- *hmi_capabilities.hmi_zone_capabilities();
- } else {
- response_params[hmi_response::hmi_zone_capabilities][0] =
- *hmi_capabilities.hmi_zone_capabilities();
- }
- }
-
- if (hmi_capabilities.pcm_stream_capabilities()) {
- response_params[strings::pcm_stream_capabilities] =
- *hmi_capabilities.pcm_stream_capabilities();
- }
-
- const std::vector<uint32_t>& diag_modes =
- application_manager_.get_settings().supported_diag_modes();
- if (!diag_modes.empty()) {
- std::vector<uint32_t>::const_iterator it = diag_modes.begin();
- uint32_t index = 0;
- for (; it != diag_modes.end(); ++it) {
- response_params[strings::supported_diag_modes][index] = *it;
- ++index;
- }
- }
-
- response_params[strings::sdl_version] =
- application_manager_.get_settings().sdl_version();
- const std::string ccpu_version =
- application_manager_.hmi_capabilities().ccpu_version();
- if (!ccpu_version.empty()) {
- response_params[strings::system_software_version] = ccpu_version;
- }
-
- if (ApplicationType::kSwitchedApplicationWrongHashId == app_type) {
- LOG4CXX_DEBUG(logger_,
- "Application has been switched from another transport, "
- "but doesn't have correct hashID.");
-
- application_manager::DeleteApplicationData(application,
- application_manager_);
-
- SendResponse(
- true, mobile_apis::Result::RESUME_FAILED, NULL, &response_params);
- return;
- }
-
- if (ApplicationType::kSwitchedApplicationHashOk == app_type) {
- LOG4CXX_DEBUG(logger_,
- "Application has been switched from another transport "
- "and has correct hashID.");
- SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
- return;
- }
-
- bool resumption =
- (*message_)[strings::msg_params].keyExists(strings::hash_id);
-
- bool need_restore_vr = resumption;
-
- std::string hash_id;
- std::string add_info;
- if (resumption) {
- hash_id = (*message_)[strings::msg_params][strings::hash_id].asString();
- if (!resumer.CheckApplicationHash(application, hash_id)) {
- LOG4CXX_WARN(logger_,
- "Hash from RAI does not match to saved resume data.");
- result_code = mobile_apis::Result::RESUME_FAILED;
- add_info = "Hash from RAI does not match to saved resume data.";
- need_restore_vr = false;
- } else if (!resumer.CheckPersistenceFilesForResumption(application)) {
- LOG4CXX_WARN(logger_, "Persistent data is missing.");
- result_code = mobile_apis::Result::RESUME_FAILED;
- add_info = "Persistent data is missing.";
- need_restore_vr = false;
- } else {
- add_info = "Resume succeeded.";
- }
- }
- if ((mobile_apis::Result::SUCCESS == result_code) &&
- (mobile_apis::Result::INVALID_ENUM != result_checking_app_hmi_type_)) {
- add_info += response_info_;
- result_code = result_checking_app_hmi_type_;
- }
-
- // in case application exist in resumption we need to send resumeVrgrammars
- if (false == resumption) {
- resumption = resumer.IsApplicationSaved(application->policy_app_id(),
- application->mac_address());
- }
-
- AppHmiTypes hmi_types;
- if ((*message_)[strings::msg_params].keyExists(strings::app_hmi_type)) {
- smart_objects::SmartArray* hmi_types_ptr =
- (*message_)[strings::msg_params][strings::app_hmi_type].asArray();
- DCHECK_OR_RETURN_VOID(hmi_types_ptr);
- SmartArrayValueExtractor extractor;
- if (hmi_types_ptr && 0 < hmi_types_ptr->size()) {
- std::transform(hmi_types_ptr->begin(),
- hmi_types_ptr->end(),
- std::back_inserter(hmi_types),
- extractor);
- }
- }
- policy::StatusNotifier notify_upd_manager = GetPolicyHandler().AddApplication(
- application->policy_app_id(), hmi_types);
- SendResponse(true, result_code, add_info.c_str(), &response_params);
- SendOnAppRegisteredNotificationToHMI(
- *(application.get()), resumption, need_restore_vr);
-#ifdef SDL_REMOTE_CONTROL
- if (msg_params.keyExists(strings::app_hmi_type)) {
- GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(),
- &(msg_params[strings::app_hmi_type]));
- }
-#endif // SDL_REMOTE_CONTROL
-
- // Default HMI level should be set before any permissions validation, since it
- // relies on HMI level.
- application_manager_.OnApplicationRegistered(application);
- (*notify_upd_manager)();
-
- // Start PTU after successfull registration
- // Sends OnPermissionChange notification to mobile right after RAI response
- // and HMI level set-up
- GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id());
-
- if (result_code != mobile_apis::Result::RESUME_FAILED) {
- resumer.StartResumption(application, hash_id);
- } else {
- resumer.StartResumptionOnlyHMILevel(application);
- }
-
- // By default app subscribed to CUSTOM_BUTTON
- SendSubscribeCustomButtonNotification();
- SendChangeRegistrationOnHMI(application);
-}
-
-DEPRECATED void
-RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
- SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
-}
-
-void RegisterAppInterfaceRequest::SendChangeRegistration(
- const hmi_apis::FunctionID::eType function_id,
- const int32_t language,
- const uint32_t app_id) {
- using helpers::Compare;
- using helpers::EQ;
- using helpers::ONE;
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- const HmiInterfaces::InterfaceID interface =
- hmi_interfaces.GetInterfaceFromFunction(function_id);
- if (hmi_interfaces.GetInterfaceState(interface) !=
- HmiInterfaces::STATE_NOT_AVAILABLE) {
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::language] = language;
- msg_params[strings::app_id] = app_id;
- SendHMIRequest(function_id, &msg_params);
- } else {
- LOG4CXX_DEBUG(logger_, "Interface " << interface << "is not avaliable");
- }
-}
-
-void RegisterAppInterfaceRequest::SendChangeRegistrationOnHMI(
- ApplicationConstSharedPtr app) {
- using namespace hmi_apis::FunctionID;
- DCHECK_OR_RETURN_VOID(app);
- DCHECK_OR_RETURN_VOID(mobile_apis::Language::INVALID_ENUM != app->language());
- SendChangeRegistration(VR_ChangeRegistration, app->language(), app->app_id());
- SendChangeRegistration(
- TTS_ChangeRegistration, app->language(), app->app_id());
- SendChangeRegistration(UI_ChangeRegistration, app->language(), app->app_id());
-}
-
-void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
- const Application& application_impl,
- bool resumption,
- bool need_restore_vr) {
- using namespace smart_objects;
- SmartObjectSPtr notification = utils::MakeShared<SmartObject>(SmartType_Map);
- if (!notification) {
- LOG4CXX_ERROR(logger_, "Failed to create smart object");
- return;
- }
-
- (*notification)[strings::params] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& params = (*notification)[strings::params];
- params[strings::function_id] = static_cast<int32_t>(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
- params[strings::message_type] = static_cast<int32_t>(kNotification);
- params[strings::protocol_version] = commands::CommandImpl::protocol_version_;
- params[strings::protocol_type] = commands::CommandImpl::hmi_protocol_type_;
-
- (*notification)[strings::msg_params] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& msg_params = (*notification)[strings::msg_params];
- // Due to current requirements in case when we're in resumption mode
- // we have to always send resumeVRGrammar field.
- if (resumption) {
- msg_params[strings::resume_vr_grammars] = need_restore_vr;
- }
-
- if (application_impl.vr_synonyms()) {
- msg_params[strings::vr_synonyms] = *(application_impl.vr_synonyms());
- }
-
- if (application_impl.tts_name()) {
- msg_params[strings::tts_name] = *(application_impl.tts_name());
- }
-
- std::string priority;
- GetPolicyHandler().GetPriority(application_impl.policy_app_id(), &priority);
-
- if (!priority.empty()) {
- msg_params[strings::priority] = MessageHelper::GetPriorityCode(priority);
- }
-
- msg_params[strings::msg_params] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& application = msg_params[strings::application];
- application[strings::app_name] = application_impl.name();
- application[strings::app_id] = application_impl.app_id();
- application[hmi_response::policy_app_id] = application_impl.policy_app_id();
- application[strings::icon] = application_impl.app_icon_path();
-
- const smart_objects::SmartObject* ngn_media_screen_name =
- application_impl.ngn_media_screen_name();
- if (ngn_media_screen_name) {
- application[strings::ngn_media_screen_app_name] = *ngn_media_screen_name;
- }
-
- application[strings::hmi_display_language_desired] =
- static_cast<int32_t>(application_impl.ui_language());
-
- application[strings::is_media_application] =
- application_impl.is_media_application();
-
- const smart_objects::SmartObject* app_type = application_impl.app_types();
- if (app_type) {
- application[strings::app_type] = *app_type;
- }
-
- std::vector<std::string> request_types =
- GetPolicyHandler().GetAppRequestTypes(application_impl.policy_app_id());
-
- application[strings::request_type] = SmartObject(SmartType_Array);
- smart_objects::SmartObject& request_array =
- application[strings::request_type];
-
- uint32_t index = 0;
- std::vector<std::string>::const_iterator it = request_types.begin();
- for (; request_types.end() != it; ++it) {
- request_array[index] = *it;
- ++index;
- }
-
- application[strings::device_info] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& device_info = application[strings::device_info];
- const protocol_handler::SessionObserver& session_observer =
- application_manager_.connection_handler().get_session_observer();
- std::string device_name;
- std::string mac_address;
- std::string transport_type;
- const connection_handler::DeviceHandle handle = application_impl.device();
- if (-1 ==
- session_observer.GetDataOnDeviceID(
- handle, &device_name, NULL, &mac_address, &transport_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device " << handle);
- }
-
- device_info[strings::name] = device_name;
- device_info[strings::id] = mac_address;
-
- const policy::DeviceConsent device_consent =
- GetPolicyHandler().GetUserConsentForDevice(mac_address);
- device_info[strings::isSDLAllowed] =
- policy::DeviceConsent::kDeviceAllowed == device_consent;
-
- device_info[strings::transport_type] =
- application_manager_.GetDeviceTransportType(transport_type);
-
- DCHECK(application_manager_.ManageHMICommand(notification));
-}
-
-mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- ApplicationSet accessor = application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = accessor.begin();
- const custom_str::CustomString& app_name =
- msg_params[strings::app_name].asCustomString();
-
- for (; accessor.end() != it; ++it) {
- // name check
- const custom_str::CustomString& cur_name = (*it)->name();
- if (app_name.CompareIgnoreCase(cur_name)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
-
- const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
- const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
- if (NULL != vr) {
- curr_vr = vr->asArray();
- CoincidencePredicateVR v(app_name);
-
- if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- }
-
- // vr check
- if (msg_params.keyExists(strings::vr_synonyms)) {
- const std::vector<smart_objects::SmartObject>* new_vr =
- msg_params[strings::vr_synonyms].asArray();
-
- CoincidencePredicateVR v(cur_name);
- if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- } // end vr check
-
- } // application for end
-
- return mobile_apis::Result::SUCCESS;
-} // method end
-
-mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
- LOG4CXX_AUTO_TRACE(logger_);
- // TODO(AOleynik): Check is necessary to allow register application in case
- // of disabled policy
- // Remove this check, when HMI will support policy
- if (!GetPolicyHandler().PolicyEnabled()) {
- return mobile_apis::Result::WARNINGS;
- }
-
- smart_objects::SmartObject& message = *message_;
- policy::StringArray app_nicknames;
- policy::StringArray app_hmi_types;
-
- const std::string mobile_app_id =
- message[strings::msg_params][strings::app_id].asString();
- const bool init_result = GetPolicyHandler().GetInitialAppData(
- mobile_app_id, &app_nicknames, &app_hmi_types);
-
- if (!init_result) {
- LOG4CXX_ERROR(logger_, "Error during initial application data check.");
- return mobile_apis::Result::INVALID_DATA;
- }
-
- if (!app_nicknames.empty()) {
- IsSameNickname compare(
- message[strings::msg_params][strings::app_name].asCustomString());
- policy::StringArray::const_iterator it =
- std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
- if (app_nicknames.end() == it) {
- LOG4CXX_WARN(logger_,
- "Application name was not found in nicknames list.");
- // App should be unregistered, if its name is not present in nicknames
- // list
- usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
- GetPolicyHandler().GetStatisticManager(),
- mobile_app_id,
- usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
- ++count_of_rejections_nickname_mismatch;
- return mobile_apis::Result::DISALLOWED;
- }
- }
-
- mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS;
-
- // If AppHMIType is not included in policy - allow any type
- if (!app_hmi_types.empty()) {
- if (message[strings::msg_params].keyExists(strings::app_hmi_type)) {
- // If AppHmiTypes are partially same, the system should allow those listed
- // in the policy table and send warning info on missed values
- smart_objects::SmartArray app_types =
- *(message[strings::msg_params][strings::app_hmi_type].asArray());
-
- std::string log;
- CheckMissedTypes checker(app_hmi_types, log);
- std::for_each(app_types.begin(), app_types.end(), checker);
- if (!log.empty()) {
- response_info_ =
- "Following AppHmiTypes are not present in policy "
- "table:" +
- log;
- result_checking_app_hmi_type_ = mobile_apis::Result::WARNINGS;
- }
- }
- // Replace AppHmiTypes in request with values allowed by policy table
- message[strings::msg_params][strings::app_hmi_type] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- smart_objects::SmartObject& app_hmi_type =
- message[strings::msg_params][strings::app_hmi_type];
-
- AppHMITypeInserter inserter(app_hmi_type);
- std::for_each(app_hmi_types.begin(), app_hmi_types.end(), inserter);
- }
-
- return result;
-}
-
-void RegisterAppInterfaceRequest::FillDeviceInfo(
- policy::DeviceInfo* device_info) {
- const std::string hardware = "hardware";
- const std::string firmware_rev = "firmwareRev";
- const std::string os = "os";
- const std::string os_ver = "osVersion";
- const std::string carrier = "carrier";
- const std::string max_number_rfcom_ports = "maxNumberRFCOMMPorts";
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- const smart_objects::SmartObject& device_info_so =
- msg_params[strings::device_info];
-
- if (device_info_so.keyExists(hardware)) {
- device_info->hardware =
- msg_params[strings::device_info][hardware].asString();
- }
- if (device_info_so.keyExists(firmware_rev)) {
- device_info->firmware_rev =
- msg_params[strings::device_info][firmware_rev].asString();
- }
- if (device_info_so.keyExists(os)) {
- device_info->os = device_info_so[os].asString();
- }
- if (device_info_so.keyExists(os_ver)) {
- device_info->os_ver = device_info_so[os_ver].asString();
- }
- if (device_info_so.keyExists(carrier)) {
- device_info->carrier = device_info_so[carrier].asString();
- }
- if (device_info_so.keyExists(max_number_rfcom_ports)) {
- device_info->max_number_rfcom_ports =
- device_info_so[max_number_rfcom_ports].asInt();
- }
-}
-
-bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const custom_string::CustomString mobile_app_id =
- (*message_)[strings::msg_params][strings::app_id].asCustomString();
-
- const ApplicationSet& applications =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = applications.begin();
- ApplicationSetConstIt it_end = applications.end();
-
- for (; it != it_end; ++it) {
- if (mobile_app_id.CompareIgnoreCase((*it)->policy_app_id().c_str())) {
- return true;
- }
- }
-
- return false;
-}
-
-bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
- return true;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
- const smart_objects::SmartArray* tn_array =
- (*message_)[strings::msg_params][strings::tts_name].asArray();
-
- smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
- smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
-
- for (; it_tn != it_tn_end; ++it_tn) {
- str = (*it_tn)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::ngn_media_screen_app_name)) {
- str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid ngn_media_screen_app_name syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
- const smart_objects::SmartArray* vs_array =
- (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
-
- smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
- smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
-
- for (; it_vs != it_vs_end; ++it_vs) {
- str = (*it_vs).asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
- str = (*message_)[strings::msg_params][strings::hash_id].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid hash_id syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::hardware)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::hardware].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info hardware syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::firmware_rev)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::firmware_rev].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info firmware_rev syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::os)) {
- str = (*message_)[strings::msg_params][strings::device_info][strings::os]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid device_info os syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::os_version)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::os_version].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info os_version syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::carrier)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::carrier].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info carrier syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- str = (*message_)[strings::msg_params][strings::app_id].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
- return true;
- }
- }
-
- return false;
-}
-
-void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam(
- smart_objects::SmartObject& vehicle_type,
- const std::string& param,
- const std::string& backup_value) {
- using namespace hmi_response;
- if (!vehicle_type.keyExists(param) || vehicle_type[param].empty()) {
- if (!backup_value.empty()) {
- LOG4CXX_DEBUG(logger_,
- param << " is missing."
- "Will be replaced with policy table value.");
- vehicle_type[param] = backup_value;
- } else {
- vehicle_type.erase(param);
- }
- }
-}
-
-void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = Common_ButtonName::CUSTOM_BUTTON;
- msg_params[strings::is_suscribed] = true;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
-bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- const std::string& policy_app_id = msg_params[strings::app_id].asString();
-
- LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id);
-
- auto app = application_manager_.application_by_policy_id(policy_app_id);
-
- if (!app) {
- LOG4CXX_DEBUG(logger_,
- "Application with policy id " << policy_app_id
- << " is not found.");
- return false;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Application with policy id " << policy_app_id << " is found.");
- if (!application_manager_.IsAppInReconnectMode(policy_app_id)) {
- LOG4CXX_DEBUG(logger_,
- "Policy id " << policy_app_id
- << " is not found in reconnection list.");
- SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
- return false;
- }
-
- LOG4CXX_DEBUG(logger_, "Application is found in reconnection list.");
-
- auto app_type = ApplicationType::kSwitchedApplicationWrongHashId;
- if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
- const auto hash_id =
- (*message_)[strings::msg_params][strings::hash_id].asString();
-
- auto& resume_ctrl = application_manager_.resume_controller();
- if (resume_ctrl.CheckApplicationHash(app, hash_id)) {
- app_type = ApplicationType::kSwitchedApplicationHashOk;
- }
- }
-
- application_manager_.ProcessReconnection(app, connection_key());
- SendRegisterAppInterfaceResponseToMobile(app_type);
-
- application_manager_.SendHMIStatusNotification(app);
-
- application_manager_.OnApplicationSwitched(app);
-
- return true;
-}
-
-policy::PolicyHandlerInterface&
-RegisterAppInterfaceRequest::GetPolicyHandler() {
- return application_manager_.GetPolicyHandler();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
deleted file mode 100644
index 3e94e652d4..0000000000
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/register_app_interface_response.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "connection_handler/connection_handler.h"
-#include "application_manager/policies/policy_handler_interface.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void RegisterAppInterfaceResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
- bool success = (*message_)[strings::msg_params][strings::success].asBool();
- bool last_message = !success;
- // Do not close connection in case of APPLICATION_NOT_REGISTERED despite it is
- // an error
- if (!success &&
- (*message_)[strings::msg_params].keyExists(strings::result_code)) {
- result_code = static_cast<mobile_apis::Result::eType>(
- (*message_)[strings::msg_params][strings::result_code].asInt());
- if (result_code == mobile_apis::Result::APPLICATION_REGISTERED_ALREADY) {
- last_message = false;
- }
- }
-
- SendResponse(success, result_code, last_message);
-
- if (mobile_apis::Result::SUCCESS != result_code) {
- return;
- }
-
- // Add registered application to the policy db right after response sent to
- // mobile to be able to check all other API according to app permissions
- application_manager::ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
- LOG4CXX_ERROR(logger_,
- "Application with connection key " << connection_key()
- << " is not registered.");
- return;
- }
-
- SetHeartBeatTimeout(connection_key(), application->policy_app_id());
-}
-
-void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
- uint32_t connection_key, const std::string& mobile_app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- policy::PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- if (policy_handler.PolicyEnabled()) {
- const uint32_t timeout = policy_handler.HeartBeatTimeout(mobile_app_id);
- if (timeout > 0) {
- application_manager_.connection_handler().SetHeartBeatTimeout(
- connection_key, timeout);
- }
- } else {
- LOG4CXX_INFO(logger_, "Policy is turn off");
- }
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc
deleted file mode 100644
index a7c2db0e65..0000000000
--- a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/reset_global_properties_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {}
-
-void ResetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- size_t obj_length =
- (*message_)[strings::msg_params][strings::properties].length();
- // if application waits for sending ttsGlobalProperties need to remove this
- // application from tts_global_properties_app_list_
- LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList");
- application_manager_.RemoveAppFromTTSGlobalPropertiesList(app_id);
-
- bool helpt_promt = false;
- bool timeout_prompt = false;
- bool vr_help_title_items = false;
- bool menu_name = false;
- bool menu_icon = false;
- bool is_key_board_properties = false;
- int number_of_reset_vr = 0;
- mobile_apis::GlobalProperty::eType global_property =
- mobile_apis::GlobalProperty::INVALID_ENUM;
-
- for (size_t i = 0; i < obj_length; ++i) {
- global_property = static_cast<mobile_apis::GlobalProperty::eType>(
- (*message_)[strings::msg_params][strings::properties][i].asInt());
-
- if (mobile_apis::GlobalProperty::HELPPROMPT == global_property) {
- helpt_promt = ResetHelpPromt(app);
- } else if (mobile_apis::GlobalProperty::TIMEOUTPROMPT == global_property) {
- timeout_prompt = ResetTimeoutPromt(app);
- } else if (((mobile_apis::GlobalProperty::VRHELPTITLE == global_property) ||
- (mobile_apis::GlobalProperty::VRHELPITEMS ==
- global_property)) &&
- (0 == number_of_reset_vr)) {
- ++number_of_reset_vr;
- vr_help_title_items = ResetVrHelpTitleItems(app);
- } else if (mobile_apis::GlobalProperty::MENUNAME == global_property) {
- menu_name = true;
- } else if (mobile_apis::GlobalProperty::MENUICON == global_property) {
- menu_icon = true;
- } else if (mobile_apis::GlobalProperty::KEYBOARDPROPERTIES ==
- global_property) {
- is_key_board_properties = true;
- }
- }
-
- if (vr_help_title_items || menu_name || menu_icon ||
- is_key_board_properties) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- }
-
- if (timeout_prompt || helpt_promt) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- }
-
- app->set_reset_global_properties_active(true);
-
- if (vr_help_title_items || menu_name || menu_icon ||
- is_key_board_properties) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (vr_help_title_items) {
- smart_objects::SmartObjectSPtr vr_help =
- MessageHelper::CreateAppVrHelp(app);
- if (!vr_help) {
- return;
- }
- msg_params = *vr_help;
- }
- if (menu_name) {
- msg_params[hmi_request::menu_title] = "";
- app->set_menu_title(msg_params[hmi_request::menu_title]);
- }
- // TODO(DT): clarify the sending parameter menuIcon
- // if (menu_icon) {
- //}
- if (is_key_board_properties) {
- smart_objects::SmartObject key_board_properties =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- key_board_properties[strings::language] =
- static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
- key_board_properties[hmi_request::keyboard_layout] =
- static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
-
- // Look for APPLINK-4432 for details.
- /*smart_objects::SmartObject limited_character_list =
- smart_objects::SmartObject(
- smart_objects::SmartType_Array);
- limited_character_list[0] = "";
- key_board_properties[hmi_request::limited_character_list] =
- limited_character_list;*/
-
- key_board_properties[hmi_request::auto_complete_text] = "";
- msg_params[hmi_request::keyboard_properties] = key_board_properties;
- }
-
- msg_params[strings::app_id] = app->app_id();
- SendHMIRequest(
- hmi_apis::FunctionID::UI_SetGlobalProperties, &msg_params, true);
- }
-
- if (timeout_prompt || helpt_promt) {
- // create ui request
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (helpt_promt) {
- msg_params[strings::help_prompt] = (*app->help_prompt());
- }
-
- if (timeout_prompt) {
- msg_params[strings::timeout_prompt] = (*app->timeout_prompt());
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- SendHMIRequest(
- hmi_apis::FunctionID::TTS_SetGlobalProperties, &msg_params, true);
- }
-}
-
-bool ResetGlobalPropertiesRequest::ResetHelpPromt(
- application_manager::ApplicationSharedPtr app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
- smart_objects::SmartObject so_help_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- app->set_help_prompt(so_help_prompt);
- return true;
-}
-
-bool ResetGlobalPropertiesRequest::ResetTimeoutPromt(
- application_manager::ApplicationSharedPtr const app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
-
- const std::vector<std::string>& time_out_promt =
- application_manager_.get_settings().time_out_promt();
-
- smart_objects::SmartObject so_time_out_promt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- for (uint32_t i = 0; i < time_out_promt.size(); ++i) {
- smart_objects::SmartObject timeoutPrompt =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- timeoutPrompt[strings::text] = time_out_promt[i];
- timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
- so_time_out_promt[i] = timeoutPrompt;
- }
-
- app->set_timeout_prompt(so_time_out_promt);
-
- return true;
-}
-
-bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems(
- application_manager::ApplicationSharedPtr const app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
- app->reset_vr_help_title();
- app->reset_vr_help();
-
- return true;
-}
-
-void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- LOG4CXX_DEBUG(logger_, "Waiting for remaining responses");
- return;
- }
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string response_info;
- const bool result = PrepareResponseParameters(result_code, response_info);
-
- SendResponse(result,
- static_cast<mobile_apis::Result::eType>(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
-}
-
-bool ResetGlobalPropertiesRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-bool ResetGlobalPropertiesRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& out_result_code,
- std::string& out_response_info) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- bool result = false;
- ResponseInfo ui_properties_info(
- ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
- ResponseInfo tts_properties_info(
- tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
-
- HmiInterfaces::InterfaceState tts_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_TTS);
-
- if (hmi_apis::Common_Result::SUCCESS == ui_result_ &&
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_ &&
- HmiInterfaces::STATE_AVAILABLE == tts_interface_state) {
- result = true;
- out_result_code = mobile_apis::Result::WARNINGS;
- out_response_info = "Unsupported phoneme type sent in a prompt";
- } else {
- result =
- PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
- out_result_code =
- PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
- out_response_info = MergeInfos(tts_properties_info,
- tts_response_info_,
- ui_properties_info,
- ui_response_info_);
- }
-
- return result;
-}
-
-bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
- return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
- IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc
deleted file mode 100644
index c621977868..0000000000
--- a/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/reset_global_properties_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {}
-
-void ResetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
deleted file mode 100644
index b0b2d5f464..0000000000
--- a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include "application_manager/commands/mobile/scrollable_message_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ScrollableMessageRequest::ScrollableMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
-
-ScrollableMessageRequest::~ScrollableMessageRequest() {}
-
-bool ScrollableMessageRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
- default_timeout_ =
- (*message_)[strings::msg_params][strings::timeout].asUInt();
- } else {
- const int32_t def_value = 30000;
- default_timeout_ = def_value;
- }
-
- return true;
-}
-
-void ScrollableMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
- SendResponse(false, processing_result);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[hmi_request::message_text][hmi_request::field_name] =
- static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::scrollableMessageBody);
- msg_params[hmi_request::message_text][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::scroll_message_body];
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::timeout] = default_timeout_;
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[strings::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_ScrollableMessage, &msg_params, true);
-}
-
-void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- case hmi_apis::FunctionID::UI_ScrollableMessage: {
- LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
-
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
-
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
deleted file mode 100644
index a5b16bdb70..0000000000
--- a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/scrollable_message_response.h"
-
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ScrollableMessageResponse::ScrollableMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-void ScrollableMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- (*message_)[strings::msg_params][strings::result_code].asInt());
- ApplicationSharedPtr application = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asInt());
- if ((mobile_apis::Result::REJECTED != result_code) && application) {
- application->UnsubscribeFromSoftButtons(
- (*message_)[strings::params][strings::function_id].asInt());
- }
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
deleted file mode 100644
index 569eba6c02..0000000000
--- a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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/mobile/send_haptic_data_request.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-SendHapticDataRequest::SendHapticDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SendHapticDataRequest::~SendHapticDataRequest() {}
-
-void SendHapticDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (app->is_navi() || app->mobile_projection_enabled()) {
- SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true);
- } else {
- SendResponse(false,
- mobile_apis::Result::DISALLOWED,
- "Application is not of type Navigation or Mobile Projection");
- }
-}
-
-void SendHapticDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SendHapticData: {
- mobile_apis::Result::eType result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
-
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc
deleted file mode 100644
index c8649d34af..0000000000
--- a/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. 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/mobile/send_haptic_data_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SendHapticDataResponse::SendHapticDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SendHapticDataResponse::~SendHapticDataResponse() {}
-
-void SendHapticDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_location_request.cc b/src/components/application_manager/src/commands/mobile/send_location_request.cc
deleted file mode 100644
index 54664a8771..0000000000
--- a/src/components/application_manager/src/commands/mobile/send_location_request.cc
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include <algorithm>
-#include "application_manager/commands/mobile/send_location_request.h"
-#include "application_manager/message_helper.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SendLocationRequest::SendLocationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SendLocationRequest::~SendLocationRequest() {}
-
-void SendLocationRequest::Run() {
- using namespace hmi_apis;
- using smart_objects::SmartObject;
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
- if (msg_params.keyExists(strings::delivery_mode)) {
- const RPCParams& allowed_params = parameters_permissions().allowed_params;
-
- if (helpers::in_range(allowed_params, strings::delivery_mode)) {
- msg_params.erase(strings::delivery_mode);
- }
- }
-
- std::vector<Common_TextFieldName::eType> fields_to_check;
- if (msg_params.keyExists(strings::location_name)) {
- fields_to_check.push_back(Common_TextFieldName::locationName);
- }
- if (msg_params.keyExists(strings::location_description)) {
- fields_to_check.push_back(Common_TextFieldName::locationDescription);
- }
- if (msg_params.keyExists(strings::address_lines)) {
- fields_to_check.push_back(Common_TextFieldName::addressLines);
- }
- if (msg_params.keyExists(strings::phone_number)) {
- fields_to_check.push_back(Common_TextFieldName::phoneNumber);
- }
-
- if (!CheckHMICapabilities(fields_to_check)) {
- SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "Strings contain invalid characters");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (msg_params.keyExists(strings::address)) {
- const utils::custom_string::CustomString& address =
- msg_params[strings::address].asCustomString();
- if (address.empty()) {
- msg_params.erase(strings::address);
- }
- }
-
- if (!CheckFieldsCompatibility()) {
- LOG4CXX_ERROR(logger_, "CheckFieldsCompatibility failed");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (msg_params.keyExists(strings::location_image)) {
- mobile_apis::Result::eType verification_result =
- mobile_apis::Result::SUCCESS;
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::location_image],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map);
- request_msg_params = msg_params;
- request_msg_params[strings::app_id] = app->hmi_app_id();
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_SendLocation, &request_msg_params, true);
-}
-
-void SendLocationRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- const smart_objects::SmartObject& message = event.smart_object();
- if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) {
- LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- const Common_Result::eType result_code = static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::params]));
- return;
- }
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
-}
-
-bool SendLocationRequest::CheckFieldsCompatibility() {
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
- MessageHelper::PrintSmartObject(msg_params);
- const bool longitude_degrees_exist =
- msg_params.keyExists(strings::longitude_degrees);
- const bool latitude_degrees_exist =
- msg_params.keyExists(strings::latitude_degrees);
- const bool address_exist = msg_params.keyExists(strings::address);
-
- if (latitude_degrees_exist ^ longitude_degrees_exist) {
- LOG4CXX_DEBUG(logger_,
- "latitude and longitude should be provided only in pair");
- return false;
- }
-
- if (!address_exist && !longitude_degrees_exist && !latitude_degrees_exist) {
- LOG4CXX_DEBUG(logger_,
- "address or latitude/longtitude should should be provided");
- return false;
- }
- return true;
-}
-void insert_if_contains(
- const smart_objects::SmartObject& msg_params,
- const std::string& param_key,
- std::vector<utils::custom_string::CustomString>& output_vector) {
- if (msg_params.keyExists(param_key)) {
- output_vector.push_back(msg_params[param_key].asCustomString());
- }
-}
-
-bool SendLocationRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- std::vector<utils::custom_string::CustomString> fields_to_check;
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
- insert_if_contains(msg_params, strings::location_name, fields_to_check);
- insert_if_contains(
- msg_params, strings::location_description, fields_to_check);
- insert_if_contains(msg_params, strings::phone_number, fields_to_check);
-
- if (msg_params.keyExists(strings::address_lines)) {
- const smart_objects::SmartArray* al_array =
- msg_params[strings::address_lines].asArray();
- smart_objects::SmartArray::const_iterator it_al = al_array->begin();
- smart_objects::SmartArray::const_iterator it_al_end = al_array->end();
- for (; it_al != it_al_end; ++it_al) {
- const utils::custom_string::CustomString& val = (*it_al).asCustomString();
- fields_to_check.push_back(val);
- }
- }
-
- if (msg_params.keyExists(strings::address)) {
- const smart_objects::SmartObject& address_so = msg_params[strings::address];
- insert_if_contains(address_so, strings::country_name, fields_to_check);
- insert_if_contains(address_so, strings::country_code, fields_to_check);
- insert_if_contains(address_so, strings::postal_code, fields_to_check);
- insert_if_contains(
- address_so, strings::administrative_area, fields_to_check);
- insert_if_contains(address_so, strings::locality, fields_to_check);
- insert_if_contains(address_so, strings::sub_locality, fields_to_check);
- insert_if_contains(address_so, strings::thoroughfare, fields_to_check);
- insert_if_contains(address_so, strings::sub_thoroughfare, fields_to_check);
- }
-
- std::vector<utils::custom_string::CustomString>::iterator it =
- fields_to_check.begin();
- for (; it != fields_to_check.end(); ++it) {
- const std::string& str = it->AsMBString();
- if (!CheckSyntax(str, false)) {
- LOG4CXX_ERROR(logger_,
- "string '" << str << "'' contains invalid characters");
- return true;
- }
- }
- return false;
-}
-
-bool SendLocationRequest::CheckHMICapabilities(
- std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names) {
- using namespace smart_objects;
- using namespace hmi_apis;
- if (fields_names.empty()) {
- return true;
- }
-
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- if (!hmi_capabilities.is_ui_cooperating()) {
- LOG4CXX_ERROR(logger_, "UI is not supported.");
- return false;
- }
-
- if (hmi_capabilities.display_capabilities()) {
- const SmartObject disp_cap = (*hmi_capabilities.display_capabilities());
- const SmartObject& text_fields =
- disp_cap.getElement(hmi_response::text_fields);
- const size_t len = text_fields.length();
- for (size_t i = 0; i < len; ++i) {
- const SmartObject& text_field = text_fields[i];
- const Common_TextFieldName::eType filed_name =
- static_cast<Common_TextFieldName::eType>(
- text_field.getElement(strings::name).asInt());
- const std::vector<Common_TextFieldName::eType>::iterator it =
- std::find(fields_names.begin(), fields_names.end(), filed_name);
- if (it != fields_names.end()) {
- fields_names.erase(it);
- }
- }
- }
-
- if (!fields_names.empty()) {
- LOG4CXX_ERROR(logger_, "Some fields are not supported by capabilities");
- return false;
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_location_response.cc b/src/components/application_manager/src/commands/mobile/send_location_response.cc
deleted file mode 100644
index 167642e390..0000000000
--- a/src/components/application_manager/src/commands/mobile/send_location_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/send_location_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SendLocationResponse::SendLocationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SendLocationResponse::~SendLocationResponse() {}
-
-void SendLocationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
deleted file mode 100644
index ee544e956a..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/mobile/set_app_icon_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetAppIconRequest::SetAppIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , is_icons_saving_enabled_(false) {
- const std::string path =
- application_manager_.get_settings().app_icons_folder();
- is_icons_saving_enabled_ = file_system::IsWritingAllowed(path) &&
- file_system::IsReadingAllowed(path);
-}
-
-SetAppIconRequest::~SetAppIconRequest() {}
-
-void SetAppIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- if (!file_system::IsFileNameValid(sync_file_name)) {
- const std::string err_msg = "Sync file name contains forbidden symbols.";
- LOG4CXX_ERROR(logger_, err_msg);
- SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
- return;
- }
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += app->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (!file_system::FileExists(full_file_path)) {
- LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (is_icons_saving_enabled_) {
- CopyToIconStorage(full_file_path);
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::sync_file_name] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- // Panasonic requres unchanged path value without encoded special characters
- const std::string full_file_path_for_hmi =
- file_system::ConvertPathForURL(full_file_path);
-
- msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
-
- // TODO(VS): research why is image_type hardcoded
- msg_params[strings::sync_file_name][strings::image_type] =
- static_cast<int32_t>(SetAppIconRequest::ImageType::DYNAMIC);
-
- // for further use in on_event function
- (*message_)[strings::msg_params][strings::sync_file_name] =
- msg_params[strings::sync_file_name];
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
-}
-
-void SetAppIconRequest::CopyToIconStorage(
- const std::string& path_to_file) const {
- if (!(application_manager_.protocol_handler()
- .get_settings()
- .max_supported_protocol_version() >=
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)) {
- LOG4CXX_WARN(logger_,
- "Icon copying skipped, since protocol ver. 4 is not enabled.");
- return;
- }
-
- std::vector<uint8_t> file_content;
- if (!file_system::ReadBinaryFile(path_to_file, file_content)) {
- LOG4CXX_ERROR(logger_, "Can't read icon file: " << path_to_file);
- return;
- }
-
- const std::string icon_storage =
- application_manager_.get_settings().app_icons_folder();
- const uint64_t storage_max_size = static_cast<uint64_t>(
- application_manager_.get_settings().app_icons_folder_max_size());
- const uint64_t file_size = file_system::FileSize(path_to_file);
-
- if (storage_max_size < file_size) {
- LOG4CXX_ERROR(logger_,
- "Icon size (" << file_size << ") is bigger, than "
- " icons storage maximum size ("
- << storage_max_size << ")."
- "Copying skipped.");
- return;
- }
-
- const uint64_t storage_size =
- static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
- if (storage_max_size < (file_size + storage_size)) {
- const uint32_t icons_amount =
- application_manager_.get_settings().app_icons_amount_to_remove();
-
- if (!icons_amount) {
- LOG4CXX_DEBUG(logger_,
- "No icons will be deleted, since amount icons to remove "
- "is zero. Icon saving skipped.");
- return;
- }
-
- while (!IsEnoughSpaceForIcon(file_size)) {
- RemoveOldestIcons(icon_storage, icons_amount);
- }
- }
- ApplicationConstSharedPtr app =
- application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(
- logger_,
- "Can't get application for connection key: " << connection_key());
- return;
- }
-
- const std::string icon_path = icon_storage + "/" + app->policy_app_id();
- if (!file_system::CreateFile(icon_path)) {
- LOG4CXX_ERROR(logger_, "Can't create icon: " << icon_path);
- return;
- }
-
- if (!file_system::Write(icon_path, file_content)) {
- LOG4CXX_ERROR(logger_, "Can't write icon: " << icon_path);
- return;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Icon was successfully copied from :" << path_to_file << " to "
- << icon_path);
-
- return;
-}
-
-void SetAppIconRequest::RemoveOldestIcons(const std::string& storage,
- const uint32_t icons_amount) const {
- const std::vector<std::string> icons_list = file_system::ListFiles(storage);
- std::map<uint64_t, std::string> icon_modification_time;
- std::vector<std::string>::const_iterator it = icons_list.begin();
- for (; it != icons_list.end(); ++it) {
- const std::string file_name = *it;
- const std::string file_path = storage + "/" + file_name;
- if (!file_system::FileExists(file_path)) {
- continue;
- }
- const uint64_t time = file_system::GetFileModificationTime(file_path);
- icon_modification_time[time] = file_name;
- }
-
- for (size_t counter = 0; counter < icons_amount; ++counter) {
- if (!icon_modification_time.size()) {
- LOG4CXX_ERROR(logger_, "No more icons left for deletion.");
- return;
- }
- const std::string file_name = icon_modification_time.begin()->second;
- const std::string file_path = storage + "/" + file_name;
- if (!file_system::DeleteFile(file_path)) {
- LOG4CXX_DEBUG(logger_, "Error while deleting icon " << file_path);
- }
- icon_modification_time.erase(icon_modification_time.begin());
- LOG4CXX_DEBUG(logger_,
- "Old icon " << file_path << " was deleted successfully.");
- }
-}
-
-bool SetAppIconRequest::IsEnoughSpaceForIcon(const uint64_t icon_size) const {
- const std::string icon_storage =
- application_manager_.get_settings().app_icons_folder();
- const uint64_t storage_max_size = static_cast<uint64_t>(
- application_manager_.get_settings().app_icons_folder_max_size());
- const uint64_t storage_size =
- static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
- return storage_max_size >= (icon_size + storage_size);
-}
-
-void SetAppIconRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- std::string response_info;
- GetInfo(message, response_info);
- if (result) {
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
-
- if (!message_.valid() || !app.valid()) {
- LOG4CXX_ERROR(logger_, "NULL pointer.");
- return;
- }
-
- const std::string& path =
- (*message_)[strings::msg_params][strings::sync_file_name]
- [strings::value].asString();
- app->set_app_icon_path(path);
-
- LOG4CXX_INFO(logger_,
- "Icon path was set to '" << app->app_icon_path() << "'");
- }
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc
deleted file mode 100644
index 29f3950ffc..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_app_icon_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetAppIconResponse::SetAppIconResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetAppIconResponse::~SetAppIconResponse() {}
-
-void SetAppIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc
deleted file mode 100644
index 38b62ce731..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_display_layout_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetDisplayLayoutRequest::SetDisplayLayoutRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {}
-
-void SetDisplayLayoutRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationConstSharedPtr app =
- application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- (*message_)[strings::msg_params][strings::app_id] = app->app_id();
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout,
- &((*message_)[strings::msg_params]),
- true);
-}
-
-void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetDisplayLayout: {
- LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool response_success = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- std::string info;
- GetInfo(message, info);
- smart_objects::SmartObject msg_params = message[strings::msg_params];
- if (response_success) {
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
-
- // in case templates_available is empty copy from hmi capabilities
- if (msg_params.keyExists(hmi_response::display_capabilities)) {
- if (0 ==
- msg_params[hmi_response::display_capabilities]
- [hmi_response::templates_available].length()) {
- msg_params[hmi_response::display_capabilities]
- [hmi_response::templates_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::templates_available);
- }
- }
- }
- SendResponse(response_success,
- MessageHelper::HMIToMobileResult(result_code),
- info.empty() ? NULL : info.c_str(),
- &msg_params);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc
deleted file mode 100644
index b5e53803c8..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_display_layout_response.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetDisplayLayoutResponse::SetDisplayLayoutResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {}
-
-void SetDisplayLayoutResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
deleted file mode 100644
index e811f5d154..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- Copyright (c) 2015, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include <algorithm>
-#include "application_manager/commands/mobile/set_global_properties_request.h"
-
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetGlobalPropertiesRequest::SetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , is_ui_send_(false)
- , is_tts_send_(false)
- , is_ui_received_(false)
- , is_tts_received_(false)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {}
-
-void SetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "No application associated with connection key "
- << connection_key());
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (!ValidateConditionalMandatoryParameters(msg_params)) {
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "There are no parameters present in request.");
- return;
- }
-
- mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
-
- if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) {
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::menu_icon],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(
- logger_, "MessageHelper::VerifyImage return " << verification_result);
- SendResponse(false, verification_result);
- return;
- }
- }
- // Check for image file(s) in vrHelpItem
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- if (mobile_apis::Result::SUCCESS !=
- MessageHelper::VerifyImageVrHelpItems(
- (*message_)[strings::msg_params][strings::vr_help],
- app,
- application_manager_)) {
- LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "White spaces found");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // if application waits for sending ttsGlobalProperties need to remove this
- // application from tts_global_properties_app_list_
- application_manager_.RemoveAppFromTTSGlobalPropertiesList(connection_key());
- bool is_help_prompt_present = msg_params.keyExists(strings::help_prompt);
- bool is_timeout_prompt_present =
- msg_params.keyExists(strings::timeout_prompt);
- bool is_vr_help_title_present = msg_params.keyExists(strings::vr_help_title);
- bool is_vr_help_present = msg_params.keyExists(strings::vr_help);
-
- // check VR params
- if (is_vr_help_title_present ^ is_vr_help_present) {
- LOG4CXX_ERROR(logger_,
- "Reject because of vr_help or vr_help_title only provided");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- /* Need to set flags before sending request to HMI
- * for correct processing this flags in method on_event */
- if (is_help_prompt_present || is_timeout_prompt_present) {
- is_tts_send_ = true;
- }
- if (is_vr_help_title_present && is_vr_help_present) {
- LOG4CXX_DEBUG(logger_, "VRHelp params presents");
-
- if (!CheckVrHelpItemsOrder(msg_params[strings::vr_help])) {
- LOG4CXX_ERROR(logger_,
- "VR Help Items contains nonsequential positions"
- << " (e.g. [1,2,4]) or not started from 1");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- PrepareUIRequestVRHelpData(app, msg_params, params);
- PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
-
- params[strings::app_id] = app->app_id();
- SendUIRequest(params, true);
- } else {
- LOG4CXX_DEBUG(logger_, "VRHelp params does not present");
- DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present);
-
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (ValidateVRHelpTitle(app->vr_help_title())) {
- LOG4CXX_DEBUG(logger_, "App already contains VRHelp data");
- } else {
- if (!PrepareUIRequestDefaultVRHelpData(app, params)) {
- LOG4CXX_ERROR(logger_, "default VRHElp data could not be generated");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
- PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
-
- // Preparing data
- if (params.empty()) {
- LOG4CXX_DEBUG(logger_, "No UI info provided");
- } else {
- params[strings::app_id] = app->app_id();
- SendUIRequest(params, true);
- }
- }
-
- // check TTS params
- if (is_help_prompt_present || is_timeout_prompt_present) {
- LOG4CXX_DEBUG(logger_, "TTS params presents");
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (is_help_prompt_present) {
- app->set_help_prompt(msg_params.getElement(strings::help_prompt));
- params[strings::help_prompt] = (*app->help_prompt());
- }
-
- if (is_timeout_prompt_present) {
- app->set_timeout_prompt(msg_params.getElement(strings::timeout_prompt));
- params[strings::timeout_prompt] = (*app->timeout_prompt());
- }
-
- params[strings::app_id] = app->app_id();
- SendTTSRequest(params, true);
- }
-}
-
-bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder(
- const smart_objects::SmartObject& vr_help) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(vr_help.getType() == smart_objects::SmartType_Array, false);
- const size_t vr_help_length = vr_help.length();
- DCHECK_OR_RETURN(vr_help_length > 0, false);
-
- for (size_t j = 0; j < vr_help_length; ++j) {
- const size_t position =
- vr_help.getElement(j).getElement(strings::position).asUInt();
- // Elements shall start from 1 and increment one by one
- if (position != (j + 1)) {
- LOG4CXX_ERROR(logger_,
- "VR help items order is wrong"
- << " at " << j << ", position value:" << position);
- return false;
- }
- }
- return true;
-}
-
-void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- is_tts_received_ = true;
- tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- LOG4CXX_DEBUG(logger_, "Continue waiting for response");
- return;
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string response_info;
- const bool result = PrepareResponseParameters(result_code, response_info);
-
- // TODO{ALeshin} APPLINK-15858. connection_key removed during SendResponse
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
-}
-
-bool SetGlobalPropertiesRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-bool SetGlobalPropertiesRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- ResponseInfo ui_properties_info(
- ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
-
- ResponseInfo tts_properties_info(
- tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
- const bool result =
- PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
- if (result &&
- (HmiInterfaces::STATE_AVAILABLE == tts_properties_info.interface_state) &&
- (tts_properties_info.is_unsupported_resource)) {
- result_code = mobile_apis::Result::WARNINGS;
- tts_response_info_ = "Unsupported phoneme type sent in a prompt";
- info = MergeInfos(tts_properties_info,
- tts_response_info_,
- ui_properties_info,
- ui_response_info_);
- return result;
- }
- result_code =
- PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
- info = MergeInfos(tts_properties_info,
- tts_response_info_,
- ui_properties_info,
- ui_response_info_);
- return result;
-}
-
-bool SetGlobalPropertiesRequest::ValidateVRHelpTitle(
- const smart_objects::SmartObject* const vr_help_so_ptr) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (vr_help_so_ptr) {
- const std::string& vr_help = vr_help_so_ptr->asString();
- LOG4CXX_TRACE(logger_, "App contains vr_help_title: \"" << vr_help << '"');
- return !vr_help.empty();
- }
- return false;
-}
-
-void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(app);
-
- app->set_vr_help_title(msg_params.getElement(strings::vr_help_title));
- app->set_vr_help(msg_params.getElement(strings::vr_help));
-
- out_params[strings::vr_help_title] = (*app->vr_help_title());
- out_params[strings::vr_help] = (*app->vr_help());
-}
-
-bool SetGlobalPropertiesRequest::PrepareUIRequestDefaultVRHelpData(
- const ApplicationSharedPtr app, smart_objects::SmartObject& out_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(app, false);
-
- LOG4CXX_DEBUG(logger_, "Generate default VRHelp data");
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& cmdMap = accessor.GetData();
-
- int32_t index = 0;
- smart_objects::SmartObject vr_help_items;
- for (CommandsMap::const_iterator command_it = cmdMap.begin();
- cmdMap.end() != command_it;
- ++command_it) {
- const smart_objects::SmartObject& command = *command_it->second;
- if (!command.keyExists(strings::vr_commands)) {
- LOG4CXX_ERROR(logger_, "VR synonyms are empty");
- return false;
- }
- // use only first
- vr_help_items[index][strings::position] = (index + 1);
- vr_help_items[index++][strings::text] =
- (*command_it->second)[strings::vr_commands][0];
- }
-
- app->set_vr_help_title(smart_objects::SmartObject(app->name()));
-
- out_params[strings::vr_help_title] = (*app->vr_help_title());
- if (vr_help_items.length() > 0) {
- app->set_vr_help(vr_help_items);
- out_params[strings::vr_help] = (*app->vr_help());
- }
- return true;
-}
-
-void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(app);
-
- const bool is_menu_title_present =
- msg_params.keyExists(hmi_request::menu_title);
- const bool is_menu_icon_present =
- msg_params.keyExists(hmi_request::menu_icon);
- const bool is_keyboard_props_present =
- msg_params.keyExists(hmi_request::keyboard_properties);
-
- if (is_menu_title_present) {
- out_params[hmi_request::menu_title] =
- msg_params[hmi_request::menu_title].asString();
- app->set_menu_title(msg_params[hmi_request::menu_title]);
- }
- if (is_menu_icon_present) {
- out_params[hmi_request::menu_icon] = msg_params[hmi_request::menu_icon];
- app->set_menu_icon(msg_params[hmi_request::menu_icon]);
- }
- if (is_keyboard_props_present) {
- out_params[hmi_request::keyboard_properties] =
- msg_params[hmi_request::keyboard_properties];
- app->set_keyboard_props(msg_params[hmi_request::keyboard_properties]);
- }
-}
-
-void SetGlobalPropertiesRequest::SendTTSRequest(
- const smart_objects::SmartObject& params, bool use_events) {
- LOG4CXX_AUTO_TRACE(logger_);
- is_tts_send_ = true;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- SendHMIRequest(
- hmi_apis::FunctionID::TTS_SetGlobalProperties, &params, use_events);
-}
-
-void SetGlobalPropertiesRequest::SendUIRequest(
- const smart_objects::SmartObject& params, bool use_events) {
- LOG4CXX_AUTO_TRACE(logger_);
- is_ui_send_ = true;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(
- hmi_apis::FunctionID::UI_SetGlobalProperties, &params, use_events);
-}
-
-bool SetGlobalPropertiesRequest::IsPendingResponseExist() {
- return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
-}
-
-bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(
- const smart_objects::SmartObject& params) {
- LOG4CXX_AUTO_TRACE(logger_);
- return params.keyExists(strings::help_prompt) ||
- params.keyExists(strings::timeout_prompt) ||
- params.keyExists(strings::vr_help_title) ||
- params.keyExists(strings::vr_help) ||
- params.keyExists(strings::menu_title) ||
- params.keyExists(strings::menu_icon) ||
- params.keyExists(strings::keyboard_properties);
-}
-
-bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str;
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- if (msg_params.keyExists(strings::help_prompt)) {
- const smart_objects::SmartArray* hp_array =
- msg_params[strings::help_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
- smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
-
- for (; it_hp != it_hp_end; ++it_hp) {
- str = (*it_hp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if (msg_params.keyExists(strings::timeout_prompt)) {
- const smart_objects::SmartArray* tp_array =
- msg_params[strings::timeout_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
- smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
-
- for (; it_tp != it_tp_end; ++it_tp) {
- str = (*it_tp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if (msg_params.keyExists(strings::vr_help)) {
- const smart_objects::SmartArray* vh_array =
- msg_params[strings::vr_help].asArray();
-
- smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
- smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
-
- for (; it_vh != it_vh_end; ++it_vh) {
- str = (*it_vh)[strings::text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_help text syntax check failed");
- return true;
- }
-
- if ((*it_vh).keyExists(strings::image)) {
- str = (*it_vh)[strings::image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid vr_help image value syntax check failed");
- return true;
- }
- } // if image exists
- } // for - vh_array iteration
- }
-
- if (msg_params.keyExists(strings::menu_icon)) {
- str = msg_params[strings::menu_icon][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu_icon value syntax check failed");
- return true;
- }
- }
-
- if (msg_params.keyExists(strings::vr_help_title)) {
- str = msg_params[strings::vr_help_title].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_help_title value syntax check failed");
- return true;
- }
- }
-
- if (msg_params.keyExists(strings::menu_title)) {
- str = msg_params[strings::menu_title].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu_title value syntax check failed");
- return true;
- }
- }
-
- if (msg_params.keyExists(strings::keyboard_properties)) {
- if (msg_params[strings::keyboard_properties].keyExists(
- strings::limited_character_list)) {
- const smart_objects::SmartArray* lcl_array =
- msg_params[strings::keyboard_properties]
- [strings::limited_character_list].asArray();
-
- smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin();
- smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end();
-
- for (; it_lcl != it_lcl_end; ++it_lcl) {
- str = (*it_lcl).asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid keyboard_properties "
- "limited_character_list syntax check failed");
- return true;
- }
- }
- }
-
- if (msg_params[strings::keyboard_properties].keyExists(
- strings::auto_complete_text)) {
- str =
- msg_params[strings::keyboard_properties][strings::auto_complete_text]
- .asCharArray();
-
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid keyboard_properties "
- "auto_complete_text syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc
deleted file mode 100644
index 5cfbcb2d58..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_global_properties_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetGlobalPropertiesResponse::SetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {}
-
-void SetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_icon_request.cc
deleted file mode 100644
index 037de54456..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_icon_request.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_icon_request.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_impl.h"
-#include "config_profile/profile.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetIconRequest::SetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SetIconRequest::~SetIconRequest() {}
-
-void SetIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += app->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (!file_system::FileExists(full_file_path)) {
- LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::sync_file_name] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- // Panasonic requres unchanged path value without encoded special characters
- const std::string full_file_path_for_hmi =
- file_system::ConvertPathForURL(full_file_path);
-
- msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
-
- // TODO(VS): research why is image_type hardcoded
- msg_params[strings::sync_file_name][strings::image_type] =
- static_cast<int32_t>(SetIconRequest::ImageType::DYNAMIC);
-
- // for further use in on_event function
- (*message_)[strings::msg_params][strings::sync_file_name] =
- msg_params[strings::sync_file_name];
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
-}
-
-void SetIconRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- bool result = mobile_apis::Result::SUCCESS == result_code;
-
- if (result) {
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
-
- const std::string path =
- (*message_)[strings::msg_params][strings::sync_file_name]
- [strings::value].asString();
- app->set_app_icon_path(path);
-
- LOG4CXX_INFO(logger_,
- "Icon path was set to '" << app->app_icon_path() << "'");
- }
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_response.cc b/src/components/application_manager/src/commands/mobile/set_icon_response.cc
deleted file mode 100644
index c140d04f51..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_icon_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_icon_response.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetIconResponse::SetIconResponse(const MessageSharedPtr& message,
- ApplicationManager& app_man)
- : CommandResponseImpl(message, app_man) {}
-
-SetIconResponse::~SetIconResponse() {}
-
-void SetIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc
deleted file mode 100644
index 54727abe01..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetMediaClockRequest::SetMediaClockRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SetMediaClockRequest::~SetMediaClockRequest() {}
-
-void SetMediaClockRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if (!app->is_media_application()) {
- LOG4CXX_ERROR(logger_, "Application is not media application");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (isDataValid()) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- // copy entirely msg
- msg_params = (*message_)[strings::msg_params];
- msg_params[strings::app_id] = app->app_id();
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
-
- SendHMIRequest(
- hmi_apis::FunctionID::UI_SetMediaClockTimer, &msg_params, true);
- } else {
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- }
-}
-
-void SetMediaClockRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- std::string response_info;
- GetInfo(message, response_info);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-bool SetMediaClockRequest::isDataValid() {
- smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
- mobile_apis::UpdateMode::eType update_mode =
- static_cast<mobile_apis::UpdateMode::eType>(
- msg_params[strings::update_mode].asUInt());
-
- if (update_mode == mobile_apis::UpdateMode::COUNTUP ||
- update_mode == mobile_apis::UpdateMode::COUNTDOWN) {
- if (!msg_params.keyExists(strings::start_time)) {
- LOG4CXX_INFO(logger_, "Invalid data");
- return false;
- }
-
- if (msg_params.keyExists(strings::end_time)) {
- unsigned int start_time_in_seconds = 0;
- start_time_in_seconds =
- (msg_params[strings::start_time][strings::hours].asUInt()) * 3600;
- start_time_in_seconds +=
- (msg_params[strings::start_time][strings::minutes].asUInt()) * 60;
- start_time_in_seconds +=
- (msg_params[strings::start_time][strings::seconds].asUInt());
-
- unsigned int end_time_in_seconds = 0;
- end_time_in_seconds =
- (msg_params[strings::end_time][strings::hours].asUInt()) * 3600;
- end_time_in_seconds +=
- (msg_params[strings::end_time][strings::minutes].asUInt()) * 60;
- end_time_in_seconds +=
- (msg_params[strings::end_time][strings::seconds].asUInt());
-
- if (((end_time_in_seconds > start_time_in_seconds) &&
- (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) ||
- ((end_time_in_seconds < start_time_in_seconds) &&
- (update_mode == mobile_apis::UpdateMode::COUNTUP))) {
- LOG4CXX_INFO(logger_, "Invalid data");
- return false;
- }
- }
- }
-
- LOG4CXX_INFO(logger_, "Data is valid");
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc
deleted file mode 100644
index 30e802a1db..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_media_clock_timer_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetMediaClockTimerResponse::SetMediaClockTimerResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {}
-
-void SetMediaClockTimerResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc
deleted file mode 100644
index 42bfea4864..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cstring>
-#include "application_manager/commands/mobile/show_constant_tbt_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowConstantTBTRequest::ShowConstantTBTRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-ShowConstantTBTRequest::~ShowConstantTBTRequest() {}
-
-void ShowConstantTBTRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
- // SDLAQ-CRS-664, VC3.1
- if ((*message_)[strings::msg_params].empty()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params = (*message_)[strings::msg_params];
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming show constant TBT has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons(msg_params,
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, processing_result);
- return;
- }
-
- mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
- if (msg_params.keyExists(strings::turn_icon)) {
- verification_result = MessageHelper::VerifyImage(
- msg_params[strings::turn_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- if (msg_params.keyExists(strings::next_turn_icon)) {
- verification_result = MessageHelper::VerifyImage(
- msg_params[strings::next_turn_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- msg_params[hmi_request::navi_texts] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t index = 0;
- if (msg_params.keyExists(strings::navigation_text_1)) {
- // erase useless parametr
- msg_params.erase(strings::navigation_text_1);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText1);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::navigation_text_1];
- }
-
- if (msg_params.keyExists(strings::navigation_text_2)) {
- // erase useless param
- msg_params.erase(strings::navigation_text_2);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText2);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::navigation_text_2];
- }
-
- if (msg_params.keyExists(strings::eta)) {
- // erase useless param
- msg_params.erase(strings::eta);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::ETA);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::eta];
- }
-
- if (msg_params.keyExists(strings::total_distance)) {
- // erase useless param
- msg_params.erase(strings::total_distance);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::totalDistance);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::total_distance];
- }
-
- if (msg_params.keyExists(strings::time_to_destination)) {
- // erase useless param
- msg_params.erase(strings::time_to_destination);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::time_to_destination];
- }
-
- if (msg_params.keyExists(strings::soft_buttons)) {
- MessageHelper::SubscribeApplicationToSoftButton(
- msg_params, app, function_id());
- }
-
- app->set_tbt_show_command(msg_params);
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, true);
-}
-
-void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
- LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- const Common_Result::eType result_code =
- static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) {
- str = (*message_)[strings::msg_params][strings::turn_icon][strings::value]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid turn_icon value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::next_turn_icon)) {
- str = (*message_)[strings::msg_params][strings::next_turn_icon]
- [strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid next_turn_icon value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_1)) {
- str = (*message_)[strings::msg_params][strings::navigation_text_1]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid navigation_text_1 value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_2)) {
- str = (*message_)[strings::msg_params][strings::navigation_text_2]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid navigation_text_2 value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::eta)) {
- str = (*message_)[strings::msg_params][strings::eta].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid eta value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::total_distance)) {
- str =
- (*message_)[strings::msg_params][strings::total_distance].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid total_distance value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::time_to_destination)) {
- str = (*message_)[strings::msg_params][strings::time_to_destination]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid time_to_destination value syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc
deleted file mode 100644
index 80a36129cf..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/show_constant_tbt_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowConstantTBTResponse::ShowConstantTBTResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
-
- : CommandResponseImpl(message, application_manager) {}
-
-ShowConstantTBTResponse::~ShowConstantTBTResponse() {}
-
-void ShowConstantTBTResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc
deleted file mode 100644
index ad598efc1d..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_request.cc
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include <string.h>
-#include "application_manager/commands/mobile/show_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowRequest::ShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , core_result_code_(mobile_apis::Result::INVALID_ENUM) {}
-
-ShowRequest::~ShowRequest() {}
-
-void ShowRequest::HandleMetadata(const char* field_id,
- int32_t field_index,
- smart_objects::SmartObject& msg_params) {
- smart_objects::SmartObject& metadata_tags =
- (*message_)[strings::msg_params][strings::metadata_tags];
-
- if (metadata_tags.keyExists(field_id)) {
- if (field_index != -1) {
- msg_params[hmi_request::show_strings][field_index]
- [hmi_request::field_types] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- const size_t num_tags = metadata_tags[field_id].length();
- for (size_t i = 0; i < num_tags; ++i) {
- const int32_t current_tag = metadata_tags[field_id][i].asInt();
- msg_params[hmi_request::show_strings][field_index]
- [hmi_request::field_types][i] = current_tag;
- }
- } else {
- LOG4CXX_INFO(logger_,
- "metadata tag provided with no item for "
- << field_id << ", ignoring with warning");
- // tag provided with no item, ignore with warning
- if (mobile_apis::Result::INVALID_ENUM == core_result_code_) {
- core_result_code_ = mobile_apis::Result::WARNINGS;
- core_response_info_ =
- "Metadata tag was provided for a field with no data.";
- }
- }
- } else {
- LOG4CXX_INFO(logger_,
- "No metadata tagging provided for field: " << field_id);
- }
-}
-
-void ShowRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- // SDLAQ-CRS-494, VC3.1
- if ((*message_)[strings::msg_params].empty()) {
- LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (!CheckStringsOfShowRequest()) {
- LOG4CXX_ERROR(logger_, "Incorrect characters in string");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result = mobile_apis::Result::SUCCESS;
- if (((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
- ((*message_)[strings::msg_params][strings::soft_buttons].length() > 0)) {
- processing_result = MessageHelper::ProcessSoftButtons(
- (*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
- }
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "Processing of soft buttons failed.");
- SendResponse(false, processing_result);
- return;
- }
-
- mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
- if (((*message_)[strings::msg_params].keyExists(strings::graphic)) &&
- ((*message_)[strings::msg_params][strings::graphic][strings::value]
- .asString()).length()) {
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::graphic],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "Image verification failed.");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::secondary_graphic],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "Image verification failed.");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
-
- msg_params[hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t index = 0;
- int32_t main_field_1_index = -1;
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField1);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_1];
- main_field_1_index = index;
- ++index;
- }
-
- int32_t main_field_2_index = -1;
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField2);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_2];
- main_field_2_index = index;
- ++index;
- }
-
- int32_t main_field_3_index = -1;
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField3);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_3];
- main_field_3_index = index;
- ++index;
- }
-
- int32_t main_field_4_index = -1;
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField4);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_4];
- main_field_4_index = index;
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::metadata_tags)) {
- HandleMetadata(strings::main_field_1, main_field_1_index, msg_params);
- HandleMetadata(strings::main_field_2, main_field_2_index, msg_params);
- HandleMetadata(strings::main_field_3, main_field_3_index, msg_params);
- HandleMetadata(strings::main_field_4, main_field_4_index, msg_params);
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaClock);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::media_clock];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaTrack);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::media_track];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::statusBar);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::status_bar];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::alignment)) {
- msg_params[strings::alignment] =
- (*message_)[strings::msg_params][strings::alignment];
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
- msg_params[strings::graphic] =
- (*message_)[strings::msg_params][strings::graphic];
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
- msg_params[strings::secondary_graphic] =
- (*message_)[strings::msg_params][strings::secondary_graphic];
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[strings::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- if ((*message_)[strings::msg_params][strings::soft_buttons].length() == 0) {
- app->UnsubscribeFromSoftButtons(function_id());
- } else {
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
- msg_params[strings::custom_presets] =
- (*message_)[strings::msg_params][strings::custom_presets];
- }
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
-
- MessageSharedPtr persistentData = new smart_objects::SmartObject(msg_params);
- app->set_show_command(*persistentData);
-}
-
-void ShowRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_Show: {
- LOG4CXX_DEBUG(logger_, "Received UI_Show event.");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- std::string response_info;
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- GetInfo(message, response_info);
- if (hmi_apis::Common_Result::WARNINGS == result_code &&
- message[strings::params].keyExists(hmi_response::message)) {
- response_info =
- message[strings::params][hmi_response::message].asString();
- }
- mobile_apis::Result::eType converted_result_code =
- MessageHelper::HMIToMobileResult(result_code);
- if (mobile_apis::Result::SUCCESS == converted_result_code &&
- mobile_apis::Result::INVALID_ENUM != core_result_code_) {
- converted_result_code = core_result_code_;
- response_info = core_response_info_;
- }
- SendResponse(result,
- converted_result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event " << event.id());
- break;
- }
- }
-}
-
-bool ShowRequest::CheckStringsOfShowRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str;
-
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
- str = (*message_)[strings::msg_params][strings::main_field_4].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_4 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
- str = (*message_)[strings::msg_params][strings::main_field_3].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_3 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
- str = (*message_)[strings::msg_params][strings::main_field_2].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_2 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
- str = (*message_)[strings::msg_params][strings::main_field_1].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_1 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
- str = (*message_)[strings::msg_params][strings::status_bar].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid status_bar syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
- str = (*message_)[strings::msg_params][strings::media_clock].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid media_clock syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
- str = (*message_)[strings::msg_params][strings::media_track].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid media_track syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
- smart_objects::SmartObject& custom_presets_array =
- (*message_)[strings::msg_params][strings::custom_presets];
- for (size_t i = 0; i < custom_presets_array.length(); ++i) {
- str = custom_presets_array[i].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed");
- return false;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
- str = (*message_)[strings::msg_params][strings::graphic][strings::value]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid graphic value syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
- str = (*message_)[strings::msg_params][strings::secondary_graphic]
- [strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid secondary_graphic value syntax check failed");
- return false;
- }
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_response.cc b/src/components/application_manager/src/commands/mobile/show_response.cc
deleted file mode 100644
index 8027c908f1..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/show_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowResponse::ShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ShowResponse::~ShowResponse() {}
-
-void ShowResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc
deleted file mode 100644
index f98869b08f..0000000000
--- a/src/components/application_manager/src/commands/mobile/slider_request.cc
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/slider_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-#include "config_profile/profile.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SliderRequest::SliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
-
-SliderRequest::~SliderRequest() {}
-
-bool SliderRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
- default_timeout_ =
- application_manager_.get_settings().default_timeout() +
- (*message_)[strings::msg_params][strings::timeout].asUInt();
- }
-
- return true;
-}
-
-void SliderRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if ((*message_)[strings::msg_params][strings::num_ticks].asInt() <
- (*message_)[strings::msg_params][strings::position].asInt()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
- if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) {
- if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() !=
- (*message_)[strings::msg_params][strings::slider_footer].length()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "Incoming slider has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params = (*message_)[strings::msg_params];
- msg_params[strings::app_id] = application->app_id();
-
- if (!(*message_)[strings::msg_params].keyExists(strings::timeout)) {
- msg_params[strings::timeout] = default_timeout_;
- }
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true);
-}
-
-void SliderRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- using namespace smart_objects;
- using namespace hmi_apis;
-
- const SmartObject& message = event.smart_object();
-
- const event_engine::Event::EventID event_id = event.id();
- if (event_id == FunctionID::UI_OnResetTimeout) {
- LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- return;
- }
-
- if (event_id != FunctionID::UI_Slider) {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
-
- LOG4CXX_DEBUG(logger_, "Received UI_Slider event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- const Common_Result::eType response_code = static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- SmartObject response_msg_params = message[strings::msg_params];
-
- const bool is_timeout_aborted = Compare<Common_Result::eType, EQ, ONE>(
- response_code, Common_Result::TIMED_OUT, Common_Result::ABORTED);
-
- if (is_timeout_aborted) {
- if (message[strings::params][strings::data].keyExists(
- strings::slider_position)) {
- // Copy slider_position info to msg_params section
- response_msg_params[strings::slider_position] =
- message[strings::params][strings::data][strings::slider_position];
- } else {
- LOG4CXX_ERROR(logger_,
- strings::slider_position << " field is absent"
- " in response.");
- response_msg_params[strings::slider_position] = 0;
- }
- }
- std::string response_info;
- GetInfo(message, response_info);
- const bool is_response_success = PrepareResultForMobileResponse(
- response_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- SendResponse(is_response_success,
- MessageHelper::HMIToMobileResult(response_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &response_msg_params);
-}
-
-bool SliderRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::slider_header].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid slider_header value syntax check failed");
- return true;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
- const smart_objects::SmartArray* sf_array =
- (*message_)[strings::msg_params][strings::slider_footer].asArray();
-
- smart_objects::SmartArray::const_iterator it_sf = sf_array->begin();
- smart_objects::SmartArray::const_iterator it_sf_end = sf_array->end();
-
- for (; it_sf != it_sf_end; ++it_sf) {
- str = (*it_sf).asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid slider_footer syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/slider_response.cc b/src/components/application_manager/src/commands/mobile/slider_response.cc
deleted file mode 100644
index 2cfcaf48fd..0000000000
--- a/src/components/application_manager/src/commands/mobile/slider_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/slider_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SliderResponse::SliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SliderResponse::~SliderResponse() {}
-
-void SliderResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc
deleted file mode 100644
index 1954cde181..0000000000
--- a/src/components/application_manager/src/commands/mobile/speak_request.cc
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include "application_manager/commands/mobile/speak_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SpeakRequest::SpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
-
-SpeakRequest::~SpeakRequest() {}
-
-void SpeakRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming speak has contains \\t\\n \\\\t \\\\n "
- " text contains only whitespace in ttsChunks");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- (*message_)[strings::msg_params][strings::app_id] = app->app_id();
- (*message_)[strings::msg_params][hmi_request::speak_type] =
- hmi_apis::Common_MethodName::SPEAK;
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- SendHMIRequest(hmi_apis::FunctionID::TTS_Speak,
- &message_->getElement(strings::msg_params),
- true);
-}
-
-void SpeakRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- switch (event.id()) {
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
- ProcessTTSSpeakResponse(event.smart_object());
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
-
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-void SpeakRequest::ProcessTTSSpeakResponse(
- const smart_objects::SmartObject& message) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- hmi_apis::Common_Result::eType hmi_result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- mobile_apis::Result::eType result_code =
- MessageHelper::HMIToMobileResult(hmi_result_code);
-
- const bool result = PrepareResultForMobileResponse(
- hmi_result_code, HmiInterfaces::HMI_INTERFACE_TTS);
-
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::SpeakID;
-
- const char* return_info = NULL;
-
- SendResponse(
- result, result_code, return_info, &(message[strings::msg_params]));
-}
-
-bool SpeakRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- const smart_objects::SmartArray* tc_array =
- (*message_)[strings::msg_params][strings::tts_chunks].asArray();
-
- smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
- smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
-
- for (; it_tc != it_tc_end; ++it_tc) {
- str = (*it_tc)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/speak_response.cc b/src/components/application_manager/src/commands/mobile/speak_response.cc
deleted file mode 100644
index 612d32c913..0000000000
--- a/src/components/application_manager/src/commands/mobile/speak_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/speak_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SpeakResponse::SpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SpeakResponse::~SpeakResponse() {}
-
-void SpeakResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
deleted file mode 100644
index 4d11467d2d..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_button_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-SubscribeButtonRequest::SubscribeButtonRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SubscribeButtonRequest::~SubscribeButtonRequest() {}
-
-void SubscribeButtonRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const mobile_apis::ButtonName::eType btn_id =
- static_cast<mobile_apis::ButtonName::eType>(
- (*message_)[str::msg_params][str::button_name].asInt());
-
- if (!IsSubscriptionAllowed(app, btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Subscribe on button " << btn_id << " isn't allowed");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (!CheckHMICapabilities(btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Subscribe on button "
- << btn_id << " isn't allowed by HMI capabilities");
- SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
- return;
- }
-
- if (app->IsSubscribedToButton(btn_id)) {
- LOG4CXX_ERROR(logger_, "Already subscribed to button " << btn_id);
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- app->SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
- SendSubscribeButtonNotification();
-
- const bool is_succedeed = true;
- SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
-}
-
-bool SubscribeButtonRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-bool SubscribeButtonRequest::IsSubscriptionAllowed(
- ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
- if (!app->is_media_application() &&
- ((mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
- (mobile_apis::ButtonName::SEEKRIGHT == btn_id) ||
- (mobile_apis::ButtonName::TUNEUP == btn_id) ||
- (mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
- return false;
- }
- return true;
-}
-
-void SubscribeButtonRequest::SendSubscribeButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- // send OnButtonSubscription notification
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
- (*message_)[strings::msg_params][strings::button_name].asUInt());
- msg_params[strings::is_suscribed] = true;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
deleted file mode 100644
index a92e58b19a..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_button_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SubscribeButtonResponse::SubscribeButtonResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SubscribeButtonResponse::~SubscribeButtonResponse() {}
-
-void SubscribeButtonResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- // TODO(DK): Some logic
- SendResponse(true);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
deleted file mode 100644
index 28cf4c754c..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_vehicle_data_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-namespace commands {
-
-SubscribeVehicleDataRequest::SubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {}
-
-#ifdef HMI_DBUS_API
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
-};
-}
-#endif // #ifdef HMI_DBUS_API
-
-void SubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- std::string info;
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- smart_objects::SmartObject response_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- bool result = false;
- CheckVISubscribtions(
- app, info, result_code, response_params, msg_params, result);
-
- if (mobile_apis::Result::INVALID_ENUM != result_code) {
- SendResponse(result,
- result_code,
- info.empty() ? NULL : info.c_str(),
- response_params.empty() ? NULL : &response_params);
- return;
- }
-
-#ifdef HMI_DBUS_API
- // Generate list of subrequests
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[strings::msg_params].keyExists(sr.str) &&
- true == (*message_)[strings::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
- LOG4CXX_DEBUG(
- logger_, hmi_requests_.size() << " requests are going to be sent to HMI");
-
- // Send subrequests
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it)
- SendHMIRequest(it->func_id, &msg_params, true);
-#else
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
- &msg_params,
- true);
-#endif // #ifdef HMI_DBUS_API
-}
-
-void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- if (hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData != event.id()) {
- LOG4CXX_ERROR(logger_, "Received unknown event.");
- return;
- }
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer.");
- return;
- }
-
-#ifdef HMI_DBUS_API
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[strings::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
-
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
- LOG4CXX_DEBUG(logger_, "All HMI requests are complete");
- const bool result = any_arg_success;
- SendResponse(any_arg_success, status, NULL, &response_params);
- if (result) {
- app->UpdateHash();
- }
- }
-#else
-
- hmi_apis::Common_Result::eType hmi_result =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- bool is_succeeded = result || !vi_already_subscribed_by_another_apps_.empty();
-
- mobile_apis::Result::eType result_code =
- MessageHelper::HMIToMobileResult(hmi_result);
-
- if (is_succeeded) {
- if (!vi_already_subscribed_by_this_app_.empty()) {
- result_code = mobile_apis::Result::IGNORED;
- response_info = "Already subscribed on some provided VehicleData.";
- }
-
- if (!vi_waiting_for_subscribe_.empty()) {
- LOG4CXX_DEBUG(logger_, "Subscribing to all pending VehicleData");
- VehicleInfoSubscriptions::const_iterator key =
- vi_waiting_for_subscribe_.begin();
- for (; key != vi_waiting_for_subscribe_.end(); ++key) {
- app->SubscribeToIVI(*key);
- }
- }
- }
-
- UnsubscribeFailedSubscriptions(app, message[strings::msg_params]);
-
- if (!vi_already_subscribed_by_another_apps_.empty() ||
- !vi_already_subscribed_by_this_app_.empty()) {
- AddAlreadySubscribedVI(
- const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
- }
-
- SendResponse(is_succeeded,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
-#endif // #ifdef HMI_DBUS_API
-}
-
-bool SubscribeVehicleDataRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-void SubscribeVehicleDataRequest::AddAlreadySubscribedVI(
- smart_objects::SmartObject& msg_params) const {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace mobile_apis;
- auto vi_to_string =
- [](const mobile_apis::VehicleDataType::eType vehicle_data) {
- for (auto& vi_str_to_int_pair : MessageHelper::vehicle_data()) {
- if (vehicle_data == vi_str_to_int_pair.second) {
- return vi_str_to_int_pair.first;
- }
- }
- return std::string();
- };
-
- VehicleInfoSubscriptions::const_iterator it_same_app =
- vi_already_subscribed_by_this_app_.begin();
- for (; vi_already_subscribed_by_this_app_.end() != it_same_app;
- ++it_same_app) {
- msg_params[vi_to_string(*it_same_app)][strings::result_code] =
- VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
- msg_params[vi_to_string(*it_same_app)][strings::data_type] = *it_same_app;
- }
-
- VehicleInfoSubscriptions::const_iterator it_another_app =
- vi_already_subscribed_by_another_apps_.begin();
- for (; vi_already_subscribed_by_another_apps_.end() != it_another_app;
- ++it_another_app) {
- msg_params[vi_to_string(*it_another_app)][strings::result_code] =
- VehicleDataResultCode::VDRC_SUCCESS;
- msg_params[vi_to_string(*it_another_app)][strings::data_type] =
- *it_another_app;
- }
-}
-
-void SubscribeVehicleDataRequest::UnsubscribeFailedSubscriptions(
- ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params) const {
- LOG4CXX_AUTO_TRACE(logger_);
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- for (; vehicle_data.end() != it; ++it) {
- if (msg_params.keyExists(it->first)) {
- if (msg_params[it->first][strings::result_code].asInt() !=
- hmi_apis::Common_VehicleDataResultCode::VDRC_SUCCESS) {
- LOG4CXX_DEBUG(logger_,
- "Subscription for VehicleDataType "
- << it->first
- << " is unsuccessfull. "
- "Unsubscribing app with connection key "
- << connection_key() << " from it.");
- app->UnsubscribeFromIVI(it->second);
- }
- }
- }
-}
-
-struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
- }
-};
-
-bool SubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
- const uint32_t param_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- SubscribedToIVIPredicate finder(param_id);
- DataAccessor<ApplicationSet> accessor = application_manager_.applications();
- ApplicationSetConstIt it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- return it != accessor.GetData().end();
-}
-
-void SubscribeVehicleDataRequest::CheckVISubscribtions(
- ApplicationSharedPtr app,
- std::string& out_info,
- mobile_apis::Result::eType& out_result_code,
- smart_objects::SmartObject& out_response_params,
- smart_objects::SmartObject& out_request_params,
- bool& out_result) {
- // counter for items to subscribe
- VehicleInfoSubscriptions::size_type items_to_subscribe = 0;
- // counter for subscribed items by application
- uint32_t subscribed_items = 0;
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- HmiInterfaces::InterfaceState interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- const bool is_interface_not_available =
- interface_state == HmiInterfaces::STATE_NOT_AVAILABLE;
-
- for (; vehicle_data.end() != it; ++it) {
- const std::string& key_name = it->first;
- if ((*message_)[strings::msg_params].keyExists(key_name)) {
- const bool is_key_enabled =
- (*message_)[strings::msg_params][key_name].asBool();
- if (is_key_enabled) {
- ++items_to_subscribe;
- }
- if (!is_interface_not_available && is_key_enabled) {
- mobile_apis::VehicleDataType::eType key_type = it->second;
- if (app->IsSubscribedToIVI(key_type)) {
- LOG4CXX_DEBUG(logger_,
- "App with connection key "
- << connection_key()
- << " is subscribed already for VehicleDataType: "
- << key_type);
- ++subscribed_items;
- vi_already_subscribed_by_this_app_.insert(key_type);
- out_response_params[key_name][strings::data_type] = key_type;
- out_response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
- continue;
- }
-
- if (IsSomeoneSubscribedFor(key_type)) {
- LOG4CXX_DEBUG(logger_,
- "There are apps subscribed already for "
- "VehicleDataType: "
- << key_type);
- if (!app->SubscribeToIVI(static_cast<uint32_t>(key_type))) {
- LOG4CXX_ERROR(
- logger_,
- "Unable to subscribe for VehicleDataType: " << key_type);
- continue;
- }
- LOG4CXX_DEBUG(
- logger_,
- "App with connection key "
- << connection_key()
- << " have been subscribed for VehicleDataType: " << key_type);
- ++subscribed_items;
- vi_already_subscribed_by_another_apps_.insert(key_type);
- out_response_params[key_name][strings::data_type] = key_type;
- out_response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
- continue;
- }
-
- out_request_params[key_name] = is_key_enabled;
-
- if (is_key_enabled) {
- vi_waiting_for_subscribe_.insert(key_type);
- LOG4CXX_DEBUG(
- logger_,
- "App with connection key "
- << connection_key()
- << " will be subscribed for VehicleDataType: " << key_type);
- ++subscribed_items;
- }
- }
- }
- }
-
- const bool is_everything_already_subscribed =
- items_to_subscribe ==
- vi_already_subscribed_by_another_apps_.size() +
- vi_already_subscribed_by_this_app_.size();
-
- if (0 == items_to_subscribe) {
- if (HasDisallowedParams()) {
- out_result_code = mobile_apis::Result::DISALLOWED;
- } else {
- out_result_code = mobile_apis::Result::INVALID_DATA;
- out_info = "No data in the request";
- }
- out_result = false;
- }
-
- if (0 == subscribed_items && !is_interface_not_available) {
- out_result_code = mobile_apis::Result::IGNORED;
- out_info = "Already subscribed on provided VehicleData.";
- out_result = false;
- }
-
- if (is_everything_already_subscribed) {
- out_result_code = vi_already_subscribed_by_this_app_.size()
- ? mobile_apis::Result::IGNORED
- : mobile_apis::Result::SUCCESS;
- if (!(vi_already_subscribed_by_this_app_.empty())) {
- out_info = "Already subscribed on some provided VehicleData.";
- }
- out_result = true;
- }
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc
deleted file mode 100644
index 7ed16407a5..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_vehicle_data_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-SubscribeVehicleDataResponse::SubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {}
-
-void SubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
deleted file mode 100644
index 8195697dfc..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/subscribe_way_points_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SubscribeWayPointsRequest::SubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {}
-
-void SubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (application_manager_.IsAppSubscribedForWayPoints(app)) {
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- if (application_manager_.IsAnyAppSubscribedForWayPoints()) {
- application_manager_.SubscribeAppForWayPoints(app);
- SendResponse(true, mobile_apis::Result::SUCCESS);
- return;
- }
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, true);
-}
-
-void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
- LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- const hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- if (result) {
- application_manager_.SubscribeAppForWayPoints(app);
- }
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-bool SubscribeWayPointsRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc
deleted file mode 100644
index c2e642619a..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/subscribe_way_points_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SubscribeWayPointsResponse::SubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SubscribeWayPointsResponse::~SubscribeWayPointsResponse() {}
-
-void SubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc
deleted file mode 100644
index fe38b93732..0000000000
--- a/src/components/application_manager/src/commands/mobile/system_request.cc
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
-
-Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/system_request.h"
-
-#include <vector>
-#include <string>
-#include <stdio.h>
-#include <algorithm>
-#include <sstream>
-#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/file_system.h"
-#include "formatters/CFormatterJsonBase.h"
-#include "json/json.h"
-#include "utils/helpers.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-CREATE_LOGGERPTR_LOCAL(logger_, "ApplicationManager")
-namespace {
-
-#ifdef ENABLE_LOG
-const char* kQueryAppsValidationFailedPrefix =
- ":QUERY_APPS_VALIDATION_FAILED: ";
-#endif
-
-const unsigned int kVrSynonymLengthMax = 40U;
-const unsigned int kVrSynonymLengthMin = 1U;
-const unsigned int kTtsNameLengthMax = 500U;
-const unsigned int kVrArraySizeMax = 100U;
-const unsigned int kVrArraySizeMin = 1U;
-const unsigned int kUrlSchemaLengthMax = 255U;
-const unsigned int kPackageNameLengthMax = 255U;
-const unsigned int kAppIdLengthMax = 40U;
-const unsigned int kAppNameLengthMax = 100U;
-const unsigned int kLanguageArraySizeMax = 100U;
-
-class QueryAppsDataValidator {
- public:
- typedef std::set<std::string> SynonymsSet;
- typedef std::map<std::string, SynonymsSet> SynonymsMap;
-
- QueryAppsDataValidator(smart_objects::SmartObject& object,
- const ApplicationManager& manager)
- : data_(object), manager_(manager) {}
-
- bool Validate() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!data_.isValid()) {
- LOG4CXX_ERROR(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response is not valid.");
- return false;
- }
- if (!HasResponseKey()) {
- return false;
- }
- return ValidateAppDataAndOsAndLanguagesData();
- }
-
- private:
- bool HasResponseKey() const {
- if (!data_.keyExists(json::response)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response does not contain '"
- << json::response << "' parameter.");
- return false;
- }
- return true;
- }
-
- bool ValidateAppDataAndOsAndLanguagesData() {
- smart_objects::SmartArray* objects_array = data_[json::response].asArray();
-
- if (!objects_array) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response is not array.");
- return false;
- }
-
- SynonymsMap synonyms_map;
- bool has_response_valid_application = false;
-
- smart_objects::SmartArray::iterator applications_iterator =
- objects_array->begin();
-
- for (; applications_iterator != objects_array->end();) {
- const smart_objects::SmartObject& app_data = *applications_iterator;
-
- if (!app_data.isValid()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "Wrong application data in json file.");
- return false;
- }
-
- if (!CheckMandatoryParametersPresent(app_data)) {
- LOG4CXX_WARN(logger_,
- "Application hasn`t some of mandatory parameters. "
- "Application will be skipped.");
-
- applications_iterator = objects_array->erase(applications_iterator);
- continue;
- }
-
- if (!ValidateAppIdAndAppName(app_data)) {
- return false;
- }
-
- // If we dont have any of android/ios field
- // we skip this json in CheckMandatoryParametersPresent
- const std::string os_type =
- (app_data.keyExists(json::android)) ? json::android : json::ios;
-
- // Verify os and dependent languages data
- if (json::ios == os_type) {
- if (app_data[json::ios][json::urlScheme].asString().length() >
- kUrlSchemaLengthMax) {
- LOG4CXX_WARN(
- logger_,
- kQueryAppsValidationFailedPrefix
- << "An urlscheme length exceeds maximum allowed ["
- << app_data[json::ios][json::urlScheme].asString().length()
- << "]>[" << kUrlSchemaLengthMax << "]");
- return false;
- }
- }
-
- if (json::android == os_type) {
- if (app_data[json::android][json::packageName].asString().length() >
- kPackageNameLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "Package name length ["
- << app_data[json::android][json::packageName]
- .asString()
- .length() << "] exceeds max length ["
- << kPackageNameLengthMax << "]in json file.");
- return false;
- }
- }
-
- // Languages verification
- if (!app_data[os_type].keyExists(json::languages)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages' doesn't exist");
- return false;
- }
- if (!ValidateLanguages(app_data[os_type][json::languages],
- synonyms_map)) {
- return false;
- }
- has_response_valid_application = true;
- ++applications_iterator;
- }
- return has_response_valid_application;
- }
-
- bool ValidateAppIdAndAppName(const smart_objects::SmartObject& app_data) {
- // Verify appid length
- const std::string app_id(app_data[json::appId].asString());
- if (app_id.length() > kAppIdLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "An Object ID length exceeds maximum allowed ["
- << app_id.length() << "]>[" << kAppIdLengthMax << "]");
- return false;
- }
-
- // Verify that appid is unique
- if (applications_id_set_.find(app_id) != applications_id_set_.end()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "An Object ID is not unigue [" << app_id << "]");
- return false;
- }
- applications_id_set_.insert(app_id);
-
- // Verify that app is not registered yet
- ApplicationSharedPtr registered_app =
- manager_.application_by_policy_id(app_id);
- if (registered_app) {
- LOG4CXX_INFO(logger_,
- "Application with the id: " << app_id
- << " is already registered.");
- }
- // And app name length
- const std::string appName(app_data[json::name].asString());
- if (appName.length() > kAppNameLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "Name of application exceeds maximum allowed ["
- << appName.length() << "]>[" << kAppNameLengthMax
- << "].");
- return false;
- }
- return true;
- }
-
- bool ValidateLanguages(const smart_objects::SmartObject& languages,
- SynonymsMap& synonyms_map) const {
- bool default_language_found = false;
- const size_t languages_array_size = languages.length();
- if (languages_array_size > kLanguageArraySizeMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages' array exceeds max size ["
- << languages_array_size << "]>[" << kLanguageArraySizeMax
- << "]");
- return false;
- }
- // Every language has ttsname string and vrsynonyms array
- for (size_t idx = 0; idx < languages_array_size; ++idx) {
- const smart_objects::SmartObject& language = languages.getElement(idx);
- if (smart_objects::SmartType_Map != language.getType()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language is not a map.");
- return false;
- }
- if (language.length() != 1) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language map size is not equal 1.");
- return false;
- }
- const std::string language_name = (*language.map_begin()).first;
- if (!language_name.length()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language name is empty");
- return false;
- }
- // Verify default language defined
- if (!(language_name).compare(json::default_)) {
- default_language_found = true;
- }
- // Add set for synonyms' duplicates validation
- if (synonyms_map.find(language_name) == synonyms_map.end()) {
- synonyms_map[language_name] = SynonymsSet();
- }
- // ttsName verification
- if (!language[language_name].keyExists(json::ttsName)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages.ttsName' doesn't exist");
- return false;
- }
- const smart_objects::SmartObject& ttsNameObject =
- language[language_name][json::ttsName];
- // ttsName is string
- if (smart_objects::SmartType_String == ttsNameObject.getType()) {
- const std::string ttsName =
- language[language_name][json::ttsName].asString();
- if (ttsName.length() > kTtsNameLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "ttsName string exceeds max length ["
- << ttsName.length() << "]>[" << kTtsNameLengthMax
- << "]");
- return false;
- }
- } else {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "ttsName is not the string type.");
- return false;
- }
-
- if (!ValidateSynonymsAtLanguage(language, language_name, synonyms_map)) {
- return false;
- }
- }
- if (!default_language_found) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << " 'languages'.default' doesn't exist");
- return false;
- }
- return true;
- }
-
- bool ValidateSynonymsAtLanguage(const smart_objects::SmartObject& language,
- const std::string& language_name,
- SynonymsMap& synonyms_map) const {
- if (!language[language_name].keyExists(json::vrSynonyms)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages.vrSynonyms' doesn't exist");
- return false;
- }
- const smart_objects::SmartArray* synonyms_array =
- language[language_name][json::vrSynonyms].asArray();
- if (!synonyms_array) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSynonyms is not array.");
- return false;
- }
- const size_t synonyms_array_size = synonyms_array->size();
- if (synonyms_array_size < kVrArraySizeMin) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSynomyms array has [" << synonyms_array_size
- << "] size < allowed min size [" << kVrArraySizeMin
- << "]");
- return false;
- }
- if (synonyms_array_size > kVrArraySizeMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSynomyms array size [" << synonyms_array_size
- << "] exceeds maximum allowed size [" << kVrArraySizeMax
- << "]");
- return false;
- }
-
- for (std::size_t idx = 0; idx < synonyms_array_size; ++idx) {
- const smart_objects::SmartObject& synonym = (*synonyms_array)[idx];
- const std::string vrSynonym = synonym.asString();
- if (vrSynonym.length() > kVrSynonymLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSYnomym item [" << idx
- << "] exceeds max length [" << vrSynonym.length()
- << "]>[" << kVrSynonymLengthMax << "]");
- return false;
- }
- if (vrSynonym.length() < kVrSynonymLengthMin) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSYnomym item [" << idx << "] length ["
- << vrSynonym.length() << "] is less then min length ["
- << kVrSynonymLengthMin << "] allowed.");
- return false;
- }
- // Verify duplicates
- SynonymsMap::iterator synonyms_map_iter =
- synonyms_map.find(language_name);
- if (synonyms_map_iter != synonyms_map.end()) {
- if (!(*synonyms_map_iter).second.insert(vrSynonym).second) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSYnomym item already defined ["
- << vrSynonym.c_str() << "] for language ["
- << language_name << "]");
- return false;
- }
- }
- }
- return true;
- }
-
- bool CheckMandatoryParametersPresent(
- const smart_objects::SmartObject& app_data) const {
- if (!app_data.keyExists(json::android) && !app_data.keyExists(json::ios)) {
- return false;
- }
-
- if (app_data.keyExists(json::android) &&
- !app_data[json::android].keyExists(json::packageName)) {
- return false;
- }
-
- if (app_data.keyExists(json::ios) &&
- !app_data[json::ios].keyExists(json::urlScheme)) {
- return false;
- }
-
- if (!app_data.keyExists(json::appId)) {
- return false;
- }
-
- if (!app_data.keyExists(json::name)) {
- return false;
- }
-
- return true;
- }
-
- smart_objects::SmartObject& data_;
- std::set<std::string> applications_id_set_;
- const ApplicationManager& manager_;
-
- DISALLOW_COPY_AND_ASSIGN(QueryAppsDataValidator);
-};
-}
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-uint32_t SystemRequest::index = 0;
-
-const std::string kSYNC = "SYNC";
-const std::string kIVSU = "IVSU";
-
-SystemRequest::SystemRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SystemRequest::~SystemRequest() {}
-
-void SystemRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!(application.valid())) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const mobile_apis::RequestType::eType request_type =
- static_cast<mobile_apis::RequestType::eType>(
- (*message_)[strings::msg_params][strings::request_type].asInt());
-
- const policy::PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- if (!policy_handler.IsRequestTypeAllowed(application->policy_app_id(),
- request_type)) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- return;
- }
-
- std::string file_name;
- if ((*message_)[strings::msg_params].keyExists(strings::file_name)) {
- file_name = (*message_)[strings::msg_params][strings::file_name].asString();
- } else {
- file_name = kSYNC;
- }
-
- if (!CheckSyntax(file_name)) {
- LOG4CXX_ERROR(logger_,
- "Incoming request contains \t\n \\t \\n or whitespace");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (!file_system::IsFileNameValid(file_name)) {
- const std::string err_msg = "Sync file name contains forbidden symbols.";
- LOG4CXX_ERROR(logger_, err_msg);
- SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
- return;
- }
-
- bool is_system_file = std::string::npos != file_name.find(kSYNC) ||
- std::string::npos != file_name.find(kIVSU);
-
- // to avoid override existing file
- if (is_system_file) {
- const uint8_t max_size = 255;
- char buf[max_size] = {'\0'};
- snprintf(buf, max_size - 1, "%d%s", index++, file_name.c_str());
- file_name = buf;
- }
-
- std::vector<uint8_t> binary_data;
- std::string binary_data_folder;
- if ((*message_)[strings::params].keyExists(strings::binary_data)) {
- binary_data = (*message_)[strings::params][strings::binary_data].asBinary();
- binary_data_folder =
- application_manager_.get_settings().system_files_path();
- } else {
- binary_data_folder =
- application_manager_.get_settings().app_storage_folder();
- binary_data_folder += "/";
- binary_data_folder += application->folder_name();
- binary_data_folder += "/";
- }
-
- std::string file_dst_path =
- application_manager_.get_settings().system_files_path();
- file_dst_path += "/";
- file_dst_path += file_name;
-
- if ((*message_)[strings::params].keyExists(strings::binary_data)) {
- LOG4CXX_DEBUG(
- logger_,
- "Binary data is present. Trying to save it to: " << binary_data_folder);
- if (mobile_apis::Result::SUCCESS !=
- (application_manager_.SaveBinary(
- binary_data, binary_data_folder, file_name, 0))) {
- LOG4CXX_DEBUG(logger_, "Binary data can't be saved.");
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- return;
- }
- } else {
- std::string app_full_file_path = binary_data_folder;
- app_full_file_path += file_name;
-
- LOG4CXX_DEBUG(logger_,
- "Binary data is not present. Trying to find file "
- << file_name << " within previously saved app file in "
- << binary_data_folder);
-
- const AppFile* file = application->GetFile(app_full_file_path);
- if (!file || !file->is_download_complete ||
- !file_system::MoveFile(app_full_file_path, file_dst_path)) {
- LOG4CXX_DEBUG(logger_, "Binary data not found.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
- processing_file_ = file_dst_path;
- }
-
- LOG4CXX_DEBUG(logger_, "Binary data ok.");
-
- if (mobile_apis::RequestType::HTTP == request_type &&
- (*message_)[strings::msg_params].keyExists(strings::file_name)) {
- const std::string& file =
- (*message_)[strings::msg_params][strings::file_name].asString();
- application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(file,
- binary_data);
- SendResponse(true, mobile_apis::Result::SUCCESS);
- return;
- } else if (mobile_apis::RequestType::QUERY_APPS == request_type) {
- using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-
- smart_objects::SmartObject sm_object;
- Json::Reader reader;
- std::string json(binary_data.begin(), binary_data.end());
- Json::Value root;
- if (!reader.parse(json.c_str(), root)) {
- LOG4CXX_DEBUG(logger_, "Unable to parse query_app json file.");
- return;
- }
-
- CFormatterJsonBase::jsonValueToObj(root, sm_object);
- if (!ValidateQueryAppData(sm_object)) {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- return;
- }
-
- application_manager_.ProcessQueryApp(sm_object, connection_key());
- SendResponse(true, mobile_apis::Result::SUCCESS);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if (std::string::npos != file_name.find(kIVSU)) {
- msg_params[strings::file_name] = file_name;
- } else {
- msg_params[strings::file_name] = file_dst_path;
- }
-
- // expected int, mandatory=true, all Policies flow (HTTP,Proprietary,External)
- msg_params[strings::app_id] = application->hmi_app_id();
-
- msg_params[strings::request_type] =
- (*message_)[strings::msg_params][strings::request_type];
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
- SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest,
- &msg_params,
- true);
-}
-
-void SystemRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
- mobile_apis::Result::eType result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
-
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!(application.valid())) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (!processing_file_.empty()) {
- file_system::DeleteFile(processing_file_);
- processing_file_.clear();
- }
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-bool SystemRequest::ValidateQueryAppData(
- smart_objects::SmartObject& data) const {
- if (!data.isValid()) {
- LOG4CXX_ERROR(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response is not valid.");
- return false;
- }
- if (!data.keyExists(json::response)) {
- LOG4CXX_ERROR(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response does not contain '"
- << json::response << "' parameter.");
- return false;
- }
-
- QueryAppsDataValidator validator(data, application_manager_);
- return validator.Validate();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/system_response.cc b/src/components/application_manager/src/commands/mobile/system_response.cc
deleted file mode 100644
index f5bc03f4a5..0000000000
--- a/src/components/application_manager/src/commands/mobile/system_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/system_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SystemResponse::SystemResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SystemResponse::~SystemResponse() {}
-
-void SystemResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc
deleted file mode 100644
index d40ad9c870..0000000000
--- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unregister_app_interface_request.h"
-
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void UnregisterAppInterfaceRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!application_manager_.application(connection_key())) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- connection_key(),
- mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM),
- commands::Command::ORIGIN_SDL);
- application_manager_.EndNaviServices(connection_key());
- application_manager_.UnregisterApplication(connection_key(),
- mobile_apis::Result::SUCCESS);
- SendResponse(true, mobile_apis::Result::SUCCESS);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc
deleted file mode 100644
index 49d9276d35..0000000000
--- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unregister_app_interface_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void UnregisterAppInterfaceResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendResponse((*message_)[strings::msg_params][strings::success].asBool());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
deleted file mode 100644
index 7e798bcb4e..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_button_request.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-UnsubscribeButtonRequest::UnsubscribeButtonRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {}
-
-void UnsubscribeButtonRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const mobile_apis::ButtonName::eType btn_id =
- static_cast<mobile_apis::ButtonName::eType>(
- (*message_)[str::msg_params][str::button_name].asInt());
-
- if (!CheckHMICapabilities(btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Button " << btn_id << " isn't allowed by HMI capabilities");
- SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
- return;
- }
-
- if (!app->UnsubscribeFromButton(
- static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
- LOG4CXX_ERROR(logger_, "App doesn't subscibe to button " << btn_id);
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- SendUnsubscribeButtonNotification();
- SendResponse(true, mobile_apis::Result::SUCCESS);
-}
-
-bool UnsubscribeButtonRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- // send OnButtonSubscription notification
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
- (*message_)[strings::msg_params][strings::button_name].asInt());
- msg_params[strings::is_suscribed] = false;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
deleted file mode 100644
index 9ac98a27f7..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_button_response.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UnsubscribeButtonResponse::UnsubscribeButtonResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {}
-
-void UnsubscribeButtonResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- // TODO(DK): Some logic
- SendResponse(true);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
deleted file mode 100644
index d6ad928bf7..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
-
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/command_impl.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-namespace commands {
-
-UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {}
-
-#ifdef HMI_DBUS_API
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
- strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey, strings::my_key},
-};
-}
-#endif // #ifdef HMI_DBUS_API
-
-void UnsubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- int32_t items_to_unsubscribe = 0;
- int32_t unsubscribed_items = 0;
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject response_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- for (; vehicle_data.end() != it; ++it) {
- const std::string& key_name = it->first;
- if ((*message_)[strings::msg_params].keyExists(key_name)) {
- bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
- if (is_key_enabled) {
- ++items_to_unsubscribe;
-
- mobile_apis::VehicleDataType::eType key_type = it->second;
- if (!app->IsSubscribedToIVI(key_type)) {
- ++unsubscribed_items;
- vi_already_unsubscribed_by_this_app_.insert(key_type);
- response_params[key_name][strings::data_type] = key_type;
- response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
- continue;
- }
-
- if (!app->UnsubscribeFromIVI(static_cast<uint32_t>(key_type))) {
- LOG4CXX_ERROR(logger_,
- "Unable to unsubscribe from "
- "VehicleDataType: "
- << key_type);
- continue;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Unsubscribed app with connection key "
- << connection_key()
- << " from VehicleDataType: " << key_type);
-
- ++unsubscribed_items;
-
- if (IsSomeoneSubscribedFor(key_type)) {
- LOG4CXX_DEBUG(logger_,
- "There are another apps still subscribed for "
- "VehicleDataType: "
- << key_type);
-
- vi_still_subscribed_by_another_apps_.insert(key_type);
- response_params[key_name][strings::data_type] = key_type;
- response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
- continue;
- }
-
- msg_params[key_name] = is_key_enabled;
- }
- }
- }
-
- bool is_everything_already_unsubscribed =
- static_cast<uint32_t>(items_to_unsubscribe) ==
- vi_still_subscribed_by_another_apps_.size() +
- vi_already_unsubscribed_by_this_app_.size();
-
- if (0 == items_to_unsubscribe) {
- if (HasDisallowedParams()) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- } else {
- SendResponse(
- false, mobile_apis::Result::INVALID_DATA, "No data in the request.");
- }
- return;
- }
-
- if (0 == unsubscribed_items) {
- SendResponse(false,
- mobile_apis::Result::IGNORED,
- "Was not subscribed on any VehicleData.",
- &response_params);
- return;
- }
-
- if (is_everything_already_unsubscribed) {
- if (!vi_already_unsubscribed_by_this_app_.empty()) {
- SendResponse(false,
- mobile_apis::Result::IGNORED,
- "Some provided VehicleData was not subscribed.",
- &response_params);
- } else {
- SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
- }
- return;
- }
-
-#ifdef HMI_DBUS_API
- // Generate list of subrequests
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[strings::msg_params].keyExists(sr.str) &&
- true == (*message_)[strings::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
- LOG4CXX_INFO(logger_,
- hmi_requests_.size() << " requests are going to be sent to HMI");
-
- // Send subrequests
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it)
- SendHMIRequest(it->func_id, &msg_params, true);
-#else
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
- &msg_params,
- true);
-#endif // #ifdef HMI_DBUS_API
-}
-
-void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- if (hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData != event.id()) {
- LOG4CXX_ERROR(logger_, "Received unknown event.");
- return;
- }
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer.");
- return;
- }
-
-#ifdef HMI_DBUS_API
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[strings::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
-
- LOG4CXX_INFO(logger_, "All HMI requests are complete");
- if (true == any_arg_success) {
- SetAllowedToTerminate(false);
- }
- SendResponse(any_arg_success, status, NULL, &response_params);
- if (true == any_arg_success) {
- app->UpdateHash();
- }
- }
-#else
- hmi_apis::Common_Result::eType hmi_result =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- mobile_apis::Result::eType result_code =
- MessageHelper::HMIToMobileResult(hmi_result);
-
- if (result) {
- if (vi_already_unsubscribed_by_this_app_.size()) {
- result_code = mobile_apis::Result::IGNORED;
- response_info = "Some provided VehicleData was not subscribed.";
- }
- }
-
- if (!vi_still_subscribed_by_another_apps_.empty() ||
- !vi_already_unsubscribed_by_this_app_.empty()) {
- AddAlreadyUnsubscribedVI(
- const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
- }
-
- if (result) {
- SetAllowedToTerminate(false);
- }
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- if (result) {
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
- }
-#endif // #ifdef HMI_DBUS_API
-}
-
-bool UnsubscribeVehicleDataRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
- }
-};
-
-bool UnsubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
- const uint32_t param_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- SubscribedToIVIPredicate finder(param_id);
- DataAccessor<ApplicationSet> accessor = application_manager_.applications();
- ApplicationSetConstIt it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- return it != accessor.GetData().end();
-}
-
-void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI(
- smart_objects::SmartObject& response) const {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace mobile_apis;
- VehicleInfoSubscriptions::const_iterator it_same_app =
- vi_already_unsubscribed_by_this_app_.begin();
- for (; vi_already_unsubscribed_by_this_app_.end() != it_same_app;
- ++it_same_app) {
- response[*it_same_app][strings::result_code] =
- VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
- }
-
- VehicleInfoSubscriptions::const_iterator it_another_app =
- vi_still_subscribed_by_another_apps_.begin();
- for (; vi_still_subscribed_by_another_apps_.end() != it_another_app;
- ++it_another_app) {
- response[*it_another_app][strings::result_code] =
- VehicleDataResultCode::VDRC_SUCCESS;
- }
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc
deleted file mode 100644
index 986256d377..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-namespace commands {
-
-UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {}
-
-void UnsubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- // TODO(DK): Some logic
- SendResponse(true);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc
deleted file mode 100644
index dc3404c022..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UnSubscribeWayPointsRequest::UnSubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UnSubscribeWayPointsRequest::~UnSubscribeWayPointsRequest() {}
-
-void UnSubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (!application_manager_.IsAppSubscribedForWayPoints(app)) {
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
-}
-
-void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
- LOG4CXX_INFO(logger_, "Received Navigation_UnSubscribeWayPoints event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- const hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- if (result) {
- application_manager_.UnsubscribeAppFromWayPoints(app);
- }
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-bool UnSubscribeWayPointsRequest::Init() {
- hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc
deleted file mode 100644
index f6430d1f0d..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UnsubscribeWayPointsResponse::UnsubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UnsubscribeWayPointsResponse::~UnsubscribeWayPointsResponse() {}
-
-void UnsubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc
deleted file mode 100644
index 44fe9d0d07..0000000000
--- a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/update_turn_list_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-UpdateTurnListRequest::UpdateTurnListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UpdateTurnListRequest::~UpdateTurnListRequest() {}
-
-void UpdateTurnListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming update turn list has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, processing_result);
- return;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
- smart_objects::SmartObject& turn_list_array =
- ((*message_)[strings::msg_params][strings::turn_list]);
- for (uint32_t i = 0; i < turn_list_array.length(); ++i) {
- if ((turn_list_array[i].keyExists(strings::turn_icon)) &&
- (mobile_apis::Result::SUCCESS !=
- MessageHelper::VerifyImage(turn_list_array[i][strings::turn_icon],
- app,
- application_manager_))) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyImage return INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params = (*message_)[strings::msg_params];
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
- if (!CheckTurnListArray()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- for (uint32_t i = 0; i < msg_params[strings::turn_list].length(); ++i) {
- if (msg_params[strings::turn_list][i].keyExists(hmi_request::navi_text)) {
- const custom_str::CustomString& navigation_text =
- msg_params[strings::turn_list][i][hmi_request::navi_text]
- .asCustomString();
- msg_params[strings::turn_list][i].erase(hmi_request::navi_text);
- msg_params[strings::turn_list][i][hmi_request::navi_text]
- [hmi_request::field_name] = static_cast<int>(
- hmi_apis::Common_TextFieldName::turnText);
- msg_params[strings::turn_list][i][hmi_request::navi_text]
- [hmi_request::field_text] = navigation_text;
- }
- }
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list) ||
- (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params, true);
- } else {
- // conditional mandatory
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- }
-}
-
-void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
- LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event");
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
- const hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-bool UpdateTurnListRequest::CheckTurnListArray() {
- int32_t length =
- (*message_)[strings::msg_params][strings::turn_list].length();
- if (0 == length) {
- return false;
- }
-
- for (int32_t i = 0; i < length; ++i) {
- if (!((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
- hmi_request::navi_text)) &&
- !((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
- strings::turn_icon))) {
- return false;
- }
- }
- return true;
-}
-
-bool UpdateTurnListRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
- const smart_objects::SmartArray* tl_array =
- (*message_)[strings::msg_params][strings::turn_list].asArray();
-
- smart_objects::SmartArray::const_iterator it_tl = tl_array->begin();
- smart_objects::SmartArray::const_iterator it_tl_end = tl_array->end();
-
- for (; it_tl != it_tl_end; ++it_tl) {
- if ((*it_tl).keyExists(strings::navigation_text)) {
- str = (*it_tl)[strings::navigation_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_,
- "Invalid turn_list navigation_text text syntax check failed");
- return true;
- }
- }
-
- if ((*it_tl).keyExists(strings::turn_icon)) {
- str = (*it_tl)[strings::turn_icon][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_, "Invalid turn_list turn_icon value syntax check failed");
- return true;
- }
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc
deleted file mode 100644
index d40a4546fc..0000000000
--- a/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/update_turn_list_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateTurnListResponse::UpdateTurnListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UpdateTurnListResponse::~UpdateTurnListResponse() {}
-
-void UpdateTurnListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // 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
new file mode 100644
index 0000000000..75e49b180e
--- /dev/null
+++ b/src/components/application_manager/src/commands/notification_from_hmi.cc
@@ -0,0 +1,111 @@
+/*
+ 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/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NotificationFromHMI::NotificationFromHMI(
+ 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) {
+ // Replace HMI app id with Mobile connection id
+ ReplaceHMIWithMobileAppId(*message);
+}
+
+NotificationFromHMI::~NotificationFromHMI() {}
+
+bool NotificationFromHMI::Init() {
+ return true;
+}
+
+bool NotificationFromHMI::CleanUp() {
+ return true;
+}
+
+void NotificationFromHMI::Run() {}
+
+void NotificationFromHMI::SendNotificationToMobile(
+ const MessageSharedPtr& message) {
+ (*message)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ rpc_service_.ManageMobileCommand(message, SOURCE_SDL);
+}
+
+void NotificationFromHMI::CreateHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+
+ // get hmi correlation id for chaining further request from this object
+ const uint32_t hmi_correlation_id_ =
+ application_manager_.GetNextHMICorrelationID();
+
+ ns_smart_device_link::ns_smart_objects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kRequest);
+ request[strings::params][strings::function_id] =
+ static_cast<int32_t>(function_id);
+ request[strings::params][strings::correlation_id] = hmi_correlation_id_;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ request[strings::msg_params] = msg_params;
+
+ if (!rpc_service_.ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/notification_to_hmi.cc b/src/components/application_manager/src/commands/notification_to_hmi.cc
new file mode 100644
index 0000000000..2e5f54e950
--- /dev/null
+++ b/src/components/application_manager/src/commands/notification_to_hmi.cc
@@ -0,0 +1,74 @@
+/*
+ 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/notification_to_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NotificationToHMI::NotificationToHMI(
+ 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) {}
+
+NotificationToHMI::~NotificationToHMI() {}
+
+bool NotificationToHMI::Init() {
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
+}
+
+bool NotificationToHMI::CleanUp() {
+ return true;
+}
+
+void NotificationToHMI::Run() {}
+
+void NotificationToHMI::SendNotification() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // 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
new file mode 100644
index 0000000000..ff760c2d2a
--- /dev/null
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -0,0 +1,115 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RequestFromHMI::RequestFromHMI(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)
+ , EventObserver(application_manager.event_dispatcher()) {
+ // Replace HMI app id with Mobile connection id
+ ReplaceHMIWithMobileAppId(*message);
+}
+
+RequestFromHMI::~RequestFromHMI() {}
+
+bool RequestFromHMI::Init() {
+ return true;
+}
+
+bool RequestFromHMI::CleanUp() {
+ return true;
+}
+
+void RequestFromHMI::Run() {}
+
+void RequestFromHMI::on_event(const event_engine::Event& 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) {
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ FillCommonParametersOfSO(*message, correlation_id, function_id);
+ (*message)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message)[strings::params][hmi_response::code] = 0;
+ (*message)[strings::msg_params][strings::success] = success;
+ (*message)[strings::msg_params][strings::result_code] = result_code;
+
+ rpc_service_.ManageHMICommand(message);
+}
+
+void RequestFromHMI::SendErrorResponse(
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const std::string error_message) {
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ FillCommonParametersOfSO(*message, correlation_id, function_id);
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kErrorResponse;
+ (*message)[strings::params][hmi_response::code] = result_code;
+ (*message)[strings::params][strings::error_msg] = error_message;
+
+ rpc_service_.ManageHMICommand(message);
+}
+
+void RequestFromHMI::FillCommonParametersOfSO(
+ smart_objects::SmartObject& message,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id) {
+ (message)[strings::params][strings::function_id] = function_id;
+ (message)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (message)[strings::params][strings::protocol_version] = protocol_version_;
+ (message)[strings::params][strings::correlation_id] = correlation_id;
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/request_to_hmi.cc b/src/components/application_manager/src/commands/request_to_hmi.cc
new file mode 100644
index 0000000000..1acbc9ace7
--- /dev/null
+++ b/src/components/application_manager/src/commands/request_to_hmi.cc
@@ -0,0 +1,97 @@
+/*
+ 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/request_to_hmi.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
+ HmiInterfaces::InterfaceID interface) {
+ const HmiInterfaces::InterfaceState state =
+ application_manager.hmi_interfaces().GetInterfaceState(interface);
+ return HmiInterfaces::STATE_NOT_AVAILABLE != state;
+}
+
+bool ChangeInterfaceState(ApplicationManager& application_manager,
+ const smart_objects::SmartObject& response_from_hmi,
+ HmiInterfaces::InterfaceID interface) {
+ if (response_from_hmi[strings::msg_params].keyExists(strings::available)) {
+ const bool is_available =
+ response_from_hmi[strings::msg_params][strings::available].asBool();
+ const HmiInterfaces::InterfaceState interface_state =
+ is_available ? HmiInterfaces::STATE_AVAILABLE
+ : HmiInterfaces::STATE_NOT_AVAILABLE;
+ application_manager.hmi_interfaces().SetInterfaceState(interface,
+ interface_state);
+ return is_available;
+ }
+ return false;
+}
+
+RequestToHMI::RequestToHMI(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) {}
+
+RequestToHMI::~RequestToHMI() {}
+
+bool RequestToHMI::Init() {
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
+}
+
+bool RequestToHMI::CleanUp() {
+ return true;
+}
+
+void RequestToHMI::Run() {
+ SendRequest();
+}
+
+void RequestToHMI::SendRequest() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/response_from_hmi.cc b/src/components/application_manager/src/commands/response_from_hmi.cc
new file mode 100644
index 0000000000..c88b14bf9c
--- /dev/null
+++ b/src/components/application_manager/src/commands/response_from_hmi.cc
@@ -0,0 +1,114 @@
+/*
+ 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/response_from_hmi.h"
+#include "application_manager/rpc_service.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResponseFromHMI::ResponseFromHMI(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) {
+ // If it is error response, shift info
+ if ((*message)[strings::params].keyExists(hmi_response::message)) {
+ (*message)[strings::msg_params][strings::info] =
+ (*message)[strings::params][hmi_response::message];
+ }
+
+ // Replace HMI app id with Mobile connection id
+ ReplaceHMIWithMobileAppId(*message);
+}
+
+ResponseFromHMI::~ResponseFromHMI() {}
+
+bool ResponseFromHMI::Init() {
+ return true;
+}
+
+bool ResponseFromHMI::CleanUp() {
+ return true;
+}
+
+void ResponseFromHMI::Run() {}
+
+void ResponseFromHMI::SendResponseToMobile(
+ const MessageSharedPtr& message, ApplicationManager& application_manager) {
+ (*message)[strings::params][strings::message_type] = MessageType::kResponse;
+
+ rpc_service_.ManageMobileCommand(message, SOURCE_SDL);
+}
+
+void ResponseFromHMI::CreateHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+
+ // get hmi correlation id for chaining further request from this object
+ const uint32_t hmi_correlation_id_ =
+ application_manager_.GetNextHMICorrelationID();
+
+ ns_smart_device_link::ns_smart_objects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] = MessageType::kRequest;
+ request[strings::params][strings::function_id] = function_id;
+ request[strings::params][strings::correlation_id] = hmi_correlation_id_;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ request[strings::msg_params] = msg_params;
+
+ if (!rpc_service_.ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/response_to_hmi.cc b/src/components/application_manager/src/commands/response_to_hmi.cc
new file mode 100644
index 0000000000..01a2ec789e
--- /dev/null
+++ b/src/components/application_manager/src/commands/response_to_hmi.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/response_to_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResponseToHMI::ResponseToHMI(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) {}
+
+ResponseToHMI::~ResponseToHMI() {}
+
+bool ResponseToHMI::Init() {
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
+}
+
+bool ResponseToHMI::CleanUp() {
+ return true;
+}
+
+void ResponseToHMI::Run() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc
deleted file mode 100644
index 2a96502cde..0000000000
--- a/src/components/application_manager/src/core_service.cc
+++ /dev/null
@@ -1,231 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <vector>
-#include <algorithm>
-#include "application_manager/core_service.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-#include "json/json.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace {
-struct AppExtensionPredicate {
- AppExtensionUID uid;
- bool operator()(const ApplicationSharedPtr app) {
- return app ? app->QueryInterface(uid).valid() : false;
- }
-};
-}
-
-CoreService::CoreService(ApplicationManager& application_manager)
- : application_manager_(application_manager) {}
-
-CoreService::~CoreService() {}
-
-mobile_apis::Result::eType CoreService::CheckPolicyPermissions(MessagePtr msg) {
- ApplicationSharedPtr app = GetApplication(msg->connection_key());
- if (!app) {
- return mobile_apis::Result::eType::APPLICATION_NOT_REGISTERED;
- }
-
-#ifdef SDL_REMOTE_CONTROL
- const RPCParams rpc_params;
- CommandParametersPermissions params;
- const mobile_apis::Result::eType ret =
- application_manager_.CheckPolicyPermissions(
- app, msg->function_name(), rpc_params, &params);
-
- if (ret != mobile_apis::Result::eType::SUCCESS) {
- return ret;
- }
-
- if (!AreParametersAllowed(msg, params)) {
- return mobile_apis::Result::eType::DISALLOWED;
- }
-
- return ret;
-#else
- return mobile_apis::Result::eType::SUCCESS;
-#endif // SDL_REMOTE_CONTROL
-}
-
-bool CoreService::CheckModule(const ApplicationId& app_id,
- const std::string& module) {
-#ifdef SDL_REMOTE_CONTROL
- ApplicationSharedPtr app = GetApplication(app_id);
- if (app) {
- return application_manager_.GetPolicyHandler().CheckModule(
- app->policy_app_id(), module);
- }
-#endif // SDL_REMOTE_CONTROL
- return false;
-}
-
-bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const {
-#ifdef SDL_REMOTE_CONTROL
- DCHECK_OR_RETURN(app, false);
- return application_manager_.GetPolicyHandler().CheckHMIType(
- app->policy_app_id(),
- mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
- app->app_types());
-#endif // SDL_REMOTE_CONTROL
- return false;
-}
-
-bool CoreService::IsInterfaceAvailable(
- const HmiInterfaces::InterfaceID interface) const {
-#ifdef SDL_REMOTE_CONTROL
- HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- const HmiInterfaces::InterfaceState state =
- hmi_interfaces.GetInterfaceState(interface);
- return HmiInterfaces::STATE_NOT_AVAILABLE != state;
-#endif // SDL_REMOTE_CONTROL
- return false;
-}
-
-void CoreService::RemoveHMIFakeParameters(
- application_manager::MessagePtr& message) {
- application_manager_.RemoveHMIFakeParameters(message);
-}
-
-ApplicationSharedPtr CoreService::GetApplication(ApplicationId app_id) {
- return application_manager_.application(app_id);
-}
-
-void CoreService::SendMessageToHMI(const MessagePtr& message) {
- application_manager_.SendPostMessageToHMI(message);
-}
-
-void CoreService::SendMessageToMobile(const MessagePtr& message) {
- application_manager_.SendPostMessageToMobile(message);
-}
-
-uint32_t CoreService::GetNextCorrelationID() {
- return application_manager_.GetNextHMICorrelationID();
-}
-
-std::vector<ApplicationSharedPtr> CoreService::GetApplications(
- AppExtensionUID uid) {
- ApplicationSet accessor = application_manager_.applications().GetData();
- AppExtensionPredicate predicate;
- predicate.uid = uid;
-
- std::vector<ApplicationSharedPtr> result;
- ApplicationSetConstIt it =
- std::find_if(accessor.begin(), accessor.end(), predicate);
- while (it != accessor.end()) {
- result.push_back(*it);
- it = std::find_if(++it, accessor.end(), predicate);
- }
- return result;
-}
-
-void CoreService::ChangeNotifyHMILevel(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level) {
- DCHECK_OR_RETURN_VOID(app);
- application_manager_.ChangeAppsHMILevel(app->app_id(), level);
-}
-
-const smart_objects::SmartObject* CoreService::GetRCCapabilities() const {
- return application_manager_.hmi_capabilities().rc_capability();
-}
-
-void CoreService::NotifyHMIAboutHMILevel(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level) {
- DCHECK_OR_RETURN_VOID(app);
- if (app->hmi_level() != mobile_apis::HMILevel::eType::HMI_FULL) {
- MessageHelper::SendActivateAppToHMI(
- app->app_id(),
- application_manager_,
- static_cast<hmi_apis::Common_HMILevel::eType>(level),
- true);
- }
-}
-
-bool CoreService::AreParametersAllowed(
- MessagePtr msg, const CommandParametersPermissions& params) {
- Json::Reader reader;
- Json::Value json;
- bool ret = reader.parse(msg->json_message(), json);
- if (ret) {
- return CheckParams(json.get(strings::params, Json::Value(Json::nullValue)),
- params.allowed_params);
- }
- return false;
-}
-
-bool CoreService::CheckParams(const Json::Value& object,
- const RPCParams& allowed_params) {
- if (!object.isObject()) {
- return true;
- }
- for (Json::Value::iterator i = object.begin(); i != object.end(); ++i) {
- std::string name = i.memberName();
- if (!IsAllowed(name, allowed_params)) {
- return false;
- }
- }
- return true;
-}
-
-bool CoreService::IsAllowed(const std::string& name,
- const RPCParams& allowed_params) {
- return std::find(allowed_params.begin(), allowed_params.end(), name) !=
- allowed_params.end();
-}
-
-bool CoreService::GetModuleTypes(const std::string& policy_app_id,
- std::vector<std::string>* modules) const {
-#ifdef SDL_REMOTE_CONTROL
- return application_manager_.GetPolicyHandler().GetModuleTypes(policy_app_id,
- modules);
-#endif // SDL_REMOTE_CONTROL
- return false;
-}
-
-MessageValidationResult CoreService::ValidateMessageBySchema(
- const Message& message) {
- const MessageValidationResult result =
- application_manager_.ValidateMessageBySchema(message);
- LOG4CXX_DEBUG(logger_, "Validation result : " << result);
- return result;
-}
-
-const ApplicationManagerSettings& CoreService::GetSettings() const {
- return application_manager_.get_settings();
-}
-
-} // 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 b19a6f9194..f1e5bf9735 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
@@ -39,8 +39,7 @@ namespace application_manager {
namespace event_engine {
using namespace sync_primitives;
-EventDispatcherImpl::EventDispatcherImpl()
- : state_lock_(false), observer_lock_(true), observers_event_() {}
+EventDispatcherImpl::EventDispatcherImpl() : observers_event_() {}
EventDispatcherImpl::~EventDispatcherImpl() {}
diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc
new file mode 100644
index 0000000000..016e09635b
--- /dev/null
+++ b/src/components/application_manager/src/help_prompt_manager_impl.cc
@@ -0,0 +1,388 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "application_manager/help_prompt_manager_impl.h"
+
+#include <algorithm>
+#include <iterator>
+
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HelpPromptManagerImpl")
+
+namespace {
+const size_t kLimitCommand = 30;
+}
+
+namespace application_manager {
+
+HelpPromptManagerImpl::HelpPromptManagerImpl(Application& app,
+ ApplicationManager& app_manager)
+ : app_(app)
+ , app_manager_(app_manager)
+ , sending_type_(SendingType::kSendBoth)
+ , is_tts_send_(false)
+ , is_ui_send_(false) {}
+
+HelpPromptManagerImpl::~HelpPromptManagerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool HelpPromptManagerImpl::AddCommand(
+ const uint32_t cmd_id, const smart_objects::SmartObject& command) {
+ if (!command.keyExists(strings::vr_commands)) {
+ LOG4CXX_DEBUG(logger_, "vr_commands does`t present");
+ return false;
+ }
+
+ const smart_objects::SmartObject& commands = command[strings::vr_commands];
+ if (commands.empty()) {
+ LOG4CXX_DEBUG(logger_, "vr_commands array is empty");
+ return false;
+ }
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+ auto it = std::find_if(
+ vr_commands_.begin(),
+ vr_commands_.end(),
+ [cmd_id](const VRCommandPair& pair) { return pair.first == cmd_id; });
+
+ if (vr_commands_.end() != it) {
+ LOG4CXX_DEBUG(logger_, "Command with id:" << cmd_id << " already exists");
+ return false;
+ }
+
+ const bool limit_exceeded =
+ kLimitCommand <= GetCommandsCount(vr_commands_.end());
+
+ LOG4CXX_DEBUG(logger_,
+ "Will be added first command from array "
+ << strings::vr_commands);
+
+ smart_objects::SmartObjectSPtr vr_item =
+ std::make_shared<smart_objects::SmartObject>(commands.asArray()->front());
+ vr_commands_.push_back(std::make_pair(cmd_id, vr_item));
+
+ LOG4CXX_DEBUG(logger_,
+ "VR command with id: " << cmd_id << " added for appID: "
+ << app_.app_id() << ". Total "
+ << vr_commands_.size() << " in cache");
+
+ return !limit_exceeded;
+}
+
+bool HelpPromptManagerImpl::DeleteCommand(const uint32_t cmd_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+
+ auto it = std::find_if(
+ vr_commands_.begin(),
+ vr_commands_.end(),
+ [cmd_id](const VRCommandPair& pair) { return pair.first == cmd_id; });
+
+ if (vr_commands_.end() == it) {
+ LOG4CXX_WARN(logger_, "VR command with id: " << cmd_id << " not found");
+ return false;
+ }
+
+ const size_t commands_before_current = GetCommandsCount(it);
+ vr_commands_.erase(it);
+ LOG4CXX_DEBUG(logger_,
+ "VR command with id: "
+ << cmd_id << " found after " << commands_before_current
+ << " commands was deleted for appID: " << app_.app_id()
+ << " Cache size after deleting: " << vr_commands_.size());
+
+ return commands_before_current < kLimitCommand;
+}
+
+void HelpPromptManagerImpl::OnVrCommandAdded(
+ const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ << " commands with id:" << cmd_id
+ << " will not be added");
+ return;
+ }
+ if (AddCommand(cmd_id, command) && !is_resumption) {
+ SendRequests();
+ }
+}
+
+void HelpPromptManagerImpl::OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ << " commands with id:" << cmd_id
+ << " will not be deleted");
+ return;
+ }
+ if (DeleteCommand(cmd_id) && !is_resumption) {
+ SendRequests();
+ }
+}
+
+void HelpPromptManagerImpl::OnSetGlobalPropertiesReceived(
+ const smart_objects::SmartObject& msg, const bool is_response) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ " do not track SetGlobalProperties");
+ return;
+ }
+
+ if (!is_response) {
+ if (msg.keyExists(strings::help_prompt)) {
+ is_tts_send_ = true;
+ }
+ if (msg.keyExists(strings::vr_help)) {
+ is_ui_send_ = true;
+ }
+
+ LOG4CXX_DEBUG(logger_, "is_tts_send_:" << is_tts_send_);
+ LOG4CXX_DEBUG(logger_, "is_ui_send_:" << is_ui_send_);
+ return;
+ }
+
+ SetSendingType(msg);
+}
+
+HelpPromptManagerImpl::SendingType HelpPromptManagerImpl::GetSendingType()
+ const {
+ return sending_type_;
+}
+
+size_t HelpPromptManagerImpl::GetCommandsCount(
+ VRCommandPairs::const_iterator end_element) const {
+ return std::distance(vr_commands_.begin(), end_element);
+}
+
+void HelpPromptManagerImpl::GenerateVrItems(
+ smart_objects::SmartObject& out_msg_params, const char* vr_key) const {
+ out_msg_params[vr_key] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ const size_t count_to_add = std::min(vr_commands_.size(), kLimitCommand);
+ for (size_t i = 0; i < count_to_add; ++i) {
+ const VRCommandPair& pair = vr_commands_[i];
+
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = pair.second->asString();
+ if (strings::help_prompt == vr_key) {
+ item[strings::type] = mobile_apis::SpeechCapabilities::SC_TEXT;
+ } else {
+ item[strings::position] = i + 1;
+ }
+
+ out_msg_params[vr_key][i] = item;
+ }
+}
+
+void HelpPromptManagerImpl::SendTTSRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "TTS request for appID:" << app_.app_id());
+ smart_objects::SmartObjectSPtr tts_global_properties =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ if (tts_global_properties) {
+ smart_objects::SmartObject& ref = *tts_global_properties;
+
+ ref[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ ref[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ ref[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ ref[strings::params][strings::correlation_id] =
+ app_manager_.GetNextHMICorrelationID();
+
+ smart_objects::SmartObject& so_to_send = *tts_global_properties;
+ so_to_send[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::TTS_SetGlobalProperties;
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ CreatePromptMsg(msg_params);
+
+ msg_params[strings::app_id] = app_.app_id();
+ so_to_send[strings::msg_params] = msg_params;
+ app_manager_.GetRPCService().ManageHMICommand(tts_global_properties);
+ }
+ is_tts_send_ = false;
+}
+
+void HelpPromptManagerImpl::SendUIRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "UI request for appID:" << app_.app_id());
+ smart_objects::SmartObjectSPtr ui_global_properties =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ if (ui_global_properties) {
+ smart_objects::SmartObject& ref = *ui_global_properties;
+
+ ref[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ ref[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ ref[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ ref[strings::params][strings::correlation_id] =
+ app_manager_.GetNextHMICorrelationID();
+
+ smart_objects::SmartObject& so_to_send = *ui_global_properties;
+ so_to_send[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_SetGlobalProperties;
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ CreateVRMsg(msg_params);
+
+ msg_params[strings::app_id] = app_.app_id();
+ so_to_send[strings::msg_params] = msg_params;
+ app_manager_.GetRPCService().ManageHMICommand(ui_global_properties);
+ }
+ is_ui_send_ = false;
+}
+
+void HelpPromptManagerImpl::SendBothRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendTTSRequest();
+ SendUIRequest();
+}
+
+void HelpPromptManagerImpl::SendRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+ switch (sending_type_) {
+ case SendingType::kSendHelpPrompt:
+ SendTTSRequest();
+ return;
+ case SendingType::kSendVRHelp:
+ SendUIRequest();
+ return;
+ case SendingType::kSendBoth:
+ SendBothRequests();
+ return;
+ case SendingType::kNoneSend:
+ break;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "SendingType:" << static_cast<uint32_t>(sending_type_)
+ << " request not sending");
+}
+
+void HelpPromptManagerImpl::CreatePromptMsg(
+ smart_objects::SmartObject& out_msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GenerateVrItems(out_msg_params, strings::help_prompt);
+ app_.set_help_prompt(out_msg_params[strings::help_prompt]);
+}
+
+void HelpPromptManagerImpl::CreateVRMsg(
+ smart_objects::SmartObject& out_msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (false == out_msg_params.keyExists(strings::vr_help_title)) {
+ if (app_.vr_help_title()) {
+ out_msg_params[strings::vr_help_title] = (*app_.vr_help_title());
+ } else {
+ out_msg_params[strings::vr_help_title] = app_.name();
+ }
+ }
+
+ GenerateVrItems(out_msg_params, strings::vr_help);
+
+ if (out_msg_params[strings::vr_help].empty()) {
+ out_msg_params.erase(strings::vr_help);
+ app_.reset_vr_help();
+ } else {
+ app_.set_vr_help(out_msg_params[strings::vr_help]);
+ }
+}
+
+void HelpPromptManagerImpl::SetSendingType(
+ const smart_objects::SmartObject& msg) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ hmi_apis::Common_Result::eType result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ msg[strings::params][hmi_response::code].asInt());
+ LOG4CXX_DEBUG(logger_, "HMI response result:" << result);
+ if (hmi_apis::Common_Result::eType::SUCCESS == result) {
+ hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ msg[strings::params][strings::function_id].asUInt());
+ LOG4CXX_DEBUG(logger_, "Function id:" << function_id);
+ switch (function_id) {
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ if (is_tts_send_) {
+ is_tts_send_ = false;
+ sending_type_ = SendingType::kSendHelpPrompt == sending_type_
+ ? SendingType::kNoneSend
+ : SendingType::kSendVRHelp;
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ if (is_ui_send_) {
+ is_ui_send_ = false;
+ sending_type_ = SendingType::kSendVRHelp == sending_type_
+ ? SendingType::kNoneSend
+ : SendingType::kSendHelpPrompt;
+ }
+ break;
+ }
+ default: { break; }
+ }
+ LOG4CXX_DEBUG(
+ logger_,
+ "Sending type set to:" << static_cast<uint32_t>(sending_type_));
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc
index 16b49faa2a..59f1c6caf2 100644
--- a/src/components/application_manager/src/helpers/application_helper.cc
+++ b/src/components/application_manager/src/helpers/application_helper.cc
@@ -21,6 +21,7 @@ void DeleteCommands(ApplicationSharedPtr app, ApplicationManager& app_manager) {
for (auto cmd : cmap) {
MessageHelper::SendDeleteCommandRequest(cmd.second, app, app_manager);
app->RemoveCommand(cmd.first);
+ app->help_prompt_manager().OnVrCommandDeleted(cmd.first, true);
}
}
@@ -87,20 +88,6 @@ void DeleteButtonSubscriptions(ApplicationSharedPtr app,
}
}
-void DeleteVISubscriptions(ApplicationSharedPtr app,
- ApplicationManager& app_manager) {
- VehicleInfoSubscriptions ivi = app->SubscribedIVI().GetData();
-
- for (auto i : ivi) {
- app->UnsubscribeFromIVI(i);
- SubscribedToIVIPredicate p(i);
- auto app = FindApp(app_manager.applications(), p);
- if (!app) {
- MessageHelper::SendUnsubscribeIVIRequest(i, app, app_manager);
- }
- }
-}
-
void CleanupAppFiles(ApplicationSharedPtr app) {
const auto icon_file = app->app_icon_path();
@@ -120,14 +107,6 @@ namespace application_manager {
CREATE_LOGGERPTR_GLOBAL(logger, "ApplicationManager")
-SubscribedToIVIPredicate::SubscribedToIVIPredicate(uint32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
-
-bool SubscribedToIVIPredicate::operator()(
- const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
-}
-
void DeleteApplicationData(ApplicationSharedPtr app,
ApplicationManager& app_manager) {
LOG4CXX_AUTO_TRACE(logger);
@@ -139,8 +118,12 @@ void DeleteApplicationData(ApplicationSharedPtr app,
DeleteChoiceSets(app, app_manager);
DeleteGlobalProperties(app, app_manager);
DeleteButtonSubscriptions(app, app_manager);
- DeleteVISubscriptions(app, app_manager);
CleanupAppFiles(app);
+ app_manager.GetPluginManager().ForEachPlugin(
+ [&app](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(
+ plugin_manager::ApplicationEvent::kDeleteApplicationData, app);
+ });
}
} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index e39b728155..f67590543d 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -44,7 +44,7 @@
#include "utils/file_system.h"
namespace application_manager {
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
namespace {
std::map<std::string, hmi_apis::Common_VrCapabilities::eType>
@@ -93,10 +93,14 @@ void InitCapabilities() {
hmi_apis::Common_SpeechCapabilities::PRE_RECORDED));
tts_enum_capabilities.insert(std::make_pair(
std::string("SILENCE"), hmi_apis::Common_SpeechCapabilities::SILENCE));
+ tts_enum_capabilities.insert(std::make_pair(
+ std::string("FILE"), hmi_apis::Common_SpeechCapabilities::FILE));
button_enum_name.insert(
std::make_pair(std::string("OK"), hmi_apis::Common_ButtonName::OK));
button_enum_name.insert(std::make_pair(
+ std::string("PLAY_PAUSE"), hmi_apis::Common_ButtonName::PLAY_PAUSE));
+ button_enum_name.insert(std::make_pair(
std::string("SEEKLEFT"), hmi_apis::Common_ButtonName::SEEKLEFT));
button_enum_name.insert(std::make_pair(
std::string("SEEKRIGHT"), hmi_apis::Common_ButtonName::SEEKRIGHT));
@@ -282,6 +286,9 @@ void InitCapabilities() {
image_field_name_enum.insert(std::make_pair(
std::string("graphic"), hmi_apis::Common_ImageFieldName::graphic));
image_field_name_enum.insert(
+ std::make_pair(std::string("secondaryGraphic"),
+ hmi_apis::Common_ImageFieldName::secondaryGraphic));
+ image_field_name_enum.insert(
std::make_pair(std::string("showConstantTBTIcon"),
hmi_apis::Common_ImageFieldName::showConstantTBTIcon));
image_field_name_enum.insert(std::make_pair(
@@ -548,10 +555,15 @@ void HMICapabilitiesImpl::set_vr_supported_languages(
void HMICapabilitiesImpl::set_display_capabilities(
const smart_objects::SmartObject& display_capabilities) {
- if (display_capabilities_) {
- delete display_capabilities_;
+ if (app_mngr_.IsSOStructValid(
+ hmi_apis::StructIdentifiers::Common_DisplayCapabilities,
+ display_capabilities)) {
+ if (display_capabilities_) {
+ delete display_capabilities_;
+ }
+ display_capabilities_ =
+ new smart_objects::SmartObject(display_capabilities);
}
- display_capabilities_ = new smart_objects::SmartObject(display_capabilities);
}
void HMICapabilitiesImpl::set_hmi_zone_capabilities(
@@ -874,7 +886,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(ui, "displayCapabilities")) {
smart_objects::SmartObject display_capabilities_so;
Json::Value display_capabilities = ui.get("displayCapabilities", "");
- Formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
+ formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
display_capabilities_so);
if (display_capabilities_so.keyExists(hmi_response::display_type)) {
@@ -1071,7 +1083,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value soft_button_capabilities =
ui.get("softButtonCapabilities", "");
smart_objects::SmartObject soft_button_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(
+ formatters::CFormatterJsonBase::jsonValueToObj(
soft_button_capabilities, soft_button_capabilities_so);
set_soft_button_capabilities(soft_button_capabilities_so);
}
@@ -1082,7 +1094,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value navigation_capability =
system_capabilities.get("navigationCapability", "");
smart_objects::SmartObject navigation_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(
+ formatters::CFormatterJsonBase::jsonValueToObj(
navigation_capability, navigation_capability_so);
set_navigation_capability(navigation_capability_so);
if (!navigation_capability_so.empty()) {
@@ -1094,7 +1106,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value phone_capability =
system_capabilities.get("phoneCapability", "");
smart_objects::SmartObject phone_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability,
+ formatters::CFormatterJsonBase::jsonValueToObj(phone_capability,
phone_capability_so);
set_phone_capability(phone_capability_so);
if (!phone_capability_so.empty()) {
@@ -1106,7 +1118,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value vs_capability =
system_capabilities.get("videoStreamingCapability", "");
smart_objects::SmartObject vs_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(vs_capability,
+ formatters::CFormatterJsonBase::jsonValueToObj(vs_capability,
vs_capability_so);
if (vs_capability_so.keyExists("supportedFormats")) {
@@ -1156,7 +1168,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value rc_capability =
system_capabilities.get("remoteControlCapability", "");
smart_objects::SmartObject rc_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
+ formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
rc_capability_so);
set_rc_capability(rc_capability_so);
if (!rc_capability_so.empty()) {
@@ -1235,7 +1247,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(buttons, "capabilities")) {
Json::Value bt_capabilities = buttons.get("capabilities", "");
smart_objects::SmartObject buttons_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
+ formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
buttons_capabilities_so);
for (uint32_t i = 0; i < buttons_capabilities_so.length(); ++i) {
@@ -1255,7 +1267,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(buttons, "presetBankCapabilities")) {
Json::Value presetBank = buttons.get("presetBankCapabilities", "");
smart_objects::SmartObject preset_bank_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
+ formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
preset_bank_so);
set_preset_bank_capabilities(preset_bank_so);
}
@@ -1265,7 +1277,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(root_json, "VehicleInfo")) {
Json::Value vehicle_info = root_json.get("VehicleInfo", "");
smart_objects::SmartObject vehicle_type_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
+ formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
vehicle_type_so);
set_vehicle_type(vehicle_type_so);
} // VehicleType end
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
deleted file mode 100644
index a7f3ce7e6b..0000000000
--- a/src/components/application_manager/src/hmi_command_factory.cc
+++ /dev/null
@@ -1,2317 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Copyright (c) 2017 Xevo Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the copyright holders nor the names of their contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/hmi_command_factory.h"
-
-#include "application_manager/message.h"
-#include "interfaces/HMI_API.h"
-
-#include "application_manager/commands/hmi/update_device_list_request.h"
-#include "application_manager/commands/hmi/update_device_list_response.h"
-#include "application_manager/commands/hmi/on_update_device_list.h"
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-#include "application_manager/commands/hmi/update_app_list_request.h"
-#include "application_manager/commands/hmi/update_app_list_response.h"
-#include "application_manager/commands/hmi/on_find_applications.h"
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-#include "application_manager/commands/hmi/allow_app_request.h"
-#include "application_manager/commands/hmi/allow_app_response.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-#include "application_manager/commands/hmi/update_sdl_request.h"
-#include "application_manager/commands/hmi/update_sdl_response.h"
-#include "application_manager/commands/hmi/activate_app_request.h"
-#include "application_manager/commands/hmi/activate_app_response.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/commands/hmi/get_system_info_request.h"
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/commands/hmi/close_popup_request.h"
-#include "application_manager/commands/hmi/close_popup_response.h"
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_add_command_request.h"
-#include "application_manager/commands/hmi/ui_add_command_response.h"
-#include "application_manager/commands/hmi/ui_delete_command_request.h"
-#include "application_manager/commands/hmi/ui_delete_command_response.h"
-#include "application_manager/commands/hmi/ui_add_submenu_request.h"
-#include "application_manager/commands/hmi/ui_add_submenu_response.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/ui_get_language_request.h"
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_change_registration_request.h"
-#include "application_manager/commands/hmi/ui_change_registration_response.h"
-#include "application_manager/commands/hmi/ui_show_request.h"
-#include "application_manager/commands/hmi/ui_show_response.h"
-#include "application_manager/commands/hmi/ui_alert_request.h"
-#include "application_manager/commands/hmi/ui_alert_response.h"
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-#include "application_manager/commands/hmi/ui_slider_request.h"
-#include "application_manager/commands/hmi/ui_slider_response.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-#include "application_manager/commands/hmi/vr_add_command_request.h"
-#include "application_manager/commands/hmi/vr_add_command_response.h"
-#include "application_manager/commands/hmi/vr_delete_command_request.h"
-#include "application_manager/commands/hmi/vr_delete_command_response.h"
-#include "application_manager/commands/hmi/vr_change_registration_request.h"
-#include "application_manager/commands/hmi/vr_change_registration_response.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/vr_get_language_request.h"
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-#include "application_manager/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-#include "application_manager/commands/hmi/tts_change_registration_request.h"
-#include "application_manager/commands/hmi/tts_change_registration_response.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/tts_get_language_request.h"
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
-#include "application_manager/commands/hmi/tts_speak_request.h"
-#include "application_manager/commands/hmi/tts_speak_response.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/commands/hmi/vi_is_ready_response.h"
-#include "application_manager/commands/hmi/vi_read_did_request.h"
-#include "application_manager/commands/hmi/vi_read_did_response.h"
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
-#include "application_manager/commands/hmi/decrypt_certificate_request.h"
-#include "application_manager/commands/hmi/decrypt_certificate_response.h"
-#endif // EXTERNAL_PROPRIETARY_MODE
-
-#ifdef HMI_DBUS_API
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request_template.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response_template.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h"
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#else
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
-#endif // #ifdef HMI_DBUS_API
-
-#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
-#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_get_way_points_request.h"
-#include "application_manager/commands/hmi/navi_get_way_points_response.h"
-#include "application_manager/commands/hmi/on_ready_notification.h"
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/navi_set_video_config_request.h"
-#include "application_manager/commands/hmi/navi_set_video_config_response.h"
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_stop_stream_response.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-#include "application_manager/commands/hmi/basic_communication_system_response.h"
-#include "application_manager/commands/hmi/basic_communication_on_awake_sdl.h"
-#include "application_manager/commands/hmi/sdl_policy_update.h"
-#include "application_manager/commands/hmi/sdl_policy_update_response.h"
-#include "application_manager/commands/hmi/on_received_policy_update.h"
-#include "application_manager/commands/hmi/on_policy_update.h"
-#include "application_manager/commands/hmi/get_urls.h"
-#include "application_manager/commands/hmi/get_urls_response.h"
-#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
-#include "application_manager/commands/hmi/navi_send_location_request.h"
-#include "application_manager/commands/hmi/navi_send_location_response.h"
-#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/dial_number_request.h"
-#include "application_manager/commands/hmi/dial_number_response.h"
-#include "application_manager/commands/hmi/ui_send_haptic_data_request.h"
-#include "application_manager/commands/hmi/ui_send_haptic_data_response.h"
-
-#include "application_manager/commands/hmi/rc_is_ready_request.h"
-#include "application_manager/commands/hmi/rc_is_ready_response.h"
-#include "application_manager/commands/hmi/rc_get_capabilities_request.h"
-#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
-namespace application_manager {
-
-CommandSharedPtr HMICommandFactory::CreateCommand(
- const commands::MessageSharedPtr& message,
- ApplicationManager& application_manager) {
- const int function_id =
- (*message)[strings::params][strings::function_id].asInt();
- LOG4CXX_DEBUG(
- logger_, "HMICommandFactory::CreateCommand function_id: " << function_id);
-
- CommandSharedPtr command(new application_manager::commands::CommandImpl(
- message, application_manager));
-
- bool is_response = false;
- const int msg_type =
- (*message)[strings::params][strings::message_type].asInt();
- if (msg_type ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- is_response = true;
- LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand response");
- } else if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(
- application_manager::MessageType::kErrorResponse)) {
- is_response = true;
- LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand error response");
- } else {
- LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand request");
- }
-
- switch (function_id) {
- case hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery: {
- command.reset(
- new commands::OnStartDeviceDiscovery(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList: {
- if (is_response) {
- command.reset(new commands::UpdateDeviceListResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UpdateDeviceListRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_ActivateApp: {
- if (is_response) {
- command.reset(
- new commands::ActivateAppResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ActivateAppRequest(message, application_manager));
- }
- break;
- }
-#ifdef EXTERNAL_PROPRIETARY_MODE
- case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: {
- if (is_response) {
- command.reset(new commands::DecryptCertificateResponse(
- message, application_manager));
- } else {
- command.reset(new commands::DecryptCertificateRequest(
- message, application_manager));
- }
- break;
- }
-#endif // EXTERNAL_PROPRIETARY_MODE
- case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: {
- if (is_response) {
- command.reset(
- new commands::GetSystemInfoResponse(message, application_manager));
- } else {
- command.reset(
- new commands::GetSystemInfoRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_ActivateApp: {
- if (is_response) {
- command.reset(
- new commands::SDLActivateAppResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SDLActivateAppRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_PolicyUpdate: {
- if (is_response) {
- command.reset(new commands::SDLPolicyUpdateResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::SDLPolicyUpdate(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_GetURLS: {
- if (is_response) {
- command.reset(
- new commands::GetUrlsResponse(message, application_manager));
- } else {
- command.reset(new commands::GetUrls(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_OnAppPermissionChanged: {
- command.reset(new commands::OnAppPermissionChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_GetListOfPermissions: {
- if (is_response) {
- command.reset(new commands::SDLGetListOfPermissionsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SDLGetListOfPermissionsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_GetUserFriendlyMessage: {
- if (is_response) {
- command.reset(new commands::SDLGetUserFriendlyMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SDLGetUserFriendlyMessageRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_GetStatusUpdate: {
- if (is_response) {
- command.reset(new commands::SDLGetStatusUpdateResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SDLGetStatusUpdateRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_OnStatusUpdate: {
- command.reset(new commands::OnStatusUpdateNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnAppPermissionConsent: {
- command.reset(new commands::OnAppPermissionConsentNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported: {
- if (is_response) {
- command.reset(new commands::MixingAudioSupportedResponse(
- message, application_manager));
- } else {
- command.reset(new commands::MixingAudioSupportedRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications: {
- command.reset(new commands::OnExitAllApplicationsNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_AddCommand: {
- if (is_response) {
- command.reset(
- new commands::UIAddCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIAddCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_DeleteCommand: {
- if (is_response) {
- command.reset(new commands::UIDeleteCommandResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::UIDeleteCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_AddSubMenu: {
- if (is_response) {
- command.reset(
- new commands::UIAddSubmenuResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIAddSubmenuRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_DeleteSubMenu: {
- if (is_response) {
- command.reset(new commands::UIDeleteSubmenuResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::UIDeleteSubmenuRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
- if (is_response) {
- command.reset(new commands::UISetMediaClockTimerResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UISetMediaClockTimerRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_PerformInteraction: {
- if (is_response) {
- command.reset(new commands::UIPerformInteractionResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIPerformInteractionRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_SetGlobalProperties: {
- if (is_response) {
- command.reset(new commands::UISetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UISetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_ScrollableMessage: {
- if (is_response) {
- command.reset(new commands::UIScrollableMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIScrollableMessageRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- if (is_response) {
- command.reset(
- new commands::UISetAppIconResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UISetAppIconRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_GetSupportedLanguages: {
- if (is_response) {
- command.reset(new commands::UIGetSupportedLanguagesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIGetSupportedLanguagesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_GetLanguage: {
- if (is_response) {
- command.reset(
- new commands::UIGetLanguageResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIGetLanguageRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::UIGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_ChangeRegistration: {
- if (is_response) {
- command.reset(new commands::UIChangeRegistratioResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
- if (is_response) {
- command.reset(new commands::UIPerformAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIPerformAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_EndAudioPassThru: {
- if (is_response) {
- command.reset(new commands::UIEndAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIEndAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_Alert: {
- if (is_response) {
- command.reset(
- new commands::UIAlertResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIAlertRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_IsReady: {
- if (is_response) {
- command.reset(
- new commands::VRIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VRIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_AddCommand: {
- if (is_response) {
- command.reset(
- new commands::VRAddCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VRAddCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_DeleteCommand: {
- if (is_response) {
- command.reset(new commands::VRDeleteCommandResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::VRDeleteCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_ChangeRegistration: {
- if (is_response) {
- command.reset(new commands::VRChangeRegistrationResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_GetSupportedLanguages: {
- if (is_response) {
- command.reset(new commands::VRGetSupportedLanguagesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRGetSupportedLanguagesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_GetLanguage: {
- if (is_response) {
- command.reset(
- new commands::VRGetLanguageResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VRGetLanguageRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::VRGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_IsReady: {
- if (is_response) {
- command.reset(
- new commands::TTSIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::TTSIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_ChangeRegistration: {
- if (is_response) {
- command.reset(new commands::TTSChangeRegistratioResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_GetSupportedLanguages: {
- if (is_response) {
- command.reset(new commands::TTSGetSupportedLanguagesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSGetSupportedLanguagesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_StopSpeaking: {
- if (is_response) {
- command.reset(new commands::TTSStopSpeakingResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::TTSStopSpeakingRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_GetLanguage: {
- if (is_response) {
- command.reset(
- new commands::TTSGetLanguageResponse(message, application_manager));
- } else {
- command.reset(
- new commands::TTSGetLanguageRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- if (is_response) {
- command.reset(
- new commands::TTSSpeakResponse(message, application_manager));
- } else {
- command.reset(
- new commands::TTSSpeakRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
- if (is_response) {
- command.reset(new commands::TTSSetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSSetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::TTSGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_Started: {
- command.reset(
- new commands::OnTTSStartedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::TTS_Stopped: {
- command.reset(
- new commands::OnTTSStoppedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppActivated: {
- command.reset(new commands::OnAppActivatedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL: {
- command.reset(
- new commands::OnAwakeSDLNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: {
- command.reset(new commands::OnExitApplicationNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_Show: {
- if (is_response) {
- command.reset(
- new commands::UIShowResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIShowRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_Slider: {
- if (is_response) {
- command.reset(
- new commands::UISliderResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UISliderRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_ClosePopUp: {
- if (is_response) {
- command.reset(
- new commands::ClosePopupResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ClosePopupRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_IsReady: {
- if (is_response) {
- command.reset(
- new commands::UIIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_IsReady: {
- if (is_response) {
- command.reset(
- new commands::VIIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VIIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
- if (is_response) {
- command.reset(
- new commands::VIReadDIDResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VIReadDIDRequest(message, application_manager));
- }
- break;
- }
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetGpsData: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message,
- application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetSpeed: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetRpm: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetRpm>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetRpm>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetFuelLevel: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetPrndl: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetVin: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetVin>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetVin>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetTirePressure: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetOdometer>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetOdometer>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetBeltStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetBodyInformation: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetDriverBraking: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetWiperStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetEngineTorque: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetECallInfo: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetMyKey: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message,
- application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
- if (is_response) {
- command.reset(new commands::VIGetVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIGetVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
-#endif // #ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
- if (is_response) {
- command.reset(
- new commands::VIGetDTCsResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VIGetDTCsRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
- if (is_response) {
- command.reset(new commands::VIDiagnosticMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIDiagnosticMessageRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetVehicleType: {
- if (is_response) {
- command.reset(new commands::VIGetVehicleTypeResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIGetVehicleTypeRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_IsReady: {
- if (is_response) {
- command.reset(
- new commands::NaviIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::NaviIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_AlertManeuver: {
- if (is_response) {
- command.reset(new commands::NaviAlertManeuverResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviAlertManeuverRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_GetWayPoints: {
- if (is_response) {
- command.reset(new commands::NaviGetWayPointsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviGetWayPointsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
- if (is_response) {
- command.reset(new commands::NaviUpdateTurnListResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviUpdateTurnListRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
- if (is_response) {
- command.reset(new commands::NaviShowConstantTBTResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviShowConstantTBTRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
- if (is_response) {
- command.reset(new commands::NaviSubscribeWayPointsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviSubscribeWayPointsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
- if (is_response) {
- command.reset(new commands::NaviUnsubscribeWayPointsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviUnSubscribeWayPointsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Buttons_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::ButtonGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ButtonGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: {
- command.reset(new commands::OnAllowSDLFunctionalityNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnSDLConsentNeeded: {
- command.reset(new commands::OnSDLConsentNeededNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_UpdateSDL: {
- if (is_response) {
- command.reset(
- new commands::UpdateSDLResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UpdateSDLRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: {
- command.reset(new commands::OnIgnitionCycleOverNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: {
- command.reset(new commands::OnSystemInfoChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnReady: {
- command.reset(
- new commands::OnReadyNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen: {
- command.reset(new commands::OnDeviceChosenNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnSystemContext: {
- command.reset(new commands::OnSystemContextNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnDriverDistraction: {
- command.reset(new commands::hmi::OnDriverDistractionNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: {
- command.reset(
- new commands::OnUpdateDeviceList(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppRegistered: {
- command.reset(new commands::OnAppRegisteredNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered: {
- command.reset(new commands::OnAppUnregisteredNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnFindApplications: {
- command.reset(
- new commands::OnFindApplications(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_UpdateAppList: {
- if (is_response) {
- command.reset(
- new commands::UpdateAppListResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UpdateAppListRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_Started: {
- command.reset(
- new commands::OnVRStartedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_Stopped: {
- command.reset(
- new commands::OnVRStoppedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_OnCommand: {
- command.reset(
- new commands::OnVRCommandNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnCommand: {
- command.reset(
- new commands::OnUICommandNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated: {
- command.reset(new commands::OnAppDeactivatedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnLanguageChange: {
- command.reset(new commands::OnUILanguageChangeNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_OnLanguageChange: {
- command.reset(new commands::OnVRLanguageChangeNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::TTS_OnLanguageChange: {
- command.reset(new commands::OnTTSLanguageChangeNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Buttons_OnButtonEvent: {
- command.reset(new commands::hmi::OnButtonEventNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Buttons_OnButtonPress: {
- command.reset(new commands::hmi::OnButtonPressNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Buttons_OnButtonSubscription: {
- command.reset(new commands::hmi::OnButtonSubscriptionNotification(
- message, application_manager));
- break;
- }
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_SubscribeGps: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeRpm: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribePrndl: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeVin: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>(
- message, application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData: {
- if (is_response) {
- command.reset(new commands::VISubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VISubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
-#endif // #ifdef HMI_DBUS_API
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeInstantFuelConsumption>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeInstantFuelConsumption>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>(
- message, application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData: {
- if (is_response) {
- command.reset(new commands::VIUnsubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIUnsubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
-#endif // #ifdef HMI_DBUS_API
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_OnGpsData: {
- command.reset(
- new commands::OnVIGpsDataNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnSpeed: {
- command.reset(
- new commands::OnVISpeedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnRpm: {
- command.reset(
- new commands::OnVIRpmNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnFuelLevel: {
- command.reset(new commands::OnVIFuelLevelNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState: {
- command.reset(new commands::OnVIFuelLevelStateNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption: {
- command.reset(new commands::OnVIInstantFuelConsumptionNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature: {
- command.reset(new commands::OnVIExternalTemperatureNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnVin: {
- command.reset(
- new commands::OnVIVinNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnPrndl: {
- command.reset(
- new commands::OnVIPrndlNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnTirePressure: {
- command.reset(new commands::OnVITirePressureNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnOdometer: {
- command.reset(
- new commands::OnVIOdometerNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnBeltStatus: {
- command.reset(new commands::OnVIBeltStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnBodyInformation: {
- command.reset(new commands::OnVIBodyInformationNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus: {
- command.reset(new commands::OnVIDeviceStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnDriverBraking: {
- command.reset(new commands::OnVIDriverBrakingNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnWiperStatus: {
- command.reset(new commands::OnVIWiperStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus: {
- command.reset(new commands::OnVIHeadLampStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnEngineTorque: {
- command.reset(new commands::OnVIEngineTorqueNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition: {
- command.reset(new commands::OnVIAccPedalPositionNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle: {
- command.reset(new commands::OnVISteeringWheelAngleNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnMyKey: {
- command.reset(
- new commands::OnVIMyKeyNotification(message, application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_OnVehicleData: {
- command.reset(new commands::OnVIVehicleDataNotification(
- message, application_manager));
- break;
- }
-#endif // #ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::Navigation_OnTBTClientState: {
- command.reset(new commands::OnNaviTBTClientStateNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnKeyboardInput: {
- command.reset(new commands::hmi::OnUIKeyBoardInputNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnTouchEvent: {
- command.reset(new commands::hmi::OnUITouchEventNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- command.reset(new commands::hmi::OnUIResetTimeoutNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
- if (is_response) {
- command.reset(new commands::NaviSetVideoConfigResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviSetVideoConfigRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_StartStream: {
- if (is_response) {
- command.reset(new commands::NaviStartStreamResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::NaviStartStreamRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_StopStream: {
- if (is_response) {
- command.reset(
- new commands::NaviStopStreamResponse(message, application_manager));
- } else {
- command.reset(
- new commands::NaviStopStreamRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_StartAudioStream: {
- if (is_response) {
- command.reset(new commands::AudioStartStreamResponse(
- message, application_manager));
- } else {
- command.reset(new commands::AudioStartStreamRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_StopAudioStream: {
- if (is_response) {
- command.reset(new commands::AudioStopStreamResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::AudioStopStreamRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_OnAudioDataStreaming: {
- command.reset(new commands::OnAudioDataStreamingNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Navigation_OnVideoDataStreaming: {
- command.reset(new commands::OnVideoDataStreamingNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_PerformInteraction: {
- if (is_response) {
- command.reset(new commands::VRPerformInteractionResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRPerformInteractionRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSystemRequest: {
- command.reset(new commands::OnSystemRequestNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnPutFile: {
- command.reset(
- new commands::OnPutFileNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource: {
- command.reset(new commands::OnResumeAudioSourceNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_SetDisplayLayout: {
- if (is_response) {
- command.reset(new commands::UiSetDisplayLayoutResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UiSetDisplayLayoutRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSDLClose: {
- command.reset(
- new commands::OnSDLCloseNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete: {
- command.reset(new commands::OnSDLPersistenceCompleteNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnFileRemoved: {
- command.reset(new commands::OnFileRemovedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnRecordStart: {
- command.reset(new commands::OnRecordStartdNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
- if (is_response) {
- command.reset(new commands::BasicCommunicationSystemResponse(
- message, application_manager));
- } else {
- command.reset(new commands::BasicCommunicationSystemRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_SendLocation: {
- if (is_response) {
- command.reset(new commands::NaviSendLocationResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviSendLocationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_AddStatisticsInfo: {
- command.reset(new commands::AddStatisticsInfoNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnSystemError: {
- command.reset(new commands::OnSystemErrorNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate: {
- command.reset(
- new commands::OnReceivedPolicyUpdate(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnPolicyUpdate: {
- command.reset(new commands::OnPolicyUpdate(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: {
- command.reset(new commands::OnDeviceStateChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- command.reset(new commands::hmi::OnTTSResetTimeoutNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: {
- command.reset(new commands::OnEventChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
- if (is_response) {
- command.reset(new commands::hmi::DialNumberResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::hmi::DialNumberRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_OnWayPointChange: {
- command.reset(new commands::OnNaviWayPointChangeNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::RC_IsReady: {
- if (is_response) {
- command.reset(
- new commands::RCIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::RCIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::RC_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::RCGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::RCGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_SendHapticData: {
- if (is_response) {
- command.reset(new commands::UISendHapticDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UISendHapticDataRequest(
- message, application_manager));
- }
- break;
- }
- }
- return command;
-}
-
-} // 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 4479665f64..452b5ab79d 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -61,8 +61,6 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnFileRemoved] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
- convert_map[BasicCommunication_AllowDeviceToConnect] =
- HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnDeviceChosen] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnFindApplications] =
@@ -222,6 +220,13 @@ generate_function_to_interface_convert_map() {
convert_map[SDL_GetURLS] = HmiInterfaces::HMI_INTERFACE_SDL;
convert_map[RC_IsReady] = HmiInterfaces::HMI_INTERFACE_RC;
convert_map[RC_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[Buttons_ButtonPress] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_SetInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_GetInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_GetInteriorVehicleDataConsent] =
+ HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_OnInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_OnRemoteControlSettings] = HmiInterfaces::HMI_INTERFACE_RC;
return convert_map;
}
diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc
index 4e5390a1b4..6e89b2419c 100644
--- a/src/components/application_manager/src/hmi_language_handler.cc
+++ b/src/components/application_manager/src/hmi_language_handler.cc
@@ -33,6 +33,7 @@
#include "application_manager/hmi_language_handler.h"
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/hmi_capabilities.h"
#include "utils/helpers.h"
#include "resumption/last_state.h"
@@ -222,7 +223,8 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile(
const uint32_t connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
DCHECK_OR_RETURN_VOID(notification);
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
@@ -236,8 +238,8 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile(
hmi_capabilities.active_ui_language();
message[strings::msg_params][strings::language] =
hmi_capabilities.active_vr_language();
- if (application_manager_.ManageMobileCommand(notification,
- commands::Command::ORIGIN_SDL)) {
+ if (application_manager_.GetRPCService().ManageMobileCommand(
+ notification, commands::Command::SOURCE_SDL)) {
LOG4CXX_INFO(logger_, "Mobile command sent");
} else {
LOG4CXX_WARN(logger_, "Cannot send mobile command");
@@ -306,11 +308,11 @@ void HMILanguageHandler::HandleWrongLanguageApp(const Apps::value_type& app) {
}
}
SendOnLanguageChangeToMobile(app.first);
- application_manager_.ManageMobileCommand(
+ application_manager_.GetRPCService().ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app.first,
mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
application_manager_.UnregisterApplication(
app.first, mobile_apis::Result::SUCCESS, false);
LOG4CXX_INFO(logger_,
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index bc1ccd8f42..7be9668543 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -32,12 +32,17 @@
*/
#include "application_manager/hmi_state.h"
+#include <ostream>
+#include <boost/assign.hpp>
+#include <boost/bimap.hpp>
#include "application_manager/application_manager.h"
#include "utils/helpers.h"
namespace application_manager {
-HmiState::HmiState(utils::SharedPtr<Application> app,
+CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState")
+
+HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id)
: app_(app)
@@ -45,36 +50,21 @@ HmiState::HmiState(utils::SharedPtr<Application> app,
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
- , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {}
+ , video_streaming_state_(mobile_apis::VideoStreamingState::INVALID_ENUM)
+ , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
+ LOG4CXX_DEBUG(logger_, *this);
+}
-HmiState::HmiState(utils::SharedPtr<Application> app,
+HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: app_(app)
, state_id_(STATE_ID_REGULAR)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
- , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {}
-
-DEPRECATED HmiState::HmiState(uint32_t app_id,
- const ApplicationManager& app_mngr,
- StateID state_id)
- : state_id_(state_id)
- , app_mngr_(app_mngr)
- , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
- , audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
- , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
- app_ = app_mngr_.application(app_id);
-}
-
-DEPRECATED HmiState::HmiState(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : state_id_(STATE_ID_REGULAR)
- , app_mngr_(app_mngr)
- , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
- , audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
+ , video_streaming_state_(mobile_apis::VideoStreamingState::INVALID_ENUM)
, system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
- app_ = app_mngr_.application(app_id);
+ LOG4CXX_DEBUG(logger_, *this);
}
void HmiState::set_parent(HmiStatePtr parent) {
@@ -104,22 +94,14 @@ mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
return AudioStreamingState::NOT_AUDIBLE;
}
-VRHmiState::VRHmiState(utils::SharedPtr<Application> app,
+VRHmiState::VRHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_VR_SESSION) {}
-DEPRECATED VRHmiState::VRHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_VR_SESSION) {}
-
-TTSHmiState::TTSHmiState(utils::SharedPtr<Application> app,
+TTSHmiState::TTSHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_TTS_SESSION) {}
-DEPRECATED TTSHmiState::TTSHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_TTS_SESSION) {}
-
mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
const {
using namespace helpers;
@@ -135,13 +117,24 @@ mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
return expected_state;
}
-NaviStreamingHmiState::NaviStreamingHmiState(utils::SharedPtr<Application> app,
- const ApplicationManager& app_mngr)
- : HmiState(app, app_mngr, STATE_ID_NAVI_STREAMING) {}
+VideoStreamingHmiState::VideoStreamingHmiState(
+ std::shared_ptr<Application> app, const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_VIDEO_STREAMING) {}
+
+mobile_apis::VideoStreamingState::eType
+VideoStreamingHmiState::video_streaming_state() const {
+ if (app_->IsVideoApplication()) {
+ return parent()->video_streaming_state();
+ }
-DEPRECATED NaviStreamingHmiState::NaviStreamingHmiState(
- uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_NAVI_STREAMING) {}
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+}
+
+NaviStreamingHmiState::NaviStreamingHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr)
+ : VideoStreamingHmiState(app, app_mngr) {
+ set_state_id(STATE_ID_NAVI_STREAMING);
+}
mobile_apis::AudioStreamingState::eType
NaviStreamingHmiState::audio_streaming_state() const {
@@ -149,24 +142,24 @@ NaviStreamingHmiState::audio_streaming_state() const {
using namespace mobile_apis;
AudioStreamingState::eType expected_state = parent()->audio_streaming_state();
- if (!is_navi_app() && AudioStreamingState::AUDIBLE == expected_state) {
+ if (!is_navi_app() && Compare<AudioStreamingState::eType, EQ, ONE>(
+ expected_state,
+ AudioStreamingState::AUDIBLE,
+ AudioStreamingState::ATTENUATED)) {
if (app_mngr_.is_attenuated_supported()) {
expected_state = AudioStreamingState::ATTENUATED;
} else {
expected_state = AudioStreamingState::NOT_AUDIBLE;
}
}
+
return expected_state;
}
-PhoneCallHmiState::PhoneCallHmiState(utils::SharedPtr<Application> app,
+PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_PHONE_CALL) {}
-DEPRECATED PhoneCallHmiState::PhoneCallHmiState(
- uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_PHONE_CALL) {}
-
mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
using namespace helpers;
using namespace mobile_apis;
@@ -184,22 +177,14 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
return HMILevel::HMI_BACKGROUND;
}
-SafetyModeHmiState::SafetyModeHmiState(utils::SharedPtr<Application> app,
+SafetyModeHmiState::SafetyModeHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_SAFETY_MODE) {}
-DEPRECATED SafetyModeHmiState::SafetyModeHmiState(
- uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_SAFETY_MODE) {}
-
-DeactivateHMI::DeactivateHMI(utils::SharedPtr<Application> app,
+DeactivateHMI::DeactivateHMI(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
-DEPRECATED DeactivateHMI::DeactivateHMI(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
-
mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
using namespace helpers;
using namespace mobile_apis;
@@ -208,42 +193,32 @@ mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
+
return HMILevel::HMI_BACKGROUND;
}
-AudioSource::AudioSource(utils::SharedPtr<Application> app,
+AudioSource::AudioSource(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
- : HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE) {}
-
-DEPRECATED AudioSource::AudioSource(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_AUDIO_SOURCE) {}
+ : HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE)
+ , keep_context_(app->keep_context()) {
+ app_->set_keep_context(false);
+}
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
- using namespace mobile_apis;
- using namespace helpers;
- // TODO(AOleynik): That NONE check is necessary to avoid issue during
+ // Checking for NONE is necessary to avoid issue during
// calculation of HMI level during setting default HMI level
- // Should be investigated (used in multiple places here), since looks weird
- if (Compare<HMILevel::eType, EQ, ONE>(parent()->hmi_level(),
- HMILevel::HMI_BACKGROUND,
- HMILevel::HMI_NONE)) {
+ if (keep_context_ ||
+ mobile_apis::HMILevel::HMI_NONE == parent()->hmi_level()) {
return parent()->hmi_level();
}
- if (is_navi_app() || is_voice_communication_app()) {
- return HMILevel::HMI_LIMITED;
- }
- return HMILevel::HMI_BACKGROUND;
+
+ return mobile_apis::HMILevel::HMI_BACKGROUND;
}
-EmbeddedNavi::EmbeddedNavi(utils::SharedPtr<Application> app,
+EmbeddedNavi::EmbeddedNavi(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
-DEPRECATED EmbeddedNavi::EmbeddedNavi(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
-
mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
using namespace mobile_apis;
using namespace helpers;
@@ -252,9 +227,46 @@ mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
- if (is_media_app()) {
- return HMILevel::HMI_LIMITED;
- }
return HMILevel::HMI_BACKGROUND;
}
+
+namespace {
+typedef boost::bimap<HmiState::StateID, std::string> StateID2StrMap;
+const StateID2StrMap kStateID2StrMap =
+ boost::assign::list_of<StateID2StrMap::relation>(
+ HmiState::StateID::STATE_ID_CURRENT, "CURRENT")(
+ HmiState::StateID::STATE_ID_REGULAR, "REGULAR")(
+ HmiState::StateID::STATE_ID_POSTPONED, "POSTPONED")(
+ HmiState::StateID::STATE_ID_PHONE_CALL, "PHONE_CALL")(
+ HmiState::StateID::STATE_ID_SAFETY_MODE, "SAFETY_MODE")(
+ HmiState::StateID::STATE_ID_VR_SESSION, "VR_SESSION")(
+ HmiState::StateID::STATE_ID_TTS_SESSION, "TTS_SESSION")(
+ HmiState::StateID::STATE_ID_VIDEO_STREAMING, "VIDEO_STREAMING")(
+ HmiState::StateID::STATE_ID_NAVI_STREAMING, "NAVI_STREAMING")(
+ HmiState::StateID::STATE_ID_DEACTIVATE_HMI, "DEACTIVATE_HMI")(
+ HmiState::StateID::STATE_ID_AUDIO_SOURCE, "AUDIO_SOURCE")(
+ HmiState::StateID::STATE_ID_EMBEDDED_NAVI, "EMBEDDED_NAVI");
+} // anonymous namespace
+
+std::ostream& operator<<(std::ostream& os, const HmiState::StateID src) {
+ try {
+ os << kStateID2StrMap.left.at(src);
+ } catch (const std::exception&) {
+ // specified element have NOT been found
+ os << "UNRECOGNIZED(" << static_cast<int>(src) << ")";
+ }
+
+ return os;
+}
+
+std::ostream& operator<<(std::ostream& os, const HmiState& src) {
+ os << "HMIState(app id:" << src.app_->app_id() << ", state:" << src.state_id()
+ << ", hmi_level:" << src.hmi_level()
+ << ", audio:" << src.audio_streaming_state()
+ << ", video:" << src.video_streaming_state()
+ << ", context:" << src.system_context() << ')';
+
+ return os;
}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
index 7bc686aef1..332d68adbf 100644
--- a/src/components/application_manager/src/message.cc
+++ b/src/components/application_manager/src/message.cc
@@ -130,11 +130,9 @@ int32_t Message::function_id() const {
return function_id_;
}
-#ifdef SDL_REMOTE_CONTROL
std::string Message::function_name() const {
return function_name_;
}
-#endif // SDL_REMOTE_CONTROL
int32_t Message::correlation_id() const {
return correlation_id_;
@@ -176,11 +174,9 @@ void Message::set_function_id(int32_t id) {
function_id_ = id;
}
-#ifdef SDL_REMOTE_CONTROL
void Message::set_function_name(const std::string& name) {
function_name_ = name;
}
-#endif // SDL_REMOTE_CONTROL
void Message::set_correlation_id(int32_t id) {
correlation_id_ = id;
@@ -194,19 +190,6 @@ void Message::set_message_type(MessageType type) {
type_ = type;
}
-void Message::set_binary_data(BinaryData* data) {
- if (NULL == data) {
- NOTREACHED();
- return;
- }
-
- if (binary_data_) {
- delete binary_data_;
- }
-
- binary_data_ = new BinaryData(*data);
-}
-
void Message::set_binary_data(const BinaryData* data) {
if (NULL == data) {
NOTREACHED();
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 0270f23144..e99db3bece 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -2,6 +2,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -50,6 +53,7 @@
#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/rpc_service.h"
#include "connection_handler/connection_handler_impl.h"
#include "transport_manager/common.h"
#include "interfaces/MOBILE_API.h"
@@ -57,11 +61,12 @@
#include "utils/file_system.h"
#include "utils/macro.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
#include "formatters/formatter_json_rpc.h"
#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "json/json.h"
+#include "formatters/CFormatterJsonBase.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
@@ -91,11 +96,8 @@ bool ValidateSoftButtons(smart_objects::SmartObject& soft_buttons) {
// Check if image parameter is valid
if (button.keyExists(strings::image)) {
SmartObject& buttonImage = button[strings::image];
-
- // Image name must not be empty and must not contain incorrect
- // character
- if (false == MessageHelper::VerifySoftButtonString(
- buttonImage[strings::value].asString())) {
+ if (false ==
+ MessageHelper::VerifyString(buttonImage[strings::value].asString())) {
return false;
}
}
@@ -172,8 +174,12 @@ std::pair<std::string,
mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE),
std::make_pair(strings::instant_fuel_consumption,
mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
+ std::make_pair(strings::fuel_range,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE),
std::make_pair(strings::external_temp,
mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
+ std::make_pair(strings::turn_signal,
+ mobile_apis::VehicleDataType::VEHICLEDATA_TURNSIGNAL),
std::make_pair(strings::vin, mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
std::make_pair(strings::prndl,
mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
@@ -183,6 +189,9 @@ std::pair<std::string,
mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
std::make_pair(strings::belt_status,
mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
+ std::make_pair(
+ strings::electronic_park_brake_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ELECTRONICPARKBRAKESTATUS),
std::make_pair(strings::body_information,
mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
std::make_pair(strings::device_status,
@@ -214,64 +223,51 @@ std::pair<std::string,
mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
std::make_pair(strings::steering_wheel_angle,
mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
-};
+ std::make_pair(strings::engine_oil_life,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)};
const VehicleData MessageHelper::vehicle_data_(
kVehicleDataInitializer,
kVehicleDataInitializer + ARRAYSIZE(kVehicleDataInitializer));
-#ifdef HMI_DBUS_API
-namespace {
-struct VehicleInfo_Requests {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-static VehicleInfo_Requests ivi_subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
-};
+smart_objects::SmartObjectSPtr MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id) {
+ using smart_objects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr object(
+ new SmartObject(smart_objects::SmartType_Map));
+ (*object)[strings::params][strings::message_type] =
+ static_cast<int>(kNotification);
+ (*object)[strings::params][strings::function_id] = function_id;
+ (*object)[strings::params][strings::connection_key] = app_id;
+ (*object)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*object)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ (*object)[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ return object;
+}
+
+ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
+MessageHelper::CreateHMINotification(hmi_apis::FunctionID::eType function_id) {
+ using smart_objects::SmartObject;
+ using smart_objects::SmartObjectSPtr;
+ using smart_objects::SmartType_Map;
+ LOG4CXX_AUTO_TRACE(logger_);
+ SmartObjectSPtr notification_ptr =
+ std::make_shared<SmartObject>(SmartType_Map);
+ SmartObject& notification = *notification_ptr;
+ notification[strings::params][strings::message_type] =
+ static_cast<int32_t>(kNotification);
+ notification[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ notification[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ notification[strings::params][strings::function_id] = function_id;
+
+ return notification_ptr;
}
-#endif // #ifdef HMI_DBUS_API
const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
CommonAppPriorityMap::const_iterator it = app_priority_values.find(priority);
@@ -283,7 +279,7 @@ const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
const std::string& language) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Language::eType value;
if (EnumConversionHelper<hmi_apis::Common_Language::eType>::StringToEnum(
language, &value)) {
@@ -304,7 +300,7 @@ std::string MessageHelper::GetDeviceMacAddressForHandle(
std::string MessageHelper::CommonLanguageToString(
hmi_apis::Common_Language::eType language) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<hmi_apis::Common_Language::eType>::EnumToCString(
language, &str)) {
@@ -317,7 +313,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
using namespace smart_objects;
- SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
SmartObject& ref = *message;
ref[strings::params][strings::message_type] = static_cast<int>(message_type);
@@ -333,7 +329,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification(
const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
mobile_apis::FunctionID::OnHashChangeID;
@@ -359,7 +355,21 @@ void MessageHelper::SendDecryptCertificateToHMI(const std::string& file_name,
msg_params[hmi_request::file_name] = file_name;
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
+}
+
+void MessageHelper::SendGetSystemTimeRequest(const uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+ SmartObjectSPtr message =
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
+
+ DCHECK(message);
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_GetSystemTime;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendHashUpdateNotification(const uint32_t app_id,
@@ -372,7 +382,8 @@ void MessageHelper::SendHashUpdateNotification(const uint32_t app_id,
}
smart_objects::SmartObjectSPtr so = CreateHashUpdateNotification(app_id);
PrintSmartObject(*so);
- if (!app_mngr.ManageMobileCommand(so, commands::Command::ORIGIN_SDL)) {
+ if (!app_mngr.GetRPCService().ManageMobileCommand(
+ so, commands::Command::SOURCE_SDL)) {
LOG4CXX_ERROR(logger_, "Failed to send HashUpdate notification.");
return;
}
@@ -386,7 +397,7 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] = static_cast<int32_t>(
@@ -424,7 +435,7 @@ void MessageHelper::SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
if ((*cmd).keyExists(strings::vr_commands)) {
@@ -441,7 +452,7 @@ void MessageHelper::SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
}
@@ -467,7 +478,7 @@ void MessageHelper::SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
const DataAccessor<CommandsMap> accessor = application->commands_map();
const CommandsMap& commands = accessor.GetData();
@@ -496,7 +507,7 @@ void MessageHelper::SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
}
}
@@ -529,7 +540,7 @@ void MessageHelper::SendDeleteChoiceSetRequest(smart_objects::SmartObject* cmd,
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
}
@@ -566,7 +577,7 @@ void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
{
@@ -586,7 +597,7 @@ void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
}
@@ -612,41 +623,7 @@ void MessageHelper::SendUnsubscribeButtonNotification(
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
-}
-
-void MessageHelper::SendUnsubscribeIVIRequest(int32_t ivi_id,
- ApplicationSharedPtr application,
- ApplicationManager& app_mngr) {
- using namespace smart_objects;
-
- std::string key_name;
- for (auto item : vehicle_data_) {
- if (ivi_id == item.second) {
- key_name = item.first;
- break;
- }
- }
-
- if (key_name.empty()) {
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[key_name] = true;
-
- SmartObjectSPtr message = CreateMessageForHMI(
- hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
- DCHECK(message);
-
- SmartObject& object = *message;
- object[strings::params][strings::function_id] =
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData;
-
- object[strings::msg_params] = msg_params;
-
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
const VehicleData& MessageHelper::vehicle_data() {
@@ -655,7 +632,7 @@ const VehicleData& MessageHelper::vehicle_data() {
std::string MessageHelper::HMIResultToString(
hmi_apis::Common_Result::eType hmi_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::EnumToCString(
hmi_result, &str)) {
@@ -666,7 +643,7 @@ std::string MessageHelper::HMIResultToString(
hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
const std::string& hmi_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Result::eType value;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::StringToEnum(
hmi_result, &value)) {
@@ -677,7 +654,7 @@ hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
std::string MessageHelper::MobileResultToString(
mobile_apis::Result::eType mobile_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::Result::eType>::EnumToCString(
mobile_result, &str)) {
@@ -688,7 +665,7 @@ std::string MessageHelper::MobileResultToString(
mobile_apis::Result::eType MessageHelper::MobileResultFromString(
const std::string& mobile_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::Result::eType value;
if (EnumConversionHelper<mobile_apis::Result::eType>::StringToEnum(
mobile_result, &value)) {
@@ -715,12 +692,12 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult(
return HMIResultFromString(result);
}
-#ifdef SDL_REMOTE_CONTROL
void MessageHelper::SendHMIStatusNotification(
const Application& application_impl,
ApplicationManager& application_manager) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
if (!notification) {
LOG4CXX_ERROR(logger_, "Failed to create smart object");
return;
@@ -745,8 +722,8 @@ void MessageHelper::SendHMIStatusNotification(
message[strings::msg_params][strings::system_context] =
static_cast<int32_t>(application_impl.system_context());
- application_manager.ManageMobileCommand(notification,
- commands::Command::ORIGIN_SDL);
+ application_manager.GetRPCService().ManageMobileCommand(
+ notification, commands::Command::SOURCE_SDL);
}
void MessageHelper::SendActivateAppToHMI(
@@ -761,8 +738,9 @@ void MessageHelper::SendActivateAppToHMI(
return;
}
- utils::SharedPtr<smart_objects::SmartObject> message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::shared_ptr<smart_objects::SmartObject> message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_ActivateApp;
@@ -800,13 +778,12 @@ void MessageHelper::SendActivateAppToHMI(
(*message)[strings::msg_params][strings::activate_app_hmi_level] = level;
}
- application_manager.ManageHMICommand(message);
+ application_manager.GetRPCService().ManageHMICommand(message);
}
-#endif // SDL_REMOTE_CONTROL
mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
const std::string& hmi_level) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::HMILevel::eType value;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::StringToEnum(
hmi_level, &value)) {
@@ -817,7 +794,7 @@ mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
std::string MessageHelper::StringifiedHMILevel(
const mobile_apis::HMILevel::eType hmi_level) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::EnumToCString(
hmi_level, &str)) {
@@ -829,7 +806,7 @@ std::string MessageHelper::StringifiedHMILevel(
std::string MessageHelper::StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id) {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::FunctionID::eType>::EnumToCString(
function_id, &str)) {
@@ -842,103 +819,13 @@ std::string MessageHelper::StringifiedFunctionID(
return std::string();
}
-#ifdef HMI_DBUS_API
-namespace {
-const std::map<std::string, uint16_t> create_get_vehicle_data_args() {
- std::map<std::string, uint16_t> rc;
- rc.insert(std::make_pair(strings::gps,
- hmi_apis::FunctionID::VehicleInfo_GetGpsData));
- rc.insert(std::make_pair(strings::speed,
- hmi_apis::FunctionID::VehicleInfo_GetSpeed));
- rc.insert(
- std::make_pair(strings::rpm, hmi_apis::FunctionID::VehicleInfo_GetRpm));
- rc.insert(std::make_pair(strings::fuel_level,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel));
- rc.insert(
- std::make_pair(strings::fuel_level_state,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState));
- rc.insert(std::make_pair(
- strings::instant_fuel_consumption,
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption));
- rc.insert(
- std::make_pair(strings::external_temp,
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature));
- rc.insert(
- std::make_pair(strings::vin, hmi_apis::FunctionID::VehicleInfo_GetVin));
- rc.insert(std::make_pair(strings::prndl,
- hmi_apis::FunctionID::VehicleInfo_GetPrndl));
- rc.insert(std::make_pair(strings::tire_pressure,
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure));
- rc.insert(std::make_pair(strings::odometer,
- hmi_apis::FunctionID::VehicleInfo_GetOdometer));
- rc.insert(std::make_pair(strings::belt_status,
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus));
- rc.insert(
- std::make_pair(strings::body_information,
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation));
- rc.insert(std::make_pair(strings::device_status,
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus));
- rc.insert(std::make_pair(strings::driver_braking,
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking));
- rc.insert(std::make_pair(strings::wiper_status,
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus));
- rc.insert(
- std::make_pair(strings::head_lamp_status,
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus));
- rc.insert(std::make_pair(strings::engine_torque,
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque));
- rc.insert(
- std::make_pair(strings::acc_pedal_pos,
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition));
- rc.insert(
- std::make_pair(strings::steering_wheel_angle,
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle));
- rc.insert(std::make_pair(strings::e_call_info,
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo));
- rc.insert(std::make_pair(strings::airbag_status,
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus));
- rc.insert(
- std::make_pair(strings::emergency_event,
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent));
- rc.insert(
- std::make_pair(strings::cluster_mode_status,
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus));
- rc.insert(std::make_pair(strings::my_key,
- hmi_apis::FunctionID::VehicleInfo_GetMyKey));
- return rc;
-}
-static std::map<std::string, uint16_t> vehicle_data_args =
- create_get_vehicle_data_args();
-}
-#endif
-
void MessageHelper::CreateGetVehicleDataRequest(
const uint32_t correlation_id,
const std::vector<std::string>& params,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
-#ifdef HMI_DBUS_API
- for (std::vector<std::string>::const_iterator it = params.begin();
- it != params.end();
- it++) {
- smart_objects::SmartObjectSPtr request =
- utils::MakeShared<smart_objects::SmartObject>();
-
- (*request)[strings::params][strings::message_type] =
- static_cast<int>(kRequest);
- (*request)[strings::params][strings::correlation_id] = correlation_id;
- (*request)[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- (*request)[strings::params][strings::protocol_type] =
- commands::CommandImpl::hmi_protocol_type_;
- (*request)[strings::params][strings::function_id] =
- static_cast<int>(vehicle_data_args[*it]);
- app_mngr.ManageHMICommand(request);
- }
-#else
-
smart_objects::SmartObjectSPtr request =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*request)[strings::params][strings::message_type] =
static_cast<int>(kRequest);
@@ -956,8 +843,7 @@ void MessageHelper::CreateGetVehicleDataRequest(
it++) {
(*request)[strings::msg_params][*it] = true;
}
- app_mngr.ManageHMICommand(request);
-#endif
+ app_mngr.GetRPCService().ManageHMICommand(request);
}
smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
@@ -967,7 +853,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
uint32_t connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*response)[strings::params][strings::function_id] =
static_cast<int>(function_id);
@@ -991,7 +877,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO(
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr device_list_so =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*device_list_so)[strings::device_list] =
@@ -1025,7 +911,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
uint32_t function_id, ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr module_info =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
smart_objects::SmartObject& object = *module_info;
object[strings::params][strings::message_type] = static_cast<int>(kRequest);
@@ -1041,7 +927,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
const std::string& path_to_icon, uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr set_icon =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!set_icon) {
@@ -1058,79 +944,6 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
return set_icon;
}
-bool MessageHelper::SendIVISubscribtions(const uint32_t app_id,
- ApplicationManager& app_mngr) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- bool result = true;
- ApplicationSharedPtr app = app_mngr.application(app_id);
-
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "Invalid application " << app_id);
- return result;
- }
-
- smart_objects::SmartObjectList requests =
- GetIVISubscriptionRequests(app, app_mngr);
- for (smart_objects::SmartObjectList::const_iterator it = requests.begin();
- it != requests.end();
- ++it) {
- if (!app_mngr.ManageHMICommand(*it)) {
- result = false;
- }
- }
- return result;
-}
-
-smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
- ApplicationSharedPtr app, ApplicationManager& app_mngr) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObjectList hmi_requests;
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer ");
- return hmi_requests;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- const VehicleData& vehicle_data = MessageHelper::vehicle_data_;
- VehicleData::const_iterator ivi_it = vehicle_data.begin();
- DataAccessor<VehicleInfoSubscriptions> vi_accessor = app->SubscribedIVI();
- const VehicleInfoSubscriptions& subscriptions = vi_accessor.GetData();
-
- for (; vehicle_data.end() != ivi_it; ++ivi_it) {
- mobile_apis::VehicleDataType::eType type_id = ivi_it->second;
- if (subscriptions.end() != subscriptions.find(type_id)) {
- std::string key_name = ivi_it->first;
- msg_params[key_name] = true;
- }
- }
-
-#ifdef HMI_JSON_API
- smart_objects::SmartObjectSPtr request = MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData, app_mngr);
- (*request)[strings::msg_params] = msg_params;
- hmi_requests.push_back(request);
-#endif // #ifdef HMI_JSON_API
-#ifdef HMI_DBUS_API
- // Generate list of ivi_subrequests
- for (size_t i = 0; i < sizeof(ivi_subrequests) / sizeof(ivi_subrequests[0]);
- ++i) {
- const VehicleInfo_Requests& sr = ivi_subrequests[i];
- if (true == msg_params.keyExists(sr.str) &&
- true == msg_params[sr.str].asBool()) {
- smart_objects::SmartObjectSPtr request =
- MessageHelper::CreateModuleInfoSO(sr.func_id, app_mngr);
- (*request)[strings::msg_params] = msg_params;
- hmi_requests.push_back(request);
- }
- }
-#endif // #ifdef HMI_DBUS_API
- return hmi_requests;
-}
-
void MessageHelper::SendOnButtonSubscriptionNotification(
uint32_t app_id,
hmi_apis::Common_ButtonName::eType button,
@@ -1141,7 +954,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification(
LOG4CXX_AUTO_TRACE(logger_);
SmartObjectSPtr notification_ptr =
- utils::MakeShared<SmartObject>(SmartType_Map);
+ std::make_shared<SmartObject>(SmartType_Map);
if (!notification_ptr) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
@@ -1163,7 +976,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification(
hmi_apis::FunctionID::Buttons_OnButtonSubscription;
notification[strings::msg_params] = msg_params;
- if (!app_mngr.ManageHMICommand(notification_ptr)) {
+ if (!app_mngr.GetRPCService().ManageHMICommand(notification_ptr)) {
LOG4CXX_ERROR(logger_, "Unable to send HMI notification");
}
}
@@ -1175,7 +988,7 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application pointer ");
return;
}
@@ -1215,7 +1028,7 @@ void MessageHelper::SendSetAppIcon(
if (msg_params) {
so_to_send[strings::msg_params] = *msg_params;
}
- application_manager.ManageHMICommand(set_app_icon);
+ application_manager.GetRPCService().ManageHMICommand(set_app_icon);
}
}
@@ -1231,7 +1044,7 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app,
void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return;
}
@@ -1241,7 +1054,7 @@ void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::const_iterator it = requests.begin();
it != requests.end();
++it) {
- DCHECK(app_mngr.ManageHMICommand(*it));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(*it));
}
}
@@ -1251,14 +1064,24 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectList requests;
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return requests;
}
+ auto& help_prompt_manager =
+ const_cast<Application*>(app.get())->help_prompt_manager();
+
+ const bool can_send_ui = helpers::Compare<HelpPromptManager::SendingType,
+ helpers::EQ,
+ helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendVRHelp,
+ HelpPromptManager::SendingType::kSendBoth);
+
// UI global properties
- if (app->vr_help_title() || app->vr_help()) {
+ if (can_send_ui && (app->vr_help_title() || app->vr_help())) {
smart_objects::SmartObjectSPtr ui_global_properties =
CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!ui_global_properties) {
@@ -1292,8 +1115,15 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
requests.push_back(ui_global_properties);
}
+ const bool can_send_vr = helpers::Compare<HelpPromptManager::SendingType,
+ helpers::EQ,
+ helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendHelpPrompt,
+ HelpPromptManager::SendingType::kSendBoth);
+
// TTS global properties
- if (app->help_prompt() || app->timeout_prompt()) {
+ if (can_send_vr && (app->help_prompt() || app->timeout_prompt())) {
smart_objects::SmartObjectSPtr tts_global_properties =
CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!tts_global_properties) {
@@ -1360,14 +1190,14 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app,
app->set_help_prompt(msg_params[strings::help_prompt]);
msg_params[strings::app_id] = app->app_id();
so_to_send[strings::msg_params] = msg_params;
- app_man.ManageHMICommand(tts_global_properties);
+ app_man.GetRPCService().ManageHMICommand(tts_global_properties);
}
}
smart_objects::SmartObjectSPtr MessageHelper::CreateAppVrHelp(
ApplicationConstSharedPtr app) {
smart_objects::SmartObjectSPtr result =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!result) {
return NULL;
@@ -1428,7 +1258,7 @@ void MessageHelper::SendShowRequestToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::const_iterator it = shows.begin();
it != shows.end();
++it) {
- DCHECK(app_mngr.ManageHMICommand(*it));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(*it));
}
}
@@ -1448,7 +1278,7 @@ void MessageHelper::SendShowConstantTBTRequestToHMI(
static_cast<int>(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
(*navi_show_tbt)[strings::msg_params] = (*app->tbt_show_command());
- DCHECK(app_man.ManageHMICommand(navi_show_tbt));
+ DCHECK(app_man.GetRPCService().ManageHMICommand(navi_show_tbt));
}
}
@@ -1462,7 +1292,7 @@ void MessageHelper::SendAddCommandRequestToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::iterator it = requests.begin();
it != requests.end();
++it) {
- DCHECK(app_man.ManageHMICommand(*it));
+ DCHECK(app_man.GetRPCService().ManageHMICommand(*it));
}
}
@@ -1590,7 +1420,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration(
void MessageHelper::SendUIChangeRegistrationRequestToHMI(
ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Application is not valid");
return;
}
@@ -1604,7 +1434,7 @@ void MessageHelper::SendUIChangeRegistrationRequestToHMI(
app_mngr);
if (ui_command) {
- app_mngr.ManageHMICommand(ui_command);
+ app_mngr.GetRPCService().ManageHMICommand(ui_command);
}
}
}
@@ -1616,7 +1446,7 @@ void MessageHelper::SendAddVRCommandToHMI(
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr request =
CreateAddVRCommandToHMI(cmd_id, vr_commands, app_id, app_mngr);
- DCHECK(app_mngr.ManageHMICommand(request));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(request));
}
smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
@@ -1651,13 +1481,47 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
return vr_command;
}
+bool MessageHelper::CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output) {
+ DCHECK_OR_RETURN(output, false);
+
+ std::string device_name;
+ std::string mac_address;
+ std::string transport_type;
+ if (-1 ==
+ session_observer.GetDataOnDeviceID(
+ device_handle, &device_name, NULL, &mac_address, &transport_type)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to extract information for device " << device_handle);
+ }
+
+ smart_objects::SmartObject& device_info_map = *output;
+ device_info_map = smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ device_info_map[strings::name] = device_name;
+ device_info_map[strings::id] = mac_address;
+ device_info_map[strings::transport_type] =
+ app_mngr.GetDeviceTransportType(transport_type);
+
+ const policy::DeviceConsent device_consent =
+ policy_handler.GetUserConsentForDevice(mac_address);
+ device_info_map[strings::isSDLAllowed] =
+ policy::DeviceConsent::kDeviceAllowed == device_consent;
+
+ return true;
+}
+
bool MessageHelper::CreateHMIApplicationStruct(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
- NsSmartDeviceLink::NsSmartObjects::SmartObject* output,
+ ns_smart_device_link::ns_smart_objects::SmartObject* output,
ApplicationManager& app_mngr) {
- using NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ using ns_smart_device_link::ns_smart_objects::SmartObject;
DCHECK_OR_RETURN(output, false);
SmartObject& message = *output;
@@ -1669,15 +1533,9 @@ bool MessageHelper::CreateHMIApplicationStruct(
const smart_objects::SmartObject* app_types = app->app_types();
const smart_objects::SmartObject* ngn_media_screen_name =
app->ngn_media_screen_name();
- std::string device_name;
- std::string mac_address;
- std::string transport_type;
- if (-1 ==
- session_observer.GetDataOnDeviceID(
- app->device(), &device_name, NULL, &mac_address, &transport_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device " << app->device());
- }
+ const smart_objects::SmartObject* day_color_scheme = app->day_color_scheme();
+ const smart_objects::SmartObject* night_color_scheme =
+ app->night_color_scheme();
message = smart_objects::SmartObject(smart_objects::SmartType_Map);
message[strings::app_name] = app->name();
@@ -1706,23 +1564,38 @@ bool MessageHelper::CreateHMIApplicationStruct(
message[strings::app_type] = *app_types;
}
+ if (day_color_scheme) {
+ message[strings::day_color_scheme] = *day_color_scheme;
+ }
+
+ if (night_color_scheme) {
+ message[strings::night_color_scheme] = *night_color_scheme;
+ }
+
message[strings::device_info] =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- message[strings::device_info][strings::name] = device_name;
- message[strings::device_info][strings::id] = mac_address;
- const policy::DeviceConsent device_consent =
- policy_handler.GetUserConsentForDevice(mac_address);
- message[strings::device_info][strings::isSDLAllowed] =
- policy::DeviceConsent::kDeviceAllowed == device_consent;
+ smart_objects::SmartObject& device_info = message[strings::device_info];
+ CreateDeviceInfo(
+ app->device(), session_observer, policy_handler, app_mngr, &device_info);
+
+ if (app->secondary_device() != 0) {
+ message[strings::secondary_device_info] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& secondary_device_info =
+ message[strings::secondary_device_info];
+ CreateDeviceInfo(app->secondary_device(),
+ session_observer,
+ policy_handler,
+ app_mngr,
+ &secondary_device_info);
+ }
- message[strings::device_info][strings::transport_type] =
- app_mngr.GetDeviceTransportType(transport_type);
return true;
}
void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return;
}
@@ -1732,7 +1605,7 @@ void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::iterator it = requests.begin();
it != requests.end();
++it) {
- DCHECK(app_mngr.ManageHMICommand(*it));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(*it));
}
}
@@ -1762,6 +1635,12 @@ smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
(*i->second)[strings::menu_name];
msg_params[strings::app_id] = app->app_id();
(*ui_sub_menu)[strings::msg_params] = msg_params;
+ if (((*i->second).keyExists(strings::menu_icon)) &&
+ (0 < (*i->second)[strings::menu_icon][strings::value].length())) {
+ msg_params[strings::menu_icon] = (*i->second)[strings::menu_icon];
+ msg_params[strings::menu_icon][strings::value] =
+ (*i->second)[strings::menu_icon][strings::value].asString();
+ }
requsets.push_back(ui_sub_menu);
}
return requsets;
@@ -1772,7 +1651,7 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
bool is_unexpected_disconnect,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
smart_objects::SmartObject& message = *notification;
@@ -1788,7 +1667,7 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
message[strings::msg_params][strings::app_id] = app->hmi_app_id();
message[strings::msg_params][strings::unexpected_disconnect] =
is_unexpected_disconnect;
- app_mngr.ManageHMICommand(notification);
+ app_mngr.GetRPCService().ManageHMICommand(notification);
}
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
@@ -1802,7 +1681,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_ActivateApp;
@@ -1845,8 +1724,8 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
return;
}
- utils::SharedPtr<smart_objects::SmartObject> message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::shared_ptr<smart_objects::SmartObject> message =
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1857,7 +1736,7 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
app_mngr.GetNextHMICorrelationID();
(*message)[strings::msg_params][strings::app_id] = app_id;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendSDLActivateAppResponse(
@@ -1865,7 +1744,7 @@ void MessageHelper::SendSDLActivateAppResponse(
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1908,13 +1787,13 @@ void MessageHelper::SendSDLActivateAppResponse(
hmi_apis::Common_Result::REJECTED;
}
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendOnSDLConsentNeeded(
const policy::DeviceParams& device_info, ApplicationManager& app_man) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1926,7 +1805,7 @@ void MessageHelper::SendOnSDLConsentNeeded(
device_info.device_mac_address;
(*message)[strings::msg_params]["device"]["name"] = device_info.device_name;
- app_man.ManageHMICommand(message);
+ app_man.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendPolicyUpdate(const std::string& file_path,
@@ -1946,7 +1825,7 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path,
for (size_t i = 0; i < retries.size(); ++i) {
object[strings::msg_params][hmi_request::retry][i] = retries[i];
}
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendGetUserFriendlyMessageResponse(
const std::vector<policy::UserFriendlyMessage>& msg,
@@ -1954,7 +1833,8 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1967,7 +1847,7 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
// If no any messages found - skip sending of "messages" param
if (msg.empty()) {
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
return;
}
@@ -2012,7 +1892,7 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
#endif // EXTERNAL_PROPRIETARY_MODE
}
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
#ifdef EXTERNAL_PROPRIETARY_MODE
@@ -2024,7 +1904,7 @@ void MessageHelper::SendGetListOfPermissionsResponse(
using namespace smart_objects;
using namespace hmi_apis;
- SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
DCHECK_OR_RETURN_VOID(message);
SmartObject& params = (*message)[strings::params];
@@ -2056,7 +1936,7 @@ void MessageHelper::SendGetListOfPermissionsResponse(
external_consent_status.end(),
external_consent_status_appender);
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
#else
void MessageHelper::SendGetListOfPermissionsResponse(
@@ -2066,7 +1946,7 @@ void MessageHelper::SendGetListOfPermissionsResponse(
using namespace smart_objects;
using namespace hmi_apis;
- SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
DCHECK_OR_RETURN_VOID(message);
SmartObject& params = (*message)[strings::params];
@@ -2085,7 +1965,7 @@ void MessageHelper::SendGetListOfPermissionsResponse(
GroupsAppender groups_appender(allowed_functions_array);
std::for_each(permissions.begin(), permissions.end(), groups_appender);
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
#endif // EXTERNAL_PROPRIETARY_MODE
@@ -2107,7 +1987,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
response_data[strings::msg_params][strings::success] = false;
response_data[strings::params][strings::connection_key] = connection_key;
- return utils::MakeShared<smart_objects::SmartObject>(response_data);
+ return std::make_shared<smart_objects::SmartObject>(response_data);
}
void MessageHelper::SendNaviSetVideoConfig(
@@ -2127,7 +2007,7 @@ void MessageHelper::SendNaviSetVideoConfig(
(*request)[strings::msg_params][strings::app_id] = app_id;
(*request)[strings::msg_params][strings::config] = video_params;
- app_mngr.ManageHMICommand(request);
+ app_mngr.GetRPCService().ManageHMICommand(request);
}
void MessageHelper::SendNaviStartStream(const int32_t app_id,
@@ -2166,7 +2046,7 @@ void MessageHelper::SendNaviStartStream(const int32_t app_id,
(*start_stream)[strings::msg_params][strings::app_id] = app_id;
(*start_stream)[strings::msg_params][strings::url] = url;
- app_mngr.ManageHMICommand(start_stream);
+ app_mngr.GetRPCService().ManageHMICommand(start_stream);
}
void MessageHelper::SendNaviStopStream(const int32_t app_id,
@@ -2183,7 +2063,7 @@ void MessageHelper::SendNaviStopStream(const int32_t app_id,
(*stop_stream)[strings::msg_params][strings::app_id] = app_id;
- app_mngr.ManageHMICommand(stop_stream);
+ app_mngr.GetRPCService().ManageHMICommand(stop_stream);
}
void MessageHelper::SendAudioStartStream(const int32_t app_id,
@@ -2223,7 +2103,7 @@ void MessageHelper::SendAudioStartStream(const int32_t app_id,
(*start_stream)[strings::msg_params][strings::app_id] = app_id;
(*start_stream)[strings::msg_params][strings::url] = url;
- DCHECK(app_mngr.ManageHMICommand(start_stream));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(start_stream));
}
void MessageHelper::SendAudioStopStream(const int32_t app_id,
@@ -2241,7 +2121,7 @@ void MessageHelper::SendAudioStopStream(const int32_t app_id,
(*stop_stream)[strings::msg_params][strings::app_id] = app_id;
- app_mngr.ManageHMICommand(stop_stream);
+ app_mngr.GetRPCService().ManageHMICommand(stop_stream);
}
void MessageHelper::SendOnDataStreaming(
@@ -2257,7 +2137,7 @@ void MessageHelper::SendOnDataStreaming(
}
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*notification)[strings::params][strings::function_id] =
@@ -2273,7 +2153,7 @@ void MessageHelper::SendOnDataStreaming(
(*notification)[strings::msg_params]["available"] = available;
- app_mngr.ManageHMICommand(notification);
+ app_mngr.GetRPCService().ManageHMICommand(notification);
}
bool MessageHelper::SendStopAudioPathThru(ApplicationManager& app_mngr) {
@@ -2285,7 +2165,7 @@ bool MessageHelper::SendStopAudioPathThru(ApplicationManager& app_mngr) {
(*result)[strings::params][strings::function_id] =
hmi_apis::FunctionID::UI_EndAudioPassThru;
- return app_mngr.ManageHMICommand(result);
+ return app_mngr.GetRPCService().ManageHMICommand(result);
}
bool MessageHelper::SendUnsubscribedWayPoints(ApplicationManager& app_mngr) {
@@ -2297,7 +2177,7 @@ bool MessageHelper::SendUnsubscribedWayPoints(ApplicationManager& app_mngr) {
(*result)[strings::params][strings::function_id] =
hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints;
- return app_mngr.ManageHMICommand(result);
+ return app_mngr.GetRPCService().ManageHMICommand(result);
}
void MessageHelper::SendPolicySnapshotNotification(
@@ -2341,14 +2221,10 @@ void MessageHelper::SendSystemRequestNotification(
commands::CommandImpl::protocol_version_;
content[strings::params][strings::connection_key] = connection_key;
-
-#ifdef DEBUG
PrintSmartObject(content);
-#endif
-
- DCHECK(app_mngr.ManageMobileCommand(
- utils::MakeShared<smart_objects::SmartObject>(content),
- commands::Command::ORIGIN_SDL));
+ DCHECK(app_mngr.GetRPCService().ManageMobileCommand(
+ std::make_shared<smart_objects::SmartObject>(content),
+ commands::Command::SOURCE_SDL));
}
void MessageHelper::SendLaunchApp(const uint32_t connection_key,
@@ -2514,9 +2390,9 @@ void MessageHelper::SendOnPermissionsChangeNotification(
}
}
- app_mngr.ManageMobileCommand(
- utils::MakeShared<smart_objects::SmartObject>(content),
- commands::Command::ORIGIN_SDL);
+ app_mngr.GetRPCService().ManageMobileCommand(
+ std::make_shared<smart_objects::SmartObject>(content),
+ commands::Command::SOURCE_SDL);
}
void MessageHelper::FillAppRevokedPermissions(
@@ -2581,22 +2457,33 @@ void MessageHelper::SendOnAppPermissionsChangedNotification(
if (permissions.requestTypeChanged) {
smart_objects::SmartObject request_types_array(
smart_objects::SmartType_Array);
- ;
+
for (uint16_t index = 0; index < permissions.requestType.size(); ++index) {
request_types_array[index] = permissions.requestType[index];
}
message[strings::msg_params][strings::request_type] = request_types_array;
}
+ if (permissions.requestSubTypeChanged) {
+ smart_objects::SmartObject request_subtypes_array(
+ smart_objects::SmartType_Array);
+
+ for (uint16_t index = 0; index < permissions.requestSubType.size();
+ ++index) {
+ request_subtypes_array[index] = permissions.requestSubType[index];
+ }
+ message[strings::msg_params][strings::request_subtype] =
+ request_subtypes_array;
+ }
- app_mngr.ManageHMICommand(
- utils::MakeShared<smart_objects::SmartObject>(message));
+ app_mngr.GetRPCService().ManageHMICommand(
+ std::make_shared<smart_objects::SmartObject>(message));
}
void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!message) {
return;
@@ -2610,14 +2497,14 @@ void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
(*message)[strings::msg_params]["status"] = status;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendUpdateSDLResponse(const std::string& result,
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
DCHECK(message);
@@ -2629,13 +2516,14 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result,
(*message)[strings::msg_params]["result"] = result;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendOnStatusUpdate(const std::string& status,
ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!message) {
return;
@@ -2646,9 +2534,10 @@ void MessageHelper::SendOnStatusUpdate(const std::string& status,
(*message)[strings::params][strings::message_type] =
MessageType::kNotification;
+ LOG4CXX_DEBUG(logger_, "Sending new status:" << status);
(*message)[strings::msg_params]["status"] = status;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) {
@@ -2661,14 +2550,15 @@ void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) {
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_GetSystemInfo;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == message.getType()) {
+ if (ns_smart_device_link::ns_smart_objects::SmartType_Array ==
+ message.getType()) {
for (uint32_t i = 0; i < message.length(); ++i) {
mobile_apis::Result::eType res =
VerifyImageFiles(message[i], app, app_mngr);
@@ -2677,7 +2567,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return res;
}
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Map ==
message.getType()) {
if (message.keyExists(strings::image_type)) {
mobile_apis::Result::eType verification_result =
@@ -2709,25 +2599,25 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return mobile_apis::Result::SUCCESS;
}
-mobile_apis::Result::eType MessageHelper::VerifyImageApplyPath(
- smart_objects::SmartObject& image,
- ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr) {
- // Checking image type first: if STATIC - skip existence check, since it is
- // HMI related file and it should know it location
- const uint32_t image_type = image[strings::image_type].asUInt();
- mobile_apis::ImageType::eType type =
- static_cast<mobile_apis::ImageType::eType>(image_type);
- if (mobile_apis::ImageType::STATIC == type) {
- return mobile_apis::Result::SUCCESS;
- }
-
+void MessageHelper::ApplyImagePath(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
const std::string& file_name = image[strings::value].asString();
+ const std::string& full_file_path = GetAppFilePath(file_name, app, app_mngr);
+
+ image[strings::value] = full_file_path;
+ return;
+}
+
+std::string MessageHelper::GetAppFilePath(std::string file_name,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
std::string str = file_name;
+ // Verify that file name is not only space characters
str.erase(remove(str.begin(), str.end(), ' '), str.end());
if (0 == str.size()) {
- return mobile_apis::Result::INVALID_DATA;
+ return "";
}
std::string full_file_path;
@@ -2753,31 +2643,86 @@ mobile_apis::Result::eType MessageHelper::VerifyImageApplyPath(
full_file_path += file_name;
}
- image[strings::value] = full_file_path;
- if (!file_system::FileExists(full_file_path)) {
- return mobile_apis::Result::INVALID_DATA;
- }
+ return full_file_path;
+}
- return mobile_apis::Result::SUCCESS;
+mobile_apis::Result::eType MessageHelper::VerifyTtsFiles(
+ smart_objects::SmartObject& tts_chunks,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS;
+ for (auto& tts_chunk : *(tts_chunks.asArray())) {
+ if (tts_chunk[strings::type] == mobile_apis::SpeechCapabilities::FILE) {
+ const std::string full_file_path =
+ GetAppFilePath(tts_chunk[strings::text].asString(), app, app_mngr);
+ tts_chunk[strings::text] = full_file_path;
+ if (!file_system::FileExists(full_file_path)) {
+ result = mobile_apis::Result::FILE_NOT_FOUND;
+ }
+ }
+ }
+ return result;
}
mobile_apis::Result::eType MessageHelper::VerifyImage(
smart_objects::SmartObject& image,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- smart_objects::SmartObject temp_image = image;
const uint32_t image_type = image[strings::image_type].asUInt();
- const mobile_apis::ImageType::eType type =
+ mobile_apis::ImageType::eType type =
static_cast<mobile_apis::ImageType::eType>(image_type);
+ const std::string& file_name = image[strings::value].asString();
- const mobile_apis::Result::eType result =
- VerifyImageApplyPath(temp_image, app, app_mngr);
- if ((mobile_apis::Result::SUCCESS == result) &&
- (mobile_apis::ImageType::DYNAMIC == type)) {
- image[strings::value] = temp_image[strings::value];
+ if (!VerifyString(file_name)) {
+ return mobile_apis::Result::INVALID_DATA;
}
- return result;
+ if (mobile_apis::ImageType::STATIC == type) {
+ return mobile_apis::Result::SUCCESS;
+ }
+
+ ApplyImagePath(image, app, app_mngr);
+
+ const std::string& imagePath = image[strings::value].asString();
+
+ if (file_system::FileExists(imagePath)) {
+ return mobile_apis::Result::SUCCESS;
+ }
+ return mobile_apis::Result::WARNINGS;
+}
+
+MessageHelper::ChoiceSetVRCommandsStatus
+MessageHelper::CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set) {
+ // if this is false, someone doesn't have vrCommands
+ bool all_have = true;
+ // if this is false, someone has vrCommands
+ bool none_have = true;
+ smart_objects::SmartArray::const_iterator current_choice_set_it =
+ choice_set.asArray()->begin();
+ // Iterate through choices
+ for (; choice_set.asArray()->end() != current_choice_set_it;
+ ++current_choice_set_it) {
+ // if the vrCommands is present
+ if (current_choice_set_it->keyExists(
+ application_manager::strings::vr_commands)) {
+ // this one has the parameter
+ none_have = false;
+ } else {
+ // this one doesn't
+ all_have = false;
+ }
+ }
+ // everyone has it
+ if (all_have) {
+ return MessageHelper::ChoiceSetVRCommandsStatus::ALL;
+ }
+ // No one has it
+ if (none_have) {
+ return MessageHelper::ChoiceSetVRCommandsStatus::NONE;
+ }
+ // mix-and-match
+ return MessageHelper::ChoiceSetVRCommandsStatus::MIXED;
}
mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
@@ -2790,21 +2735,21 @@ mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
if (message[i].keyExists(strings::image)) {
verification_result_image =
VerifyImage(message[i][strings::image], app, app_mngr);
- if (mobile_apis::Result::SUCCESS != verification_result_image) {
- return verification_result_image;
+ if (mobile_apis::Result::INVALID_DATA == verification_result_image) {
+ break;
}
}
}
- return mobile_apis::Result::SUCCESS;
+ return verification_result_image;
}
-bool MessageHelper::VerifySoftButtonString(const std::string& str) {
+bool MessageHelper::VerifyString(const std::string& str) {
if ((std::string::npos != str.find_first_of("\t\n")) ||
(std::string::npos != str.find("\\n")) ||
(std::string::npos != str.find("\\t")) ||
(std::string::npos == str.find_first_not_of(' '))) {
LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifySoftButtonString"
+ "MessageHelper::VerifyString"
"string contains incorrect character");
return false;
}
@@ -2863,7 +2808,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
}
if ((!request_soft_buttons[i].keyExists(strings::image) ||
- (Result::SUCCESS !=
+ (Result::INVALID_DATA ==
VerifyImage(
request_soft_buttons[i][strings::image], app, app_mngr)))) {
return Result::INVALID_DATA;
@@ -2875,7 +2820,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
request_soft_buttons[i].erase(strings::image);
}
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
- (!VerifySoftButtonString(
+ (!VerifyString(
request_soft_buttons[i][strings::text].asString()))) {
return Result::INVALID_DATA;
}
@@ -2884,13 +2829,13 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
case SoftButtonType::SBT_BOTH: {
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
((request_soft_buttons[i][strings::text].length()) &&
- (!VerifySoftButtonString(
+ (!VerifyString(
request_soft_buttons[i][strings::text].asString())))) {
return Result::INVALID_DATA;
}
if ((!request_soft_buttons[i].keyExists(strings::image) ||
- (Result::SUCCESS !=
+ (Result::INVALID_DATA ==
VerifyImage(
request_soft_buttons[i][strings::image], app, app_mngr)))) {
return Result::INVALID_DATA;
@@ -2928,76 +2873,12 @@ void MessageHelper::SubscribeApplicationToSoftButton(
app->SubscribeToSoftButtons(function_id, softbuttons_id);
}
-// TODO(AK): change printf to logger
bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
- return true;
-#ifdef ENABLE_LOG
- static uint32_t tab = 0;
- std::string tab_buffer;
-
- if (tab == 0) {
- printf("\n-------------------------------------------------------------");
- }
-
- for (uint32_t i = 0; i < tab; ++i) {
- tab_buffer += "\t";
- }
-
- switch (object.getType()) {
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Array: {
- for (size_t i = 0; i < object.length(); i++) {
- ++tab;
-
- printf("\n%s%zu: ", tab_buffer.c_str(), i);
- if (!PrintSmartObject(object.getElement(i))) {
- printf("\n");
- return false;
- }
- }
- break;
- }
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Map: {
- std::set<std::string> keys = object.enumerate();
-
- for (std::set<std::string>::const_iterator key = keys.begin();
- key != keys.end();
- key++) {
- ++tab;
-
- printf("\n%s%s: ", tab_buffer.c_str(), (*key).c_str());
- if (!PrintSmartObject(object[(*key).c_str()])) {
- printf("\n");
- return false;
- }
- }
- break;
- }
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean:
- object.asBool() ? printf("true\n") : printf("false\n");
- break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Double: {
- printf("%f", object.asDouble());
- break;
- }
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Integer:
- printf("%lld", static_cast<long long int>(object.asInt()));
- break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_String:
- printf("%s", object.asString().c_str());
- break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Character:
- printf("%c", object.asChar());
- break;
- default:
- printf("PrintSmartObject - default case\n");
- break;
- }
-
- if (0 != tab) {
- --tab;
- } else {
- printf("\n-------------------------------------------------------------\n");
- }
+#ifdef DEBUG
+ Json::Value tmp;
+ namespace Formatters = ns_smart_device_link::ns_json_handler::formatters;
+ Formatters::CFormatterJsonBase::objToJsonValue(object, tmp);
+ LOG4CXX_DEBUG(logger_, "SMART OBJECT: " << tmp.toStyledString());
#endif
return true;
}
diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc
deleted file mode 100644
index f6f9cab7f5..0000000000
--- a/src/components/application_manager/src/mobile_command_factory.cc
+++ /dev/null
@@ -1,731 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Copyright (c) 2017 Xevo Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the copyright holders nor the names of their contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/mobile_command_factory.h"
-#include "application_manager/commands/mobile/add_command_request.h"
-#include "application_manager/commands/mobile/add_command_response.h"
-#include "application_manager/commands/mobile/delete_command_request.h"
-#include "application_manager/commands/mobile/delete_command_response.h"
-#include "application_manager/commands/mobile/add_sub_menu_request.h"
-#include "application_manager/commands/mobile/add_sub_menu_response.h"
-#include "application_manager/commands/mobile/alert_request.h"
-#include "application_manager/commands/mobile/alert_response.h"
-#include "application_manager/commands/mobile/alert_maneuver_request.h"
-#include "application_manager/commands/mobile/alert_maneuver_response.h"
-#include "application_manager/commands/mobile/change_registration_request.h"
-#include "application_manager/commands/mobile/change_registration_response.h"
-#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
-#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
-#include "application_manager/commands/mobile/delete_file_request.h"
-#include "application_manager/commands/mobile/delete_file_response.h"
-#include "application_manager/commands/mobile/delete_interaction_choice_set_request.h"
-#include "application_manager/commands/mobile/delete_interaction_choice_set_response.h"
-#include "application_manager/commands/mobile/delete_sub_menu_request.h"
-#include "application_manager/commands/mobile/delete_sub_menu_response.h"
-#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
-#include "application_manager/commands/mobile/end_audio_pass_thru_response.h"
-#include "application_manager/commands/mobile/generic_response.h"
-#include "application_manager/commands/mobile/get_dtcs_request.h"
-#include "application_manager/commands/mobile/get_dtcs_response.h"
-#include "application_manager/commands/mobile/get_system_capability_request.h"
-#include "application_manager/commands/mobile/get_system_capability_response.h"
-#include "application_manager/commands/mobile/get_vehicle_data_request.h"
-#include "application_manager/commands/mobile/get_vehicle_data_response.h"
-#include "application_manager/commands/mobile/get_way_points_request.h"
-#include "application_manager/commands/mobile/get_way_points_response.h"
-#include "application_manager/commands/mobile/list_files_request.h"
-#include "application_manager/commands/mobile/list_files_response.h"
-#include "application_manager/commands/mobile/on_app_interface_unregistered_notification.h"
-#include "application_manager/commands/mobile/on_audio_pass_thru_notification.h"
-#include "application_manager/commands/mobile/on_button_event_notification.h"
-#include "application_manager/commands/mobile/on_button_press_notification.h"
-#include "application_manager/commands/mobile/on_driver_distraction_notification.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/commands/mobile/on_language_change_notification.h"
-#include "application_manager/commands/mobile/on_command_notification.h"
-#include "application_manager/commands/mobile/on_permissions_change_notification.h"
-#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
-#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
-#include "application_manager/commands/mobile/on_hash_change_notification.h"
-#include "application_manager/commands/mobile/on_way_point_change_notification.h"
-#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
-#include "application_manager/commands/mobile/perform_audio_pass_thru_response.h"
-#include "application_manager/commands/mobile/perform_interaction_request.h"
-#include "application_manager/commands/mobile/perform_interaction_response.h"
-#include "application_manager/commands/mobile/put_file_request.h"
-#include "application_manager/commands/mobile/put_file_response.h"
-#include "application_manager/commands/mobile/read_did_request.h"
-#include "application_manager/commands/mobile/read_did_response.h"
-#include "application_manager/commands/mobile/register_app_interface_request.h"
-#include "application_manager/commands/mobile/register_app_interface_response.h"
-#include "application_manager/commands/mobile/reset_global_properties_request.h"
-#include "application_manager/commands/mobile/reset_global_properties_response.h"
-#include "application_manager/commands/mobile/scrollable_message_request.h"
-#include "application_manager/commands/mobile/scrollable_message_response.h"
-#include "application_manager/commands/mobile/set_display_layout_request.h"
-#include "application_manager/commands/mobile/set_display_layout_response.h"
-#include "application_manager/commands/mobile/set_global_properties_request.h"
-#include "application_manager/commands/mobile/set_global_properties_response.h"
-#include "application_manager/commands/mobile/set_app_icon_request.h"
-#include "application_manager/commands/mobile/set_app_icon_response.h"
-#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
-#include "application_manager/commands/mobile/set_media_clock_timer_response.h"
-#include "application_manager/commands/mobile/show_constant_tbt_request.h"
-#include "application_manager/commands/mobile/show_constant_tbt_response.h"
-#include "application_manager/commands/mobile/show_request.h"
-#include "application_manager/commands/mobile/show_response.h"
-#include "application_manager/commands/mobile/slider_request.h"
-#include "application_manager/commands/mobile/slider_response.h"
-#include "application_manager/commands/mobile/speak_request.h"
-#include "application_manager/commands/mobile/speak_response.h"
-#include "application_manager/commands/mobile/subscribe_button_request.h"
-#include "application_manager/commands/mobile/subscribe_button_response.h"
-#include "application_manager/commands/mobile/subscribe_vehicle_data_request.h"
-#include "application_manager/commands/mobile/subscribe_vehicle_data_response.h"
-#include "application_manager/commands/mobile/subscribe_way_points_request.h"
-#include "application_manager/commands/mobile/subscribe_way_points_response.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_request.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_response.h"
-#include "application_manager/commands/mobile/unregister_app_interface_request.h"
-#include "application_manager/commands/mobile/unregister_app_interface_response.h"
-#include "application_manager/commands/mobile/unsubscribe_button_request.h"
-#include "application_manager/commands/mobile/unsubscribe_button_response.h"
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
-#include "application_manager/commands/mobile/update_turn_list_request.h"
-#include "application_manager/commands/mobile/update_turn_list_response.h"
-#include "application_manager/commands/mobile/system_request.h"
-#include "application_manager/commands/mobile/system_response.h"
-#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
-#include "application_manager/commands/mobile/on_touch_event_notification.h"
-#include "application_manager/commands/mobile/on_system_request_notification.h"
-#include "application_manager/commands/mobile/diagnostic_message_request.h"
-#include "application_manager/commands/mobile/diagnostic_message_response.h"
-#include "application_manager/commands/mobile/send_location_request.h"
-#include "application_manager/commands/mobile/send_location_response.h"
-#include "application_manager/commands/mobile/dial_number_request.h"
-#include "application_manager/commands/mobile/dial_number_response.h"
-#include "application_manager/commands/mobile/send_haptic_data_request.h"
-#include "application_manager/commands/mobile/send_haptic_data_response.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/make_shared.h"
-
-namespace application_manager {
-
-CommandSharedPtr MobileCommandFactory::CreateCommand(
- const commands::MessageSharedPtr& message,
- commands::Command::CommandOrigin origin,
- ApplicationManager& application_manager) {
- CommandSharedPtr command;
-
- switch ((*message)[strings::params][strings::function_id].asInt()) {
- case mobile_apis::FunctionID::RegisterAppInterfaceID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kRequest)) {
- command.reset(new commands::RegisterAppInterfaceRequest(
- message, application_manager));
-
- } else {
- command.reset(new commands::RegisterAppInterfaceResponse(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UnregisterAppInterfaceID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kRequest)) {
- command.reset(new commands::UnregisterAppInterfaceRequest(
- message, application_manager));
- } else {
- command.reset(new commands::UnregisterAppInterfaceResponse(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetGlobalPropertiesID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ResetGlobalPropertiesID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ResetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ResetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AddCommandID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AddCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::AddCommandRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteCommandID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DeleteCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DeleteCommandRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AddSubMenuID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AddSubMenuResponse(message, application_manager));
- } else {
- command.reset(
- new commands::AddSubMenuRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteSubMenuID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DeleteSubMenuResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DeleteSubMenuRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteInteractionChoiceSetID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::DeleteInteractionChoiceSetResponse(
- message, application_manager));
- } else {
- command.reset(new commands::DeleteInteractionChoiceSetRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AlertID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AlertResponse(message, application_manager));
- } else {
- command.reset(new commands::AlertRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SpeakID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SpeakResponse(message, application_manager));
- } else {
- command.reset(new commands::SpeakRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SliderID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SliderResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SliderRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::PerformAudioPassThruID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::PerformAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::PerformAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::CreateInteractionChoiceSetID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::CreateInteractionChoiceSetResponse(
- message, application_manager));
- } else {
- command.reset(new commands::CreateInteractionChoiceSetRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::PerformInteractionID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::PerformInteractionResponse(
- message, application_manager));
- } else {
- command.reset(new commands::PerformInteractionRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::EndAudioPassThruID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::EndAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::EndAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::PutFileID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::PutFileResponse(message, application_manager));
- } else {
- command.reset(
- new commands::PutFileRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteFileID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DeleteFileResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DeleteFileRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ListFilesID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::ListFilesResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ListFilesRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SubscribeButtonID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SubscribeButtonResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::SubscribeButtonRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UnsubscribeButtonID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::UnsubscribeButtonResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UnsubscribeButtonRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ShowConstantTBTID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ShowConstantTBTResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::ShowConstantTBTRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ShowID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ShowResponse(message, application_manager));
- } else {
- command.reset(new commands::ShowRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::GetWayPointsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command = utils::MakeShared<commands::GetWayPointsResponse>(
- message, application_manager);
- } else {
- command = utils::MakeShared<commands::GetWayPointsRequest>(
- message, application_manager);
- }
- break;
- }
- case mobile_apis::FunctionID::SubscribeVehicleDataID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UnsubscribeVehicleDataID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::UnsubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UnsubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SubscribeWayPointsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command = utils::MakeShared<commands::SubscribeWayPointsResponse>(
- message, application_manager);
- } else {
- command = utils::MakeShared<commands::SubscribeWayPointsRequest>(
- message, application_manager);
- }
- break;
- }
- case mobile_apis::FunctionID::UnsubscribeWayPointsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command = utils::MakeShared<commands::UnsubscribeWayPointsResponse>(
- message, application_manager);
- } else {
- command = utils::MakeShared<commands::UnSubscribeWayPointsRequest>(
- message, application_manager);
- }
- break;
- }
- case mobile_apis::FunctionID::GetSystemCapabilityID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::GetSystemCapabilityResponse(
- message, application_manager));
- } else {
- command.reset(new commands::GetSystemCapabilityRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ReadDIDID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::ReadDIDResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ReadDIDRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::GetVehicleDataID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::GetVehicleDataResponse(message, application_manager));
- } else {
- command.reset(
- new commands::GetVehicleDataRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ScrollableMessageID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ScrollableMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ScrollableMessageRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AlertManeuverID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AlertManeuverResponse(message, application_manager));
- } else {
- command.reset(
- new commands::AlertManeuverRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetAppIconID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SetAppIconResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SetAppIconRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetDisplayLayoutID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SetDisplayLayoutResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SetDisplayLayoutRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UpdateTurnListID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::UpdateTurnListResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UpdateTurnListRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ChangeRegistrationID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ChangeRegistrationResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::GetDTCsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::GetDTCsResponse(message, application_manager));
- } else {
- command.reset(
- new commands::GetDTCsRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DiagnosticMessageID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::DiagnosticMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::DiagnosticMessageRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetMediaClockTimerID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SetMediaClockTimerResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::SetMediaClockRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SystemRequestID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SystemResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SystemRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SendLocationID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SendLocationResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SendLocationRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DialNumberID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DialNumberResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DialNumberRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SendHapticDataID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SendHapticDataResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SendHapticDataRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::OnButtonEventID: {
- command.reset(new commands::mobile::OnButtonEventNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnButtonPressID: {
- command.reset(new commands::mobile::OnButtonPressNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnAudioPassThruID: {
- command.reset(new commands::OnAudioPassThruNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnVehicleDataID: {
- command.reset(new commands::OnVehicleDataNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnAppInterfaceUnregisteredID: {
- command.reset(new commands::OnAppInterfaceUnregisteredNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnCommandID: {
- command.reset(
- new commands::OnCommandNotification(message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnTBTClientStateID: {
- command.reset(new commands::OnTBTClientStateNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnDriverDistractionID: {
- command.reset(new commands::mobile::OnDriverDistractionNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnLanguageChangeID: {
- command.reset(new commands::OnLanguageChangeNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnPermissionsChangeID: {
- command.reset(new commands::OnPermissionsChangeNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnHMIStatusID: {
- if (commands::Command::ORIGIN_SDL == origin) {
- command.reset(new commands::OnHMIStatusNotification(
- message, application_manager));
- } else {
- command.reset(new commands::OnHMIStatusNotificationFromMobile(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::OnKeyboardInputID: {
- command.reset(new commands::mobile::OnKeyBoardInputNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnTouchEventID: {
- command.reset(new commands::mobile::OnTouchEventNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnSystemRequestID: {
- command.reset(new commands::mobile::OnSystemRequestNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnHashChangeID: {
- command.reset(new commands::mobile::OnHashChangeNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnWayPointChangeID: {
- command = utils::MakeShared<commands::OnWayPointChangeNotification>(
- message, application_manager);
- break;
- }
- default: {
- (*message)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::GenericResponseID);
- command.reset(
- new commands::GenericResponse(message, application_manager));
- }
- }
- return command;
-}
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index 2f06c5f3b5..1ee368a212 100644
--- a/src/components/application_manager/src/mobile_message_handler.cc
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -143,6 +143,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV1(
message->service_type()));
if (!message) {
NOTREACHED();
+ delete outgoing_message;
return NULL;
}
@@ -178,7 +179,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2(
return NULL;
}
- std::auto_ptr<application_manager::Message> outgoing_message(
+ std::unique_ptr<application_manager::Message> outgoing_message(
new application_manager::Message(
protocol_handler::MessagePriority::FromServiceType(
message->service_type())));
diff --git a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
new file mode 100644
index 0000000000..712b91afe7
--- /dev/null
+++ b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
@@ -0,0 +1,111 @@
+#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h"
+#include <dlfcn.h>
+
+#include "utils/file_system.h"
+
+namespace application_manager {
+namespace plugin_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PluginManager")
+
+RPCPluginManagerImpl::RPCPluginManagerImpl(
+ ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : app_manager_(app_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+bool IsLibraryFile(const std::string& file_path) {
+ size_t pos = file_path.find_last_of(".");
+ if (std::string::npos == pos) {
+ return false;
+ }
+ if (file_path.substr(pos + 1).compare("so") != 0) {
+ return false;
+ }
+ return true;
+}
+
+RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) {
+ if (!IsLibraryFile(full_plugin_path)) {
+ LOG4CXX_DEBUG(logger_, "Skip loading " << full_plugin_path);
+ return RPCPluginPtr();
+ }
+
+ void* plugin_dll = dlopen(full_plugin_path.c_str(), RTLD_LAZY);
+ if (nullptr == plugin_dll) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to open dll " << full_plugin_path << " : "
+ << dlerror());
+ return RPCPluginPtr();
+ }
+
+ typedef RPCPlugin* (*Create)();
+ Create create_plugin = reinterpret_cast<Create>(dlsym(plugin_dll, "Create"));
+ char* error_string = dlerror();
+ if (nullptr != error_string) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to export dll's " << full_plugin_path
+ << " symbols : " << error_string);
+ dlclose(plugin_dll);
+ return RPCPluginPtr();
+ }
+ RPCPlugin* plugin = create_plugin();
+ dlclose(plugin_dll);
+ return RPCPluginPtr(plugin);
+}
+
+uint32_t RPCPluginManagerImpl::LoadPlugins(const std::string& plugins_path) {
+ LOG4CXX_INFO(logger_, "Loading plugins from " << plugins_path);
+ std::vector<std::string> plugin_files = file_system::ListFiles(plugins_path);
+ for (auto& plugin_file : plugin_files) {
+ std::string full_name = plugins_path + '/' + plugin_file;
+ auto plugin = LoadPlugin(full_name);
+ if (!plugin) {
+ continue;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Loaded " << plugin->PluginName() << " plugin from "
+ << full_name);
+ if (plugin->Init(
+ app_manager_, rpc_service_, hmi_capabilities_, policy_handler_)) {
+ loaded_plugins_.push_back(std::move(plugin));
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "Initialisation of " << plugin->PluginName()
+ << " plugin from " << full_name
+ << " failed");
+ }
+ }
+ return loaded_plugins_.size();
+}
+
+std::vector<RPCPluginPtr>& RPCPluginManagerImpl::GetPlugins() {
+ return loaded_plugins_;
+}
+
+utils::Optional<RPCPlugin> RPCPluginManagerImpl::FindPluginToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) {
+ typedef utils::Optional<RPCPlugin> PluginOptional;
+ for (auto& plugin : loaded_plugins_) {
+ if (plugin->IsAbleToProcess(function_id, message_source)) {
+ return PluginOptional(*plugin);
+ }
+ }
+ return PluginOptional(PluginOptional::EMPTY,
+ std::string("Plugin for processing RPC not found"));
+}
+
+void RPCPluginManagerImpl::ForEachPlugin(
+ std::function<void(RPCPlugin&)> functor) {
+ for (auto& plugin : loaded_plugins_) {
+ functor(*plugin);
+ }
+}
+
+} // namespace plugin_manager
+} // namespace application_manager
diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc
index 828f2d923a..f397814005 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -63,14 +63,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
- ProcessOdometerEvent(message);
- break;
- }
- default: { break; }
- unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetOdometer);
-#else
case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
ProcessOdometerEvent(message);
unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
@@ -82,7 +74,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
break;
}
default: { break; }
-#endif
}
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 559b9c0035..1b64c5d7b4 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -42,6 +42,7 @@
#include "application_manager/application_manager.h"
#include "application_manager/state_controller.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
#include "policy/policy_manager_impl.h"
#include "connection_handler/connection_handler.h"
#include "utils/macro.h"
@@ -53,11 +54,9 @@
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
#include "utils/scope_guard.h"
-#include "utils/make_shared.h"
+
+#include "utils/helpers.h"
#include "policy/policy_manager.h"
-#ifdef SDL_REMOTE_CONTROL
-#include "functional_module/plugin_manager.h"
-#endif // SDL_REMOTE_CONTROL
namespace policy {
@@ -90,7 +89,8 @@ RequestTypeMap TypeToString = {
{mobile_apis::RequestType::VEHICLE_DIAGNOSTICS, "VEHICLE_DIAGNOSTICS"},
{mobile_apis::RequestType::EMERGENCY, "EMERGENCY"},
{mobile_apis::RequestType::MEDIA, "MEDIA"},
- {mobile_apis::RequestType::FOTA, "FOTA"}};
+ {mobile_apis::RequestType::FOTA, "FOTA"},
+ {mobile_apis::RequestType::OEM_SPECIFIC, "OEM_SPECIFIC"}};
const std::string RequestTypeToString(mobile_apis::RequestType::eType type) {
RequestTypeMap::const_iterator it = TypeToString.find(type);
@@ -162,10 +162,12 @@ struct DeactivateApplication {
void operator()(const ApplicationSharedPtr& app) {
if (device_id_ == app->device()) {
- state_ctrl_.SetRegularState(app,
- mobile_apis::HMILevel::HMI_NONE,
- mobile_apis::AudioStreamingState::NOT_AUDIBLE,
- true);
+ state_ctrl_.SetRegularState(
+ app,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ true);
}
}
@@ -222,7 +224,7 @@ struct LinksCollector {
}
void operator()(const ApplicationSharedPtr& app) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Invalid pointer to application was passed."
"Skip current application.");
@@ -256,7 +258,7 @@ struct LinkAppToDevice {
}
void operator()(const ApplicationSharedPtr& app) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Invalid pointer to application was passed."
"Skip current application.");
@@ -325,8 +327,7 @@ PolicyHandler::PolicyHandler(const PolicySettings& settings,
: AsyncRunner("PolicyHandler async runner thread")
, dl_handle_(0)
, last_activated_app_id_(0)
- , app_to_device_link_lock_(true)
- , statistic_manager_impl_(utils::MakeShared<StatisticManagerImpl>(this))
+ , statistic_manager_impl_(std::make_shared<StatisticManagerImpl>(this))
, settings_(settings)
, application_manager_(application_manager) {}
@@ -353,14 +354,14 @@ bool PolicyHandler::LoadPolicyLibrary() {
if (CreateManager()) {
policy_manager_->set_listener(this);
event_observer_ =
- utils::SharedPtr<PolicyEventObserver>(new PolicyEventObserver(
+ std::shared_ptr<PolicyEventObserver>(new PolicyEventObserver(
this, application_manager_.event_dispatcher()));
}
} else {
LOG4CXX_ERROR(logger_, error);
}
- return policy_manager_.valid();
+ return (policy_manager_.use_count() != 0);
}
bool PolicyHandler::CreateManager() {
@@ -373,11 +374,11 @@ bool PolicyHandler::CreateManager() {
char* error_string = dlerror();
if (NULL == error_string) {
policy_manager_ =
- utils::SharedPtr<PolicyManager>(create_manager(), delete_manager);
+ std::shared_ptr<PolicyManager>(create_manager(), delete_manager);
} else {
LOG4CXX_WARN(logger_, error_string);
}
- return policy_manager_.valid();
+ return (policy_manager_.use_count() != 0);
}
const PolicySettings& PolicyHandler::get_settings() const {
@@ -518,7 +519,7 @@ void PolicyHandler::SendOnAppPermissionsChanged(
<< policy_app_id);
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_, "No app found for policy app id = " << policy_app_id);
return;
}
@@ -553,7 +554,7 @@ struct SmartObjectToInt {
StatusNotifier PolicyHandler::AddApplication(
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
- POLICY_LIB_CHECK(utils::MakeShared<utils::CallNothing>());
+ POLICY_LIB_CHECK(std::make_shared<utils::CallNothing>());
return policy_manager_->AddApplication(application_id, hmi_types);
}
@@ -589,7 +590,7 @@ void PolicyHandler::OnAppPermissionConsentInternal(
if (connection_key) {
ApplicationSharedPtr app = application_manager_.application(connection_key);
- if (app.valid()) {
+ if (app.use_count() != 0) {
out_permissions.policy_app_id = app->policy_app_id();
DeviceParams device_params = GetDeviceParams(
app->device(),
@@ -616,7 +617,7 @@ void PolicyHandler::OnAppPermissionConsentInternal(
// If list of apps sent to HMI for user consents is not the same as
// current,
// permissions should be set only for coincident to registered apps
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Invalid pointer to application was passed."
"Permissions setting skipped.");
@@ -657,9 +658,9 @@ void PolicyHandler::OnAppPermissionConsentInternal(
void policy::PolicyHandler::SetDaysAfterEpoch() {
POLICY_LIB_CHECK_VOID();
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+ int days_after_epoch = date_time::getSecs(current_time) / kSecondsInDay;
PTUpdatedAt(Counters::DAYS_AFTER_EPOCH, days_after_epoch);
}
@@ -731,7 +732,7 @@ std::vector<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions(
ApplicationSharedPtr app = application_manager_.application(connection_key);
std::vector<FunctionalGroupPermission> group_permissions;
- if (NULL == app.get() || !app.valid()) {
+ if (NULL == app.get() || app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Connection key '"
<< connection_key
@@ -881,7 +882,7 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Application with id '"
<< policy_app_id
@@ -950,13 +951,14 @@ void PolicyHandler::OnVehicleDataUpdated(
void PolicyHandler::OnPendingPermissionChange(
const std::string& policy_app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"PolicyHandler::OnPendingPermissionChange for "
<< policy_app_id);
POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"No app found for " << policy_app_id << " policy app id.");
return;
@@ -974,6 +976,7 @@ void PolicyHandler::OnPendingPermissionChange(
app,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
true);
policy_manager_->RemovePendingPermissionChanges(policy_app_id);
return;
@@ -987,8 +990,6 @@ void PolicyHandler::OnPendingPermissionChange(
if (permissions.appPermissionsConsentNeeded) {
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
-
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
// "Break" statement has to be here to continue processing in case of
// there is another "true" flag in permissions struct
break;
@@ -998,8 +999,6 @@ void PolicyHandler::OnPendingPermissionChange(
if (permissions.isAppPermissionsRevoked) {
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
-
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
break;
}
@@ -1013,22 +1012,21 @@ void PolicyHandler::OnPendingPermissionChange(
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
}
- application_manager_.ManageMobileCommand(
+ application_manager_.GetRPCService().ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app->app_id(),
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
application_manager_.OnAppUnauthorized(app->app_id());
-
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
- if (permissions.requestTypeChanged) {
+ if (permissions.requestTypeChanged || permissions.requestSubTypeChanged) {
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
+
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
@@ -1080,12 +1078,7 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
SetDaysAfterEpoch();
event_observer_->subscribe_on_event(
-#ifdef HMI_DBUS_API
- hmi_apis::FunctionID::VehicleInfo_GetOdometer, correlation_id
-#else
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id
-#endif
- );
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id);
std::vector<std::string> vehicle_data_args;
vehicle_data_args.push_back(strings::odometer);
MessageHelper::CreateGetVehicleDataRequest(
@@ -1193,10 +1186,6 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
accessor.GetData().end(),
DeactivateApplication(device_handle,
application_manager_.state_controller()));
-#ifdef SDL_REMOTE_CONTROL
- application_manager_.GetPluginManager().OnPolicyEvent(
- functional_modules::PolicyEvent::kApplicationsDisabled);
-#endif // SDL_REMOTE_CONTROL
} else {
std::for_each(
accessor.GetData().begin(),
@@ -1245,12 +1234,15 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
if (is_allowed) {
// Send HMI status notification to mobile
// Put application in full
- AudioStreamingState::eType state = app->is_audio()
- ? AudioStreamingState::AUDIBLE
- : AudioStreamingState::NOT_AUDIBLE;
+ AudioStreamingState::eType audio_state =
+ app->IsAudioApplication() ? AudioStreamingState::AUDIBLE
+ : AudioStreamingState::NOT_AUDIBLE;
+ VideoStreamingState::eType video_state =
+ app->IsVideoApplication() ? VideoStreamingState::STREAMABLE
+ : VideoStreamingState::NOT_STREAMABLE;
application_manager_.state_controller().SetRegularState(
- app, mobile_apis::HMILevel::HMI_FULL, state, true);
+ app, mobile_apis::HMILevel::HMI_FULL, audio_state, video_state, true);
last_activated_app_id_ = 0;
} else {
DeactivateApplication deactivate_notification(
@@ -1270,9 +1262,8 @@ void PolicyHandler::OnIgnitionCycleOver() {
void PolicyHandler::OnActivateApp(uint32_t connection_key,
uint32_t correlation_id) {
LOG4CXX_AUTO_TRACE(logger_);
- POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app = application_manager_.application(connection_key);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_, "Activated App failed: no app found.");
return;
}
@@ -1366,7 +1357,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1419,7 +1410,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1462,7 +1453,7 @@ void PolicyHandler::OnSnapshotCreated(
std::string policy_snapshot_full_path;
if (SaveSnapshot(pt_string, policy_snapshot_full_path)) {
const uint32_t timeout_exchange_s =
- timeout_exchange_ms / date_time::DateTime::MILLISECONDS_IN_SECOND;
+ timeout_exchange_ms / date_time::MILLISECONDS_IN_SECOND;
MessageHelper::SendPolicyUpdate(policy_snapshot_full_path,
timeout_exchange_s,
retry_delay_seconds,
@@ -1519,6 +1510,13 @@ void PolicyHandler::CheckPermissions(
POLICY_LIB_CHECK_VOID();
const std::string hmi_level =
MessageHelper::StringifiedHMILevel(app->hmi_level());
+ if (hmi_level.empty()) {
+ LOG4CXX_WARN(logger_,
+ "HMI level for " << app->policy_app_id() << " is invalid, rpc "
+ << rpc << " is not allowed.");
+ result.hmi_level_permitted = policy::kRpcDisallowed;
+ return;
+ }
const std::string device_id = MessageHelper::GetDeviceMacAddressForHandle(
app->device(), application_manager_);
LOG4CXX_INFO(logger_,
@@ -1584,7 +1582,7 @@ uint32_t PolicyHandler::NextRetryTimeout() {
}
uint32_t PolicyHandler::TimeoutExchangeSec() const {
- return TimeoutExchangeMSec() / date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return TimeoutExchangeMSec() / date_time::MILLISECONDS_IN_SECOND;
}
uint32_t PolicyHandler::TimeoutExchangeMSec() const {
@@ -1623,7 +1621,7 @@ void PolicyHandler::remove_listener(PolicyHandlerObserver* listener) {
listeners_.remove(listener);
}
-utils::SharedPtr<usage_statistics::StatisticsManager>
+std::shared_ptr<usage_statistics::StatisticsManager>
PolicyHandler::GetStatisticManager() const {
return statistic_manager_impl_;
}
@@ -1665,7 +1663,7 @@ custom_str::CustomString PolicyHandler::GetAppName(
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1879,6 +1877,18 @@ void PolicyHandler::OnAppRegisteredOnMobile(const std::string& application_id) {
policy_manager_->OnAppRegisteredOnMobile(application_id);
}
+RequestType::State PolicyHandler::GetAppRequestTypeState(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(RequestType::State::UNAVAILABLE);
+ return policy_manager_->GetAppRequestTypesState(policy_app_id);
+}
+
+RequestSubType::State PolicyHandler::GetAppRequestSubTypeState(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(RequestSubType::State::UNAVAILABLE);
+ return policy_manager_->GetAppRequestSubTypesState(policy_app_id);
+}
+
bool PolicyHandler::IsRequestTypeAllowed(
const std::string& policy_app_id,
mobile_apis::RequestType::eType type) const {
@@ -1891,17 +1901,66 @@ bool PolicyHandler::IsRequestTypeAllowed(
return false;
}
- std::vector<std::string> request_types =
- policy_manager_->GetAppRequestTypes(policy_app_id);
+ const RequestType::State request_type_state =
+ policy_manager_->GetAppRequestTypesState(policy_app_id);
+
+ switch (request_type_state) {
+ case RequestType::State::EMPTY: {
+ // If empty array of request types is assigned to app - any is allowed
+ LOG4CXX_TRACE(logger_, "Any Request Type is allowed by policies.");
+ return true;
+ }
+ case RequestType::State::OMITTED: {
+ // If RequestType parameter omitted for app - any is disallowed
+ LOG4CXX_TRACE(logger_, "All Request Types are disallowed by policies.");
+ return false;
+ }
+ case RequestType::State::AVAILABLE: {
+ // If any of request types is available for current application - get them
+ const auto request_types =
+ policy_manager_->GetAppRequestTypes(policy_app_id);
+ return helpers::in_range(request_types, stringified_type);
+ }
+ default:
+ return false;
+ }
+}
+
+bool PolicyHandler::IsRequestSubTypeAllowed(
+ const std::string& policy_app_id,
+ const std::string& request_subtype) const {
+ POLICY_LIB_CHECK(false);
+ using namespace mobile_apis;
- // If no request types are assigned to app - any is allowed
- if (request_types.empty()) {
- return true;
+ if (request_subtype.empty()) {
+ LOG4CXX_ERROR(logger_, "Request subtype to check is empty.");
+ return false;
}
- std::vector<std::string>::const_iterator it =
- std::find(request_types.begin(), request_types.end(), stringified_type);
- return request_types.end() != it;
+ const RequestSubType::State request_subtype_state =
+ policy_manager_->GetAppRequestSubTypesState(policy_app_id);
+ switch (request_subtype_state) {
+ case RequestSubType::State::EMPTY: {
+ // If empty array of request subtypes is assigned to app - any is allowed
+ LOG4CXX_TRACE(logger_, "Any Request SubType is allowed by policies.");
+ return true;
+ }
+ case RequestSubType::State::OMITTED: {
+ // If RequestSubType parameter omitted for app - any is disallowed
+ LOG4CXX_TRACE(logger_,
+ "All Request SubTypes are disallowed by policies.");
+ return false;
+ }
+ case RequestSubType::State::AVAILABLE: {
+ // If any of request subtypes is available for current application
+ // get them all
+ const auto request_subtypes =
+ policy_manager_->GetAppRequestSubTypes(policy_app_id);
+ return helpers::in_range(request_subtypes, request_subtype);
+ }
+ default:
+ return false;
+ }
}
const std::vector<std::string> PolicyHandler::GetAppRequestTypes(
@@ -1910,6 +1969,12 @@ const std::vector<std::string> PolicyHandler::GetAppRequestTypes(
return policy_manager_->GetAppRequestTypes(policy_app_id);
}
+const std::vector<std::string> PolicyHandler::GetAppRequestSubTypes(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(std::vector<std::string>());
+ return policy_manager_->GetAppRequestSubTypes(policy_app_id);
+}
+
const VehicleInfo policy::PolicyHandler::GetVehicleInfo() const {
POLICY_LIB_CHECK(VehicleInfo());
return policy_manager_->GetVehicleInfo();
@@ -1961,8 +2026,6 @@ bool PolicyHandler::IsUrlAppIdValid(const uint32_t app_idx,
return ((is_registered && !is_empty_urls) || is_default);
}
-#ifdef SDL_REMOTE_CONTROL
-
std::vector<std::string> PolicyHandler::GetDevicesIds(
const std::string& policy_app_id) {
return application_manager_.devices(policy_app_id);
@@ -2096,5 +2159,4 @@ void PolicyHandler::OnUpdateHMILevel(const std::string& device_id,
}
UpdateHMILevel(app, level);
}
-#endif // SDL_REMOTE_CONTROL
} // namespace policy
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index 1b9bd7ffb9..315cf6fdf8 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -34,8 +34,8 @@
#include "application_manager/request_controller.h"
#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "utils/make_shared.h"
+#include "application_manager/commands/request_to_hmi.h"
+
#include "utils/timer_task_impl.h"
namespace application_manager {
@@ -50,6 +50,7 @@ RequestController::RequestController(const RequestControlerSettings& settings)
: pool_state_(UNDEFINED)
, pool_size_(settings.thread_pool_size())
, request_tracker_(settings)
+ , duplicate_message_count_()
, timer_("AM RequestCtrlTimer",
new timer::TimerTaskImpl<RequestController>(
this, &RequestController::TimeoutThread))
@@ -175,7 +176,7 @@ RequestController::TResult RequestController::addHMIRequest(
const RequestPtr request) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!request.valid()) {
+ if (request.use_count() == 0) {
LOG4CXX_ERROR(logger_, "HMI request pointer is invalid");
return RequestController::INVALID_DATA;
}
@@ -184,7 +185,7 @@ RequestController::TResult RequestController::addHMIRequest(
const uint64_t timeout_in_mseconds =
static_cast<uint64_t>(request->default_timeout());
RequestInfoPtr request_info_ptr =
- utils::MakeShared<HMIRequestInfo>(request, timeout_in_mseconds);
+ std::make_shared<HMIRequestInfo>(request, timeout_in_mseconds);
if (0 == timeout_in_mseconds) {
LOG4CXX_DEBUG(logger_,
@@ -230,6 +231,21 @@ void RequestController::TerminateRequest(const uint32_t correlation_id,
<< correlation_id << " connection_key = " << connection_key
<< " function_id = " << function_id
<< " force_terminate = " << force_terminate);
+ {
+ AutoLock auto_lock(duplicate_message_count_lock_);
+ auto dup_it = duplicate_message_count_.find(correlation_id);
+ if (duplicate_message_count_.end() != dup_it) {
+ duplicate_message_count_[correlation_id]--;
+ if (0 == duplicate_message_count_[correlation_id]) {
+ duplicate_message_count_.erase(dup_it);
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Ignoring termination request due to duplicate correlation "
+ "ID being sent");
+ return;
+ }
+ }
+
RequestInfoPtr request =
waiting_for_response_.Find(connection_key, correlation_id);
if (!request) {
@@ -271,7 +287,7 @@ void RequestController::terminateWaitingForExecutionAppRequests(
std::list<RequestPtr>::iterator request_it = mobile_request_list_.begin();
while (mobile_request_list_.end() != request_it) {
RequestPtr request = (*request_it);
- if ((request.valid()) && (request->connection_key() == app_id)) {
+ if ((request.use_count() != 0) && (request->connection_key() == app_id)) {
mobile_request_list_.erase(request_it++);
} else {
++request_it;
@@ -385,17 +401,17 @@ void RequestController::TimeoutThread() {
LOG4CXX_DEBUG(logger_,
"Timeout for "
<< (RequestInfo::HMIRequest ==
- probably_expired->requst_type()
+ probably_expired->request_type()
? "HMI"
: "Mobile")
<< " request id: " << probably_expired->requestId()
<< " connection_key: " << probably_expired->app_id()
<< " NOT expired");
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- const TimevalStruct end_time = probably_expired->end_time();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
+ const date_time::TimeDuration end_time = probably_expired->end_time();
if (current_time < end_time) {
- const uint32_t msecs = static_cast<uint32_t>(
- date_time::DateTime::getmSecs(end_time - current_time));
+ const uint32_t msecs =
+ static_cast<uint32_t>(date_time::getmSecs(end_time - current_time));
LOG4CXX_DEBUG(logger_, "Sleep for " << msecs << " millisecs");
timer_condition_.WaitFor(auto_lock, msecs);
}
@@ -404,7 +420,7 @@ void RequestController::TimeoutThread() {
LOG4CXX_INFO(logger_,
"Timeout for "
<< (RequestInfo::HMIRequest ==
- probably_expired->requst_type()
+ probably_expired->request_type()
? "HMI"
: "Mobile")
<< " request id: " << probably_expired->requestId()
@@ -472,9 +488,26 @@ void RequestController::Worker::threadMain() {
const uint32_t timeout_in_mseconds = request_ptr->default_timeout();
RequestInfoPtr request_info_ptr =
- utils::MakeShared<MobileRequestInfo>(request_ptr, timeout_in_mseconds);
-
- request_controller_->waiting_for_response_.Add(request_info_ptr);
+ std::make_shared<MobileRequestInfo>(request_ptr, timeout_in_mseconds);
+
+ if (!request_controller_->waiting_for_response_.Add(request_info_ptr)) {
+ commands::CommandRequestImpl* cmd_request =
+ dynamic_cast<commands::CommandRequestImpl*>(request_ptr.get());
+ if (cmd_request != NULL) {
+ uint32_t corr_id = cmd_request->correlation_id();
+ request_controller_->duplicate_message_count_lock_.Acquire();
+ auto dup_it =
+ request_controller_->duplicate_message_count_.find(corr_id);
+ if (request_controller_->duplicate_message_count_.end() == dup_it) {
+ request_controller_->duplicate_message_count_[corr_id] = 0;
+ }
+ request_controller_->duplicate_message_count_[corr_id]++;
+ request_controller_->duplicate_message_count_lock_.Release();
+ cmd_request->SendResponse(
+ false, mobile_apis::Result::INVALID_ID, "Duplicate correlation_id");
+ }
+ continue;
+ }
LOG4CXX_DEBUG(logger_, "timeout_in_mseconds " << timeout_in_mseconds);
if (0 != timeout_in_mseconds) {
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
index 9a5828d939..bbcda06b43 100644
--- a/src/components/application_manager/src/request_info.cc
+++ b/src/components/application_manager/src/request_info.cc
@@ -51,7 +51,7 @@ HMIRequestInfo::HMIRequestInfo(RequestPtr request, const uint64_t timeout_msec)
}
HMIRequestInfo::HMIRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: RequestInfo(request, HMIRequest, start_time, timeout_msec) {
correlation_id_ = request_->correlation_id();
@@ -66,7 +66,7 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request,
}
MobileRequestInfo::MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: RequestInfo(request, MobileRequest, start_time, timeout_msec) {
correlation_id_ = request_.get()->correlation_id();
@@ -74,19 +74,19 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request,
}
RequestInfo::RequestInfo(RequestPtr request,
- const RequestInfo::RequestType requst_type,
- const TimevalStruct& start_time,
+ const RequestInfo::RequestType request_type,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: request_(request), start_time_(start_time), timeout_msec_(timeout_msec) {
updateEndTime();
- requst_type_ = requst_type;
+ request_type_ = request_type;
correlation_id_ = request_->correlation_id();
app_id_ = request_->connection_key();
}
void application_manager::request_controller::RequestInfo::updateEndTime() {
- end_time_ = date_time::DateTime::getCurrentTime();
- date_time::DateTime::AddMilliseconds(end_time_, timeout_msec_);
+ end_time_ = date_time::getCurrentTime();
+ date_time::AddMilliseconds(end_time_, timeout_msec_);
}
void RequestInfo::updateTimeOut(const uint64_t& timeout_msec) {
@@ -95,9 +95,8 @@ void RequestInfo::updateTimeOut(const uint64_t& timeout_msec) {
}
bool RequestInfo::isExpired() {
- TimevalStruct curr_time = date_time::DateTime::getCurrentTime();
- return date_time::DateTime::getmSecs(end_time_) <=
- date_time::DateTime::getmSecs(curr_time);
+ date_time::TimeDuration curr_time = date_time::getCurrentTime();
+ return date_time::getmSecs(end_time_) <= date_time::getmSecs(curr_time);
}
uint64_t RequestInfo::hash() {
@@ -123,7 +122,7 @@ bool RequestInfoSet::Add(RequestInfoPtr request_info) {
logger_,
"Add request app_id = " << request_info->app_id()
<< "; corr_id = " << request_info->requestId());
- sync_primitives::AutoLock lock(this_lock_);
+ sync_primitives::AutoLock lock(pending_requests_lock_);
CheckSetSizes();
const std::pair<HashSortedRequestInfoSet::iterator, bool>& insert_resilt =
hash_sorted_pending_requests_.insert(request_info);
@@ -151,10 +150,10 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key,
RequestInfoPtr result;
// Request info for searching in request info set by log_n time
- utils::SharedPtr<FakeRequestInfo> request_info_for_search(
+ std::shared_ptr<FakeRequestInfo> request_info_for_search(
new FakeRequestInfo(connection_key, correlation_id));
- sync_primitives::AutoLock lock(this_lock_);
+ sync_primitives::AutoLock lock(pending_requests_lock_);
HashSortedRequestInfoSet::iterator it =
hash_sorted_pending_requests_.find(request_info_for_search);
if (it != hash_sorted_pending_requests_.end()) {
@@ -166,7 +165,7 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key,
RequestInfoPtr RequestInfoSet::Front() {
RequestInfoPtr result;
- sync_primitives::AutoLock lock(this_lock_);
+ sync_primitives::AutoLock lock(pending_requests_lock_);
TimeSortedRequestInfoSet::iterator it = time_sorted_pending_requests_.begin();
if (it != time_sorted_pending_requests_.end()) {
result = *it;
@@ -176,7 +175,7 @@ RequestInfoPtr RequestInfoSet::Front() {
RequestInfoPtr RequestInfoSet::FrontWithNotNullTimeout() {
LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(this_lock_);
+ sync_primitives::AutoLock lock(pending_requests_lock_);
RequestInfoPtr result;
TimeSortedRequestInfoSet::iterator it = time_sorted_pending_requests_.begin();
while (it != time_sorted_pending_requests_.end()) {
@@ -220,7 +219,7 @@ bool RequestInfoSet::Erase(const RequestInfoPtr request_info) {
}
bool RequestInfoSet::RemoveRequest(const RequestInfoPtr request_info) {
- sync_primitives::AutoLock lock(this_lock_);
+ sync_primitives::AutoLock lock(pending_requests_lock_);
return Erase(request_info);
}
@@ -229,7 +228,7 @@ uint32_t RequestInfoSet::RemoveRequests(
LOG4CXX_AUTO_TRACE(logger_);
uint32_t erased = 0;
- sync_primitives::AutoLock lock(this_lock_);
+ sync_primitives::AutoLock lock(pending_requests_lock_);
HashSortedRequestInfoSet::iterator it =
std::find_if(hash_sorted_pending_requests_.begin(),
hash_sorted_pending_requests_.end(),
@@ -257,6 +256,7 @@ uint32_t RequestInfoSet::RemoveMobileRequests() {
}
const size_t RequestInfoSet::Size() {
+ sync_primitives::AutoLock lock(pending_requests_lock_);
CheckSetSizes();
return time_sorted_pending_requests_.size();
}
@@ -283,7 +283,7 @@ bool RequestInfoSet::AppIdCompararator::operator()(
bool RequestInfoTimeComparator::operator()(const RequestInfoPtr lhs,
const RequestInfoPtr rhs) const {
date_time::TimeCompare compare_result =
- date_time::DateTime::compareTime(lhs->end_time(), rhs->end_time());
+ date_time::compareTime(lhs->end_time(), rhs->end_time());
if (compare_result == date_time::LESS) {
return true;
} else if (compare_result == date_time::GREATER) {
diff --git a/src/components/application_manager/src/request_tracker.cc b/src/components/application_manager/src/request_tracker.cc
index 13b3d4d873..c047c82579 100644
--- a/src/components/application_manager/src/request_tracker.cc
+++ b/src/components/application_manager/src/request_tracker.cc
@@ -77,7 +77,7 @@ bool RequestTracker::Track(const ApplicationID& app_id,
const uint32_t max_requests,
ApplicationsRequestsTracker& tracker) {
LOG4CXX_AUTO_TRACE(logger_);
- using date_time::DateTime;
+ using namespace date_time;
if (!time_scale || !max_requests) {
LOG4CXX_INFO(logger_, "Time scale request tracking is disabled.");
@@ -93,7 +93,7 @@ bool RequestTracker::Track(const ApplicationID& app_id,
if (tracker.end() == it_app) {
LOG4CXX_DEBUG(logger_, "Adding new application into tracking.");
- tracker[app_id].push_back(DateTime::getCurrentTime());
+ tracker[app_id].push_back(getCurrentTime());
return true;
}
@@ -102,25 +102,24 @@ bool RequestTracker::Track(const ApplicationID& app_id,
if (it_app->second.size() < max_requests) {
LOG4CXX_DEBUG(logger_, "Adding new request into tracking.");
- tracker[app_id].push_back(DateTime::getCurrentTime());
+ tracker[app_id].push_back(getCurrentTime());
return true;
}
LOG4CXX_DEBUG(logger_,
"Oldest request is added at: "
- << DateTime::getmSecs(it_app->second.front())
- << ". Current time is: "
- << DateTime::getmSecs(DateTime::getCurrentTime())
+ << getmSecs(it_app->second.front())
+ << ". Current time is: " << getmSecs(getCurrentTime())
<< ". Time scale is: " << time_scale);
- if (DateTime::calculateTimeSpan(it_app->second.front()) > time_scale) {
+ if (calculateTimeSpan(it_app->second.front()) > time_scale) {
LOG4CXX_DEBUG(logger_, "Dropping oldest request, adding new one.");
ApplicationsRequestsTracker::mapped_type& times = tracker[app_id];
DCHECK_OR_RETURN(!times.empty(), false);
times.erase(times.begin());
- times.push_back(DateTime::getCurrentTime());
+ times.push_back(getCurrentTime());
return true;
}
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index 72f2246e7c..3e77078ee5 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -35,6 +35,7 @@
#include <algorithm>
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "utils/file_system.h"
#include "connection_handler/connection_handler_impl.h"
@@ -47,17 +48,22 @@
#include "utils/helpers.h"
#include "application_manager/resumption/resumption_data_db.h"
#include "application_manager/resumption/resumption_data_json.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace resumption {
using namespace application_manager;
+static mobile_api::HMILevel::eType PickHigherHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2);
+static mobile_api::HMILevel::eType PickLowerHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2);
+static mobile_api::HMILevel::eType ConvertHmiLevelString(const std::string str);
+
CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
: event_engine::EventObserver(application_manager.event_dispatcher())
- , queue_lock_(false)
, restore_hmi_level_timer_(
"RsmCtrlRstore",
new timer::TimerTaskImpl<ResumeCtrlImpl>(
@@ -68,13 +74,20 @@ ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
, is_resumption_active_(false)
, is_data_saved_(false)
, is_suspended_(false)
- , launch_time_(time(NULL))
+ , launch_time_(time(nullptr))
+ , low_voltage_time_(0)
+ , wake_up_time_(0)
, application_manager_(application_manager) {}
#ifdef BUILD_TESTS
void ResumeCtrlImpl::set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) {
+ std::shared_ptr<ResumptionData> mock_storage) {
resumption_storage_ = mock_storage;
}
+
+bool ResumeCtrlImpl::get_resumption_active() const {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ return is_resumption_active_;
+}
#endif // BUILD_TESTS
bool ResumeCtrlImpl::Init(resumption::LastState& last_state) {
@@ -117,6 +130,8 @@ bool ResumeCtrlImpl::Init(resumption::LastState& last_state) {
application_manager_.get_settings()
.app_resumption_save_persistent_data_timeout(),
timer::kPeriodic);
+
+ resumption_storage_->IncrementGlobalIgnOnCounter();
return true;
}
@@ -133,9 +148,13 @@ void ResumeCtrlImpl::SaveAllApplications() {
void ResumeCtrlImpl::SaveApplication(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(application);
- LOG4CXX_INFO(logger_,
- "application with appID " << application->app_id()
- << " will be saved");
+ if (application_manager_.IsLowVoltage()) {
+ LOG4CXX_DEBUG(logger_, "Low Voltage state is active");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "application with appID " << application->app_id()
+ << " will be saved");
resumption_storage_->SaveApplication(application);
}
@@ -157,10 +176,38 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
if (result) {
DCHECK_OR_RETURN(application, false);
if (saved_app.keyExists(strings::hmi_level)) {
- const HMILevel::eType saved_hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- saved_app[strings::hmi_level].asInt());
- LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ HMILevel::eType saved_hmi_level;
+ if (HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ saved_hmi_level = application->deferred_resumption_hmi_level();
+ LOG4CXX_INFO(logger_,
+ "Retry resuming into HMI level : " << saved_hmi_level);
+ application->set_deferred_resumption_hmi_level(
+ HMILevel::eType::INVALID_ENUM);
+ } else {
+ saved_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
+ saved_app[strings::hmi_level].asInt());
+ LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ }
+
+ // Check one of the high-bandwidth transports (configured through
+ // smartDeviceLink.ini file) is available. If not, then the HMI level to
+ // resume into will be modified.
+ if (!application_manager_.CheckResumptionRequiredTransportAvailable(
+ application)) {
+ mobile_apis::HMILevel::eType low_bandwidth_level =
+ GetHmiLevelOnLowBandwidthTransport(application);
+
+ application->set_deferred_resumption_hmi_level(saved_hmi_level);
+
+ saved_hmi_level =
+ PickLowerHmiLevel(saved_hmi_level, low_bandwidth_level);
+ LOG4CXX_DEBUG(
+ logger_,
+ "High-bandwidth transport not available, app will resume into : "
+ << saved_hmi_level);
+ }
+
return SetAppHMIState(application, saved_hmi_level, true);
} else {
result = false;
@@ -175,9 +222,23 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
bool ResumeCtrlImpl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(application, false);
- mobile_apis::HMILevel::eType default_hmi =
+ mobile_apis::HMILevel::eType hmi_level =
application_manager_.GetDefaultHmiLevel(application);
- return SetAppHMIState(application, default_hmi, false);
+
+ // Check one of the high-bandwidth transports (configured through
+ // smartDeviceLink.ini file) is available. If not, then the HMI level to
+ // resume into will be modified.
+ if (!application_manager_.CheckResumptionRequiredTransportAvailable(
+ application)) {
+ mobile_apis::HMILevel::eType low_bandwidth_level =
+ GetHmiLevelOnLowBandwidthTransport(application);
+ hmi_level = PickLowerHmiLevel(hmi_level, low_bandwidth_level);
+ LOG4CXX_DEBUG(
+ logger_,
+ "High-bandwidth transport not available, default HMI level is set to : "
+ << hmi_level);
+ }
+ return SetAppHMIState(application, hmi_level, false);
}
void ResumeCtrlImpl::ApplicationResumptiOnTimer() {
@@ -257,6 +318,10 @@ uint32_t ResumeCtrlImpl::GetHMIApplicationID(
bool ResumeCtrlImpl::RemoveApplicationFromSaved(
ApplicationConstSharedPtr application) {
+ if (application_manager_.IsLowVoltage()) {
+ LOG4CXX_DEBUG(logger_, "Low Voltage state is active");
+ return false;
+ }
const std::string& device_mac = application->mac_address();
return resumption_storage_->RemoveApplicationFromSaved(
application->policy_app_id(), device_mac);
@@ -270,8 +335,11 @@ void ResumeCtrlImpl::OnSuspend() {
void ResumeCtrlImpl::OnIgnitionOff() {
LOG4CXX_AUTO_TRACE(logger_);
- resumption_storage_->IncrementIgnOffCount();
- FinalPersistData();
+ if (!application_manager_.IsLowVoltage()) {
+ resumption_storage_->IncrementIgnOffCount();
+ resumption_storage_->ResetGlobalIgnOnCount();
+ FinalPersistData();
+ }
}
void ResumeCtrlImpl::OnAwake() {
@@ -281,6 +349,25 @@ void ResumeCtrlImpl::OnAwake() {
StartSavePersistentDataTimer();
}
+void ResumeCtrlImpl::SaveLowVoltageTime() {
+ low_voltage_time_ = time(nullptr);
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage timestamp : " << low_voltage_time_ << " saved");
+}
+
+void ResumeCtrlImpl::SaveWakeUpTime() {
+ wake_up_time_ = std::time(nullptr);
+ LOG4CXX_DEBUG(logger_, "Wake Up timestamp : " << wake_up_time_ << " saved");
+}
+
+time_t ResumeCtrlImpl::LowVoltageTime() const {
+ return low_voltage_time_;
+}
+
+time_t ResumeCtrlImpl::WakeUpTime() const {
+ return wake_up_time_;
+}
+
bool ResumeCtrlImpl::is_suspended() const {
return is_suspended_;
}
@@ -352,6 +439,28 @@ bool ResumeCtrlImpl::StartResumptionOnlyHMILevel(
return result;
}
+void ResumeCtrlImpl::RetryResumption(const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Invalid app_id = " << app_id);
+ return;
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ // check and update resumption deferred flag in queue_lock_
+ if (mobile_api::HMILevel::eType::INVALID_ENUM ==
+ app->deferred_resumption_hmi_level()) {
+ LOG4CXX_DEBUG(logger_, "No need to retry resumption for app: " << app_id);
+ return;
+ }
+ }
+
+ AddToResumptionTimerQueue(app_id);
+}
+
void ResumeCtrlImpl::StartAppHmiStateResumption(
ApplicationSharedPtr application) {
using namespace date_time;
@@ -365,15 +474,33 @@ void ResumeCtrlImpl::StartAppHmiStateResumption(
LOG4CXX_ERROR(logger_, "Application was not saved");
return;
}
- const uint32_t ign_off_count = saved_app[strings::ign_off_count].asUInt();
- bool restore_data_allowed = false;
- restore_data_allowed =
- CheckAppRestrictions(application, saved_app) &&
- ((0 == ign_off_count) || CheckIgnCycleRestrictions(saved_app));
- if (restore_data_allowed) {
+
+ const bool is_hmi_level_applicable_to_resume =
+ CheckAppRestrictions(application, saved_app);
+
+ if (!is_hmi_level_applicable_to_resume) {
+ LOG4CXX_DEBUG(logger_, "No applicable HMI level found for resuming");
+ return;
+ }
+
+ const bool is_resume_allowed_by_low_voltage =
+ CheckLowVoltageRestrictions(saved_app);
+
+ const bool is_hmi_level_allowed_by_ign_cycle =
+ CheckIgnCycleRestrictions(saved_app);
+
+ const bool restore_hmi_level_allowed =
+ is_resume_allowed_by_low_voltage && is_hmi_level_allowed_by_ign_cycle;
+
+ if (restore_hmi_level_allowed) {
LOG4CXX_INFO(logger_,
"Resume application " << application->policy_app_id());
RestoreAppHMIState(application);
+ if (mobile_apis::HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ // the application has not been fully resumed
+ return;
+ }
RemoveApplicationFromSaved(application);
} else {
LOG4CXX_INFO(logger_,
@@ -544,8 +671,12 @@ void ResumeCtrlImpl::AddCommands(ApplicationSharedPtr application,
saved_app[strings::application_commands];
for (size_t i = 0; i < app_commands.length(); ++i) {
const smart_objects::SmartObject& command = app_commands[i];
+ const uint32_t cmd_id = command[strings::cmd_id].asUInt();
+ const bool is_resumption = true;
- application->AddCommand(command[strings::cmd_id].asUInt(), command);
+ application->AddCommand(cmd_id, command);
+ application->help_prompt_manager().OnVrCommandAdded(
+ cmd_id, command, is_resumption);
}
ProcessHMIRequests(MessageHelper::CreateAddCommandRequestToHMI(
application, application_manager_));
@@ -606,34 +737,25 @@ void ResumeCtrlImpl::AddSubscriptions(
ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app) {
LOG4CXX_AUTO_TRACE(logger_);
- if (saved_app.keyExists(strings::application_subscribtions)) {
- const smart_objects::SmartObject& subscribtions =
- saved_app[strings::application_subscribtions];
+ if (saved_app.keyExists(strings::application_subscriptions)) {
+ const smart_objects::SmartObject& subscriptions =
+ saved_app[strings::application_subscriptions];
- if (subscribtions.keyExists(strings::application_buttons)) {
- const smart_objects::SmartObject& subscribtions_buttons =
- subscribtions[strings::application_buttons];
+ if (subscriptions.keyExists(strings::application_buttons)) {
+ const smart_objects::SmartObject& subscriptions_buttons =
+ subscriptions[strings::application_buttons];
mobile_apis::ButtonName::eType btn;
- for (size_t i = 0; i < subscribtions_buttons.length(); ++i) {
+ for (size_t i = 0; i < subscriptions_buttons.length(); ++i) {
btn = static_cast<mobile_apis::ButtonName::eType>(
- (subscribtions_buttons[i]).asInt());
+ (subscriptions_buttons[i]).asInt());
application->SubscribeToButton(btn);
}
}
MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
application, application_manager_);
- if (subscribtions.keyExists(strings::application_vehicle_info)) {
- const smart_objects::SmartObject& subscribtions_ivi =
- subscribtions[strings::application_vehicle_info];
- mobile_apis::VehicleDataType::eType ivi;
- for (size_t i = 0; i < subscribtions_ivi.length(); ++i) {
- ivi = static_cast<mobile_apis::VehicleDataType::eType>(
- (subscribtions_ivi[i]).asInt());
- application->SubscribeToIVI(ivi);
- }
- ProcessHMIRequests(MessageHelper::GetIVISubscriptionRequests(
- application, application_manager_));
+ for (auto& extension : application->Extensions()) {
+ extension->ProcessResumption(subscriptions);
}
}
}
@@ -641,30 +763,62 @@ void ResumeCtrlImpl::AddSubscriptions(
bool ResumeCtrlImpl::CheckIgnCycleRestrictions(
const smart_objects::SmartObject& saved_app) {
LOG4CXX_AUTO_TRACE(logger_);
- bool result = true;
if (!CheckDelayAfterIgnOn()) {
- LOG4CXX_INFO(logger_, "Application was connected long after ign on");
- result = false;
+ LOG4CXX_DEBUG(logger_, "Application was connected long after ign on");
+ return false;
}
- if (!DisconnectedJustBeforeIgnOff(saved_app)) {
- LOG4CXX_INFO(logger_, "Application was dissconnected long before ign off");
- result = false;
+ if (!CheckDelayBeforeIgnOff(saved_app)) {
+ LOG4CXX_DEBUG(logger_, "Application was disconnected long before ign off");
+ return false;
}
- return result;
+ return true;
}
-bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
+bool ResumeCtrlImpl::CheckLowVoltageRestrictions(
const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!CheckDelayBeforeLowVoltage(saved_app)) {
+ LOG4CXX_DEBUG(logger_,
+ "Application was disconnected long before low voltage");
+ return false;
+ }
+
+ if (!CheckDelayAfterWakeUp()) {
+ LOG4CXX_DEBUG(logger_, "Application was connected long after wake up");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "HMI Level resuming in not restricted by Low Voltage");
+ return true;
+}
+
+bool ResumeCtrlImpl::CheckDelayBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app) const {
using namespace date_time;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
const time_t time_stamp =
static_cast<time_t>(saved_app[strings::time_stamp].asInt());
- time_t ign_off_time =
+ const time_t ign_off_time =
static_cast<time_t>(resumption_storage_->GetIgnOffTime());
+
+ if (CheckIgnCyclesData() && 0 == ign_off_time) {
+ LOG4CXX_DEBUG(
+ logger_, "No IGNITION OFF records found: This is first Ignition cycle");
+ return true;
+ }
+
+ // This means that ignition off timestamp was not saved
+ // Possible reasons: Low Voltage event, core crash etc.
+ if (ign_off_time < time_stamp) {
+ LOG4CXX_DEBUG(logger_, "Last IGNITION OFF record missed");
+ return true;
+ }
+
const uint32_t sec_spent_before_ign = labs(ign_off_time - time_stamp);
LOG4CXX_DEBUG(
logger_,
@@ -677,6 +831,71 @@ bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
application_manager_.get_settings().resumption_delay_before_ign();
}
+bool ResumeCtrlImpl::CheckDelayBeforeLowVoltage(
+ const smart_objects::SmartObject& saved_app) const {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
+
+ if (0 == LowVoltageTime()) {
+ LOG4CXX_DEBUG(logger_, "No Low Voltage signal timestamp saved");
+ return true;
+ }
+
+ const time_t unregistration_time_stamp =
+ static_cast<time_t>(saved_app[strings::time_stamp].asInt());
+ const time_t low_voltage_timestamp = static_cast<time_t>(LowVoltageTime());
+ const int32_t sec_spent_before_low_voltage =
+ (low_voltage_timestamp - unregistration_time_stamp);
+ if (0 > sec_spent_before_low_voltage) {
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage time: "
+ << low_voltage_timestamp
+ << "; App disconnect time: " << unregistration_time_stamp
+ << "; Secs between app disconnect and low voltage event "
+ << sec_spent_before_low_voltage);
+ return true;
+ }
+
+ const uint32_t secs_between_app_disconnect_and_low_voltage =
+ static_cast<uint32_t>(sec_spent_before_low_voltage);
+ const uint32_t wait_time =
+ application_manager_.get_settings().resumption_delay_before_ign();
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage time: "
+ << low_voltage_timestamp
+ << "; App disconnect time: " << unregistration_time_stamp
+ << "; Secs between app disconnect and low voltage event "
+ << secs_between_app_disconnect_and_low_voltage
+ << "; Timeout for HMI level resuming: " << wait_time);
+ return secs_between_app_disconnect_and_low_voltage <= wait_time;
+}
+
+bool ResumeCtrlImpl::CheckDelayAfterWakeUp() const {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (0 == WakeUpTime()) {
+ LOG4CXX_DEBUG(logger_, "No WakeUp signal timestamp saved");
+ return true;
+ }
+
+ const time_t current_time = time(nullptr);
+ const time_t wake_up_timestamp = static_cast<time_t>(WakeUpTime());
+
+ const uint32_t seconds_from_wake_up_signal =
+ labs(current_time - wake_up_timestamp);
+ const uint32_t wait_time =
+ application_manager_.get_settings().resumption_delay_after_ign();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Current time: " << current_time << "; WakeUp Signal time: "
+ << wake_up_timestamp << "; Seconds passed from wake up: "
+ << seconds_from_wake_up_signal
+ << "; Timeout for HMI level resuming: " << wait_time);
+ return seconds_from_wake_up_signal <= wait_time;
+}
+
bool ResumeCtrlImpl::CheckAppRestrictions(
ApplicationConstSharedPtr application,
const smart_objects::SmartObject& saved_app) {
@@ -685,16 +904,23 @@ bool ResumeCtrlImpl::CheckAppRestrictions(
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(saved_app.keyExists(strings::hmi_level), false);
- const HMILevel::eType hmi_level =
- static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
+ HMILevel::eType hmi_level;
+ if (mobile_api::HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ hmi_level = application->deferred_resumption_hmi_level();
+ } else {
+ hmi_level =
+ static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
+ }
const bool result = Compare<HMILevel::eType, EQ, ONE>(
hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)
? true
: false;
LOG4CXX_DEBUG(logger_,
- "is_media_app " << application->is_media_application()
- << "; hmi_level " << hmi_level << " result "
- << result);
+ "is_media_app: " << application->is_media_application()
+ << "; hmi_level: " << hmi_level << "; result: "
+ << (result ? "Applicable for resume"
+ : "Non-applicable for resume"));
return result;
}
@@ -707,11 +933,36 @@ bool ResumeCtrlImpl::CheckIcons(ApplicationSharedPtr application,
return mobile_apis::Result::INVALID_DATA != verify_images;
}
-bool ResumeCtrlImpl::CheckDelayAfterIgnOn() {
+bool ResumeCtrlImpl::CheckIgnCyclesData() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t global_ign_on_count =
+ resumption_storage_->GetGlobalIgnOnCounter();
+ const uint32_t the_first_ignition = 1;
+ const bool is_emergency_ign_off_occurred =
+ global_ign_on_count > the_first_ignition;
+ // global_ign_on_count is reseting to 0 at ignition off
+ // global_ign_on_count is incrementing at ignition on
+ // global_ign_on_count > 1 means that correct ignition off was not present.
+ if (is_emergency_ign_off_occurred) {
+ LOG4CXX_WARN(logger_,
+ "Emergency IGN OFF occurred. Possibly after Low Voltage");
+ return false;
+ }
+ return true;
+}
+
+bool ResumeCtrlImpl::CheckDelayAfterIgnOn() const {
using namespace date_time;
LOG4CXX_AUTO_TRACE(logger_);
- const time_t curr_time = time(NULL);
+ const time_t ign_off_time = GetIgnOffTime();
+
+ if (CheckIgnCyclesData() && 0 == ign_off_time) {
+ LOG4CXX_DEBUG(logger_, "This is first Ignition cycle");
+ return true;
+ }
+ const time_t curr_time = time(nullptr);
const time_t sdl_launch_time = LaunchTime();
+
const uint32_t seconds_from_sdl_start = labs(curr_time - sdl_launch_time);
const uint32_t wait_time =
application_manager_.get_settings().resumption_delay_after_ign();
@@ -727,7 +978,7 @@ time_t ResumeCtrlImpl::LaunchTime() const {
return launch_time_;
}
-time_t ResumeCtrlImpl::GetIgnOffTime() {
+time_t ResumeCtrlImpl::GetIgnOffTime() const {
return resumption_storage_->GetIgnOffTime();
}
@@ -743,7 +994,7 @@ bool ResumeCtrlImpl::ProcessHMIRequest(smart_objects::SmartObjectSPtr request,
(*request)[strings::correlation_id].asInt();
subscribe_on_event(function_id, hmi_correlation_id);
}
- if (!application_manager_.ManageHMICommand(request)) {
+ if (!application_manager_.GetRPCService().ManageHMICommand(request)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
return false;
}
@@ -762,14 +1013,21 @@ void ResumeCtrlImpl::ProcessHMIRequests(
void ResumeCtrlImpl::AddToResumptionTimerQueue(const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
+ bool run_resumption = false;
queue_lock_.Acquire();
waiting_for_timer_.push_back(app_id);
+
+ if (!is_resumption_active_) {
+ is_resumption_active_ = true;
+ run_resumption = true;
+ }
queue_lock_.Release();
LOG4CXX_DEBUG(logger_,
"Application ID " << app_id << " have been added"
" to resumption queue.");
- if (!is_resumption_active_) {
- is_resumption_active_ = true;
+ if (run_resumption) {
+ LOG4CXX_DEBUG(logger_,
+ "Application ID " << app_id << " will be restored by timer");
restore_hmi_level_timer_.Start(
application_manager_.get_settings().app_resuming_timeout(),
timer::kSingleShot);
@@ -834,4 +1092,97 @@ bool ResumeCtrlImpl::IsAppDataResumptionExpired(
return max_ign_off_count <= application[strings::ign_off_count].asInt();
}
+mobile_apis::HMILevel::eType ResumeCtrlImpl::GetHmiLevelOnLowBandwidthTransport(
+ ApplicationConstSharedPtr application) const {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const ApplicationManagerSettings& settings =
+ application_manager_.get_settings();
+ const std::string& level_for_navi_app =
+ settings.navigation_lowbandwidth_resumption_level();
+ const std::string& level_for_projection_app =
+ settings.projection_lowbandwidth_resumption_level();
+ const std::string& level_for_media_app =
+ settings.media_lowbandwidth_resumption_level();
+
+ HMILevel::eType result_level = HMILevel::HMI_NONE;
+ HMILevel::eType level;
+
+ // NAVIGATION, PROJECTION and media apps have special exceptions. Their HMI
+ // level can be configured through .ini file. when the app has multiple
+ // AppHMIType, then the highest level will be applied.
+ if (application->is_navi()) {
+ level = ConvertHmiLevelString(level_for_navi_app);
+ LOG4CXX_DEBUG(logger_,
+ "NAVIGATION apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+ if (application->mobile_projection_enabled()) {
+ level = ConvertHmiLevelString(level_for_projection_app);
+ LOG4CXX_DEBUG(logger_,
+ "PROJECTION apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+ if (application->is_media_application()) {
+ level = ConvertHmiLevelString(level_for_media_app);
+ LOG4CXX_DEBUG(logger_,
+ "media apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+
+ return result_level;
+}
+
+static mobile_api::HMILevel::eType PickHigherHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2) {
+ using namespace mobile_apis;
+
+ if (val1 == HMILevel::INVALID_ENUM) {
+ return val2;
+ } else if (val2 == HMILevel::INVALID_ENUM) {
+ return val1;
+ }
+
+ // smaller enum value has higher level
+ return val1 < val2 ? val1 : val2;
+}
+
+static mobile_api::HMILevel::eType PickLowerHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2) {
+ using namespace mobile_apis;
+
+ if (val1 == HMILevel::INVALID_ENUM) {
+ return val2;
+ } else if (val2 == HMILevel::INVALID_ENUM) {
+ return val1;
+ }
+
+ // bigger enum value has lower level
+ return val1 > val2 ? val1 : val2;
+}
+
+static mobile_api::HMILevel::eType ConvertHmiLevelString(
+ const std::string str) {
+ using namespace mobile_apis;
+
+ if ("BACKGROUND" == str) {
+ return HMILevel::HMI_BACKGROUND;
+ } else if ("FULL" == str) {
+ return HMILevel::HMI_FULL;
+ } else if ("LIMITED" == str) {
+ return HMILevel::HMI_LIMITED;
+ } else if ("NONE" == str) {
+ return HMILevel::HMI_NONE;
+ } else {
+ return HMILevel::HMI_NONE;
+ }
+}
+
} // namespce resumption
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index bd5bdbddab..856fb03750 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -41,7 +41,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
ResumptionData::ResumptionData(
const application_manager::ApplicationManager& application_manager)
- : resumption_lock_(true), application_manager_(application_manager) {}
+ : application_manager_(application_manager) {}
smart_objects::SmartObject ResumptionData::GetApplicationCommands(
app_mngr::ApplicationConstSharedPtr application) const {
@@ -159,16 +159,9 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubscriptions(
strings::application_buttons,
subscriptions);
- DataAccessor<VehicleInfoSubscriptions> vi_accessor =
- application->SubscribedIVI();
-
- const VehicleInfoSubscriptions& vi_subscription = vi_accessor.GetData();
-
- LOG4CXX_DEBUG(logger_, "SubscribedIVI:" << vi_subscription.size());
- Append(vi_subscription.begin(),
- vi_subscription.end(),
- strings::application_vehicle_info,
- subscriptions);
+ for (auto extension : application->Extensions()) {
+ extension->SaveResumptionData(subscriptions);
+ }
return subscriptions;
}
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc
index b031fd0afd..1591ce566a 100644
--- a/src/components/application_manager/src/resumption/resumption_data_db.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_db.cc
@@ -163,11 +163,10 @@ void ResumptionDataDB::SaveApplication(
}
if (application->is_application_data_changed()) {
- if (application_exist) {
- if (!DeleteSavedApplication(policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Deleting of application data is not finished");
- return;
- }
+ if (application_exist &&
+ !DeleteSavedApplication(policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Deleting of application data is not finished");
+ return;
}
if (!SaveApplicationToDB(application, policy_app_id, device_mac)) {
@@ -176,23 +175,15 @@ void ResumptionDataDB::SaveApplication(
}
LOG4CXX_INFO(logger_, "All data from application were saved successfully");
application->set_is_application_data_changed(false);
- } else {
- if (application_exist) {
- if (!UpdateApplicationData(application, policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Updating application data is failed");
- return;
- }
- LOG4CXX_INFO(logger_, "Application data were updated successfully");
- } else {
- if (Compare<HMILevel::eType, EQ, ONE>(application->hmi_level(),
- HMILevel::HMI_FULL,
- HMILevel::HMI_LIMITED)) {
- if (!InsertApplicationData(application, policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Saving data of application is failed");
- return;
- }
- }
+ } else if (application_exist) {
+ if (!UpdateApplicationData(application, policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Updating application data is failed");
+ return;
}
+ LOG4CXX_INFO(logger_, "Application data were updated successfully");
+ } else if (!InsertApplicationData(application, policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Saving data of application is failed");
+ return;
}
WriteDb();
}
@@ -212,8 +203,6 @@ uint32_t ResumptionDataDB::GetHMIApplicationID(
return hmi_app_id;
}
-DEPRECATED void ResumptionDataDB::OnSuspend() {}
-
void ResumptionDataDB::IncrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -240,7 +229,7 @@ void ResumptionDataDB::IncrementIgnOffCount() {
}
}
- if (query_update_last_ign_off_time.Prepare(KUpdateLastIgnOffTime)) {
+ if (query_update_last_ign_off_time.Prepare(kUpdateLastIgnOffTime)) {
query_update_last_ign_off_time.Bind(0, static_cast<int64_t>(time(NULL)));
if (query_update_last_ign_off_time.Exec()) {
LOG4CXX_INFO(logger_, "Data last_ign_off_time was updated");
@@ -293,8 +282,6 @@ bool ResumptionDataDB::GetHashId(const std::string& policy_app_id,
return SelectHashId(policy_app_id, device_id, hash_id);
}
-DEPRECATED void ResumptionDataDB::OnAwake() {}
-
void ResumptionDataDB::DecrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -376,10 +363,61 @@ bool ResumptionDataDB::RemoveApplicationFromSaved(
uint32_t ResumptionDataDB::GetIgnOffTime() const {
LOG4CXX_AUTO_TRACE(logger_);
-
return SelectIgnOffTime();
}
+uint32_t ResumptionDataDB::GetGlobalIgnOnCounter() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(kSelectGlobalIgnOnCounter)) {
+ LOG4CXX_ERROR(logger_,
+ "Problem with prepare query : " << kSelectGlobalIgnOnCounter);
+ return 1;
+ }
+
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_,
+ "Problem with exec query : " << kSelectGlobalIgnOnCounter);
+ return 1;
+ }
+
+ const auto global_ign_on_counter = query.GetUInteger(0);
+ LOG4CXX_DEBUG(logger_, "Global Ign On Counter = " << global_ign_on_counter);
+ return global_ign_on_counter;
+}
+
+void ResumptionDataDB::IncrementGlobalIgnOnCounter() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ db_->BeginTransaction();
+ utils::dbms::SQLQuery query_update_global_ign_on_count(db());
+ if (query_update_global_ign_on_count.Prepare(kUpdateGlobalIgnOnCount)) {
+ if (query_update_global_ign_on_count.Exec()) {
+ LOG4CXX_DEBUG(logger_,
+ "Data query_update_global_ign_on_count was updated");
+ }
+ }
+ db_->CommitTransaction();
+ WriteDb();
+}
+
+void ResumptionDataDB::ResetGlobalIgnOnCount() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ LOG4CXX_DEBUG(logger_, "Global IGN ON counter resetting");
+
+ utils::dbms::SQLQuery query_update_global_ign_on_count(db());
+ if (query_update_global_ign_on_count.Prepare(kResetGlobalIgnOnCount)) {
+ if (query_update_global_ign_on_count.Exec()) {
+ LOG4CXX_DEBUG(logger_, "Data was updated");
+ }
+ }
+}
+
ssize_t ResumptionDataDB::IsApplicationSaved(
const std::string& policy_app_id, const std::string& device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -557,7 +595,6 @@ void ResumptionDataDB::SelectDataForLoadResumeData(
using namespace app_mngr;
using namespace smart_objects;
LOG4CXX_AUTO_TRACE(logger_);
-
utils::dbms::SQLQuery select_data(db());
utils::dbms::SQLQuery count_application(db());
if (!select_data.Prepare(kSelectDataForLoadResumeData) ||
@@ -953,7 +990,7 @@ bool ResumptionDataDB::SelectSubscriptionsData(
return false;
}
- saved_app[strings::application_subscribtions] = SmartObject(SmartType_Map);
+ saved_app[strings::application_subscriptions] = SmartObject(SmartType_Map);
if (0 == count_item) {
LOG4CXX_INFO(logger_, "Application does not contain subscriptions data");
@@ -972,8 +1009,8 @@ bool ResumptionDataDB::SelectSubscriptionsData(
size_t buttons_idx = 0;
size_t vi_idx = 0;
/* Position of data in "select_subscriptions" :
- field "vehicleValue" from table "applicationSubscribtionsArray" = 0
- field "ButtonNameValue" from table "applicationSubscribtionsArray" = 1*/
+ field "vehicleValue" from table "applicationSubscriptionsArray" = 0
+ field "ButtonNameValue" from table "applicationSubscriptionsArray" = 1*/
while (select_subscriptions.Next()) {
if (!select_subscriptions.IsNull(0)) {
application_vehicle_info[vi_idx++] = select_subscriptions.GetInteger(0);
@@ -983,12 +1020,12 @@ bool ResumptionDataDB::SelectSubscriptionsData(
}
}
if (!application_buttons.empty()) {
- saved_app[strings::application_subscribtions]
+ saved_app[strings::application_subscriptions]
[strings::application_buttons] = application_buttons;
}
if (!application_vehicle_info.empty()) {
- saved_app[strings::application_subscribtions]
+ saved_app[strings::application_subscriptions]
[strings::application_vehicle_info] = application_vehicle_info;
}
LOG4CXX_INFO(logger_, "Subscriptions were restored from DB successfully");
@@ -1504,9 +1541,9 @@ bool ResumptionDataDB::DeleteSavedSubscriptions(
LOG4CXX_AUTO_TRACE(logger_);
if (!ExecQueryToDeleteData(
- policy_app_id, device_id, kDeleteApplicationSubscribtionsArray)) {
+ policy_app_id, device_id, kDeleteApplicationSubscriptionsArray)) {
LOG4CXX_WARN(logger_,
- "Incorrect delete from applicationSubscribtionsArray.");
+ "Incorrect delete from applicationSubscriptionsArray.");
return false;
}
return true;
@@ -1899,7 +1936,7 @@ bool ResumptionDataDB::SaveApplicationToDB(
}
if (!InsertSubscriptionsData(GetApplicationSubscriptions(application),
application_primary_key)) {
- LOG4CXX_WARN(logger_, "Incorrect insert subscribtions data to DB.");
+ LOG4CXX_WARN(logger_, "Incorrect insert subscriptions data to DB.");
db_->RollbackTransaction();
return false;
}
@@ -1956,9 +1993,9 @@ bool ResumptionDataDB::SaveApplicationToDB(
db_->RollbackTransaction();
return false;
}
- if (!InsertSubscriptionsData(application["subscribtions"],
+ if (!InsertSubscriptionsData(application["subscriptions"],
application_primary_key)) {
- LOG4CXX_WARN(logger_, "Incorrect insert subscribtions data to DB.");
+ LOG4CXX_WARN(logger_, "Incorrect insert subscriptions data to DB.");
db_->RollbackTransaction();
return false;
}
@@ -2164,9 +2201,9 @@ bool ResumptionDataDB::InsertSubscriptionsData(
return false;
}
/* Positions of binding data for "insert_subscriptions":
- field "idApplication" from table "applicationSubscribtionsArray" = 0
- field "vehicleValue" from table "applicationSubscribtionsArray" = 1
- field "ButtonNameValue" from table "applicationSubscribtionsArray" = 2*/
+ field "idApplication" from table "applicationSubscriptionsArray" = 0
+ field "vehicleValue" from table "applicationSubscriptionsArray" = 1
+ field "ButtonNameValue" from table "applicationSubscriptionsArray" = 2*/
for (size_t i = 0; i < max_length; ++i) {
insert_subscriptions.Bind(0, application_primary_key);
if (i < vi_sub_length) {
diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc
index b8ce6a76c4..c8e9032dfa 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -41,7 +41,7 @@
namespace resumption {
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
@@ -81,22 +81,22 @@ void ResumptionDataJson::SaveApplication(
json_app[strings::hmi_level] = static_cast<int32_t>(hmi_level);
json_app[strings::ign_off_count] = 0;
json_app[strings::hash_id] = hash;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationCommands(application), tmp);
json_app[strings::application_commands] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationSubMenus(application), tmp);
json_app[strings::application_submenus] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationInteractionChoiseSets(application), tmp);
json_app[strings::application_choice_sets] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationGlobalProperties(application), tmp);
json_app[strings::application_global_properties] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationSubscriptions(application), tmp);
- json_app[strings::application_subscribtions] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ json_app[strings::application_subscriptions] = tmp;
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationFiles(application), tmp);
json_app[strings::application_files] = tmp;
json_app[strings::time_stamp] = time_stamp;
@@ -143,8 +143,6 @@ uint32_t ResumptionDataJson::GetHMIApplicationID(
return hmi_app_id;
}
-DEPRECATED void ResumptionDataJson::OnSuspend() {}
-
void ResumptionDataJson::IncrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
@@ -169,8 +167,6 @@ void ResumptionDataJson::IncrementIgnOffCount() {
LOG4CXX_DEBUG(logger_, GetResumptionData().toStyledString());
}
-DEPRECATED void ResumptionDataJson::OnAwake() {}
-
void ResumptionDataJson::DecrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
@@ -229,7 +225,7 @@ bool ResumptionDataJson::GetSavedApplication(
return false;
}
const Json::Value& json_saved_app = GetSavedApplications()[idx];
- Formatters::CFormatterJsonBase::jsonValueToObj(json_saved_app, saved_app);
+ formatters::CFormatterJsonBase::jsonValueToObj(json_saved_app, saved_app);
return true;
}
@@ -283,6 +279,51 @@ uint32_t ResumptionDataJson::GetIgnOffTime() const {
return resumption[strings::last_ign_off_time].asUInt();
}
+uint32_t ResumptionDataJson::GetGlobalIgnOnCounter() const {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+ if (resumption.isMember(strings::global_ign_on_counter)) {
+ const uint32_t global_ign_on_counter =
+ resumption[strings::global_ign_on_counter].asUInt();
+ LOG4CXX_DEBUG(logger_, "Global Ign On Counter = " << global_ign_on_counter);
+ return global_ign_on_counter;
+ }
+ return 1;
+}
+
+void ResumptionDataJson::IncrementGlobalIgnOnCounter() {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+ if (resumption.isMember(strings::global_ign_on_counter)) {
+ const uint32_t global_ign_on_counter =
+ resumption[strings::global_ign_on_counter].asUInt();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Global IGN ON counter in resumption data: " << global_ign_on_counter);
+ resumption[strings::global_ign_on_counter] = global_ign_on_counter + 1;
+ LOG4CXX_DEBUG(logger_,
+ "Global IGN ON counter new value: "
+ << resumption[strings::global_ign_on_counter].asUInt());
+ } else {
+ resumption[strings::global_ign_on_counter] = 1;
+ }
+ last_state().SaveStateToFileSystem();
+}
+
+void ResumptionDataJson::ResetGlobalIgnOnCount() {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+
+ resumption[strings::global_ign_on_counter] = 0;
+ LOG4CXX_DEBUG(logger_, "Global IGN ON counter resetting");
+}
+
ssize_t ResumptionDataJson::IsApplicationSaved(
const std::string& policy_app_id, const std::string& device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -473,7 +514,7 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id,
application[strings::application_submenus].clear();
application[strings::application_choice_sets].clear();
application[strings::application_global_properties].clear();
- application[strings::application_subscribtions].clear();
+ application[strings::application_subscriptions].clear();
application[strings::application_files].clear();
application.removeMember(strings::grammar_id);
LOG4CXX_DEBUG(logger_,
diff --git a/src/components/application_manager/src/resumption/resumption_sql_queries.cc b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
index 7a5008542c..4770bafef4 100644
--- a/src/components/application_manager/src/resumption/resumption_sql_queries.cc
+++ b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
@@ -37,6 +37,7 @@ const std::string kCreateSchema =
"BEGIN ; "
"CREATE TABLE IF NOT EXISTS `resumption`( "
" `idresumption` INTEGER PRIMARY KEY, "
+ " `global_ign_on_count` INTEGER, "
" `last_ign_off_time` INTEGER "
" ); "
"CREATE TABLE IF NOT EXISTS `subscribedForWayPoints`( "
@@ -298,8 +299,8 @@ const std::string kCreateSchema =
"CREATE INDEX IF NOT EXISTS "
"`applicationSubMenuArray.fk_Application_idx` "
" ON `applicationSubMenuArray`(`idApplication`); "
- "CREATE TABLE IF NOT EXISTS `applicationSubscribtionsArray`( "
- " `idapplicationSubscribtionsArray` INTEGER PRIMARY KEY NOT NULL, "
+ "CREATE TABLE IF NOT EXISTS `applicationSubscriptionsArray`( "
+ " `idapplicationSubscriptionsArray` INTEGER PRIMARY KEY NOT NULL, "
" `vehicleValue` INTEGER, "
" `ButtonNameValue` INTEGER, "
" `idApplication` INTEGER, "
@@ -308,8 +309,8 @@ const std::string kCreateSchema =
" REFERENCES `application`(`idApplication`) "
" ); "
"CREATE INDEX IF NOT EXISTS "
- "`applicationSubscribtionsArray.fk_Application_idx` "
- " ON `applicationSubscribtionsArray`(`idApplication`); "
+ "`applicationSubscriptionsArray.fk_Application_idx` "
+ " ON `applicationSubscriptionsArray`(`idApplication`); "
"CREATE TABLE IF NOT EXISTS `_internal_data`( "
" `db_version_hash` INTEGER "
" ); "
@@ -365,14 +366,16 @@ const std::string kDropSchema =
"DROP TABLE IF EXISTS `applicationSubMenuArray`; "
"DROP INDEX IF EXISTS `applicationSubMenuArray.fk_subMenu_idx`; "
"DROP INDEX IF EXISTS `applicationSubMenuArray.fk_Application_idx`; "
- "DROP TABLE IF EXISTS `applicationSubscribtionsArray`; "
- "DROP INDEX IF EXISTS `applicationSubscribtionsArray.fk_Application_idx`; "
+ "DROP TABLE IF EXISTS `applicationSubscriptionsArray`; "
+ "DROP INDEX IF EXISTS `applicationSubscriptionsArray.fk_Application_idx`; "
"DROP TABLE IF EXISTS `_internal_data`; "
"COMMIT; "
"VACUUM;";
const std::string kInsertInitData =
- "INSERT OR IGNORE INTO `resumption` (`last_ign_off_time`) VALUES (0); "
+ "INSERT OR IGNORE INTO `resumption` "
+ "(`last_ign_off_time`, `global_ign_on_count`) "
+ "VALUES (0, 0); "
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); ";
const std::string kChecksResumptionData =
@@ -410,6 +413,17 @@ const std::string kSelectHashId =
const std::string kSelectIgnOffTime =
"SELECT `last_ign_off_time` FROM `resumption`";
+const std::string kSelectGlobalIgnOnCounter =
+ "SELECT `global_ign_on_count` FROM `resumption`";
+
+const std::string kResetGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = 0";
+
+const std::string kUpdateGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = `global_ign_on_count` + 1 ";
+
const std::string kCheckApplication =
"SELECT COUNT (`deviceID`) FROM `application` "
"WHERE `deviceID` = ? AND `appID` = ?";
@@ -445,7 +459,7 @@ const std::string kUpdateSuspendData =
"UPDATE `application` "
"SET `ign_off_count` = `ign_off_count` + 1";
-const std::string KUpdateLastIgnOffTime =
+const std::string kUpdateLastIgnOffTime =
"UPDATE `resumption` "
"SET `last_ign_off_time` = ?";
@@ -477,8 +491,8 @@ const std::string kDeleteApplicationSubMenuArray =
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?)";
-const std::string kDeleteApplicationSubscribtionsArray =
- "DELETE FROM `applicationSubscribtionsArray` "
+const std::string kDeleteApplicationSubscriptionsArray =
+ "DELETE FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?)";
@@ -713,7 +727,7 @@ const std::string kInsertVrCommand =
"(?, ?, ?);";
const std::string kInsertSubscriptions =
- "INSERT INTO `applicationSubscribtionsArray` "
+ "INSERT INTO `applicationSubscriptionsArray` "
"(`idApplication`, `vehicleValue`, `ButtonNameValue`) "
"VALUES "
"(?, ?, ?);";
@@ -851,14 +865,14 @@ const std::string kSelectCommands =
const std::string kSelectCountSubscriptions =
"SELECT COUNT (`idApplication`) "
- "FROM `applicationSubscribtionsArray` "
+ "FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?);";
const std::string kSelectSubscriptions =
"SELECT `vehicleValue`, `ButtonNameValue` "
- "FROM `applicationSubscribtionsArray` "
+ "FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?);";
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
new file mode 100644
index 0000000000..939b3d1ce6
--- /dev/null
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -0,0 +1,427 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/rpc_handler_impl.h"
+
+namespace application_manager {
+namespace rpc_handler {
+
+CREATE_LOGGERPTR_LOCAL(logger_, "RPCHandlerImpl")
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
+
+RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager)
+ : app_manager_(app_manager)
+ , messages_from_mobile_("AM FromMobile", this)
+ , messages_from_hmi_("AM FromHMI", this)
+ , hmi_so_factory_(hmi_apis::HMI_API())
+ , mobile_so_factory_(mobile_apis::MOBILE_API())
+#ifdef TELEMETRY_MONITOR
+ , metric_observer_(NULL)
+#endif // TELEMETRY_MONITOR
+{
+}
+
+RPCHandlerImpl::~RPCHandlerImpl() {}
+
+void RPCHandlerImpl::ProcessMessageFromMobile(
+ const std::shared_ptr<Message> message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+#ifdef TELEMETRY_MONITOR
+ AMTelemetryObserver::MessageMetricSharedPtr metric(
+ new AMTelemetryObserver::MessageMetric());
+ metric->begin = date_time::getCurrentTime();
+#endif // TELEMETRY_MONITOR
+ smart_objects::SmartObjectSPtr so_from_mobile =
+ std::make_shared<smart_objects::SmartObject>();
+
+ DCHECK_OR_RETURN_VOID(so_from_mobile);
+ if (!so_from_mobile) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ if (!ConvertMessageToSO(*message, *so_from_mobile)) {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+#ifdef TELEMETRY_MONITOR
+ metric->message = so_from_mobile;
+#endif // TELEMETRY_MONITOR
+
+ if (!app_manager_.GetRPCService().ManageMobileCommand(
+ so_from_mobile, commands::Command::SOURCE_MOBILE)) {
+ LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
+ }
+#ifdef TELEMETRY_MONITOR
+ metric->end = date_time::getCurrentTime();
+ if (metric_observer_) {
+ metric_observer_->OnMessage(metric);
+ }
+#endif // TELEMETRY_MONITOR
+}
+
+void RPCHandlerImpl::ProcessMessageFromHMI(
+ const std::shared_ptr<Message> message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr smart_object =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!smart_object) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ if (!ConvertMessageToSO(*message, *smart_object)) {
+ if (application_manager::MessageType::kResponse ==
+ (*smart_object)[strings::params][strings::message_type].asInt()) {
+ (*smart_object).erase(strings::msg_params);
+ (*smart_object)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+ (*smart_object)[strings::msg_params][strings::info] =
+ std::string("Invalid message received from vehicle");
+ } else {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "Converted message, trying to create hmi command");
+ if (!app_manager_.GetRPCService().ManageHMICommand(smart_object)) {
+ LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
+ }
+}
+void RPCHandlerImpl::Handle(const impl::MessageFromMobile message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ return;
+ }
+ if (app_manager_.is_stopping()) {
+ LOG4CXX_INFO(logger_, "Application manager is stopping");
+ return;
+ }
+
+ ProcessMessageFromMobile(message);
+}
+
+void RPCHandlerImpl::Handle(const impl::MessageFromHmi message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ return;
+ }
+ ProcessMessageFromHMI(message);
+}
+
+void RPCHandlerImpl::OnMessageReceived(
+ const protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ std::shared_ptr<Message> outgoing_message = ConvertRawMsgToMessage(message);
+
+ if (outgoing_message) {
+ LOG4CXX_DEBUG(logger_, "Posting new Message");
+ messages_from_mobile_.PostMessage(
+ impl::MessageFromMobile(outgoing_message));
+ }
+}
+
+void RPCHandlerImpl::OnMobileMessageSent(
+ const protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+void RPCHandlerImpl::OnMessageReceived(
+ hmi_message_handler::MessageSharedPointer message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ messages_from_hmi_.PostMessage(impl::MessageFromHmi(message));
+}
+
+void RPCHandlerImpl::OnErrorSending(
+ hmi_message_handler::MessageSharedPointer message) {
+ return;
+}
+
+#ifdef TELEMETRY_MONITOR
+void RPCHandlerImpl::SetTelemetryObserver(AMTelemetryObserver* observer) {
+ metric_observer_ = observer;
+}
+
+#endif // TELEMETRY_MONITOR
+
+void RPCHandlerImpl::GetMessageVersion(
+ ns_smart_device_link::ns_smart_objects::SmartObject& output,
+ utils::SemanticVersion& message_version) {
+ if (output.keyExists(
+ ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS) &&
+ output[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS]
+ .keyExists(strings::sync_msg_version)) {
+ // SyncMsgVersion exists, check if it is valid.
+ auto sync_msg_version =
+ output[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS]
+ [strings::sync_msg_version];
+ uint16_t major = 0;
+ uint16_t minor = 0;
+ uint16_t patch = 0;
+ if (sync_msg_version.keyExists(strings::major_version)) {
+ major = sync_msg_version[strings::major_version].asUInt();
+ }
+ if (sync_msg_version.keyExists(strings::minor_version)) {
+ minor = sync_msg_version[strings::minor_version].asUInt();
+ }
+ if (sync_msg_version.keyExists(strings::patch_version)) {
+ patch = sync_msg_version[strings::patch_version].asUInt();
+ }
+ utils::SemanticVersion temp_version(major, minor, patch);
+ if (temp_version.isValid()) {
+ message_version = (temp_version >= utils::rpc_version_5)
+ ? temp_version
+ : utils::base_rpc_version;
+ }
+ }
+}
+
+bool RPCHandlerImpl::ConvertMessageToSO(
+ const Message& message,
+ ns_smart_device_link::ns_smart_objects::SmartObject& output) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "\t\t\tMessage to convert: protocol "
+ << message.protocol_version() << "; json "
+ << message.json_message());
+
+ switch (message.protocol_version()) {
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2: {
+ const bool conversion_result =
+ formatters::CFormatterJsonSDLRPCv2::fromString(
+ message.json_message(),
+ output,
+ message.function_id(),
+ message.type(),
+ message.correlation_id());
+
+ rpc::ValidationReport report("RPC");
+
+ // Attach RPC version to SmartObject if it does not exist yet.
+ auto app_ptr = app_manager_.application(message.connection_key());
+ utils::SemanticVersion msg_version(0, 0, 0);
+ if (app_ptr) {
+ msg_version = app_ptr->msg_version();
+ } else if (mobile_apis::FunctionID::RegisterAppInterfaceID ==
+ static_cast<mobile_apis::FunctionID::eType>(
+ output[strings::params][strings::function_id].asInt())) {
+ GetMessageVersion(output, msg_version);
+ }
+
+ if (!conversion_result ||
+ !mobile_so_factory().attachSchema(output, true, msg_version) ||
+ ((output.validate(&report, msg_version) !=
+ smart_objects::errors::OK))) {
+ LOG4CXX_WARN(logger_,
+ "Failed to parse string to smart object with API version "
+ << msg_version.toString() << " : "
+ << message.json_message());
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ message.connection_key(),
+ message.function_id(),
+ message.correlation_id(),
+ mobile_apis::Result::INVALID_DATA));
+
+ (*response)[strings::msg_params][strings::info] =
+ rpc::PrettyFormat(report);
+ app_manager_.GetRPCService().ManageMobileCommand(
+ response, commands::Command::SOURCE_SDL);
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Convertion result for sdl object is true function_id "
+ << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+
+ output[strings::params][strings::connection_key] =
+ message.connection_key();
+ output[strings::params][strings::protocol_version] =
+ message.protocol_version();
+ if (message.binary_data()) {
+ if (message.payload_size() < message.data_size()) {
+ LOG4CXX_ERROR(logger_,
+ "Incomplete binary"
+ << " binary size should be " << message.data_size()
+ << " payload data size is "
+ << message.payload_size());
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ message.connection_key(),
+ message.function_id(),
+ message.correlation_id(),
+ mobile_apis::Result::INVALID_DATA));
+ app_manager_.GetRPCService().ManageMobileCommand(
+ response, commands::Command::SOURCE_SDL);
+ return false;
+ }
+ output[strings::params][strings::binary_data] =
+ *(message.binary_data());
+ }
+ break;
+ }
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI: {
+#ifdef ENABLE_LOG
+ int32_t result =
+#endif
+ formatters::FormatterJsonRpc::FromString<
+ hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(message.json_message(), output);
+ LOG4CXX_DEBUG(logger_,
+ "Convertion result: "
+ << result << " function id "
+ << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+ if (!hmi_so_factory().attachSchema(output, false)) {
+ LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
+ return false;
+ }
+
+ rpc::ValidationReport report("RPC");
+
+ if (output.validate(&report) != smart_objects::errors::OK) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect parameter from HMI"
+ << rpc::PrettyFormat(report));
+
+ output.erase(strings::msg_params);
+ output[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_DATA;
+ output[strings::msg_params][strings::info] = rpc::PrettyFormat(report);
+ return false;
+ }
+ break;
+ }
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1: {
+ static ns_smart_device_link_rpc::V1::v4_protocol_v1_2_no_extra v1_shema;
+
+ if (message.function_id() == 0 || message.type() == kUnknownType) {
+ LOG4CXX_ERROR(logger_, "Message received: UNSUPPORTED_VERSION");
+
+ int32_t conversation_result =
+ formatters::CFormatterJsonSDLRPCv1::fromString<
+ ns_smart_device_link_rpc::V1::FunctionID::eType,
+ ns_smart_device_link_rpc::V1::messageType::eType>(
+ message.json_message(), output);
+
+ if (formatters::CFormatterJsonSDLRPCv1::kSuccess ==
+ conversation_result) {
+ smart_objects::SmartObject params = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+
+ output[strings::params][strings::message_type] =
+ ns_smart_device_link_rpc::V1::messageType::response;
+ output[strings::params][strings::connection_key] =
+ message.connection_key();
+
+ output[strings::msg_params] = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+ output[strings::msg_params][strings::success] = false;
+ output[strings::msg_params][strings::result_code] =
+ ns_smart_device_link_rpc::V1::Result::UNSUPPORTED_VERSION;
+
+ smart_objects::SmartObjectSPtr msg_to_send =
+ std::make_shared<smart_objects::SmartObject>(output);
+ v1_shema.attachSchema(*msg_to_send, false);
+ app_manager_.GetRPCService().SendMessageToMobile(msg_to_send);
+ return false;
+ }
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_,
+ "Application used unsupported protocol :"
+ << message.protocol_version() << ".");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Successfully parsed message into smart object");
+ return true;
+}
+
+std::shared_ptr<Message> RPCHandlerImpl::ConvertRawMsgToMessage(
+ const protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(message);
+ std::shared_ptr<Message> outgoing_message;
+
+ LOG4CXX_DEBUG(logger_, "Service type." << message->service_type());
+ if (message->service_type() != protocol_handler::kRpc &&
+ message->service_type() != protocol_handler::kBulk) {
+ // skip this message, not under handling of ApplicationManager
+ LOG4CXX_TRACE(logger_, "Skipping message; not the under AM handling.");
+ return outgoing_message;
+ }
+
+ Message* convertion_result =
+ MobileMessageHandler::HandleIncomingMessageProtocol(message);
+
+ if (convertion_result) {
+ outgoing_message = std::shared_ptr<Message>(convertion_result);
+ } else {
+ LOG4CXX_ERROR(logger_, "Received invalid message");
+ }
+ return outgoing_message;
+}
+
+hmi_apis::HMI_API& RPCHandlerImpl::hmi_so_factory() {
+ return hmi_so_factory_;
+}
+
+mobile_apis::MOBILE_API& RPCHandlerImpl::mobile_so_factory() {
+ return mobile_so_factory_;
+}
+}
+}
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
new file mode 100644
index 0000000000..7a68ae5779
--- /dev/null
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -0,0 +1,629 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/rpc_service_impl.h"
+
+namespace application_manager {
+namespace rpc_service {
+
+CREATE_LOGGERPTR_LOCAL(logger_, "RPCServiceImpl")
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
+
+RPCServiceImpl::RPCServiceImpl(
+ ApplicationManager& app_manager,
+ request_controller::RequestController& request_ctrl,
+ protocol_handler::ProtocolHandler* protocol_handler,
+ hmi_message_handler::HMIMessageHandler* hmi_handler,
+ CommandHolder& commands_holder)
+ : app_manager_(app_manager)
+ , request_ctrl_(request_ctrl)
+ , protocol_handler_(protocol_handler)
+ , hmi_handler_(hmi_handler)
+ , commands_holder_(commands_holder)
+ , messages_to_mobile_("AM ToMobile", this)
+ , messages_to_hmi_("AM ToHMI", this)
+ , hmi_so_factory_(hmi_apis::HMI_API())
+ , mobile_so_factory_(mobile_apis::MOBILE_API()) {}
+
+RPCServiceImpl::~RPCServiceImpl() {}
+
+bool RPCServiceImpl::ManageMobileCommand(
+ const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ return false;
+ }
+
+ if (app_manager_.IsLowVoltage()) {
+ LOG4CXX_WARN(logger_, "Low Voltage is active");
+ return false;
+ }
+
+ MessageHelper::PrintSmartObject(*message);
+
+ const uint32_t connection_key = static_cast<uint32_t>(
+ (*message)[strings::params][strings::connection_key].asUInt());
+
+ auto app_ptr = app_manager_.application(connection_key);
+ if (app_ptr && app_manager_.IsAppInReconnectMode(app_ptr->policy_app_id())) {
+ commands_holder_.Suspend(
+ app_ptr, CommandHolder::CommandType::kMobileCommand, message);
+ return true;
+ }
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ // Notifications from HMI have no such parameter
+ uint32_t correlation_id =
+ (*message)[strings::params].keyExists(strings::correlation_id)
+ ? (*message)[strings::params][strings::correlation_id].asUInt()
+ : 0;
+
+ int32_t protocol_type =
+ (*message)[strings::params][strings::protocol_type].asInt();
+
+ ApplicationSharedPtr app;
+ if (((mobile_apis::FunctionID::RegisterAppInterfaceID != function_id) &&
+ (protocol_type == commands::CommandImpl::mobile_protocol_type_)) &&
+ (mobile_apis::FunctionID::UnregisterAppInterfaceID != function_id)) {
+ app = app_manager_.application(connection_key);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "RET APPLICATION_NOT_REGISTERED");
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ static_cast<int32_t>(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED));
+
+ SendMessageToMobile(response);
+ return false;
+ }
+
+ // Message for "CheckPermission" must be with attached schema
+ mobile_so_factory().attachSchema(*message, false);
+ }
+
+ 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, source);
+
+ if (!command) {
+ LOG4CXX_WARN(logger_, "Failed to create mobile command from smart object");
+ return false;
+ }
+
+ int32_t message_type =
+ (*message)[strings::params][strings::message_type].asInt();
+ if (message_type == mobile_apis::messageType::response) {
+ if (command->Init()) {
+ command->Run();
+ command->CleanUp();
+ }
+ return true;
+ }
+ if (message_type == mobile_apis::messageType::notification) {
+ request_ctrl_.addNotification(command);
+ if (command->Init()) {
+ command->Run();
+ if (command->CleanUp()) {
+ request_ctrl_.removeNotification(command.get());
+ }
+ // If CleanUp returned false notification should remove it self.
+ }
+ return true;
+ }
+
+ if (message_type == mobile_apis::messageType::request) {
+ // commands will be launched from requesr_ctrl
+ mobile_apis::HMILevel::eType app_hmi_level =
+ mobile_apis::HMILevel::INVALID_ENUM;
+ if (app) {
+ app_hmi_level = app->hmi_level();
+ }
+
+ // commands will be launched from request_ctrl
+
+ const request_controller::RequestController::TResult result =
+ request_ctrl_.addMobileRequest(command, app_hmi_level);
+
+ if (result == request_controller::RequestController::SUCCESS) {
+ LOG4CXX_DEBUG(logger_, "Perform request");
+ } else if (result == request_controller::RequestController::
+ TOO_MANY_PENDING_REQUESTS) {
+ LOG4CXX_ERROR(logger_,
+ "RET Unable top perform request: "
+ << "TOO_MANY_PENDING_REQUESTS");
+
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ static_cast<int32_t>(
+ mobile_apis::Result::TOO_MANY_PENDING_REQUESTS));
+ ApplicationSharedPtr app_ptr = app_manager_.application(connection_key);
+ if (app_ptr) {
+ app_ptr->usage_report().RecordRemovalsForBadBehavior();
+ }
+
+ SendMessageToMobile(response);
+ return false;
+ } else if (result ==
+ request_controller::RequestController::TOO_MANY_REQUESTS) {
+ LOG4CXX_ERROR(logger_,
+ "RET Unable to perform request: "
+ << "TOO_MANY_REQUESTS");
+
+ ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key,
+ mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS),
+ commands::Command::SOURCE_SDL);
+
+ app_manager_.UnregisterApplication(
+ connection_key,
+ mobile_apis::Result::TOO_MANY_PENDING_REQUESTS,
+ false);
+ ApplicationSharedPtr app_ptr = app_manager_.application(connection_key);
+ if (app_ptr) {
+ app_ptr->usage_report().RecordRemovalsForBadBehavior();
+ }
+ return false;
+ } else if (result == request_controller::RequestController::
+ NONE_HMI_LEVEL_MANY_REQUESTS) {
+ LOG4CXX_ERROR(logger_,
+ "RET Unable to perform request: "
+ << "REQUEST_WHILE_IN_NONE_HMI_LEVEL");
+
+ ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key,
+ mobile_api::AppInterfaceUnregisteredReason::
+ REQUEST_WHILE_IN_NONE_HMI_LEVEL),
+ commands::Command::SOURCE_SDL);
+
+ ApplicationSharedPtr app_ptr = app_manager_.application(connection_key);
+ if (app_ptr) {
+ app_ptr->usage_report().RecordRemovalsForBadBehavior();
+ }
+ app_manager_.UnregisterApplication(
+ connection_key, mobile_apis::Result::INVALID_ENUM, false);
+ return false;
+ } else {
+ LOG4CXX_ERROR(logger_, "RET Unable to perform request: Unknown case");
+ return false;
+ }
+ return true;
+ }
+
+ LOG4CXX_ERROR(logger_, "RET UNKNOWN MESSAGE TYPE " << message_type);
+ return false;
+}
+
+bool RPCServiceImpl::ManageHMICommand(
+ const commands::MessageSharedPtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ return false;
+ }
+
+ if (app_manager_.IsLowVoltage()) {
+ LOG4CXX_WARN(logger_, "Low Voltage is active");
+ return false;
+ }
+
+ 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);
+ 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);
+
+ if (!command) {
+ LOG4CXX_WARN(logger_, "Failed to create command from smart object");
+ return false;
+ }
+
+ if ((*message).keyExists(strings::msg_params) &&
+ (*message)[strings::msg_params].keyExists(strings::app_id)) {
+ const auto connection_key =
+ (*message)[strings::msg_params][strings::app_id].asUInt();
+
+ auto app = app_manager_.application(static_cast<uint32_t>(connection_key));
+ if (app && app_manager_.IsAppInReconnectMode(app->policy_app_id())) {
+ commands_holder_.Suspend(
+ app, CommandHolder::CommandType::kHmiCommand, message);
+ return true;
+ }
+ }
+
+ int32_t message_type =
+ (*(message.get()))[strings::params][strings::message_type].asInt();
+
+ if (kRequest == message_type) {
+ LOG4CXX_DEBUG(logger_, "ManageHMICommand");
+ request_ctrl_.addHMIRequest(command);
+ }
+
+ if (command->Init()) {
+ command->Run();
+ if (kResponse == message_type) {
+ const uint32_t correlation_id =
+ (*(message.get()))[strings::params][strings::correlation_id].asUInt();
+ const int32_t function_id =
+ (*(message.get()))[strings::params][strings::function_id].asInt();
+ request_ctrl_.OnHMIResponse(correlation_id, function_id);
+ }
+ return true;
+ }
+ return false;
+}
+
+void RPCServiceImpl::Handle(const impl::MessageToHmi message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!hmi_handler_) {
+ LOG4CXX_ERROR(logger_, "Observer is not set for HMIMessageHandler");
+ return;
+ }
+
+ hmi_handler_->SendMessageToHMI(message);
+ LOG4CXX_INFO(logger_, "Message for HMI given away");
+}
+
+void RPCServiceImpl::Handle(const impl::MessageToMobile message) {
+ if (!protocol_handler_) {
+ LOG4CXX_WARN(logger_,
+ "Protocol Handler is not set; cannot send message to mobile.");
+ return;
+ }
+
+ std::shared_ptr<protocol_handler::RawMessage> rawMessage(
+ MobileMessageHandler::HandleOutgoingMessageProtocol(message));
+
+ if (!rawMessage) {
+ LOG4CXX_ERROR(logger_, "Failed to create raw message.");
+ return;
+ }
+
+ bool is_final = message.is_final;
+ bool close_session = false;
+ if (is_final) {
+ if (1 < app_manager_.connection_handler().GetConnectionSessionsCount(
+ message->connection_key())) {
+ is_final = false;
+ close_session = true;
+ }
+ }
+
+ protocol_handler_->SendMessageToMobileApp(rawMessage, is_final);
+ LOG4CXX_INFO(logger_, "Message for mobile given away");
+
+ if (close_session) {
+ app_manager_.connection_handler().CloseSession(message->connection_key(),
+ connection_handler::kCommon);
+ }
+}
+
+void RPCServiceImpl::SendMessageToMobile(
+ const application_manager::commands::MessageSharedPtr message,
+ bool final_message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ if (!protocol_handler_) {
+ LOG4CXX_WARN(logger_, "No Protocol Handler set");
+ return;
+ }
+
+ ApplicationSharedPtr app = app_manager_.application(
+ (*message)[strings::params][strings::connection_key].asUInt());
+
+ const bool is_result_code_exists =
+ (*message)[strings::msg_params].keyExists(strings::result_code);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with connection key");
+ if (is_result_code_exists &&
+ ((*message)[strings::msg_params][strings::result_code] ==
+ ns_smart_device_link_rpc::V1::Result::UNSUPPORTED_VERSION)) {
+ (*message)[strings::params][strings::protocol_version] =
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1;
+ } else {
+ (*message)[strings::params][strings::protocol_version] =
+ app_manager_.SupportedSDLVersion();
+ }
+ } else {
+ (*message)[strings::params][strings::protocol_version] =
+ app->protocol_version();
+ }
+
+ if (app && is_result_code_exists &&
+ (*message)[strings::msg_params][strings::result_code] ==
+ mobile_apis::Result::OUT_OF_MEMORY) {
+ app->usage_report().RecordRejectionsSyncOutOfMemory();
+ }
+
+ mobile_so_factory().attachSchema(*message, false);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Attached schema to message, result if valid: " << message->isValid());
+
+ // Messages to mobile are not yet prioritized so use default priority value
+ std::shared_ptr<Message> message_to_send(
+ new Message(protocol_handler::MessagePriority::kDefault));
+ if (!ConvertSOtoMessage((*message), (*message_to_send))) {
+ LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
+ return;
+ }
+
+ smart_objects::SmartObject& msg_to_mobile = *message;
+ // If correlation_id is not present, it is from-HMI message which should be
+ // checked against policy permissions
+ if (msg_to_mobile[strings::params].keyExists(strings::correlation_id)) {
+ request_ctrl_.OnMobileResponse(
+ msg_to_mobile[strings::params][strings::correlation_id].asUInt(),
+ msg_to_mobile[strings::params][strings::connection_key].asUInt(),
+ msg_to_mobile[strings::params][strings::function_id].asInt());
+ } else if (app) {
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asUInt());
+ RPCParams params;
+
+ const smart_objects::SmartObject& s_map = (*message)[strings::msg_params];
+ if (smart_objects::SmartType_Map == s_map.getType()) {
+ smart_objects::SmartMap::iterator iter = s_map.map_begin();
+ smart_objects::SmartMap::iterator iter_end = s_map.map_end();
+
+ for (; iter != iter_end; ++iter) {
+ if (true == iter->second.asBool()) {
+ LOG4CXX_INFO(logger_, "Request's param: " << iter->first);
+ params.insert(iter->first);
+ }
+ }
+ }
+ const std::string string_functionID =
+ MessageHelper::StringifiedFunctionID(function_id);
+ const mobile_apis::Result::eType check_result =
+ app_manager_.CheckPolicyPermissions(app, string_functionID, params);
+ if (mobile_apis::Result::SUCCESS != check_result) {
+ LOG4CXX_WARN(logger_,
+ "Function \"" << string_functionID << "\" (#" << function_id
+ << ") not allowed by policy");
+ return;
+ }
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ if (function_id == mobile_apis::FunctionID::OnSystemRequestID) {
+ mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message)[strings::msg_params][strings::request_type].asUInt());
+ if (mobile_apis::RequestType::PROPRIETARY == request_type ||
+ mobile_apis::RequestType::HTTP == request_type) {
+ app_manager_.GetPolicyHandler().OnUpdateRequestSentToMobile();
+ }
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
+ }
+
+ if (message_to_send->binary_data()) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Binary data size: " << message_to_send->binary_data()->size());
+ }
+ messages_to_mobile_.PostMessage(
+ impl::MessageToMobile(message_to_send, final_message));
+}
+
+void RPCServiceImpl::SendMessageToHMI(
+ const commands::MessageSharedPtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ if (!hmi_handler_) {
+ LOG4CXX_WARN(logger_, "No HMI Handler set");
+ return;
+ }
+
+ // SmartObject |message| has no way to declare priority for now
+ std::shared_ptr<Message> message_to_send(
+ new Message(protocol_handler::MessagePriority::kDefault));
+ if (!message_to_send) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ hmi_so_factory().attachSchema(*message, false);
+ LOG4CXX_INFO(
+ logger_,
+ "Attached schema to message, result if valid: " << message->isValid());
+
+ if (!ConvertSOtoMessage(*message, *message_to_send)) {
+ LOG4CXX_WARN(logger_,
+ "Cannot send message to HMI: failed to create string");
+ return;
+ }
+
+ messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send));
+}
+
+void RPCServiceImpl::set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) {
+ protocol_handler_ = handler;
+}
+
+void RPCServiceImpl::set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) {
+ hmi_handler_ = handler;
+}
+
+bool RPCServiceImpl::ConvertSOtoMessage(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& message,
+ Message& output) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (smart_objects::SmartType_Null == message.getType() ||
+ smart_objects::SmartType_Invalid == message.getType()) {
+ LOG4CXX_WARN(logger_, "Invalid smart object received.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Message with protocol: " << message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_PROTOCOL_TYPE)
+ .asInt());
+
+ std::string output_string;
+ const int64_t protocol_type = message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_PROTOCOL_TYPE)
+ .asInt();
+ const int64_t protocol_version = message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_PROTOCOL_VERSION)
+ .asInt();
+ switch (protocol_type) {
+ case 0: {
+ if (protocol_version == 1) {
+ if (!formatters::CFormatterJsonSDLRPCv1::toString(message,
+ output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
+ } else {
+ if (!formatters::CFormatterJsonSDLRPCv2::toString(message,
+ output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(
+ static_cast<protocol_handler::MajorProtocolVersion>(
+ protocol_version));
+ }
+
+ break;
+ }
+ case 1: {
+ if (!formatters::FormatterJsonRpc::ToString(message, output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
+ break;
+ }
+ default:
+ NOTREACHED();
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Convertion result: " << output_string);
+
+ output.set_connection_key(message.getElement(jhs::S_PARAMS)
+ .getElement(strings::connection_key)
+ .asInt());
+
+ output.set_function_id(
+ message.getElement(jhs::S_PARAMS).getElement(jhs::S_FUNCTION_ID).asInt());
+
+ output.set_correlation_id(message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_CORRELATION_ID)
+ .asInt());
+ output.set_message_type(
+ static_cast<MessageType>(message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_MESSAGE_TYPE)
+ .asInt()));
+
+ // Currently formatter creates JSON = 3 bytes for empty SmartObject.
+ // workaround for notification. JSON must be empty
+ if (mobile_apis::FunctionID::OnAudioPassThruID !=
+ message.getElement(jhs::S_PARAMS)
+ .getElement(strings::function_id)
+ .asInt()) {
+ output.set_json_message(output_string);
+ }
+
+ if (message.getElement(jhs::S_PARAMS).keyExists(strings::binary_data)) {
+ const application_manager::BinaryData binaryData(
+ message.getElement(jhs::S_PARAMS)
+ .getElement(strings::binary_data)
+ .asBinary());
+
+ output.set_binary_data(&binaryData);
+ }
+
+ LOG4CXX_DEBUG(logger_, "Successfully parsed smart object into message");
+ return true;
+}
+
+hmi_apis::HMI_API& RPCServiceImpl::hmi_so_factory() {
+ return hmi_so_factory_;
+}
+
+mobile_apis::MOBILE_API& RPCServiceImpl::mobile_so_factory() {
+ return mobile_so_factory_;
+}
+
+} // namespace rpc_service
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 0bf3287e42..ff9ebb6208 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -18,6 +18,7 @@ const char* msg_params = "msg_params";
const char* method_name = "methodName";
const char* info = "info";
const char* app_id = "appID";
+const char* full_app_id = "fullAppID";
const char* bundle_id = "appBundleID";
const char* app_info = "appInfo";
const char* app_launch = "app_launch";
@@ -124,10 +125,12 @@ const char* hours = "hours";
const char* minutes = "minutes";
const char* seconds = "seconds";
const char* update_mode = "updateMode";
+const char* audioStreamingIndicator = "audioStreamingIndicator";
const char* trigger_source = "triggerSource";
const char* hmi_level = "hmiLevel";
const char* activate_app_hmi_level = "level";
const char* audio_streaming_state = "audioStreamingState";
+const char* video_streaming_state = "videoStreamingState";
const char* system_context = "systemContext";
const char* speech_capabilities = "speechCapabilities";
const char* vr_capabilities = "vrCapabilities";
@@ -142,17 +145,30 @@ const char* navigation_capability = "navigationCapability";
const char* phone_capability = "phoneCapability";
const char* video_streaming_capability = "videoStreamingCapability";
const char* rc_capability = "remoteControlCapability";
+const char* day_color_scheme = "dayColorScheme";
+const char* night_color_scheme = "nightColorScheme";
+const char* primary_color = "primaryColor";
+const char* secondary_color = "secondaryColor";
+const char* background_color = "backgroundColor";
+const char* red = "red";
+const char* green = "green";
+const char* blue = "blue";
+const char* display_layout = "displayLayout";
+const char* icon_resumed = "iconResumed";
// PutFile
const char* sync_file_name = "syncFileName";
const char* file_name = "fileName";
const char* file_type = "fileType";
const char* file_size = "fileSize";
+const char* crc32_check_sum = "crc";
const char* request_type = "requestType";
+const char* request_subtype = "requestSubType";
const char* persistent_file = "persistentFile";
const char* file_data = "fileData";
const char* space_available = "spaceAvailable";
const char* image_type = "imageType";
+const char* is_template = "isTemplate";
const char* image = "image";
const char* type = "type";
const char* system_file = "systemFile";
@@ -168,6 +184,7 @@ const char* did_location = "didLocation";
const char* app_list = "appList";
const char* device_list = "deviceList";
const char* device_info = "deviceInfo";
+const char* secondary_device_info = "secondaryDeviceInfo";
const char* name = "name";
const char* id = "id";
const char* isSDLAllowed = "isSDLAllowed";
@@ -202,12 +219,15 @@ const char* rpm = "rpm";
const char* fuel_level = "fuelLevel";
const char* fuel_level_state = "fuelLevel_State";
const char* instant_fuel_consumption = "instantFuelConsumption";
+const char* fuel_range = "fuelRange";
const char* external_temp = "externalTemperature";
+const char* turn_signal = "turnSignal";
const char* vin = "vin";
const char* prndl = "prndl";
const char* tire_pressure = "tirePressure";
const char* odometer = "odometer";
const char* belt_status = "beltStatus";
+const char* electronic_park_brake_status = "electronicParkBrakeStatus";
const char* body_information = "bodyInformation";
const char* device_status = "deviceStatus";
const char* driver_braking = "driverBraking";
@@ -238,6 +258,7 @@ const char* remote_control = "remoteControl";
const char* sdl_version = "sdlVersion";
const char* system_software_version = "systemSoftwareVersion";
const char* priority = "priority";
+const char* engine_oil_life = "engineOilLife";
// resuming
const char* application_commands = "applicationCommands";
@@ -246,7 +267,7 @@ const char* application_choice_sets = "applicationChoiceSets";
const char* application_global_properties = "globalProperties";
const char* application_vehicle_info = "vehicleInfo";
const char* application_buttons = "buttons";
-const char* application_subscribtions = "subscribtions";
+const char* application_subscriptions = "subscriptions";
const char* application_files = "applicationFiles";
const char* application_show = "applicationShow";
const char* resumption = "resumption";
@@ -256,6 +277,7 @@ const char* last_ign_off_time = "last_ign_off_time";
const char* resume_vr_grammars = "resumeVrGrammars";
const char* ign_off_count = "ign_off_count";
+const char* global_ign_on_counter = "global_ign_on_counter";
const char* suspend_count = "suspend_count";
const char* connection_info = "connection_info";
@@ -351,7 +373,7 @@ const char* instance_follow_redirect = "InstanceFollowRedirect";
const char* charset = "charset";
const char* content_lenght = "Content_Lenght";
const char* GET = "GET";
-} // http_request
+} // namespace http_request
namespace mobile_notification {
const char* state = "state";
@@ -364,7 +386,17 @@ const char* kFull = "FULL";
const char* kLimited = "LIMITED";
const char* kBackground = "BACKGROUND";
const char* kNone = "NONE";
-}
+} // namespace hmi_levels
+
+namespace time_keys {
+const char* millisecond = "millisecond";
+const char* second = "second";
+const char* minute = "minute";
+const char* hour = "hour";
+const char* day = "day";
+const char* month = "month";
+const char* year = "year";
+} // namespace time_keys
namespace hmi_request {
const char* parent_id = "parentID";
@@ -426,6 +458,7 @@ const char* dtc = "dtc";
const char* ecu_header = "ecuHeader";
const char* image_capabilities = "imageCapabilities";
const char* display_type = "displayType";
+const char* display_name = "displayName";
const char* text_fields = "textFields";
const char* media_clock_formats = "mediaClockFormats";
const char* graphic_supported = "graphicSupported";
@@ -436,7 +469,7 @@ const char* num_custom_presets_available = "numCustomPresetsAvailable";
const char* urls = "urls";
const char* policy_app_id = "policyAppID";
const char* enabled = "enabled";
-
+const char* system_time = "systemTime";
} // namespace hmi_response
namespace hmi_notification {
@@ -451,7 +484,6 @@ const char* policyfile = "policyfile";
const char* is_active = "isActive";
const char* is_deactivated = "isDeactivated";
const char* event_name = "eventName";
-
} // namespace hmi_notification
} // namespace application_manager
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 84081a3830..3d44709657 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -31,24 +31,29 @@
*/
#include "application_manager/state_controller_impl.h"
+#include <tuple>
#include "application_manager/usage_statistics.h"
+#include "application_manager/rpc_service.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
+
#include "connection_handler/connection_handler.h"
namespace application_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "StateControllerImpl")
-bool IsStatusChanged(HmiStatePtr old_state, HmiStatePtr new_state) {
- if (old_state->hmi_level() != new_state->hmi_level() ||
- old_state->audio_streaming_state() !=
- new_state->audio_streaming_state() ||
- old_state->system_context() != new_state->system_context()) {
- return true;
- }
- return false;
+namespace {
+bool IsStateChanged(const HmiState& old_state, const HmiState& new_state) {
+ return std::make_tuple(old_state.hmi_level(),
+ old_state.audio_streaming_state(),
+ old_state.video_streaming_state(),
+ old_state.system_context()) !=
+ std::make_tuple(new_state.hmi_level(),
+ new_state.audio_streaming_state(),
+ new_state.video_streaming_state(),
+ new_state.system_context());
}
+} // unnamed namespace
StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
: EventObserver(app_mngr.event_dispatcher()), app_mngr_(app_mngr) {
@@ -64,20 +69,20 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state,
const bool send_activate_app) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
- DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
+ DCHECK_OR_RETURN_VOID(HmiState::STATE_ID_REGULAR == state->state_id());
+
+ LOG4CXX_DEBUG(logger_, "Set regular state " << *state);
if (state->hmi_level() == mobile_apis::HMILevel::INVALID_ENUM ||
state->audio_streaming_state() ==
mobile_apis::AudioStreamingState::INVALID_ENUM ||
+ state->video_streaming_state() ==
+ mobile_apis::VideoStreamingState::INVALID_ENUM ||
state->system_context() == mobile_apis::SystemContext::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "Get invalid state");
+ LOG4CXX_ERROR(logger_, "Got invalid state");
return;
}
@@ -91,7 +96,8 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
app->SetPostponedState(state);
return;
}
- hmi_apis::Common_HMILevel::eType hmi_level =
+ LOG4CXX_DEBUG(logger_, "Resolved state: " << *resolved_state);
+ const hmi_apis::Common_HMILevel::eType hmi_level =
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
@@ -100,7 +106,7 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
if (-1 != corr_id) {
subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
corr_id);
- waiting_for_activate[app->app_id()] = resolved_state;
+ waiting_for_activate_[app->app_id()] = resolved_state;
return;
}
LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateApp");
@@ -113,13 +119,10 @@ void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool send_activate_app) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
@@ -127,6 +130,7 @@ void StateControllerImpl::SetRegularState(
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
+ hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_regular->system_context());
SetRegularState(app, hmi_state, send_activate_app);
}
@@ -136,19 +140,15 @@ void StateControllerImpl::SetRegularState(
const mobile_apis::HMILevel::eType hmi_level,
const bool send_activate_app) {
using namespace mobile_apis;
- using namespace helpers;
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
const HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
+ hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level));
hmi_state->set_system_context(SystemContext::SYSCTXT_MAIN);
SetRegularState(app, hmi_state, send_activate_app);
}
@@ -157,37 +157,32 @@ void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool send_activate_app) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
+ hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(system_context);
SetRegularState(app, hmi_state, send_activate_app);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_state = app->RegularHmiState();
HmiStatePtr hmi_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
+ hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level));
hmi_state->set_system_context(prev_state
? prev_state->system_context()
: mobile_apis::SystemContext::SYSCTXT_MAIN);
@@ -197,12 +192,8 @@ void StateControllerImpl::SetRegularState(
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::SystemContext::eType system_context) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
@@ -211,19 +202,18 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_hmi_level(prev_regular->hmi_level());
hmi_state->set_audio_streaming_state(
CalcAudioState(app, prev_regular->hmi_level()));
+ hmi_state->set_video_streaming_state(
+ CalcVideoState(app, prev_regular->hmi_level()));
hmi_state->set_system_context(system_context);
SetRegularState(app, hmi_state, false);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_state = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr hmi_state =
@@ -231,18 +221,15 @@ void StateControllerImpl::SetRegularState(
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(prev_state->hmi_level());
hmi_state->set_audio_streaming_state(audio_state);
+ hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_state->system_context());
SetRegularState(app, hmi_state, false);
}
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
if (mobile_apis::HMILevel::HMI_FULL == state->hmi_level()) {
SetRegularState(app, state, true);
@@ -251,84 +238,178 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
}
}
-void StateControllerImpl::HmiLevelConflictResolver::operator()(
- ApplicationSharedPtr to_resolve) {
- using namespace mobile_apis;
+namespace {
+
+/**
+ * @brief IsStreamableHMILevel checks whether the HMI level
+ * supports audio/video streaming.
+ * @param val HMI level
+ * @return true if streamable, false otherwise
+ */
+bool IsStreamableHMILevel(mobile_apis::HMILevel::eType val) {
using namespace helpers;
+ return Compare<mobile_apis::HMILevel::eType, EQ, ONE>(
+ val, mobile_apis::HMILevel::HMI_FULL, mobile_apis::HMILevel::HMI_LIMITED);
+}
+
+/**
+ * @brief IsSameAudioAppType checks whether the both applications:
+ * 1) belongs to exact HMI type that may stream audio without
+ * 'isMediaApplication' parameter set to true ('NAVIGATION', 'COMMUNICATION')
+ * 2) belongs to other HMI types with parameter 'isMediaApplication'
+ * is set to true.
+ * 3) are not media.
+ * @param app1 1st application
+ * @param app2 2nd application
+ * @return true if audio applications have same application HMI type
+ */
+bool IsSameAudioAppType(const Application& app1, const Application& app2) {
+ const auto is_only_media_app_type = [](const Application& app) {
+ return app.is_media_application() && !app.is_navi() &&
+ !app.is_voice_communication_supported();
+ };
+
+ const bool both_navi = app1.is_navi() && app2.is_navi();
+ const bool both_vc = app1.is_voice_communication_supported() &&
+ app2.is_voice_communication_supported();
+ const bool both_media =
+ is_only_media_app_type(app1) && is_only_media_app_type(app2);
+ const bool both_other =
+ !app1.IsAudioApplication() && !app2.IsAudioApplication();
+ const bool same_app_audio_type =
+ both_navi || both_vc || both_media || both_other;
+
+ return same_app_audio_type;
+}
+} // unnamed namespace
+
+void StateControllerImpl::HmiLevelConflictResolver::operator()(
+ ApplicationSharedPtr app_to_resolve) {
+ DCHECK_OR_RETURN_VOID(app_to_resolve);
DCHECK_OR_RETURN_VOID(state_ctrl_);
- if (to_resolve == applied_)
+ DCHECK_OR_RETURN_VOID(applied_);
+ DCHECK_OR_RETURN_VOID(state_);
+
+ if (applied_ == app_to_resolve) {
+ // Same app. Nothing to resolve
+ return;
+ }
+
+ const HmiStatePtr state_to_resolve = app_to_resolve->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(state_to_resolve);
+
+ // If applied HMI state is FULL:
+ // - all NOT audio/video applications becomes BACKGROUND
+ // - all audio/video applications with other app type
+ // (navi, vc, media, projection) in FULL becomes LIMMITED
+ // - all audio/video applications with same app type becomes BACKGROUND
+ //
+ // If applied HMI state is LIMITED:
+ // - all NOT audio/video applications saves their's HMI states
+ // - all applications with other app types saves their's HMI states
+ // - all audio/video applications with same app type becomes BACKGROUND
+
+ if (!IsStreamableHMILevel(state_->hmi_level())) {
+ LOG4CXX_DEBUG(logger_,
+ "Applied for app " << applied_->app_id() << " HMI level "
+ << state_->hmi_level()
+ << " is NOT streamable. Exit.");
return;
- HmiStatePtr cur_state = to_resolve->RegularHmiState();
-
- const bool applied_grabs_audio =
- Compare<HMILevel::eType, EQ, ONE>(
- state_->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED) &&
- applied_->IsAudioApplication();
- const bool applied_grabs_full = state_->hmi_level() == HMILevel::HMI_FULL;
- const bool to_resolve_handles_full =
- cur_state->hmi_level() == HMILevel::HMI_FULL;
- const bool to_resolve_handles_audio =
- Compare<HMILevel::eType, EQ, ONE>(
- cur_state->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED) &&
- to_resolve->IsAudioApplication();
- const bool same_app_type = state_ctrl_->IsSameAppType(applied_, to_resolve);
-
- // If applied Hmi state is FULL:
- // all not audio applications will get BACKGROUND
- // all applications with same HMI type will get BACKGROUND
- // all audio applications with other HMI type(navi, vc, media) in FULL will
- // get LIMMITED HMI level
-
- // If applied Hmi state is LIMITED:
- // all applications with other HMI types will save HMI states
- // all not audio applications will save HMI states
- // all applications with same HMI type will get BACKGROUND
-
- // If applied Hmi state is BACKGROUND:
- // all applications will save HMI states
-
- HMILevel::eType result_hmi_level = cur_state->hmi_level();
- if (applied_grabs_full && to_resolve_handles_audio && !same_app_type)
- result_hmi_level = HMILevel::HMI_LIMITED;
-
- if ((applied_grabs_full && to_resolve_handles_full &&
- !to_resolve->IsAudioApplication()) ||
- (applied_grabs_audio && to_resolve_handles_audio && same_app_type))
- result_hmi_level = HMILevel::HMI_BACKGROUND;
-
- if (cur_state->hmi_level() != result_hmi_level) {
+ }
+
+ if (!IsStreamableHMILevel(state_to_resolve->hmi_level())) {
LOG4CXX_DEBUG(logger_,
- "Application " << to_resolve->app_id()
- << " will change HMI level to "
- << result_hmi_level);
- state_ctrl_->SetupRegularHmiState(to_resolve,
+ "To resolve app " << app_to_resolve->app_id() << " HMI level "
+ << state_to_resolve->hmi_level()
+ << " is NOT streamable. Exit.");
+ return;
+ }
+
+ // Applied app constants
+ const auto applied_hmi_level = state_->hmi_level();
+
+ const bool applied_grabs_video =
+ IsStreamableHMILevel(applied_hmi_level) && applied_->IsVideoApplication();
+
+ // App to resolve constants
+ const auto to_resolve_hmi_level = state_to_resolve->hmi_level();
+
+ const bool to_resolve_grabs_audio =
+ IsStreamableHMILevel(to_resolve_hmi_level) &&
+ app_to_resolve->IsAudioApplication();
+
+ const bool to_resolve_grabs_video =
+ IsStreamableHMILevel(to_resolve_hmi_level) &&
+ app_to_resolve->IsVideoApplication();
+
+ // Compatibility constants
+ const bool same_app_audio_type =
+ IsSameAudioAppType(*applied_, *app_to_resolve);
+
+ // Result variables
+ mobile_apis::VideoStreamingState::eType result_video_state =
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ mobile_apis::AudioStreamingState::eType result_audio_state =
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+
+ if (to_resolve_grabs_audio && !same_app_audio_type) {
+ result_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
+ }
+
+ if (to_resolve_grabs_video && !applied_grabs_video) {
+ result_video_state = mobile_apis::VideoStreamingState::STREAMABLE;
+ }
+
+ mobile_apis::HMILevel::eType result_hmi_level = state_to_resolve->hmi_level();
+
+ using namespace helpers;
+ if (mobile_apis::VideoStreamingState::STREAMABLE == result_video_state ||
+ Compare<mobile_apis::AudioStreamingState::eType, EQ, ONE>(
+ result_audio_state,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::AudioStreamingState::ATTENUATED)) {
+ result_hmi_level = mobile_apis::HMILevel::HMI_LIMITED;
+ } else {
+ result_hmi_level = mobile_apis::HMILevel::HMI_BACKGROUND;
+ }
+
+ if (std::make_tuple(to_resolve_hmi_level,
+ state_to_resolve->audio_streaming_state(),
+ state_to_resolve->video_streaming_state()) !=
+ std::make_tuple(
+ result_hmi_level, result_audio_state, result_video_state)) {
+ LOG4CXX_DEBUG(logger_,
+ "Application "
+ << app_to_resolve->app_id() << " will change state to: "
+ << "HMI level " << to_resolve_hmi_level << " --> "
+ << result_hmi_level << ", audio "
+ << state_to_resolve->audio_streaming_state() << " --> "
+ << result_audio_state << ", video "
+ << state_to_resolve->video_streaming_state() << " --> "
+ << result_video_state);
+ state_ctrl_->SetupRegularHmiState(app_to_resolve,
result_hmi_level,
- result_hmi_level == HMILevel::HMI_LIMITED
- ? AudioStreamingState::AUDIBLE
- : AudioStreamingState::NOT_AUDIBLE);
+ result_audio_state,
+ result_video_state);
} else {
LOG4CXX_DEBUG(logger_,
- "Application " << to_resolve->app_id()
- << " will not change HMI level");
+ "Application " << app_to_resolve->app_id()
+ << " will NOT change HMI level");
}
}
HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
HmiStatePtr state) const {
using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "State to resolve: hmi_level "
- << state->hmi_level() << ", audio_state "
- << state->audio_streaming_state() << ", system_context "
- << state->system_context());
+ LOG4CXX_DEBUG(logger_, "State to resolve: " << *state);
HmiStatePtr available_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN(available_state, HmiStatePtr());
available_state->set_hmi_level(state->hmi_level());
available_state->set_audio_streaming_state(state->audio_streaming_state());
+ available_state->set_video_streaming_state(state->video_streaming_state());
available_state->set_system_context(state->system_context());
if (app->is_resuming()) {
@@ -337,6 +418,8 @@ HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
available_state->set_hmi_level(available_level);
available_state->set_audio_streaming_state(
CalcAudioState(app, available_level));
+ available_state->set_video_streaming_state(
+ CalcVideoState(app, available_level));
}
return IsStateAvailable(app, available_state) ? available_state
: HmiStatePtr();
@@ -345,11 +428,8 @@ HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
HmiStatePtr state) const {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
using namespace mobile_apis;
- if (!app->is_resuming() ||
- !Compare<HMILevel::eType, EQ, ONE>(
- state->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
+ if (!app->is_resuming() || !IsStreamableHMILevel(state->hmi_level())) {
LOG4CXX_DEBUG(logger_, "Application is not in resuming mode.");
return true;
}
@@ -375,27 +455,27 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
ApplicationSharedPtr app, mobile_apis::HMILevel::eType hmi_level) const {
- using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::HMILevel::eType result = hmi_level;
- if (!Compare<HMILevel::eType, EQ, ONE>(
- hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
+ LOG4CXX_DEBUG(logger_, "HMI Level: " << hmi_level);
+
+ if (!IsStreamableHMILevel(hmi_level)) {
return result;
}
const bool is_audio_app = app->IsAudioApplication();
const bool does_audio_app_with_same_type_exist =
app_mngr_.IsAppTypeExistsInFullOrLimited(app);
- if (HMILevel::HMI_LIMITED == hmi_level) {
+
+ if (mobile_apis::HMILevel::HMI_LIMITED == hmi_level) {
if (!is_audio_app || does_audio_app_with_same_type_exist) {
result = app_mngr_.GetDefaultHmiLevel(app);
}
return result;
}
- const bool is_active_app_exist = app_mngr_.active_application();
+ const bool is_active_app_exist = (bool)app_mngr_.active_application();
if (is_audio_app) {
if (does_audio_app_with_same_type_exist) {
result = app_mngr_.GetDefaultHmiLevel(app);
@@ -424,13 +504,8 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
bool StateControllerImpl::IsStateAvailable(ApplicationSharedPtr app,
HmiStatePtr state) const {
using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "Checking state: hmi_level "
- << state->hmi_level() << ", audio_state "
- << state->audio_streaming_state() << ", system_context "
- << state->system_context());
+ LOG4CXX_DEBUG(logger_, "Checking state: " << *state);
if (app->is_resuming()) {
return IsStateAvailableForResumption(app, state);
@@ -454,11 +529,8 @@ bool StateControllerImpl::IsStateAvailableForResumption(
ApplicationSharedPtr app, HmiStatePtr state) const {
LOG4CXX_AUTO_TRACE(logger_);
using namespace mobile_apis;
- using namespace helpers;
- if (!app->is_resuming() ||
- !Compare<HMILevel::eType, EQ, ONE>(
- state->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
+ if (!app->is_resuming() || !IsStreamableHMILevel(state->hmi_level())) {
LOG4CXX_DEBUG(logger_,
"Application is not in resuming mode."
<< " Requested state is available");
@@ -492,20 +564,17 @@ bool StateControllerImpl::IsStateAvailableForResumption(
void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app,
HmiStatePtr state) {
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
- LOG4CXX_DEBUG(logger_,
- "hmi_level " << state->hmi_level() << ", audio_state "
- << state->audio_streaming_state()
- << ", system_context " << state->system_context());
+ LOG4CXX_DEBUG(logger_, "Setup regular state: " << *state);
HmiStatePtr curr_state = app->CurrentHmiState();
HmiStatePtr old_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(old_state);
old_state->set_hmi_level(curr_state->hmi_level());
old_state->set_audio_streaming_state(curr_state->audio_streaming_state());
+ old_state->set_video_streaming_state(curr_state->video_streaming_state());
old_state->set_system_context(curr_state->system_context());
app->SetRegularState(state);
@@ -524,10 +593,8 @@ void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app,
void StateControllerImpl::SetupRegularHmiState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const mobile_apis::AudioStreamingState::eType audio_state) {
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
- using helpers::Compare;
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_state = app->RegularHmiState();
@@ -537,6 +604,7 @@ void StateControllerImpl::SetupRegularHmiState(
DCHECK_OR_RETURN_VOID(new_state);
new_state->set_hmi_level(hmi_level);
new_state->set_audio_streaming_state(audio_state);
+ new_state->set_video_streaming_state(video_state);
new_state->set_system_context(prev_state->system_context());
SetupRegularHmiState(app, new_state);
}
@@ -547,28 +615,12 @@ void StateControllerImpl::ApplyRegularState(ApplicationSharedPtr app,
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
+ LOG4CXX_DEBUG(logger_,
+ "Applying to app " << app->app_id() << " state " << *state);
SetupRegularHmiState(app, state);
- ForEachApplication<HmiLevelConflictResolver>(
- HmiLevelConflictResolver(app, state, this));
-}
-
-bool StateControllerImpl::IsSameAppType(ApplicationConstSharedPtr app1,
- ApplicationConstSharedPtr app2) {
- const bool both_media =
- app1->is_media_application() && app2->is_media_application();
-
- const bool both_navi = app1->is_navi() && app2->is_navi();
-
- const bool both_vc = app1->is_voice_communication_supported() &&
- app2->is_voice_communication_supported();
-
- const bool both_simple =
- !app1->IsAudioApplication() && !app2->IsAudioApplication();
-
- const bool both_projection =
- app1->mobile_projection_enabled() && app2->mobile_projection_enabled();
-
- return both_simple || both_media || both_navi || both_vc || both_projection;
+ LOG4CXX_DEBUG(logger_,
+ "Resolving HMI level conflicts for app " << app->app_id());
+ ForEachApplication(HmiLevelConflictResolver(app, state, this));
}
void StateControllerImpl::on_event(const event_engine::Event& event) {
@@ -615,7 +667,7 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
const uint32_t id =
message[strings::msg_params][hmi_notification::event_name].asUInt();
// TODO(AOleynik): Add verification/conversion check here
- Common_EventTypes::eType state_id =
+ const Common_EventTypes::eType state_id =
static_cast<Common_EventTypes::eType>(id);
if (is_active) {
if (Common_EventTypes::AUDIO_SOURCE == state_id) {
@@ -660,6 +712,9 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
break;
}
}
+
+ LOG4CXX_WARN(logger_,
+ "Couldn't recognize state id (val='" << state_id << "')");
break;
}
default:
@@ -674,17 +729,9 @@ void StateControllerImpl::OnStateChanged(ApplicationSharedPtr app,
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(old_state);
DCHECK_OR_RETURN_VOID(new_state);
- LOG4CXX_DEBUG(logger_,
- "old: hmi_level " << old_state->hmi_level() << ", audio_state "
- << old_state->audio_streaming_state()
- << ", system_context "
- << old_state->system_context());
- LOG4CXX_DEBUG(logger_,
- "new: hmi_level " << new_state->hmi_level() << ", audio_state "
- << new_state->audio_streaming_state()
- << ", system_context "
- << new_state->system_context());
- if (IsStatusChanged(old_state, new_state)) {
+ LOG4CXX_DEBUG(logger_, "Old state: " << *old_state);
+ LOG4CXX_DEBUG(logger_, "New state: " << *new_state);
+ if (IsStateChanged(*old_state, *new_state)) {
app_mngr_.SendHMIStatusNotification(app);
if (new_state->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
app->ResetDataInNone();
@@ -693,15 +740,13 @@ void StateControllerImpl::OnStateChanged(ApplicationSharedPtr app,
app->app_id(), old_state->hmi_level(), new_state->hmi_level());
app->usage_report().RecordHmiStateChanged(new_state->hmi_level());
} else {
- LOG4CXX_ERROR(logger_, "Status not changed");
+ LOG4CXX_ERROR(logger_, "State has NOT been changed.");
}
}
-bool StateControllerImpl::IsTempStateActive(HmiState::StateID ID) const {
+bool StateControllerImpl::IsTempStateActive(HmiState::StateID id) const {
sync_primitives::AutoLock autolock(active_states_lock_);
- StateIDList::const_iterator itr =
- std::find(active_states_.begin(), active_states_.end(), ID);
- return active_states_.end() != itr;
+ return helpers::in_range(active_states_, id);
}
void StateControllerImpl::OnApplicationRegistered(
@@ -713,23 +758,25 @@ void StateControllerImpl::OnApplicationRegistered(
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- active_states_lock_.Acquire();
- StateIDList::iterator it = active_states_.begin();
- for (; it != active_states_.end(); ++it) {
- HmiStatePtr new_state = CreateHmiState(app, *it);
- DCHECK_OR_RETURN_VOID(new_state);
- DCHECK_OR_RETURN_VOID(new_state->state_id() != HmiState::STATE_ID_REGULAR);
- HmiStatePtr old_hmi_state = app->CurrentHmiState();
- new_state->set_parent(old_hmi_state);
- app->AddHMIState(new_state);
+ {
+ sync_primitives::AutoLock lck(active_states_lock_);
+ for (const auto state_id : active_states_) {
+ HmiStatePtr new_state = CreateHmiState(app, state_id);
+ DCHECK_OR_RETURN_VOID(new_state);
+ DCHECK_OR_RETURN_VOID(new_state->state_id() !=
+ HmiState::STATE_ID_REGULAR);
+ HmiStatePtr old_hmi_state = app->CurrentHmiState();
+ new_state->set_parent(old_hmi_state);
+ app->AddHMIState(new_state);
+ }
}
- active_states_lock_.Release();
HmiStatePtr default_state =
CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(default_state);
default_state->set_hmi_level(default_level);
default_state->set_audio_streaming_state(CalcAudioState(app, default_level));
+ default_state->set_video_streaming_state(CalcVideoState(app, default_level));
default_state->set_system_context(SystemContext::SYSCTXT_MAIN);
HmiStatePtr initial_state = app->RegularHmiState();
@@ -758,7 +805,7 @@ int64_t StateControllerImpl::SendBCActivateApp(
LOG4CXX_ERROR(logger_, "Unable to create BC.ActivateAppRequest");
return -1;
}
- if (!app_mngr_.ManageHMICommand(bc_activate_app_request)) {
+ if (!app_mngr_.GetRPCService().ManageHMICommand(bc_activate_app_request)) {
LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateAppRequest");
return -1;
}
@@ -778,16 +825,18 @@ void StateControllerImpl::ApplyPostponedStateForApp(ApplicationSharedPtr app) {
}
}
-void StateControllerImpl::TempStateStarted(HmiState::StateID ID) {
+void StateControllerImpl::TempStateStarted(HmiState::StateID id) {
LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock autolock(active_states_lock_);
- StateIDList::iterator it =
- std::find(active_states_.begin(), active_states_.end(), ID);
- if (it == active_states_.end()) {
- active_states_.push_back(ID);
- } else {
- LOG4CXX_ERROR(logger_, "StateID " << ID << " is already active");
+
+ {
+ sync_primitives::AutoLock autolock(active_states_lock_);
+ if (!helpers::in_range(active_states_, id)) {
+ active_states_.push_back(id);
+ return;
+ }
}
+
+ LOG4CXX_ERROR(logger_, "StateID '" << id << "' is already active");
}
void StateControllerImpl::TempStateStopped(HmiState::StateID ID) {
@@ -805,16 +854,34 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr regular = app->RegularHmiState();
+ const HmiStatePtr regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(regular);
- HmiStatePtr new_regular = utils::MakeShared<HmiState>(*regular);
+ HmiStatePtr new_regular = std::make_shared<HmiState>(*regular);
+
+ LOG4CXX_DEBUG(logger_, "Current HMI level: '" << app->hmi_level() << "'");
+ const bool is_audio_app = app->IsAudioApplication();
+ const bool is_video_app = app->IsVideoApplication();
- if (app->IsAudioApplication()) {
+ if (is_audio_app || is_video_app) {
+ // audio or video app move to HMI level limited
new_regular->set_hmi_level(HMILevel::HMI_LIMITED);
- new_regular->set_audio_streaming_state(AudioStreamingState::AUDIBLE);
+
+ if (is_audio_app) {
+ new_regular->set_audio_streaming_state(AudioStreamingState::AUDIBLE);
+ } else {
+ new_regular->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ }
+
+ if (is_video_app) {
+ new_regular->set_video_streaming_state(VideoStreamingState::STREAMABLE);
+ } else {
+ new_regular->set_video_streaming_state(
+ VideoStreamingState::NOT_STREAMABLE);
+ }
} else {
new_regular->set_hmi_level(HMILevel::HMI_BACKGROUND);
new_regular->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ new_regular->set_video_streaming_state(VideoStreamingState::NOT_STREAMABLE);
}
SetRegularState(app, new_regular, false);
@@ -831,7 +898,7 @@ void StateControllerImpl::OnActivateAppResponse(
ApplicationSharedPtr application =
app_mngr_.application_by_hmi_app(hmi_app_id);
if (application && hmi_apis::Common_Result::SUCCESS == code) {
- HmiStatePtr pending_state = waiting_for_activate[application->app_id()];
+ HmiStatePtr pending_state = waiting_for_activate_[application->app_id()];
DCHECK_OR_RETURN_VOID(pending_state);
ApplyRegularState(application, pending_state);
}
@@ -854,9 +921,7 @@ void StateControllerImpl::OnAppActivated(
void StateControllerImpl::OnAppDeactivated(
const smart_objects::SmartObject& message) {
- using namespace hmi_apis;
using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = message[strings::msg_params][strings::app_id].asUInt();
@@ -875,12 +940,22 @@ void StateControllerImpl::OnAppDeactivated(
DeactivateApp(app);
}
-void StateControllerImpl::OnNaviStreamingStarted() {
- ApplyTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+void StateControllerImpl::OnVideoStreamingStarted(
+ ApplicationConstSharedPtr app) {
+ if (app->is_navi()) {
+ ApplyTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+ } else {
+ ApplyTempState<HmiState::STATE_ID_VIDEO_STREAMING>();
+ }
}
-void StateControllerImpl::OnNaviStreamingStopped() {
- CancelTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+void StateControllerImpl::OnVideoStreamingStopped(
+ ApplicationConstSharedPtr app) {
+ if (app->is_navi()) {
+ CancelTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+ } else {
+ CancelTempState<HmiState::STATE_ID_VIDEO_STREAMING>();
+ }
}
bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const {
@@ -896,49 +971,53 @@ bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const {
}
HmiStatePtr StateControllerImpl::CreateHmiState(
- utils::SharedPtr<Application> app, HmiState::StateID state_id) const {
+ std::shared_ptr<Application> app, HmiState::StateID state_id) const {
using namespace utils;
LOG4CXX_AUTO_TRACE(logger_);
HmiStatePtr new_state;
switch (state_id) {
case HmiState::STATE_ID_PHONE_CALL: {
- new_state = MakeShared<PhoneCallHmiState>(app, app_mngr_);
+ new_state = std::make_shared<PhoneCallHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_SAFETY_MODE: {
- new_state = MakeShared<SafetyModeHmiState>(app, app_mngr_);
+ new_state = std::make_shared<SafetyModeHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_VR_SESSION: {
- new_state = MakeShared<VRHmiState>(app, app_mngr_);
+ new_state = std::make_shared<VRHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_TTS_SESSION: {
- new_state = MakeShared<TTSHmiState>(app, app_mngr_);
+ new_state = std::make_shared<TTSHmiState>(app, app_mngr_);
+ break;
+ }
+ case HmiState::STATE_ID_VIDEO_STREAMING: {
+ new_state = std::make_shared<VideoStreamingHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_NAVI_STREAMING: {
- new_state = MakeShared<NaviStreamingHmiState>(app, app_mngr_);
+ new_state = std::make_shared<NaviStreamingHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_REGULAR: {
- new_state = MakeShared<HmiState>(app, app_mngr_);
+ new_state = std::make_shared<HmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_POSTPONED: {
- new_state = MakeShared<HmiState>(app, app_mngr_, state_id);
+ new_state = std::make_shared<HmiState>(app, app_mngr_, state_id);
break;
}
case HmiState::STATE_ID_DEACTIVATE_HMI: {
- new_state = MakeShared<DeactivateHMI>(app, app_mngr_);
+ new_state = std::make_shared<DeactivateHMI>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_AUDIO_SOURCE: {
- new_state = MakeShared<AudioSource>(app, app_mngr_);
+ new_state = std::make_shared<AudioSource>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_EMBEDDED_NAVI: {
- new_state = MakeShared<EmbeddedNavi>(app, app_mngr_);
+ new_state = std::make_shared<EmbeddedNavi>(app, app_mngr_);
break;
}
default:
@@ -952,20 +1031,31 @@ HmiStatePtr StateControllerImpl::CreateHmiState(
mobile_apis::AudioStreamingState::eType StateControllerImpl::CalcAudioState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level) const {
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
- using helpers::Compare;
- using helpers::EQ;
- using helpers::ONE;
-
- AudioStreamingState::eType audio_state = AudioStreamingState::NOT_AUDIBLE;
- if (Compare<HMILevel::eType, EQ, ONE>(
- hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
- if (app->IsAudioApplication()) {
- audio_state = AudioStreamingState::AUDIBLE;
- }
+ auto state = mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+ if (IsStreamableHMILevel(hmi_level) && app->IsAudioApplication()) {
+ state = mobile_apis::AudioStreamingState::AUDIBLE;
}
- return audio_state;
+
+ LOG4CXX_DEBUG(logger_,
+ "Calculated audio state of app "
+ << app->app_id() << " for " << hmi_level << " HMI level is "
+ << state);
+ return state;
+}
+
+mobile_apis::VideoStreamingState::eType StateControllerImpl::CalcVideoState(
+ ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level) const {
+ auto state = mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ if (IsStreamableHMILevel(hmi_level) && app->IsVideoApplication()) {
+ state = mobile_apis::VideoStreamingState::STREAMABLE;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Calculated video state of app "
+ << app->app_id() << " for " << hmi_level << " HMI level is "
+ << state);
+ return state;
}
} // namespace application_manager
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
new file mode 100644
index 0000000000..27f0972c01
--- /dev/null
+++ b/src/components/application_manager/src/system_time/system_time_handler_impl.cc
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/system_time/system_time_handler_impl.h"
+
+#include <algorithm>
+
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/HMI_API.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+SystemTimeHandlerImpl::SystemTimeHandlerImpl(
+ ApplicationManager& application_manager)
+ : event_engine::EventObserver(application_manager.event_dispatcher())
+ , utc_time_can_be_received_(false)
+ , awaiting_get_system_time_(false)
+ , last_time_(0)
+ , system_time_listener_(NULL)
+ , app_manager_(application_manager) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(
+ hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady);
+}
+
+SystemTimeHandlerImpl::~SystemTimeHandlerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ unsubscribe_from_all_events();
+}
+
+void SystemTimeHandlerImpl::DoSystemTimeQuery() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace application_manager;
+
+ sync_primitives::AutoLock lock(state_lock_);
+ if (!utc_time_can_be_received_) {
+ LOG4CXX_INFO(logger_,
+ "Navi module is not yet ready."
+ << "Will process request once it became ready.");
+ return;
+ }
+ SendTimeRequest();
+}
+
+void SystemTimeHandlerImpl::DoSubscribe(utils::SystemTimeListener* listener) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(listener);
+ sync_primitives::AutoLock lock(system_time_listener_lock_);
+ system_time_listener_ = listener;
+}
+
+void SystemTimeHandlerImpl::DoUnsubscribe(utils::SystemTimeListener* listener) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(system_time_listener_lock_);
+ system_time_listener_ = NULL;
+}
+
+time_t SystemTimeHandlerImpl::FetchSystemTime() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return last_time_;
+}
+
+bool SystemTimeHandlerImpl::utc_time_can_be_received() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(state_lock_);
+ return utc_time_can_be_received_;
+}
+
+void SystemTimeHandlerImpl::SendTimeRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (awaiting_get_system_time_) {
+ LOG4CXX_WARN(logger_, "Another GetSystemTime request in progress. Skipped");
+ return;
+ }
+
+ using namespace application_manager;
+ uint32_t correlation_id = app_manager_.GetNextHMICorrelationID();
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_GetSystemTime,
+ correlation_id);
+ MessageHelper::SendGetSystemTimeRequest(correlation_id, app_manager_);
+ awaiting_get_system_time_ = true;
+}
+
+void SystemTimeHandlerImpl::on_event(
+ const application_manager::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace application_manager;
+ using namespace hmi_apis::FunctionID;
+ switch (event.id()) {
+ case BasicCommunication_OnSystemTimeReady:
+ ProcessSystemTimeReadyNotification();
+ break;
+ case BasicCommunication_GetSystemTime:
+ ProcessSystemTimeResponse(event);
+ break;
+ default:
+ LOG4CXX_ERROR(logger_, "Unknown Event received");
+ break;
+ }
+}
+
+void SystemTimeHandlerImpl::ProcessSystemTimeReadyNotification() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(state_lock_);
+ utc_time_can_be_received_ = true;
+ unsubscribe_from_event(
+ hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady);
+}
+
+void SystemTimeHandlerImpl::ProcessSystemTimeResponse(
+ const application_manager::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ const smart_objects::SmartObject& system_time_so =
+ message[strings::msg_params][hmi_response::system_time];
+
+ struct tm system_time;
+ memset(&system_time, 0, sizeof(struct tm));
+
+ system_time.tm_sec = system_time_so[time_keys::second].asInt();
+ system_time.tm_min = system_time_so[time_keys::minute].asInt();
+ // According to tm specification of tm type hour should be decreased by 1
+ system_time.tm_hour = system_time_so[time_keys::hour].asInt() - 1;
+ system_time.tm_mday = system_time_so[time_keys::day].asInt();
+ // According to tm specification of tm type mon should be decreased by 1
+ system_time.tm_mon = system_time_so[time_keys::month].asInt() - 1;
+ // According to tm specification of tm type
+ // tm_year - number of years since 1900
+ system_time.tm_year = system_time_so[time_keys::year].asInt() - 1900;
+
+ // Normalize and convert time from 'tm' format to 'time_t'
+ last_time_ = mktime(&system_time);
+
+ sync_primitives::AutoLock lock(system_time_listener_lock_);
+ if (system_time_listener_) {
+ system_time_listener_->OnSystemTimeArrived(last_time_);
+ }
+ sync_primitives::AutoLock state_lock(state_lock_);
+ awaiting_get_system_time_ = false;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc
index 80755b6509..1cfccd816e 100644
--- a/src/components/application_manager/src/usage_statistics.cc
+++ b/src/components/application_manager/src/usage_statistics.cc
@@ -35,10 +35,9 @@
#include "smart_objects/enum_schema_item.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
using namespace mobile_apis;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
using namespace usage_statistics;
namespace application_manager {
@@ -56,7 +55,7 @@ std::string LanguageIdToString(Language::eType lang_id) {
UsageStatistics::UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<StatisticsManager> statistics_manager)
+ std::shared_ptr<StatisticsManager> statistics_manager)
: time_in_hmi_state_sptr_(
new usage_statistics::AppStopwatchImpl(statistics_manager, app_id))
, app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI)
@@ -78,7 +77,7 @@ UsageStatistics::UsageStatistics(
UsageStatistics::UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
AppStopwatch* time_in_hmi_state_ptr)
: time_in_hmi_state_sptr_(time_in_hmi_state_ptr)
, app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI)
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index 90059e4d98..02cf58485a 100644..100755
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -45,6 +45,7 @@ include_directories(
${COMPONENTS_DIR}/media_manager/include/
${COMPONENTS_DIR}/security_manager/include/
${COMPONENTS_DIR}/application_manager/test/include/
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include/
${BSON_INCLUDE_DIRECTORY}
)
@@ -70,13 +71,12 @@ set(testSources
set(testSourcesMockHmi
${AM_SOURCE_DIR}/src/message_helper/message_helper.cc
${AM_TEST_DIR}/application_manager_impl_mock_hmi_test.cc
- ${AM_TEST_DIR}/mock_hmi_command_factory.cc
)
-if(REMOTE_CONTROL)
- list(APPEND testSources ${AM_TEST_DIR}/rc_policy_handler_test.cc)
-endif(REMOTE_CONTROL)
-
+set(testSourcesHelpPromptManager
+ ${AM_TEST_DIR}/help_prompt_manager_test.cc
+ ${AM_TEST_DIR}/mock_message_helper.cc
+)
set (RequestController_SOURCES
${AM_TEST_DIR}/request_controller/request_controller_test.cc
${AM_TEST_DIR}/mock_message_helper.cc
@@ -85,6 +85,7 @@ set (RequestController_SOURCES
set(LIBRARIES
Utils
ApplicationManager
+ sdl_rpc_plugin
jsoncpp
Policy
connectionHandler
@@ -134,7 +135,8 @@ set(CMAKE_EXE_LINKER_FLAGS
)
create_test("application_manager_test" "${testSources}" "${LIBRARIES}")
create_test("application_manager_mock_hmi_test" "${testSourcesMockHmi}" "${LIBRARIES}")
-add_dependencies("application_manager_test" libbson)
+
+create_test("help_prompt_manager_test" "${testSourcesHelpPromptManager}" "${LIBRARIES}")
create_test("request_controller_test" "${RequestController_SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
index 1b90f29647..3293a8908d 100644
--- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
@@ -40,7 +40,7 @@
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "connection_handler/mock_connection_handler.h"
-#include "utils/make_shared.h"
+
#include "utils/test_async_waiter.h"
namespace test {
@@ -60,12 +60,12 @@ namespace ch_test = test::components::connection_handler_test;
namespace am_test = test::components::application_manager_test;
const uint32_t MAX_TEST_DURATION = 1000; // 1 second
-typedef utils::SharedPtr<am_test::MockApplication> MockAppPtr;
+typedef std::shared_ptr<am_test::MockApplication> MockAppPtr;
class AppLaunchCtrlTest : public ::testing::Test {
public:
MockAppPtr AppFromAppData(const app_launch::ApplicationData& app_data) {
- utils::SharedPtr<NiceMock<am_test::MockApplication> > app =
- utils::MakeShared<NiceMock<am_test::MockApplication> >();
+ std::shared_ptr<NiceMock<am_test::MockApplication> > app =
+ std::make_shared<NiceMock<am_test::MockApplication> >();
ON_CALL(*app, mac_address()).WillByDefault(ReturnRef(app_data.device_mac_));
ON_CALL(*app, bundle_id()).WillByDefault(ReturnRef(app_data.bundle_id_));
@@ -77,7 +77,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
app_launch::ApplicationDataPtr AppDataFromApp(
const am_test::MockApplication& app) {
app_launch::ApplicationDataPtr app_data =
- utils::MakeShared<NiceMock<app_launch::ApplicationData> >(
+ std::make_shared<NiceMock<app_launch::ApplicationData> >(
app.policy_app_id(), app.bundle_id(), app.mac_address());
return app_data;
}
@@ -137,7 +137,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
using app_launch::ApplicationData;
AppAndAppData app;
app.second =
- utils::MakeShared<ApplicationData>(app_id, bundle_id, device_mac);
+ std::make_shared<ApplicationData>(app_id, bundle_id, device_mac);
app.first = AppFromAppData(*app.second);
return app;
}
@@ -164,7 +164,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
NiceMock<ch_test::MockConnectionHandler> connection_handler_mock_;
NiceMock<resumprion_test::MockResumeCtrl> resume_ctrl_mock_;
NiceMock<app_launch_test::MockAppLaunchSettings> settings_;
- std::auto_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
};
app_launch::ApplicationData AppDataFromApp(
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
index e095f0682e..dc96fcf176 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
@@ -38,7 +38,7 @@
#include "utils/macro.h"
#include "sql_database.h"
#include "sql_query.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "application_manager/mock_app_launch_settings.h"
#include "application_manager/app_launch/app_launch_data_db.h"
@@ -113,7 +113,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
return test_db_;
}
- static std::auto_ptr<AppLaunchDataDB> res_db_;
+ static std::unique_ptr<AppLaunchDataDB> res_db_;
AppLaunchDataDB* res_db() {
return res_db_.get();
@@ -145,7 +145,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
};
utils::dbms::SQLDatabase* AppLaunchDataDBTest::test_db_ = NULL;
-std::auto_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
+std::unique_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
void AppLaunchDataDBTest::AddApplicationDataWithIncreaseTable(
const ApplicationData& data) {
@@ -284,7 +284,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d1_mobile_app_id", i);
const std::string bundle_id = AddCounter("d1_bundle_id", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_1);
AddApplicationDataWithIncreaseTable(*app_data);
input_data1.push_back(app_data);
@@ -294,7 +294,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d2_mobile_app_id", i);
const std::string bundle_id = AddCounter("d2_bundle_id", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_2);
AddApplicationDataWithIncreaseTable(*app_data);
input_data2.push_back(app_data);
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
index cc7d3f5814..4541970c70 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
@@ -36,7 +36,6 @@
#include "json/json.h"
#include "gtest/gtest.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
#include "utils/file_system.h"
#include "utils/date_time.h"
#include "resumption/last_state_impl.h"
@@ -67,7 +66,7 @@ class AppLaunchDataJsonTest : public ::testing::Test {
private:
virtual void SetUp() {
::file_system::DeleteFile(kAppStorageFile);
- test_last_state_ = std::auto_ptr<resumption::LastState>(
+ test_last_state_ = std::unique_ptr<resumption::LastState>(
new resumption::LastStateImpl(kAppStorageFolder, kAppInfoStorage));
ASSERT_TRUE(::file_system::CreateFile(kAppStorageFile));
@@ -97,14 +96,15 @@ class AppLaunchDataJsonTest : public ::testing::Test {
void AddApplicationDataWithIncreaseTable(const ApplicationData& data);
void AddApplicationDataWithoutIncreaseTable(const ApplicationData& data);
- TimevalStruct GetApplicationData_EXPECT_TRUE(const ApplicationData& in_data,
- ApplicationData& out_data);
+ date_time::TimeDuration GetApplicationData_EXPECT_TRUE(
+ const ApplicationData& in_data, ApplicationData& out_data);
void GetApplicationData_EXPECT_FALSE(const ApplicationData& in_data);
std::string AddCounter(const std::string& inp, int32_t val);
- std::auto_ptr<resumption::LastState> test_last_state_;
- std::auto_ptr<AppLaunchDataJson> res_json_;
- void SetTimestamp(const ApplicationData& in_data, TimevalStruct& timestamp);
+ std::unique_ptr<resumption::LastState> test_last_state_;
+ std::unique_ptr<AppLaunchDataJson> res_json_;
+ void SetTimestamp(const ApplicationData& in_data,
+ date_time::TimeDuration& timestamp);
};
void AppLaunchDataJsonTest::AddApplicationDataWithIncreaseTable(
@@ -129,7 +129,7 @@ void AppLaunchDataJsonTest::AddApplicationDataWithoutIncreaseTable(
EXPECT_EQ(sizeBeforeAdding, sizeAfterAdding);
}
-TimevalStruct AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
+date_time::TimeDuration AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
const ApplicationData& in_data, ApplicationData& out_data) {
uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
@@ -148,9 +148,9 @@ TimevalStruct AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
out_data.bundle_id_ =
json_data_list[index][am::strings::bundle_id].asString();
// time stamp
- TimevalStruct tmVal = {0};
- tmVal.tv_sec =
- json_data_list[index][am::strings::app_launch_last_session].asUInt64();
+ date_time::TimeDuration tmVal = date_time::seconds(
+ json_data_list[index][am::strings::app_launch_last_session].asUInt64());
+
return tmVal;
}
@@ -168,7 +168,7 @@ void AppLaunchDataJsonTest::GetApplicationData_EXPECT_FALSE(
}
void AppLaunchDataJsonTest::SetTimestamp(const ApplicationData& in_data,
- TimevalStruct& timestamp) {
+ date_time::TimeDuration& timestamp) {
uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
int32_t index = NotFound;
@@ -183,7 +183,7 @@ void AppLaunchDataJsonTest::SetTimestamp(const ApplicationData& in_data,
EXPECT_EQ(sizeBeforeGetting, sizeAfterGetting);
// time stamp
json_data_list[index][am::strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(timestamp.tv_sec);
+ static_cast<Json::Value::UInt64>(date_time::getSecs(timestamp));
}
std::string AppLaunchDataJsonTest::AddCounter(const std::string& inp,
@@ -225,18 +225,18 @@ TEST_F(AppLaunchDataJsonTest, RefreshTimestamp) {
ApplicationData data("mobile_app_id", "bundle_id", "device_mac");
AddApplicationDataWithIncreaseTable(data);
ApplicationData recoveredData("", "", "");
- TimevalStruct timestamp1 =
+ date_time::TimeDuration timestamp1 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
- TimevalStruct tm = {0, 0};
+ date_time::TimeDuration tm = date_time::TimeDurationZero();
SetTimestamp(data, tm);
- TimevalStruct timestamp2 =
+ date_time::TimeDuration timestamp2 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
- EXPECT_NE(timestamp1.tv_sec, timestamp2.tv_sec);
+ EXPECT_NE(date_time::getSecs(timestamp1), date_time::getSecs(timestamp2));
AddApplicationDataWithoutIncreaseTable(data); // again insert the same
- TimevalStruct timestamp3 =
+ date_time::TimeDuration timestamp3 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
EXPECT_TRUE(data == recoveredData);
- EXPECT_NE(timestamp2.tv_sec, timestamp3.tv_sec);
+ EXPECT_NE(date_time::getSecs(timestamp2), date_time::getSecs(timestamp3));
}
TEST_F(AppLaunchDataJsonTest, MaxCount) {
@@ -250,7 +250,7 @@ TEST_F(AppLaunchDataJsonTest, MaxCount) {
// insert new time stamp
ApplicationData changedRecord("mobile_app_id_0", "bundle_id_0", "device_mac");
- TimevalStruct tm = {0, 0};
+ date_time::TimeDuration tm = date_time::TimeDurationZero();
SetTimestamp(changedRecord, tm);
uint32_t size_max = res_json()->GetCurentNumberOfAppData();
@@ -301,7 +301,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d1_mobile_app_id_", i);
const std::string bundle_id = AddCounter("d1_bundle_id_", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_1);
AddApplicationDataWithIncreaseTable(*app_data);
input_data1.push_back(app_data);
@@ -311,7 +311,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d2_mobile_app_id_", i);
const std::string bundle_id = AddCounter("d2_bundle_id_", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_2);
AddApplicationDataWithIncreaseTable(*app_data);
input_data2.push_back(app_data);
diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc
index a0b6fd6aa2..3203839fc2 100644
--- a/src/components/application_manager/test/application_helper_test.cc
+++ b/src/components/application_manager/test/application_helper_test.cc
@@ -50,8 +50,9 @@
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
+#include "test/resumption/mock_last_state.h"
+#include "media_manager/mock_media_manager.h"
namespace {
const uint8_t expected_tread_pool_size = 2u;
@@ -69,6 +70,8 @@ using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
+using resumption_test::MockLastState;
+using test::components::media_manager_test::MockMediaManager;
using namespace application_manager;
using namespace policy_handler_test;
@@ -112,13 +115,18 @@ class ApplicationHelperTest : public testing::Test {
const connection_handler::DeviceHandle device_id = 1;
const custom_str::CustomString app_name("");
- app_impl_ = new ApplicationImpl(
+ const std::string path_to_plagin = "";
+ EXPECT_CALL(mock_application_manager_settings_, plugins_folder())
+ .WillOnce(ReturnRef(path_to_plagin));
+ app_manager_impl_.Init(mock_last_state_, &mock_media_manager_);
+
+ app_impl_ = std::make_shared<ApplicationImpl>(
application_id,
policy_app_id,
mac_address,
device_id,
app_name,
- utils::MakeShared<usage_statistics_test::MockStatisticsManager>(),
+ std::make_shared<usage_statistics_test::MockStatisticsManager>(),
app_manager_impl_);
}
@@ -127,6 +135,8 @@ class ApplicationHelperTest : public testing::Test {
NiceMock<MockPolicySettings> mock_policy_settings_;
ApplicationManagerImpl app_manager_impl_;
+ MockMediaManager mock_media_manager_;
+ MockLastState mock_last_state_;
ApplicationSharedPtr app_impl_;
};
@@ -134,8 +144,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
const uint32_t cmd_id = 1;
const uint32_t menu_id = 2;
const uint32_t choice_set_id = 3;
- const mobile_apis::VehicleDataType::eType vi =
- mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL;
const mobile_apis::ButtonName::eType button = mobile_apis::ButtonName::AC;
smart_objects::SmartObject cmd;
@@ -147,7 +155,7 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
app_impl_->AddCommand(cmd_id, cmd[strings::msg_params]);
app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
- EXPECT_TRUE(app_impl_->SubscribeToIVI(static_cast<uint32_t>(vi)));
+
EXPECT_TRUE(app_impl_->SubscribeToButton(button));
const std::string some_string = "some_string";
@@ -173,7 +181,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
EXPECT_TRUE(NULL != app_impl_->FindSubMenu(menu_id));
EXPECT_TRUE(NULL != app_impl_->FindChoiceSet(choice_set_id));
EXPECT_TRUE(app_impl_->IsSubscribedToButton(button));
- EXPECT_TRUE(app_impl_->IsSubscribedToIVI(static_cast<uint32_t>(vi)));
auto help_prompt = app_impl_->help_prompt();
EXPECT_TRUE(help_prompt->asString() == some_string);
auto timeout_prompt = app_impl_->timeout_prompt();
@@ -198,7 +205,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
EXPECT_FALSE(NULL != app_impl_->FindSubMenu(menu_id));
EXPECT_FALSE(NULL != app_impl_->FindChoiceSet(choice_set_id));
EXPECT_FALSE(app_impl_->IsSubscribedToButton(button));
- EXPECT_FALSE(app_impl_->IsSubscribedToIVI(static_cast<uint32_t>(vi)));
help_prompt = app_impl_->help_prompt();
EXPECT_FALSE(help_prompt->asString() == some_string);
timeout_prompt = app_impl_->timeout_prompt();
@@ -230,8 +236,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) {
app_impl_->AddCommand(cmd_id, cmd[strings::msg_params]);
app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
- app_impl_->SubscribeToIVI(static_cast<uint32_t>(
- mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL));
app_impl_->SubscribeToButton(mobile_apis::ButtonName::AC);
EXPECT_CALL(*mock_message_helper_, SendUnsubscribedWayPoints(_));
@@ -247,8 +251,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) {
EXPECT_CALL(*mock_message_helper_,
SendUnsubscribeButtonNotification(_, _, _));
- EXPECT_CALL(*mock_message_helper_, SendUnsubscribeIVIRequest(_, _, _));
-
// Act
application_manager::DeleteApplicationData(app_impl_, app_manager_impl_);
}
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 6b7f78b8f7..301ed227b8 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -39,7 +39,6 @@
#include "application_manager/hmi_state.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
#include "application_manager/mock_message_helper.h"
#include "utils/custom_string.h"
#include "application_manager/mock_application_manager.h"
@@ -64,6 +63,7 @@ using namespace mobile_apis;
namespace custom_str = utils::custom_string;
using ::testing::_;
+using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::AtLeast;
@@ -100,12 +100,17 @@ class ApplicationImplTest : public ::testing::Test {
mac_address,
device_handle,
app_name,
- utils::MakeShared<MockStatisticsManager>(),
+ std::make_shared<MockStatisticsManager>(),
mock_application_manager_));
HmiStatePtr initial_state = CreateTestHmiState();
app_impl->SetInitialState(initial_state);
}
+
+ virtual void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(MockMessageHelper::message_helper_mock());
+ }
+
HmiStatePtr CreateTestHmiState();
HmiStatePtr TestAddHmiState(HMILevel::eType hmi_lvl,
@@ -115,7 +120,7 @@ class ApplicationImplTest : public ::testing::Test {
void CheckCurrentHMIState();
MockApplicationManagerSettings mock_application_manager_settings_;
MockApplicationManager mock_application_manager_;
- utils::SharedPtr<ApplicationImpl> app_impl;
+ std::shared_ptr<ApplicationImpl> app_impl;
uint32_t app_id;
std::string policy_app_id;
std::string mac_address;
@@ -130,8 +135,8 @@ class ApplicationImplTest : public ::testing::Test {
};
HmiStatePtr ApplicationImplTest::CreateTestHmiState() {
- HmiStatePtr testState = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(app_impl),
+ HmiStatePtr testState = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(app_impl),
mock_application_manager_,
state_id);
testState->set_hmi_level(test_lvl);
@@ -179,7 +184,7 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetCurrentState) {
HmiState::STATE_ID_REGULAR,
&ApplicationImpl::SetRegularState);
TestAddHmiState(HMILevel::HMI_LIMITED,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
CheckCurrentHMIState();
@@ -191,7 +196,7 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetRegularState) {
HmiState::STATE_ID_REGULAR,
&ApplicationImpl::SetRegularState);
TestAddHmiState(HMILevel::HMI_LIMITED,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr current_state = app_impl->RegularHmiState();
@@ -206,7 +211,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveLastState) {
HmiState::STATE_ID_PHONE_CALL,
&ApplicationImpl::AddHMIState);
HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
HmiState::STATE_ID_TTS_SESSION,
@@ -219,7 +224,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveLastState) {
HmiStatePtr current_state = app_impl->CurrentHmiState();
EXPECT_EQ(state2, current_state);
EXPECT_EQ(HMILevel::HMI_NONE, current_state->hmi_level());
- EXPECT_EQ(HmiState::STATE_ID_NAVI_STREAMING, current_state->state_id());
+ EXPECT_EQ(HmiState::STATE_ID_VIDEO_STREAMING, current_state->state_id());
}
TEST_F(ApplicationImplTest, AddStates_RemoveNotLastNotFirstState) {
@@ -227,7 +232,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveNotLastNotFirstState) {
HmiState::STATE_ID_PHONE_CALL,
&ApplicationImpl::AddHMIState);
HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
HmiState::STATE_ID_TTS_SESSION,
@@ -251,7 +256,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) {
&ApplicationImpl::AddHMIState);
// Second state
TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
HmiState::STATE_ID_TTS_SESSION,
@@ -265,12 +270,12 @@ TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) {
// Last state does not have a parent
EXPECT_EQ(HMILevel::HMI_LIMITED, current_state->hmi_level());
EXPECT_EQ(HmiState::STATE_ID_TTS_SESSION, current_state->state_id());
- EXPECT_EQ(NULL, current_state->parent());
+ EXPECT_EQ(nullptr, current_state->parent());
}
TEST_F(ApplicationImplTest, SetRegularState_RemoveFirstState) {
HmiStatePtr state1 = TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
// Set regular state
HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_FULL,
@@ -304,7 +309,7 @@ TEST_F(ApplicationImplTest, SetPostponedState_RemovePostponedState) {
// Check that state was correctly removed
app_impl->RemovePostponedState();
state2 = app_impl->PostponedHmiState();
- EXPECT_EQ(NULL, state2);
+ EXPECT_EQ(nullptr, state2);
}
TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
@@ -321,7 +326,7 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
audiostate = AudioStreamingState::AUDIBLE;
syst_context = SystemContext::SYSCTXT_MENU;
TestAddHmiState(HMILevel::HMI_LIMITED,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
EXPECT_EQ(test_lvl, app_impl->hmi_level());
@@ -400,7 +405,7 @@ TEST_F(ApplicationImplTest, GetFile) {
test_file.file_type = FileType::GRAPHIC_JPEG;
test_file.file_name = "test_file 1";
- EXPECT_EQ(NULL, app_impl->GetFile(test_file.file_name));
+ EXPECT_EQ(nullptr, app_impl->GetFile(test_file.file_name));
EXPECT_TRUE(app_impl->AddFile(test_file));
const AppFile* app_file = app_impl->GetFile(test_file.file_name);
EXPECT_EQ(test_file.is_persistent, app_file->is_persistent);
@@ -806,7 +811,7 @@ TEST_F(ApplicationImplTest, StopStreaming_StreamingApproved) {
TEST_F(ApplicationImplTest, PushPopMobileMessage) {
smart_objects::SmartObjectSPtr on_driver_distraction =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
const hmi_apis::Common_DriverDistractionState::eType state =
hmi_apis::Common_DriverDistractionState::DD_ON;
(*on_driver_distraction)[strings::params][strings::function_id] =
@@ -827,6 +832,29 @@ TEST_F(ApplicationImplTest, PushPopMobileMessage) {
EXPECT_TRUE(messages.empty());
}
+TEST_F(ApplicationImplTest, SetSecondaryDeviceTest) {
+ connection_handler::DeviceHandle initial_device =
+ app_impl->secondary_device();
+ EXPECT_EQ(0u, initial_device);
+
+ connection_handler::DeviceHandle device = 123;
+ app_impl->set_secondary_device(device);
+
+ EXPECT_EQ(device, app_impl->secondary_device());
+}
+
+TEST_F(ApplicationImplTest, SetDeferredResumptionHMILevelTest) {
+ using namespace mobile_api::HMILevel;
+ HMILevel::eType initial_deferred_level =
+ app_impl->deferred_resumption_hmi_level();
+ EXPECT_EQ(HMILevel::eType::INVALID_ENUM, initial_deferred_level);
+
+ HMILevel::eType deferred_level = HMILevel::eType::HMI_FULL;
+ app_impl->set_deferred_resumption_hmi_level(deferred_level);
+
+ EXPECT_EQ(deferred_level, app_impl->deferred_resumption_hmi_level());
+}
+
} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
index b9437d55e0..8ab852779a 100644
--- a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
@@ -38,17 +38,21 @@
#include "application_manager/application_impl.h"
#include "application_manager/application_manager_impl.h"
#include "utils/custom_string.h"
-#include "utils/make_shared.h"
+
#include "encryption/hashing.h"
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_resumption_data.h"
-#include "application_manager/mock_hmi_command_factory.h"
+#include "application_manager/mock_command_factory.h"
#include "application_manager/mock_request.h"
#include "connection_handler/mock_connection_handler.h"
#include "policy/mock_policy_settings.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol_handler/mock_session_observer.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_rpc_plugin.h"
+#include "utils/optional.h"
namespace test {
namespace components {
@@ -83,7 +87,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test {
public:
ApplicationManagerImplMockHmiTest()
: mock_storage_(
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
mock_app_mngr_)) {}
protected:
@@ -113,6 +117,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test {
app_manager_impl_->set_connection_handler(&mock_connection_handler_);
app_manager_impl_->resume_controller().set_resumption_storage(
mock_storage_);
+ app_manager_impl_->set_protocol_handler(&mock_protocol_handler_);
}
void SetCommonExpectationOnAppReconnection(
@@ -141,14 +146,14 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test {
Return(0)));
}
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
application_manager_test::MockApplicationManager mock_app_mngr_;
NiceMock<policy_handler_test::MockPolicySettings> mock_policy_settings_;
NiceMock<connection_handler_test::MockConnectionHandler>
mock_connection_handler_;
NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
+ NiceMock<protocol_handler_test::MockProtocolHandler> mock_protocol_handler_;
std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
};
@@ -159,16 +164,22 @@ TEST_F(ApplicationManagerImplMockHmiTest,
const std::string mac_address = "MA:CA:DD:RE:SS";
const connection_handler::DeviceHandle device_id = 1u;
const custom_str::CustomString app_name("");
+ plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
+ new plugin_manager::MockRPCPluginManager;
- utils::SharedPtr<ApplicationImpl> app_impl = new ApplicationImpl(
+ std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>(
application_id,
policy_app_id,
encryption::MakeHash(mac_address),
device_id,
app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
new usage_statistics_test::MockStatisticsManager()),
*app_manager_impl_);
+ std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
+ mock_rpc_plugin_manager);
+
+ app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr);
app_manager_impl_->AddMockApplication(app_impl);
@@ -178,12 +189,21 @@ TEST_F(ApplicationManagerImplMockHmiTest,
const connection_handler::Device usb(
device_id + 1, "USB_device", "USB_serial", "USB_IOS");
- MockHMICommandFactory* mock_hmi_factory =
- MockHMICommandFactory::mock_hmi_command_factory();
+ MockCommandFactory mock_command_factory;
+
+ // // Skip sending notification on device switching as it is not the goal
+ // here
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(std::shared_ptr<commands::Command>()));
+
+ plugin_manager::MockRPCPlugin mock_rpc_plugin;
+ utils::Optional<plugin_manager::RPCPlugin> mock_rpc_plugin_opt =
+ mock_rpc_plugin;
- // Skip sending notification on device switching as it is not the goal here
- EXPECT_CALL(*mock_hmi_factory, CreateCommand(_, _))
- .WillOnce(Return(utils::SharedPtr<commands::Command>()));
+ EXPECT_CALL(*mock_rpc_plugin_manager, FindPluginToProcess(_, _))
+ .WillRepeatedly(Return(mock_rpc_plugin_opt));
+ ON_CALL(mock_rpc_plugin, GetCommandFactory())
+ .WillByDefault(ReturnRef(mock_command_factory));
app_manager_impl_->OnDeviceSwitchingStart(bt, usb);
@@ -191,27 +211,27 @@ TEST_F(ApplicationManagerImplMockHmiTest,
const uint32_t correlation_id_1 = 1u;
const uint32_t correlation_id_2 = 2u;
const uint32_t correlation_id_3 = 3u;
- utils::SharedPtr<NiceMock<MockRequest> > cmd_1 =
- utils::MakeShared<NiceMock<MockRequest> >(connection_key,
- correlation_id_1);
- utils::SharedPtr<NiceMock<MockRequest> > cmd_2 =
- utils::MakeShared<NiceMock<MockRequest> >(connection_key,
- correlation_id_2);
- utils::SharedPtr<NiceMock<MockRequest> > cmd_3 =
- utils::MakeShared<NiceMock<MockRequest> >(connection_key,
- correlation_id_3);
-
- EXPECT_CALL(*mock_hmi_factory, CreateCommand(_, _))
+ std::shared_ptr<NiceMock<MockRequest> > cmd_1 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_1);
+ std::shared_ptr<NiceMock<MockRequest> > cmd_2 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_2);
+ std::shared_ptr<NiceMock<MockRequest> > cmd_3 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_3);
+
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
.WillOnce(Return(cmd_1))
.WillOnce(Return(cmd_2))
.WillOnce(Return(cmd_3));
commands::MessageSharedPtr hmi_msg_1 =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
commands::MessageSharedPtr hmi_msg_2 =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
commands::MessageSharedPtr hmi_msg_3 =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*hmi_msg_1)[strings::msg_params][strings::app_id] =
(*hmi_msg_2)[strings::msg_params][strings::app_id] =
@@ -222,11 +242,11 @@ TEST_F(ApplicationManagerImplMockHmiTest,
EXPECT_CALL(*cmd_3, Init()).Times(0);
// Act
- app_manager_impl_->ManageHMICommand(hmi_msg_1);
- app_manager_impl_->ManageHMICommand(hmi_msg_2);
- app_manager_impl_->ManageHMICommand(hmi_msg_3);
+ app_manager_impl_->GetRPCService().ManageHMICommand(hmi_msg_1);
+ app_manager_impl_->GetRPCService().ManageHMICommand(hmi_msg_2);
+ app_manager_impl_->GetRPCService().ManageHMICommand(hmi_msg_3);
- EXPECT_CALL(*mock_hmi_factory, CreateCommand(_, _))
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
.WillOnce(Return(cmd_1))
.WillOnce(Return(cmd_2))
.WillOnce(Return(cmd_3));
@@ -246,7 +266,7 @@ TEST_F(ApplicationManagerImplMockHmiTest,
app_manager_impl_->ProcessReconnection(app_impl, new_application_id);
app_manager_impl_->OnApplicationSwitched(app_impl);
- Mock::VerifyAndClearExpectations(&mock_hmi_factory);
+ Mock::VerifyAndClearExpectations(&mock_command_factory);
}
} // application_manager_test
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index c922c227bb..7e57b51329 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -43,6 +43,8 @@
#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/resumption/resume_ctrl_impl.h"
#include "application_manager/test/include/application_manager/mock_message_helper.h"
#include "connection_handler/mock_connection_handler.h"
@@ -52,10 +54,11 @@
#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 "utils/custom_string.h"
#include "utils/file_system.h"
#include "utils/lock.h"
-#include "utils/make_shared.h"
+
#include "utils/push_log.h"
#include "encryption/hashing.h"
@@ -68,6 +71,7 @@ namespace policy_test = test::components::policy_handler_test;
namespace con_test = connection_handler_test;
using testing::_;
+using ::testing::An;
using ::testing::Matcher;
using ::testing::ByRef;
using ::testing::DoAll;
@@ -89,22 +93,30 @@ namespace {
const std::string kDirectoryName = "./test_storage";
const uint32_t kTimeout = 10000u;
connection_handler::DeviceHandle kDeviceId = 12345u;
+const std::string kAppId = "someID";
+const uint32_t kConnectionKey = 1232u;
+const std::string kAppName = "appName";
} // namespace
class ApplicationManagerImplTest : public ::testing::Test {
public:
ApplicationManagerImplTest()
- : mock_storage_(
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ : app_id_(0u)
+ , mock_storage_(
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
mock_app_mngr_))
+ , mock_rpc_service_(new MockRPCService)
, mock_message_helper_(
application_manager::MockMessageHelper::message_helper_mock())
- , app_id_(0u) {
+
+ {
+#ifdef ENABLE_LOG
logger::create_log_message_loop_thread();
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+#endif
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
}
~ApplicationManagerImplTest() {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
}
protected:
@@ -114,7 +126,7 @@ class ApplicationManagerImplTest : public ::testing::Test {
.WillByDefault(DoAll(SetArgPointee<3u>(app_id_), Return(0)));
ON_CALL(mock_connection_handler_, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer_));
-
+ app_manager_impl_->SetRPCService(mock_rpc_service_);
app_manager_impl_->resume_controller().set_resumption_storage(
mock_storage_);
app_manager_impl_->set_connection_handler(&mock_connection_handler_);
@@ -136,11 +148,13 @@ class ApplicationManagerImplTest : public ::testing::Test {
.WillByDefault(Return(stop_streaming_timeout));
ON_CALL(mock_application_manager_settings_, default_timeout())
.WillByDefault(ReturnRef(kTimeout));
+ ON_CALL(mock_application_manager_settings_,
+ application_list_update_timeout()).WillByDefault(Return(kTimeout));
app_manager_impl_.reset(new am::ApplicationManagerImpl(
mock_application_manager_settings_, mock_policy_settings_));
- mock_app_ptr_ = utils::SharedPtr<MockApplication>(new MockApplication());
-
+ mock_app_ptr_ = std::shared_ptr<MockApplication>(new MockApplication());
+ app_manager_impl_->set_protocol_handler(&mock_protocol_handler_);
ASSERT_TRUE(app_manager_impl_.get());
ASSERT_TRUE(mock_app_ptr_.get());
}
@@ -175,31 +189,40 @@ class ApplicationManagerImplTest : public ::testing::Test {
Return(0)));
}
+ bool CheckResumptionRequiredTransportAvailableTest(
+ smart_objects::SmartObject* app_types_array,
+ connection_handler::DeviceHandle primary_device_handle,
+ std::string primary_transport_device_string,
+ connection_handler::DeviceHandle secondary_device_handle,
+ std::string secondary_transport_device_string);
+
+ uint32_t app_id_;
NiceMock<policy_test::MockPolicySettings> mock_policy_settings_;
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
+
+ std::unique_ptr<rpc_service::RPCService> mock_rpc_service_;
NiceMock<con_test::MockConnectionHandler> mock_connection_handler_;
NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
application_manager_test::MockApplicationManager mock_app_mngr_;
- std::auto_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+ std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
application_manager::MockMessageHelper* mock_message_helper_;
- uint32_t app_id_;
- utils::SharedPtr<MockApplication> mock_app_ptr_;
+
+ std::shared_ptr<MockApplication> mock_app_ptr_;
+ NiceMock<protocol_handler_test::MockProtocolHandler> mock_protocol_handler_;
};
TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject app_data;
const uint32_t connection_key = 65537u;
-
app_data[am::json::name] = "application_manager_test";
app_data[am::json::appId] = app_id_;
app_data[am::json::android] = "bucket";
app_data[am::json::android][am::json::packageName] = "com.android.test";
smart_objects::SmartObject sm_object(SmartType_Map);
sm_object[am::json::response][0] = app_data;
- SmartObjectSPtr sptr = MakeShared<SmartObject>(sm_object);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(sm_object);
ON_CALL(*mock_message_helper_, CreateModuleInfoSO(_, _))
.WillByDefault(Return(sptr));
@@ -210,21 +233,19 @@ TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
TEST_F(ApplicationManagerImplTest,
SubscribeAppForWayPoints_ExpectSubscriptionApp) {
- auto app_ptr =
- ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
}
TEST_F(ApplicationManagerImplTest,
UnsubscribeAppForWayPoints_ExpectUnsubscriptionApp) {
- auto app_ptr =
- ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
app_manager_impl_->UnsubscribeAppFromWayPoints(app_ptr);
EXPECT_FALSE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
- const std::set<int32_t> result =
+ const std::set<uint32_t> result =
app_manager_impl_->GetAppsSubscribedForWayPoints();
EXPECT_TRUE(result.empty());
}
@@ -233,19 +254,20 @@ TEST_F(
ApplicationManagerImplTest,
IsAnyAppSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
EXPECT_FALSE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
- app_manager_impl_->SubscribeAppForWayPoints(app_id_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
EXPECT_TRUE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
}
TEST_F(
ApplicationManagerImplTest,
GetAppsSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
- auto app_ptr =
- ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
- std::set<int32_t> result = app_manager_impl_->GetAppsSubscribedForWayPoints();
+ std::set<uint32_t> result =
+ app_manager_impl_->GetAppsSubscribedForWayPoints();
EXPECT_EQ(1u, result.size());
- EXPECT_TRUE(result.find(app_ptr) != result.end());
+ EXPECT_TRUE(result.find(app_ptr->app_id()) != result.end());
}
TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_RpcService) {
@@ -675,9 +697,89 @@ TEST_F(ApplicationManagerImplTest,
}
TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportStartedCallback_BeforeAppRegistration) {
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = 123;
+
+ // make sure that BC.UpdateAppList is not invoked
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .Times(0);
+
+ app_manager_impl_->OnSecondaryTransportStartedCallback(device_handle,
+ session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportStartedCallback_AfterAppRegistration) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ AddMockApplication();
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(app_id_));
+
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = app_id_;
+
+ EXPECT_CALL(*mock_app_ptr_, set_secondary_device(device_handle)).Times(1);
+ // called by ResumeCtrlImpl::RetryResumption()
+ EXPECT_CALL(*mock_app_ptr_, deferred_resumption_hmi_level())
+ .WillOnce(Return(mobile_api::HMILevel::eType::INVALID_ENUM));
+
+ smart_objects::SmartObject dummy_object(SmartType_Map);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(dummy_object);
+
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .WillOnce(Return(sptr));
+
+ app_manager_impl_->OnSecondaryTransportStartedCallback(device_handle,
+ session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportEndedCallback_AfterAppRegistration) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = app_id_;
+
+ AddMockApplication();
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(app_id_));
+ EXPECT_CALL(*mock_app_ptr_, secondary_device())
+ .WillRepeatedly(Return(device_handle));
+
+ EXPECT_CALL(*mock_app_ptr_, set_secondary_device(0)).Times(1);
+
+ smart_objects::SmartObject dummy_object(SmartType_Map);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(dummy_object);
+
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .WillOnce(Return(sptr));
+
+ app_manager_impl_->OnSecondaryTransportEndedCallback(session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportEndedCallback_BeforeAppRegistration) {
+ const int32_t session_key = app_id_;
+
+ // make sure that BC.UpdateAppList is not invoked
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .Times(0);
+
+ app_manager_impl_->OnSecondaryTransportEndedCallback(session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
OnDeviceSwitchingStart_ExpectPutAppsInWaitList) {
- utils::SharedPtr<MockApplication> switching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> switching_app_ptr =
+ std::make_shared<MockApplication>();
const std::string switching_device_id = "switching";
const std::string switching_device_id_hash =
@@ -694,8 +796,8 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*switching_app_ptr, hmi_level())
.WillRepeatedly(Return(hmi_level_switching_app));
- utils::SharedPtr<MockApplication> nonswitching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> nonswitching_app_ptr =
+ std::make_shared<MockApplication>();
const std::string nonswitching_device_id = "nonswitching";
const std::string nonswitching_device_id_hash =
@@ -734,8 +836,14 @@ TEST_F(ApplicationManagerImplTest,
TEST_F(ApplicationManagerImplTest,
OnDeviceSwitchingFinish_ExpectUnregisterAppsInWaitList) {
- utils::SharedPtr<MockApplication> switching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> switching_app_ptr =
+ std::make_shared<MockApplication>();
+
+ plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
+ new plugin_manager::MockRPCPluginManager;
+ std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
+ mock_rpc_plugin_manager);
+ app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr);
const std::string switching_device_id = "switching";
const std::string switching_device_id_hash =
@@ -752,8 +860,8 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*switching_app_ptr, hmi_level())
.WillRepeatedly(Return(hmi_level_switching_app));
- utils::SharedPtr<MockApplication> nonswitching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> nonswitching_app_ptr =
+ std::make_shared<MockApplication>();
const std::string nonswitching_device_id = "nonswitching";
const std::string nonswitching_device_id_hash =
@@ -783,7 +891,6 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*mock_message_helper_, CreateDeviceListSO(_, _, _))
.WillOnce(Return(smart_objects::SmartObjectSPtr()));
-
app_manager_impl_->OnDeviceSwitchingStart(switching_device,
non_switching_device);
@@ -802,13 +909,13 @@ TEST_F(ApplicationManagerImplTest,
const connection_handler::DeviceHandle device_id = 1;
const custom_str::CustomString app_name("");
- utils::SharedPtr<ApplicationImpl> app_impl = new ApplicationImpl(
+ std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>(
application_id,
policy_app_id,
mac_address,
device_id,
app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
new usage_statistics_test::MockStatisticsManager()),
*app_manager_impl_);
@@ -871,12 +978,16 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
ON_CALL(mock_application_manager_settings_, recording_file_name())
.WillByDefault(ReturnRef(dummy_file_name));
+ std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
+ new plugin_manager::MockRPCPluginManager);
+ app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr);
+
const uint32_t app_id_1 = 65537;
const uint32_t app_id_2 = 65538;
std::string dummy_mac_address;
- utils::SharedPtr<MockApplication> mock_app_1 =
- utils::SharedPtr<MockApplication>(new MockApplication());
+ std::shared_ptr<MockApplication> mock_app_1 =
+ std::shared_ptr<MockApplication>(new MockApplication());
EXPECT_CALL(*mock_app_1, app_id()).WillRepeatedly(Return(app_id_1));
EXPECT_CALL(*mock_app_1, device()).WillRepeatedly(Return(0));
EXPECT_CALL(*mock_app_1, mac_address())
@@ -886,8 +997,8 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
.WillRepeatedly(
Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
- utils::SharedPtr<MockApplication> mock_app_2 =
- utils::SharedPtr<MockApplication>(new MockApplication());
+ std::shared_ptr<MockApplication> mock_app_2 =
+ std::shared_ptr<MockApplication>(new MockApplication());
EXPECT_CALL(*mock_app_2, app_id()).WillRepeatedly(Return(app_id_2));
EXPECT_CALL(*mock_app_2, device()).WillRepeatedly(Return(0));
EXPECT_CALL(*mock_app_2, mac_address())
@@ -941,6 +1052,367 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
}
}
+static std::map<std::string, std::vector<std::string> > CreateTransportMap() {
+ /*
+ * DefaultTransportRequiredForResumption = TCP_WIFI, IAP_USB, SPP_BLUETOOTH
+ * MediaTransportRequiredForResumption = TCP_WIFI, AOA_USB
+ * NavigationTransportRequiredForResumption = AOA_USB, SPP_BLUETOOTH
+ * TestingTransportRequiredForResumption =
+ * EmptyAppTransportRequiredForResumption = TCP_WIFI
+ */
+ std::string TCP_WIFI("TCP_WIFI");
+ std::string IAP_USB("IAP_USB");
+ std::string SPP_BLUETOOTH("SPP_BLUETOOTH");
+ std::string AOA_USB("AOA_USB");
+
+ std::vector<std::string> default_transports;
+ default_transports.push_back(TCP_WIFI);
+ default_transports.push_back(IAP_USB);
+ default_transports.push_back(SPP_BLUETOOTH);
+ std::vector<std::string> media_transports;
+ media_transports.push_back(TCP_WIFI);
+ media_transports.push_back(AOA_USB);
+ std::vector<std::string> navi_transports;
+ navi_transports.push_back(AOA_USB);
+ navi_transports.push_back(SPP_BLUETOOTH);
+ std::vector<std::string> testing_transports;
+ std::vector<std::string> empty_transports;
+ empty_transports.push_back(TCP_WIFI);
+
+ std::map<std::string, std::vector<std::string> > transport_map;
+ transport_map[std::string("DEFAULT")] = default_transports;
+ transport_map[std::string("MEDIA")] = media_transports;
+ transport_map[std::string("NAVIGATION")] = navi_transports;
+ transport_map[std::string("TESTING")] = testing_transports;
+ transport_map[std::string("EMPTY_APP")] = empty_transports;
+
+ return transport_map;
+}
+
+bool ApplicationManagerImplTest::CheckResumptionRequiredTransportAvailableTest(
+ smart_objects::SmartObject* app_types_array,
+ connection_handler::DeviceHandle primary_device_handle,
+ std::string primary_transport_device_string,
+ connection_handler::DeviceHandle secondary_device_handle,
+ std::string secondary_transport_device_string) {
+ EXPECT_CALL(*mock_app_ptr_, app_types())
+ .WillRepeatedly(Return(app_types_array));
+
+ std::map<std::string, std::vector<std::string> > transport_map =
+ CreateTransportMap();
+
+ EXPECT_CALL(mock_application_manager_settings_,
+ transport_required_for_resumption_map())
+ .WillRepeatedly(ReturnRef(transport_map));
+
+ EXPECT_CALL(*mock_app_ptr_, device())
+ .WillRepeatedly(Return(primary_device_handle));
+ EXPECT_CALL(*mock_app_ptr_, secondary_device())
+ .WillRepeatedly(Return(secondary_device_handle));
+
+ EXPECT_CALL(mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(primary_device_handle))
+ .WillOnce(Return(primary_transport_device_string));
+
+ if (secondary_device_handle != 0) {
+ EXPECT_CALL(
+ mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(secondary_device_handle))
+ .WillOnce(Return(secondary_transport_device_string));
+ } else {
+ EXPECT_CALL(mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(
+ secondary_device_handle)).WillOnce(Return(std::string("")));
+ }
+
+ return app_manager_impl_->CheckResumptionRequiredTransportAvailable(
+ mock_app_ptr_);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_Success) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::DEFAULT;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is DEFAULT.
+ // - A DEFAULT app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI, IAP_USB or SPP_BLUETOOTH.
+ // - We have SPP_BLUETOOTH for primary transport.
+ // -> Conclusion: the app has required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NotListed) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::SOCIAL;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is SOCIAL.
+ // - We do not have an entry in .ini file for SOCIAL apps.
+ // -> In this case, resumption is always enabled for backward compatibility.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_Disabled) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::TESTING;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is TESTING.
+ // - We do not have any transports allowed for TESTING apps.
+ // -> In this case, resumption is always disabled.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NoAppTypes) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ // we don't specify any app type
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app doesn't specify AppHMIType.
+ // - .ini file specifies TCP_WIFI for EMPTY_APP entry.
+ // -> The app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NoAppTypes2) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app doesn't specify AppHMIType.
+ // - .ini file specifies TCP_WIFI for EMPTY_APP entry.
+ // -> The app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ NULL,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_TwoTransports_Success) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::MEDIA;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is MEDIA.
+ // - A MEDIA app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI or AOA_USB.
+ // - We have TCP_WIFI for secondary transport.
+ // -> Conclusion: the app has required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_TwoTransports_Failure) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::NAVIGATION;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is NAVIGATION.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - We have IAP_USB for primary and TCP_WIFI for secondary transport.
+ // -> Conclusion: the app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_MultipleAppTypes_Failure) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::MEDIA;
+ app_types_array[1] = mobile_apis::AppHMIType::eType::NAVIGATION;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is MEDIA and NAVIGATION.
+ // - A MEDIA app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI or AOA_USB.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - We have IAP_USB for primary and TCP_WIFI is secondary
+ // -> Conclusion: the app does NOT have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_MultipleAppTypes_Empty) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::NAVIGATION;
+ app_types_array[1] = mobile_apis::AppHMIType::eType::SYSTEM;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is NAVIGATION and SYSTEM.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - .ini file does not have an entry for SYSTEM apps. So any transport is
+ // allowed.
+ // - We have SPP_BLUETOOTH for primary and TCP_WIFI is secondary
+ // -> Conclusion: the app does NOT have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ RegisterApplication_PathToTheIconExists_IconWasSet) {
+ file_system::CreateDirectory(kDirectoryName);
+ const std::string full_icon_path = kDirectoryName + "/" + kAppId;
+ ASSERT_TRUE(file_system::CreateFile(full_icon_path));
+
+ smart_objects::SmartObject request_for_registration(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& params =
+ request_for_registration[strings::msg_params];
+ params[strings::app_id] = kAppId;
+ params[strings::language_desired] = mobile_api::Language::EN_US;
+ params[strings::hmi_display_language_desired] = mobile_api::Language::EN_US;
+
+ request_for_registration[strings::params][strings::connection_key] =
+ kConnectionKey;
+ request_for_registration[strings::msg_params][strings::app_name] = kAppName;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::minor_version] = APIVersion::kAPIV2;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::major_version] = APIVersion::kAPIV3;
+
+ request_for_registration[strings::params][strings::protocol_version] =
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2;
+
+ smart_objects::SmartObjectSPtr request_for_registration_ptr =
+ std::make_shared<smart_objects::SmartObject>(request_for_registration);
+
+ ApplicationSharedPtr application =
+ app_manager_impl_->RegisterApplication(request_for_registration_ptr);
+ EXPECT_STREQ(kAppName.c_str(), application->name().c_str());
+ EXPECT_STREQ(full_icon_path.c_str(), application->app_icon_path().c_str());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2,
+ application->protocol_version());
+ EXPECT_EQ(APIVersion::kAPIV2,
+ application->version().min_supported_api_version);
+ EXPECT_EQ(APIVersion::kAPIV3,
+ application->version().max_supported_api_version);
+
+ EXPECT_TRUE(file_system::RemoveDirectory(kDirectoryName, true));
+}
+
} // application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc
index 33f23022f0..a0bfa2890f 100644
--- a/src/components/application_manager/test/application_state_test.cc
+++ b/src/components/application_manager/test/application_state_test.cc
@@ -41,8 +41,6 @@
#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "utils/make_shared.h"
-
namespace test {
namespace components {
namespace application_manager_test {
@@ -58,7 +56,7 @@ std::vector<StateID> GenerateCurrentStates() {
states.push_back(StateID::STATE_ID_SAFETY_MODE);
states.push_back(StateID::STATE_ID_VR_SESSION);
states.push_back(StateID::STATE_ID_TTS_SESSION);
- states.push_back(StateID::STATE_ID_NAVI_STREAMING);
+ states.push_back(StateID::STATE_ID_VIDEO_STREAMING);
states.push_back(StateID::STATE_ID_DEACTIVATE_HMI);
return states;
}
@@ -75,7 +73,7 @@ class ApplicationStateTest : public ::testing::Test {
ApplicationState app_state;
const StateID current_id = StateID::STATE_ID_CURRENT;
const StateID postponed_id = StateID::STATE_ID_POSTPONED;
- utils::SharedPtr<MockApplication> mock_app_;
+ std::shared_ptr<MockApplication> mock_app_;
MockApplicationManager app_mngr_;
};
@@ -85,8 +83,8 @@ std::vector<StateID> ApplicationStateTest::added_states_ =
TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -97,8 +95,8 @@ TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
TEST_F(ApplicationStateTest, AddStates_RemoveStates_GetCurrentState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -120,18 +118,18 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
// Added some states
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
}
// Postponed state wasn't added
HmiStatePtr get_postponed_id = app_state.GetState(postponed_id);
- EXPECT_EQ(NULL, get_postponed_id);
+ EXPECT_EQ(nullptr, get_postponed_id);
// Add posponed state
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
@@ -143,8 +141,8 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
// Add state
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
state->set_hmi_level(HMILevel::HMI_FULL);
@@ -152,8 +150,8 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
++new_state;
// Add some other
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -169,16 +167,16 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
++new_state;
// Add postponed state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
@@ -188,8 +186,8 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
ASSERT_EQ(state, post_state);
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -211,30 +209,30 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
// Add some state
StateID first_state = StateID::STATE_ID_PHONE_CALL;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
first_state);
app_state.AddState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
// Add new postponed state
- utils::SharedPtr<MockApplication> mock_app_2(new MockApplication);
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ std::shared_ptr<MockApplication> mock_app_2(new MockApplication);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
// Add regular state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
StateID::STATE_ID_REGULAR);
app_state.AddState(state);
@@ -250,8 +248,8 @@ TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
TEST_F(ApplicationStateTest, InitState_GetRegularState) {
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
init_state);
@@ -267,8 +265,8 @@ TEST_F(ApplicationStateTest, InitState_GetRegularState) {
TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
// Precondition
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
init_state);
state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
@@ -276,8 +274,8 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
app_state.InitState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
@@ -290,14 +288,14 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
app_state.RemoveState(postponed_id);
get_postponed_state = app_state.GetState(postponed_id);
- EXPECT_EQ(NULL, get_postponed_state);
+ EXPECT_EQ(nullptr, get_postponed_state);
}
TEST_F(ApplicationStateTest,
AddRegularState_RemoveRegularState_RegularStateNotDeleted) {
StateID reg_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
reg_state);
app_state.InitState(state);
diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc
index e10cd5d008..56e24b8d29 100644
--- a/src/components/application_manager/test/command_holder_test.cc
+++ b/src/components/application_manager/test/command_holder_test.cc
@@ -35,11 +35,10 @@
#include "application_manager/command_holder_impl.h"
#include "application_manager/commands/command.h"
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_rpc_service.h"
namespace test {
namespace components {
@@ -47,6 +46,7 @@ namespace application_manager_test {
using testing::_;
using testing::Return;
+using ::testing::ReturnRef;
namespace am = application_manager;
@@ -65,14 +65,17 @@ class CommandHolderImplTest : public testing::Test {
.WillByDefault(Return(kHmiApplicationId_));
ON_CALL(*mock_app_ptr_, policy_app_id())
.WillByDefault(Return(kPolicyAppId_));
+ ON_CALL(mock_app_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
}
MockApplicationManager mock_app_manager_;
const std::string kPolicyAppId_;
const uint32_t kHmiApplicationId_;
const uint32_t kConnectionKey_;
- utils::SharedPtr<smart_objects::SmartObject> cmd_ptr_;
- utils::SharedPtr<MockApplication> mock_app_ptr_;
+ std::shared_ptr<smart_objects::SmartObject> cmd_ptr_;
+ std::shared_ptr<MockApplication> mock_app_ptr_;
+ application_manager_test::MockRPCService mock_rpc_service_;
};
TEST_F(CommandHolderImplTest, HoldOne_ExpectReleaseOne) {
@@ -81,7 +84,7 @@ TEST_F(CommandHolderImplTest, HoldOne_ExpectReleaseOne) {
mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
// Act
- EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_));
cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
}
@@ -96,7 +99,7 @@ TEST_F(CommandHolderImplTest, HoldMany_ExpectReleaseSame) {
} while (iterations < 5);
// Act
- EXPECT_CALL(mock_app_manager_, 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);
}
@@ -109,7 +112,7 @@ TEST_F(CommandHolderImplTest, Hold_Drop_ExpectNoReleased) {
// Act
cmd_holder.Clear(mock_app_ptr_);
- EXPECT_CALL(mock_app_manager_, 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);
}
@@ -121,10 +124,10 @@ TEST_F(CommandHolderImplTest, Hold_ReleaseAnotherId_ExpectNoReleased) {
mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
// Act
- utils::SharedPtr<MockApplication> another_app =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> another_app =
+ std::make_shared<MockApplication>();
- EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0);
cmd_holder.Resume(another_app, am::CommandHolder::CommandType::kHmiCommand);
}
@@ -139,11 +142,11 @@ TEST_F(CommandHolderImplTest, Hold_DropAnotherId_ExpectReleased) {
} while (iterations < 3);
// Act
- utils::SharedPtr<MockApplication> another_app =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> another_app =
+ std::make_shared<MockApplication>();
cmd_holder.Clear(another_app);
- EXPECT_CALL(mock_app_manager_, 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);
}
@@ -157,13 +160,13 @@ TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) {
mock_app_ptr_, am::CommandHolder::CommandType::kMobileCommand, cmd_ptr_);
// Act
- EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_));
cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
EXPECT_CALL(
- mock_app_manager_,
+ mock_rpc_service_,
ManageMobileCommand(cmd_ptr_,
- am::commands::Command::CommandOrigin::ORIGIN_MOBILE));
+ am::commands::Command::CommandSource::SOURCE_MOBILE));
cmd_holder.Resume(mock_app_ptr_,
am::CommandHolder::CommandType::kMobileCommand);
}
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
index 8dafc16471..33258e60db 100644
--- a/src/components/application_manager/test/commands/CMakeLists.txt
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -35,10 +35,7 @@ include_directories(
${COMPONENTS_DIR}/application_manager/include/
${COMPONENTS_DIR}/application_manager/include/application_manager/
${COMPONENTS_DIR}/application_manager/include/application_manager/commands/
- ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/hmi/
- ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/mobile/
- ${COMPONENTS_DIR}/application_manager/test/include/
- ${COMPONENTS_DIR}/application_manager/test/include/application_manager/
+ ${CMAKE_SOURCE_DIR}/src
)
set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands)
@@ -47,11 +44,9 @@ file(GLOB SOURCES
${COMMANDS_TEST_DIR}/*
${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
- ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
- ${COMPONENTS_DIR}/application_manager/src/message.cc
- ${COMMANDS_TEST_DIR}/hmi/*
- ${COMMANDS_TEST_DIR}/hmi/hmi_notifications/*
- ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/test/commands/command_imp_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/commands/command_request_impl_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/commands/command_response_impl_test.cc
)
set(LIBRARIES
@@ -60,11 +55,10 @@ set(LIBRARIES
SmartObjects
HMI_API
MOBILE_API
- ApplicationManager
- AMHMICommandsLibrary
- AMMobileCommandsLibrary
connectionHandler
+ ApplicationManager
jsoncpp
+ Policy
)
-create_cotired_test("commands_test" "${SOURCES}" "${LIBRARIES}" )
+create_test("commands_test" "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/test/commands/command_impl_test.cc b/src/components/application_manager/test/commands/command_impl_test.cc
index ff9634cbb1..222f16ef46 100644
--- a/src/components/application_manager/test/commands/command_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_impl_test.cc
@@ -37,7 +37,7 @@
#include <set>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -55,7 +55,6 @@ using ::testing::Return;
using ::testing::AtLeast;
using ::testing::_;
-using ::utils::SharedPtr;
namespace strings = ::application_manager::strings;
using ::application_manager::commands::CommandImpl;
using ::application_manager::ApplicationManager;
@@ -63,7 +62,7 @@ using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::ApplicationSharedPtr;
using ::test::components::application_manager_test::MockApplication;
-typedef SharedPtr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<MockApplication> MockAppPtr;
namespace {
const uint32_t kDefaultMsgCount = 5u;
@@ -87,8 +86,15 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
using CommandImpl::ReplaceHMIWithMobileAppId;
UnwrappedCommandImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
};
// Create `SmartObject` which handle array of `SmartObjects`
@@ -118,11 +124,11 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
};
typedef CommandImplTest::UnwrappedCommandImpl UCommandImpl;
-typedef SharedPtr<UCommandImpl> UCommandImplPtr;
+typedef std::shared_ptr<UCommandImpl> UCommandImplPtr;
TEST_F(CommandImplTest, GetMethods_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandImpl> command =
+ std::shared_ptr<CommandImpl> command =
CreateCommand<CommandImpl>(kDefaultTimeout_, msg);
// Current implementation always return `true`
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 4493c54d3c..c70dd14852 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
@@ -40,7 +40,7 @@
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/data_accessor.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -65,7 +65,6 @@ using ::testing::Return;
using ::testing::SaveArg;
using ::testing::DoAll;
-using ::utils::SharedPtr;
using am::commands::MessageSharedPtr;
using am::CommandParametersPermissions;
using am::event_engine::EventObserver;
@@ -96,6 +95,9 @@ const std::string kMissedParam = "missed_param";
class CommandRequestImplTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
+ CommandRequestImplTest()
+ : app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
+
class UnwrappedCommandRequestImpl : public CommandRequestImpl {
public:
using CommandRequestImpl::CheckAllowedParameters;
@@ -104,8 +106,12 @@ class CommandRequestImplTest
using CommandRequestImpl::HasDisallowedParams;
UnwrappedCommandRequestImpl(const MessageSharedPtr& message,
- ApplicationManager& am)
- : CommandRequestImpl(message, am) {}
+ ApplicationManager& am,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(
+ message, am, rpc_service, hmi_capabilities, policy_handler) {}
const RequestState current_state() const {
return current_state_;
@@ -127,21 +133,21 @@ class CommandRequestImplTest
}
};
- MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
- app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
+ MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) {
+ app_set = (!app_set ? std::make_shared<ApplicationSet>() : app_set);
MockAppPtr app(CreateMockApp());
app_set->insert(app);
EXPECT_CALL(app_mngr_, applications())
.WillOnce(
- Return(DataAccessor<ApplicationSet>(*app_set, app_set_lock_)));
+ Return(DataAccessor<ApplicationSet>(*app_set, app_set_lock_ptr_)));
return app;
}
- sync_primitives::Lock app_set_lock_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
};
typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl;
-typedef SharedPtr<UCommandRequestImpl> CommandPtr;
+typedef std::shared_ptr<UCommandRequestImpl> CommandPtr;
TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>();
@@ -150,7 +156,8 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
// First -- on `onTimeOut` method call
// Second -- on destruction;
EXPECT_CALL(event_dispatcher_, remove_observer(_)).Times(2);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
// If `command` already done, then state should change to `kCompleted`.
command->set_current_state(RequestState::kCompleted);
@@ -171,9 +178,10 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) {
MessageSharedPtr dummy_msg(CreateMessage());
EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
.WillOnce(Return(dummy_msg));
+
EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(dummy_msg, Command::CommandOrigin::ORIGIN_SDL));
+ mock_rpc_service_,
+ ManageMobileCommand(dummy_msg, Command::CommandSource::SOURCE_SDL));
command->onTimeOut();
@@ -250,7 +258,7 @@ TEST_F(CommandRequestImplTest, CreateHMINotification_SUCCESS) {
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
command->CreateHMINotification(kInvalidFunctionId, *msg_params);
@@ -271,7 +279,8 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
EXPECT_EQ(kCorrelationId,
command->SendHMIRequest(kInvalidFunctionId, NULL, false));
@@ -288,8 +297,8 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
EXPECT_CALL(event_dispatcher_, add_observer(_, _, _));
EXPECT_EQ(kCorrelationId,
@@ -386,7 +395,7 @@ TEST_F(CommandRequestImplTest,
EXPECT_CALL(mock_message_helper_, CreateBlockedByPoliciesResponse(_, _, _, _))
.WillOnce(Return(smart_objects::SmartObjectSPtr()));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _));
EXPECT_FALSE(command->CheckPermissions());
}
@@ -438,7 +447,7 @@ TEST_F(CommandRequestImplTest, SendResponse_TimedOut_UNSUCCESS) {
command->set_current_state(RequestState::kTimedOut);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
// Args do not affect on anything in this case;
command->SendResponse(true, kMobResultSuccess, NULL, NULL);
@@ -453,7 +462,8 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
EXPECT_TRUE(smart_objects::SmartType_Null == (*msg).getType());
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
// Args do not affect on anything in this case;
@@ -483,7 +493,8 @@ TEST_F(CommandRequestImplTest,
kDisallowedParam1);
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
command->SendResponse(true, kMobResultSuccess, NULL, NULL);
@@ -501,7 +512,8 @@ TEST_F(CommandRequestImplTest, HashUpdateAllowed_UpdateExpected) {
command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const bool is_succedeed = true;
@@ -521,7 +533,8 @@ TEST_F(CommandRequestImplTest, HashUpdateDisallowed_HashUpdateNotExpected) {
CommandRequestImpl::HashUpdateMode::kSkipHashUpdate);
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const bool is_succedeed = true;
@@ -539,7 +552,8 @@ TEST_F(CommandRequestImplTest, RequestFailed_HashUpdateNotExpected) {
command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const bool is_succedeed = false;
@@ -557,7 +571,8 @@ TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) {
command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const bool is_succedeed = true;
diff --git a/src/components/application_manager/test/commands/command_response_impl_test.cc b/src/components/application_manager/test/commands/command_response_impl_test.cc
index f95b9a49b2..41cc654a24 100644
--- a/src/components/application_manager/test/commands/command_response_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_response_impl_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -49,7 +49,7 @@ namespace command_response_impl {
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
-using ::utils::SharedPtr;
+
using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::commands::CommandResponseImpl;
@@ -57,7 +57,8 @@ class CommandResponseImplTest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>();
+ std::shared_ptr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>();
// Current implementation always return `true`
EXPECT_TRUE(command->Init());
EXPECT_TRUE(command->CleanUp());
@@ -66,7 +67,7 @@ TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) {
TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
// Do not have a weight in this case
const bool kSuccess = true;
@@ -78,7 +79,7 @@ TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
// then send message to mobile.
(*msg)[strings::msg_params][strings::result_code] = kResultCode;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
}
@@ -86,7 +87,7 @@ TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageValidResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const bool kSuccess = true;
@@ -94,7 +95,7 @@ TEST_F(CommandResponseImplTest,
mobile_apis::Result::eType::SUCCESS;
const bool kFinalResponse = true;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
// If `msg_params->result_code` does not exist in message
// and arg `result_code` not equals `INVALID_ENUM`,
@@ -108,7 +109,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const bool kSuccess = true;
@@ -122,7 +123,7 @@ TEST_F(CommandResponseImplTest,
// then set it to `msg_params->result_code` and send message to mobile.
(*msg)[strings::params][hmi_response::code] = mobile_apis::Result::SUCCESS;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
@@ -133,7 +134,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const mobile_apis::Result::eType kResultCode =
@@ -147,7 +148,7 @@ TEST_F(CommandResponseImplTest,
// then `msg_params->result_code` will be `SUCCESS`
const bool kSuccess = true;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
@@ -158,7 +159,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_INVALID_ENUM) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const mobile_apis::Result::eType kResultCode =
@@ -172,7 +173,7 @@ TEST_F(CommandResponseImplTest,
// then `msg_params->result_code` will be `INVALID_ENUM`
const bool kSuccess = false;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
diff --git a/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
deleted file mode 100644
index 7f7911a01d..0000000000
--- a/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/activate_app_request.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/command_impl.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_application.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace activate_app_request {
-
-using ::testing::_;
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::MessageSharedPtr;
-using am::commands::ActivateAppRequest;
-using am::commands::CommandImpl;
-
-using ::test::components::application_manager_test::MockApplication;
-
-typedef SharedPtr<MockApplication> MockAppPtr;
-typedef ::utils::SharedPtr<ActivateAppRequest> ActivateAppRequestPtr;
-
-MATCHER_P(CheckMessage, level, "") {
- return level ==
- static_cast<mobile_apis::HMILevel::eType>(
- (*arg)[strings::msg_params][strings::activate_app_hmi_level]
- .asInt());
-}
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kCorrelationId = 2u;
-} // namespace
-
-class ActivateAppRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateMsgParams() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = kAppId;
- msg_params[strings::correlation_id] = kCorrelationId;
- (*msg)[strings::msg_params] = msg_params;
- (*msg)[strings::params][strings::app_id] = kAppId;
- (*msg)[strings::params][strings::correlation_id] = kCorrelationId;
- (*msg)[strings::app_id] = kAppId;
- return msg;
- }
-};
-
-TEST_F(ActivateAppRequestTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- MockAppPtr app = CreateMockApp();
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
-
- ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId));
-
-// TODO(OKozlov) Investigate and fix issue with using log
-#ifdef ENABLE_LOG
- (*msg)[strings::msg_params][strings::activate_app_hmi_level] =
- mobile_apis::HMILevel::HMI_FULL;
-#endif
- ActivateAppRequestPtr command(CreateCommand<ActivateAppRequest>(msg));
-
- EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
-#ifdef ENABLE_LOG
- EXPECT_CALL(app_mngr_,
- SendMessageToHMI(CheckMessage(mobile_apis::HMILevel::HMI_FULL)));
-#else
- EXPECT_CALL(app_mngr_,
- SendMessageToHMI(msg)));
-#endif
- command->Run();
-
-#ifndef ENABLE_LOG
- EXPECT_EQ(CommandImpl::hmi_protocol_type_,
- (*msg)[strings::params][strings::protocol_type].asInt());
- EXPECT_EQ(CommandImpl::protocol_version_,
- (*msg)[strings::params][strings::protocol_version].asInt());
-#endif
-}
-
-} // namespace activate_app_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc
deleted file mode 100644
index 88efc61816..0000000000
--- a/src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace add_statistics_info_notification {
-
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_notification = ::application_manager::hmi_notification;
-using am::commands::MessageSharedPtr;
-using am::commands::AddStatisticsInfoNotification;
-using am::commands::CommandImpl;
-using policy::PolicyHandler;
-using policy_test::MockPolicyHandlerInterface;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-typedef ::utils::SharedPtr<AddStatisticsInfoNotification> NotificationPtr;
-
-namespace {
-const uint32_t kStatisticType = 1u;
-} // namespace
-
-class AddStatisticsInfoNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- protected:
- MockPolicyHandlerInterface policy_handler_;
-};
-
-TEST_F(AddStatisticsInfoNotificationTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::msg_params][am::hmi_notification::statistic_type] =
- kStatisticType;
- NotificationPtr command(CreateCommand<AddStatisticsInfoNotification>(msg));
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler_));
- EXPECT_CALL(policy_handler_, AddStatisticsInfo(kStatisticType));
-
- command->Run();
-}
-
-} // namespace add_statistics_info_notification
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc
deleted file mode 100644
index 60eced4830..0000000000
--- a/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/commands/command_impl.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace allow_all_apps_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::AllowAllAppsResponse;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-typedef ::utils::SharedPtr<AllowAllAppsResponse> ResponsePtr;
-
-namespace {
-const bool kResponseIsAllowed = true;
-} //
-
-class AllowAllAppsResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(AllowAllAppsResponseTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::allowed] = kResponseIsAllowed;
-
- ResponsePtr command(CreateCommand<AllowAllAppsResponse>(msg));
-
- EXPECT_CALL(app_mngr_, SetAllAppsAllowed(kResponseIsAllowed));
-
- command->Run();
-}
-
-} // namespace allow_all_apps_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc
deleted file mode 100644
index 69b4abe39d..0000000000
--- a/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/allow_app_response.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/mock_application.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace allow_app_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::AllowAppResponse;
-using ::testing::_;
-using ::testing::Return;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const bool kIsResponseAllowed = true;
-}
-
-typedef ::utils::SharedPtr<AllowAppResponse> ResponsePtr;
-
-class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(AllowAppResponseTest, Run_AppCreated_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
-
- ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_app_allowed(kIsResponseAllowed));
-
- command->Run();
-}
-
-TEST_F(AllowAppResponseTest, Run_AppNotCreated_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
-
- ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
-
- MockAppPtr mock_app;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
-
- command->Run();
-}
-
-} // namespace allow_app_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc
deleted file mode 100644
index b2a8f0858a..0000000000
--- a/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace button_get_capabilities_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::ButtonGetCapabilitiesResponse;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-typedef ::utils::SharedPtr<ButtonGetCapabilitiesResponse> ResponsePtr;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-class ButtonGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateMsgParams() {
- capabilities_[strings::name] = hmi_apis::Common_ButtonName::OK;
- preset_bank_capabilities_ = true;
-
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::capabilities] = (capabilities_);
- (*msg)[strings::msg_params][hmi_response::preset_bank_capabilities] =
- (preset_bank_capabilities_);
-
- return msg;
- }
-
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
- SmartObject preset_bank_capabilities_;
-};
-
-TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeSuccess_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_preset_bank_capabilities(preset_bank_capabilities_));
-
- command->Run();
-}
-
-TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeAborted_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::ABORTED;
-
- ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities()).Times(0);
- EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_))
- .Times(0);
- EXPECT_CALL(mock_hmi_capabilities_,
- set_preset_bank_capabilities(preset_bank_capabilities_)).Times(0);
-
- command->Run();
-}
-
-} // namespace button_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc
deleted file mode 100644
index b4a6ea272a..0000000000
--- a/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "commands/commands_test.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/close_popup_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace close_popup_response {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-using am::commands::ResponseFromHMI;
-using am::commands::ClosePopupResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-
-class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(ClosePopupResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- ResponseFromHMIPtr command(CreateCommand<ClosePopupResponse>(command_msg));
-
- command->Run();
-}
-
-} // namespace close_popup_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc
deleted file mode 100644
index 7c95a4ca2f..0000000000
--- a/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc
+++ /dev/null
@@ -1,617 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/command_request_test.h"
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-#include "gtest/gtest.h"
-
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-#include "application_manager/commands/hmi/allow_app_request.h"
-#include "application_manager/commands/hmi/allow_app_response.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
-#include "application_manager/commands/hmi/update_device_list_request.h"
-#include "application_manager/commands/hmi/update_device_list_response.h"
-#include "application_manager/commands/hmi/on_update_device_list.h"
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-#include "application_manager/commands/hmi/update_app_list_request.h"
-#include "application_manager/commands/hmi/update_app_list_response.h"
-#include "application_manager/commands/hmi/on_find_applications.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-#include "application_manager/commands/hmi/update_sdl_request.h"
-#include "application_manager/commands/hmi/update_sdl_response.h"
-#include "application_manager/commands/hmi/activate_app_request.h"
-#include "application_manager/commands/hmi/activate_app_response.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/commands/hmi/get_system_info_request.h"
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/commands/hmi/close_popup_request.h"
-#include "application_manager/commands/hmi/close_popup_response.h"
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_add_command_request.h"
-#include "application_manager/commands/hmi/ui_add_command_response.h"
-#include "application_manager/commands/hmi/ui_delete_command_request.h"
-#include "application_manager/commands/hmi/ui_delete_command_response.h"
-#include "application_manager/commands/hmi/ui_add_submenu_request.h"
-#include "application_manager/commands/hmi/ui_add_submenu_response.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/ui_get_language_request.h"
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_change_registration_request.h"
-#include "application_manager/commands/hmi/ui_change_registration_response.h"
-#include "application_manager/commands/hmi/ui_show_request.h"
-#include "application_manager/commands/hmi/ui_show_response.h"
-#include "application_manager/commands/hmi/ui_alert_request.h"
-#include "application_manager/commands/hmi/ui_alert_response.h"
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-#include "application_manager/commands/hmi/ui_slider_request.h"
-#include "application_manager/commands/hmi/ui_slider_response.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-#include "application_manager/commands/hmi/vr_add_command_request.h"
-#include "application_manager/commands/hmi/vr_add_command_response.h"
-#include "application_manager/commands/hmi/vr_delete_command_request.h"
-#include "application_manager/commands/hmi/vr_delete_command_response.h"
-#include "application_manager/commands/hmi/vr_change_registration_request.h"
-#include "application_manager/commands/hmi/vr_change_registration_response.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/vr_get_language_request.h"
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-#include "application_manager/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-#include "application_manager/commands/hmi/tts_change_registration_request.h"
-#include "application_manager/commands/hmi/tts_change_registration_response.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/tts_get_language_request.h"
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
-#include "application_manager/commands/hmi/tts_speak_request.h"
-#include "application_manager/commands/hmi/tts_speak_response.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/commands/hmi/vi_is_ready_response.h"
-#include "application_manager/commands/hmi/vi_read_did_request.h"
-#include "application_manager/commands/hmi/vi_read_did_response.h"
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
-#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
-#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_get_way_points_request.h"
-#include "application_manager/commands/hmi/navi_get_way_points_response.h"
-#include "application_manager/commands/hmi/on_ready_notification.h"
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_stop_stream_response.h"
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-#include "application_manager/commands/hmi/basic_communication_system_response.h"
-#include "application_manager/commands/hmi/sdl_policy_update.h"
-#include "application_manager/commands/hmi/sdl_policy_update_response.h"
-#include "application_manager/commands/hmi/on_received_policy_update.h"
-#include "application_manager/commands/hmi/on_policy_update.h"
-#include "application_manager/commands/hmi/get_urls.h"
-#include "application_manager/commands/hmi/get_urls_response.h"
-#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
-#include "application_manager/commands/hmi/navi_send_location_request.h"
-#include "application_manager/commands/hmi/navi_send_location_response.h"
-#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/dial_number_request.h"
-#include "application_manager/commands/hmi/dial_number_response.h"
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#include "application_manager/commands/hmi/ui_set_icon_request.h"
-
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace am = application_manager;
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace dummy_hmi_commands_test {
-
-namespace commands = ::application_manager::commands;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-using commands::MessageSharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
-using ::test::components::application_manager_test::MockApplicationManager;
-using ::test::components::application_manager_test::
- MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
-
-template <class Command>
-class HMICommandsTest : public components::commands_test::CommandRequestTest<
- CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- stream_retry_.first = 0;
- stream_retry_.second = 0;
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
- ON_CALL(app_mngr_settings_, start_stream_retry_amount())
- .WillByDefault(ReturnRef(stream_retry_));
- }
-
- protected:
- std::pair<uint32_t, int32_t> stream_retry_;
-};
-
-template <class Command>
-class HMICommandsTestFirst : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestSecond : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestThird : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestFourth : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestFifth : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
- * TYPED_TEST_CASE for HMI and mobile commands
- */
-
-typedef Types<commands::OnStartDeviceDiscovery,
- commands::UpdateDeviceListResponse,
- commands::UpdateDeviceListRequest,
- commands::ActivateAppResponse,
- commands::ActivateAppRequest,
- commands::GetSystemInfoResponse,
- commands::GetSystemInfoRequest,
- commands::SDLActivateAppResponse,
- commands::SDLActivateAppRequest,
- commands::SDLPolicyUpdateResponse,
- commands::SDLPolicyUpdate,
- commands::GetUrlsResponse,
- commands::GetUrls,
- commands::OnAppPermissionChangedNotification,
- commands::SDLGetListOfPermissionsResponse,
- commands::SDLGetListOfPermissionsRequest,
- commands::SDLGetUserFriendlyMessageResponse,
- commands::SDLGetUserFriendlyMessageRequest,
- commands::SDLGetStatusUpdateResponse,
- commands::SDLGetStatusUpdateRequest,
- commands::OnStatusUpdateNotification,
- commands::OnAppPermissionConsentNotification,
- commands::MixingAudioSupportedResponse,
- commands::MixingAudioSupportedRequest,
- commands::OnExitAllApplicationsNotification,
- commands::UIAddCommandResponse,
- commands::UIAddCommandRequest,
- commands::UIDeleteCommandResponse,
- commands::UIDeleteCommandRequest,
- commands::UIAddSubmenuResponse,
- commands::UIAddSubmenuRequest,
- commands::UIDeleteSubmenuResponse,
- commands::UIDeleteSubmenuRequest,
- commands::UISetMediaClockTimerResponse,
- commands::UISetMediaClockTimerRequest,
- commands::UIPerformInteractionResponse,
- commands::UIPerformInteractionRequest,
- commands::UISetGlobalPropertiesResponse,
- commands::UISetGlobalPropertiesRequest,
- commands::UIScrollableMessageResponse,
- commands::UIScrollableMessageRequest,
- commands::UISetAppIconResponse,
- commands::UISetAppIconRequest,
- commands::UIGetSupportedLanguagesResponse,
- commands::UIGetSupportedLanguagesRequest,
- commands::UIGetLanguageResponse,
- commands::UIGetLanguageRequest,
- commands::UIGetCapabilitiesResponse,
- commands::UIGetCapabilitiesRequest,
- commands::UIChangeRegistratioResponse> HMICommandsListFirst;
-
-typedef Types<commands::UIChangeRegistrationRequest,
- commands::UIPerformAudioPassThruResponse,
- commands::UIPerformAudioPassThruRequest,
- commands::UIEndAudioPassThruResponse,
- commands::UIEndAudioPassThruRequest,
- commands::UIAlertResponse,
- commands::UIAlertRequest,
- commands::VRIsReadyResponse,
- commands::VRIsReadyRequest,
- commands::VRAddCommandResponse,
- commands::VRAddCommandRequest,
- commands::VRDeleteCommandResponse,
- commands::VRDeleteCommandRequest,
- commands::VRChangeRegistrationResponse,
- commands::VRChangeRegistrationRequest,
- commands::VRGetSupportedLanguagesResponse,
- commands::VRGetSupportedLanguagesRequest,
- commands::VRGetLanguageResponse,
- commands::VRGetLanguageRequest,
- commands::VRGetCapabilitiesResponse,
- commands::VRGetCapabilitiesRequest,
- commands::TTSIsReadyResponse,
- commands::TTSIsReadyRequest,
- commands::TTSChangeRegistratioResponse,
- commands::TTSChangeRegistrationRequest,
- commands::TTSGetSupportedLanguagesResponse,
- commands::TTSGetSupportedLanguagesRequest,
- commands::TTSStopSpeakingResponse,
- commands::TTSStopSpeakingRequest,
- commands::TTSGetLanguageResponse,
- commands::TTSGetLanguageRequest,
- commands::TTSSpeakResponse,
- commands::TTSSpeakRequest,
- commands::TTSSetGlobalPropertiesResponse,
- commands::TTSSetGlobalPropertiesRequest,
- commands::TTSGetCapabilitiesResponse,
- commands::TTSGetCapabilitiesRequest,
- commands::OnTTSStartedNotification,
- commands::OnTTSStoppedNotification,
- commands::OnAppActivatedNotification,
- commands::OnExitApplicationNotification,
- commands::UIShowResponse,
- commands::UIShowRequest,
- commands::UISliderResponse,
- commands::UISliderRequest,
- commands::ClosePopupResponse,
- commands::ClosePopupRequest,
- commands::UIIsReadyResponse,
- commands::UIIsReadyRequest,
- commands::VIIsReadyResponse> HMICommandsListSecond;
-
-typedef Types<commands::VIIsReadyRequest,
- commands::VIReadDIDResponse,
- commands::VIReadDIDRequest,
- commands::VIGetVehicleDataResponse,
- commands::VIGetVehicleDataRequest,
- commands::VIGetDTCsResponse,
- commands::VIGetDTCsRequest,
- commands::VIDiagnosticMessageResponse,
- commands::VIDiagnosticMessageRequest,
- commands::VIGetVehicleTypeResponse,
- commands::VIGetVehicleTypeRequest,
- commands::NaviIsReadyResponse,
- commands::NaviIsReadyRequest,
- commands::NaviAlertManeuverResponse,
- commands::NaviAlertManeuverRequest,
- commands::NaviGetWayPointsResponse,
- commands::NaviGetWayPointsRequest,
- commands::NaviUpdateTurnListResponse,
- commands::NaviUpdateTurnListRequest,
- commands::NaviShowConstantTBTResponse,
- commands::NaviShowConstantTBTRequest,
- commands::NaviSubscribeWayPointsResponse,
- commands::NaviSubscribeWayPointsRequest,
- commands::NaviUnsubscribeWayPointsResponse,
- commands::NaviUnSubscribeWayPointsRequest,
- commands::ButtonGetCapabilitiesResponse,
- commands::ButtonGetCapabilitiesRequest,
- commands::OnAllowSDLFunctionalityNotification,
- commands::OnSDLConsentNeededNotification,
- commands::UpdateSDLResponse,
- commands::UpdateSDLRequest,
- commands::OnIgnitionCycleOverNotification,
- commands::OnSystemInfoChangedNotification,
- commands::OnReadyNotification,
- commands::OnDeviceChosenNotification,
- commands::OnSystemContextNotification,
- commands::hmi::OnDriverDistractionNotification,
- commands::OnUpdateDeviceList,
- commands::OnAppRegisteredNotification,
- commands::OnAppUnregisteredNotification,
- commands::OnFindApplications,
- commands::UpdateAppListResponse,
- commands::UpdateAppListRequest,
- commands::OnVRStartedNotification,
- commands::OnVRStoppedNotification,
- commands::OnVRCommandNotification,
- commands::OnUICommandNotification,
- commands::OnAppDeactivatedNotification> HMICommandsListThird;
-
-typedef Types<commands::hmi::OnButtonEventNotification,
- commands::hmi::OnButtonPressNotification,
- commands::hmi::OnButtonSubscriptionNotification,
- commands::VISubscribeVehicleDataResponse,
- commands::VISubscribeVehicleDataRequest,
- commands::VIUnsubscribeVehicleDataResponse,
- commands::VIUnsubscribeVehicleDataRequest,
- commands::OnVIVehicleDataNotification,
- commands::OnNaviTBTClientStateNotification,
- commands::hmi::OnUIKeyBoardInputNotification,
- commands::hmi::OnUITouchEventNotification,
- commands::hmi::OnUIResetTimeoutNotification,
- commands::NaviStartStreamResponse,
- commands::NaviStartStreamRequest,
- commands::NaviStopStreamResponse,
- commands::NaviStopStreamRequest,
- commands::AudioStartStreamResponse,
- commands::AudioStartStreamRequest,
- commands::AudioStopStreamResponse,
- commands::AudioStopStreamRequest,
- commands::OnAudioDataStreamingNotification,
- commands::OnVideoDataStreamingNotification,
- commands::VRPerformInteractionResponse,
- commands::VRPerformInteractionRequest,
- commands::OnSystemRequestNotification,
- commands::OnPutFileNotification,
- commands::OnResumeAudioSourceNotification,
- commands::UiSetDisplayLayoutResponse,
- commands::UiSetDisplayLayoutRequest,
- commands::OnSDLCloseNotification,
- commands::OnSDLPersistenceCompleteNotification,
- commands::OnFileRemovedNotification,
- commands::OnRecordStartdNotification,
- commands::BasicCommunicationSystemResponse,
- commands::BasicCommunicationSystemRequest,
- commands::NaviSendLocationResponse,
- commands::NaviSendLocationRequest,
- commands::AddStatisticsInfoNotification,
- commands::OnSystemErrorNotification,
- commands::OnReceivedPolicyUpdate,
- commands::OnPolicyUpdate,
- commands::OnDeviceStateChangedNotification,
- commands::hmi::OnTTSResetTimeoutNotification,
- commands::hmi::DialNumberResponse,
- commands::hmi::DialNumberRequest,
- commands::OnEventChangedNotification,
- commands::OnNaviWayPointChangeNotification,
- commands::OnUILanguageChangeNotification,
- commands::OnVRLanguageChangeNotification,
- commands::OnTTSLanguageChangeNotification> HMICommandsListFourth;
-
-typedef Types<commands::OnVIGpsDataNotification,
- commands::OnVISpeedNotification,
- commands::OnVIRpmNotification,
- commands::OnVIFuelLevelNotification,
- commands::OnVIFuelLevelStateNotification,
- commands::OnVIInstantFuelConsumptionNotification,
- commands::OnVIExternalTemperatureNotification,
- commands::OnVIVinNotification,
- commands::OnVIPrndlNotification,
- commands::OnVITirePressureNotification,
- commands::OnVIOdometerNotification,
- commands::OnVIBeltStatusNotification,
- commands::OnVIBodyInformationNotification,
- commands::OnVIDeviceStatusNotification,
- commands::OnVIDriverBrakingNotification,
- commands::OnVIWiperStatusNotification,
- commands::OnVIHeadLampStatusNotification,
- commands::OnVIEngineTorqueNotification,
- commands::OnVIAccPedalPositionNotification,
- commands::OnVISteeringWheelAngleNotification,
- commands::OnVIMyKeyNotification,
- commands::AllowAllAppsRequest,
- commands::AllowAllAppsResponse,
- commands::AllowAppRequest,
- commands::AllowAppResponse> HMICommandsListFifth;
-
-TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
-TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
-TYPED_TEST_CASE(HMICommandsTestThird, HMICommandsListThird);
-TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth);
-TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
-
-TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-} // namespace dummy_hmi_commands_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc
deleted file mode 100644
index e8c88256c3..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/commands/hmi/get_system_info_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_system_info_request {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::RequestToHMI;
-using am::commands::GetSystemInfoRequest;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 1u;
-} // namespace
-
-class GetSystemInfoRequestTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(GetSystemInfoRequestTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
-
- RequestToHMIPtr command(CreateCommand<GetSystemInfoRequest>(command_msg));
-
- const uint32_t kAppId = command->application_id();
-
- EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::msg_params][strings::app_id].asUInt(),
- kAppId);
- EXPECT_EQ((*command_msg)[strings::params][strings::correlation_id].asUInt(),
- kCorrelationId);
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace get_system_info_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc
deleted file mode 100644
index 980b6e0e9d..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_system_info_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::ResponseFromHMI;
-using am::commands::GetSystemInfoResponse;
-using am::commands::CommandImpl;
-using am::commands::SystemInfo;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string ccpu_version("4.1.3.B_EB355B");
-const std::string wers_country_code("WAEGB");
-const uint32_t lang_code = 0u;
-const std::string kLanguage = "";
-} // namespace
-
-class GetSystemInfoResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::msg_params]["ccpu_version"] = ccpu_version;
- (*command_msg)[strings::msg_params]["wersCountryCode"] = wers_country_code;
- (*command_msg)[strings::msg_params]["language"] = lang_code;
-
- return command_msg;
- }
-
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(GetSystemInfoResponseTest, GetSystemInfo_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
- policy_test::MockPolicyHandlerInterface policy_handler;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- std::string language;
- EXPECT_CALL(mock_message_helper_,
- CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code)))
- .WillOnce(Return(language));
- EXPECT_EQ(kLanguage, language);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler,
- OnGetSystemInfo(ccpu_version, wers_country_code, kLanguage));
-
- command->Run();
-}
-
-TEST_F(GetSystemInfoResponseTest, GetSystemInfo_UNSUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::WRONG_LANGUAGE;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
- policy_test::MockPolicyHandlerInterface policy_handler;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities()).Times(0);
-
- EXPECT_CALL(mock_message_helper_,
- CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code)))
- .Times(0);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler, OnGetSystemInfo("", "", ""));
-
- command->Run();
-}
-
-} // namespace get_system_info_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/test/commands/hmi/get_urls_response_test.cc
deleted file mode 100644
index 5a41cae7ce..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_urls_response_test.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_to_hmi.h"
-#include "application_manager/commands/hmi/get_urls_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_urls_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::ResponseToHMI;
-using am::commands::GetUrlsResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<ResponseToHMI> ResponseToHMIPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class GetUrlResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(GetUrlResponseTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- ResponseToHMIPtr command(CreateCommand<GetUrlsResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace get_urls_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/test/commands/hmi/get_urls_test.cc
deleted file mode 100644
index 9430dc045c..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_urls_test.cc
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/message.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/commands/hmi/get_urls.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "hmi/request_from_hmi.h"
-#include "policy/mock_policy_manager.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_urls {
-
-using namespace hmi_apis;
-using namespace policy;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-using ::testing::SetArgReferee;
-using ::test::components::application_manager_test::MockApplication;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::RequestFromHMI;
-using am::commands::GetUrls;
-using am::commands::CommandImpl;
-using policy::PolicyHandler;
-using policy_test::MockPolicyHandlerInterface;
-
-typedef SharedPtr<RequestFromHMI> RequestFromHMIPtr;
-
-namespace {
-const uint32_t kInvalidAppId_ = 0u;
-const uint32_t kAppIdForSending = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kServiceType = 0u;
-const std::string kInitialService = "0x0";
-const std::string kPolicyService = "7";
-const std::string kDefaultUrl = "URL is not found";
-const std::string kDefaultId = "default";
-const std::string kPolicyAppId = "policy_app_id";
-} // namespace
-
-class GetUrlsTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- policy_test::MockPolicyHandlerInterface mock_policy_handler_;
- MessageSharedPtr command_msg_;
- RequestFromHMIPtr request_command_;
-
- GetUrlsTest() {
- command_msg_ =
- CreateMessage(NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
- (*command_msg_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kInitialService;
-
- request_command_ = CreateCommand<GetUrls>(command_msg_);
-
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
- }
-};
-
-TEST_F(GetUrlsTest, RUN_SUCCESS) {
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- request_command_->Run();
-}
-
-TEST_F(GetUrlsTest, RUN_PolicyNotEnabled_UNSUCCESS) {
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(false));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-
-TEST_F(GetUrlsTest, RUN_EmptyEndpoints_UNSUCCESS) {
- EndpointUrls endpoints_;
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-
-#ifdef EXTENDED_POLICY
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- MockAppPtr mock_app = CreateMockApp();
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kAppIdForSending));
-
- EXPECT_CALL(app_mngr_, application(kAppIdForSending))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppIdForSending));
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::SUCCESS,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-
- EXPECT_EQ(kAppIdForSending,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [strings::app_id].asInt());
- EXPECT_EQ(kDefaultUrl,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [strings::url].asString());
-}
-
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kInvalidAppId_));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, application(kInvalidAppId_)).Times(0);
-
- request_command_->Run();
-}
-
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_ApplicationIsNotValid_UNSUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- MockAppPtr invalid_mock_app;
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kAppIdForSending));
-
- EXPECT_CALL(app_mngr_, application(kAppIdForSending))
- .WillOnce(Return(invalid_mock_app));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_FoundURLForApplication_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- data.app_id = kPolicyAppId;
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- MockAppPtr mock_app = CreateMockApp();
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kAppIdForSending));
-
- EXPECT_CALL(app_mngr_, application(kAppIdForSending))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(kPolicyAppId));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::SUCCESS,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-#endif
-
-TEST_F(GetUrlsTest, DISABLED_ProcessServiceURLs_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
- kDefaultUrl;
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::hmi_response::policy_app_id] = "1";
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- data.app_id = "1";
- endpoints_.push_back(data);
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
- EXPECT_EQ(kDefaultUrl,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::strings::url].asString());
- EXPECT_EQ(endpoints_[0].app_id,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::hmi_response::policy_app_id].asString());
-}
-
-TEST_F(GetUrlsTest, ProcessServiceURLs_PolicyDefaultId_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
- kDefaultUrl;
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::hmi_response::policy_app_id] = kDefaultId;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(_))
- .WillOnce(Return(mock_app));
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
- EXPECT_TRUE(
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- .keyExists(am::hmi_response::policy_app_id));
-}
-
-} // namespace get_urls
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
deleted file mode 100644
index ffedf1b4f6..0000000000
--- a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
+++ /dev/null
@@ -1,1980 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
-
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-#include "application_manager/commands/hmi/on_ready_notification.h"
-#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/commands/hmi/on_policy_update.h"
-#include "application_manager/commands/hmi/on_received_policy_update.h"
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-
-#include "utils/lock.h"
-#include "utils/data_accessor.h"
-#include "utils/signals.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_state_controller.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/hmi_capabilities_impl.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "transport_manager/mock_transport_manager.h"
-#include "connection_handler/mock_connection_handler.h"
-#include "connection_handler/mock_connection_handler_settings.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "protocol_handler/mock_session_observer.h"
-#include "application_manager/mock_resume_ctrl.h"
-
-#ifdef SDL_REMOTE_CONTROL
-#include "functional_module/plugin_manager.h"
-#endif // SDL_REMOTE_CONTROL
-
-namespace am = application_manager;
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace hmi_notifications_test {
-
-using ::testing::_;
-using ::testing::Test;
-using ::testing::Types;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::testing::InSequence;
-using ::utils::SharedPtr;
-using ::smart_objects::SmartObject;
-using ::application_manager::commands::MessageSharedPtr;
-using ::test::components::application_manager_test::MockApplicationManager;
-using ::test::components::application_manager_test::
- MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
-using ::test::components::event_engine_test::MockEventDispatcher;
-using ::application_manager::MockMessageHelper;
-
-using namespace am::commands;
-
-typedef SharedPtr<MockApplication> MockAppPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-#define MEDIA true
-#define NOT_MEDIA false
-#define VC true
-#define NOT_VC false
-#define NAVI true
-#define NOT_NAVI false
-
-ACTION_P(GetEventId, event_id) {
- *event_id = arg0.id();
-}
-ACTION_P(GetArg, arg) {
- *arg = arg0;
-}
-
-ACTION_P(GetArg3, result) {
- arg3 = *result;
-}
-
-ACTION_P2(GetConnectIdPermissionConsent, connect_id, consent) {
- *connect_id = arg0;
- std::vector<policy::FunctionalGroupPermission>::const_iterator it =
- arg1.group_permissions.begin();
- for (; it != arg1.group_permissions.end(); ++it) {
- consent->group_permissions.push_back(*it);
- }
- consent->consent_source = arg1.consent_source;
-}
-ACTION_P2(GetBoolValueAndString, value, str) {
- *value = arg0;
- *str = arg1;
-}
-ACTION_P(GetMessage, message) {
- (*message)[am::strings::params][am::strings::function_id] =
- (*arg0)[am::strings::params][am::strings::function_id].asInt();
- (*message)[am::strings::params][am::strings::message_type] =
- (*arg0)[am::strings::params][am::strings::message_type].asInt();
- (*message)[am::strings::params][am::strings::correlation_id] =
- (*arg0)[am::strings::params][am::strings::correlation_id].asInt();
- (*message)[am::strings::params][am::strings::connection_key] =
- (*arg0)[am::strings::params][am::strings::connection_key].asInt();
- return (*message)[am::strings::params][am::strings::correlation_id].asInt();
-}
-
-namespace {
-const uint32_t kCountCommandsManageMobile_ = 22u;
-const uint32_t kCountCommandsToHmi_ = 12u;
-const int32_t kHmiProtocolType_ = 1;
-const int32_t kMobileProtocolType_ = 0;
-const int32_t kProtocolVersion_ = 3;
-const uint32_t kCorrelationId_ = 1939u;
-const uint32_t kAppId_ = 2014u;
-} // namespace
-
-class HMICommandsNotificationsTest
- : public components::commands_test::CommandsTest<
- CommandsTestMocks::kIsNice> {
- public:
- HMICommandsNotificationsTest()
- : applications_(application_set_, applications_lock_), app_ptr_(NULL) {}
-
- ~HMICommandsNotificationsTest() {
- // Fix DataAccessor release and WinQt crash
- Mock::VerifyAndClearExpectations(&app_mngr_);
- }
- typedef Command CommandType;
-
- protected:
- am::ApplicationSet application_set_;
- sync_primitives::Lock applications_lock_;
- DataAccessor<am::ApplicationSet> applications_;
- MockHMICapabilities mock_hmi_capabilities_;
-
- NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
- NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
-
- application_manager_test::MockStateController mock_state_controller_;
-
- am::ApplicationSharedPtr app_;
- NiceMock<MockApplication>* app_ptr_;
-
- typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
- kMocksAreNice>::Result MockConnectionHandler;
-
- typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
- kMocksAreNice>::Result MockSessionObserver;
-
- MockConnectionHandler mock_connection_handler_;
- MockSessionObserver mock_session_observer_;
-
- void InitCommand(const uint32_t& default_timeout) OVERRIDE {
- app_ = ConfigureApp(&app_ptr_, kAppId_, NOT_MEDIA, NOT_NAVI, NOT_VC);
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(default_timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(mock_event_dispatcher_));
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(policy_interface_));
- ON_CALL(app_mngr_, application_by_hmi_app(_)).WillByDefault(Return(app_));
- ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_));
- }
-
- am::ApplicationSharedPtr ConfigureApp(NiceMock<MockApplication>** app_mock,
- uint32_t app_id,
- bool media,
- bool navi,
- bool vc) {
- *app_mock = new NiceMock<MockApplication>;
-
- Mock::AllowLeak(*app_mock); // WorkAround for gogletest bug
- am::ApplicationSharedPtr app(*app_mock);
-
- ON_CALL(**app_mock, app_id()).WillByDefault(Return(app_id));
- ON_CALL(**app_mock, is_media_application()).WillByDefault(Return(media));
- ON_CALL(**app_mock, is_navi()).WillByDefault(Return(navi));
- ON_CALL(**app_mock, is_voice_communication_supported())
- .WillByDefault(Return(vc));
- ON_CALL(**app_mock, IsAudioApplication())
- .WillByDefault(Return(media || navi || vc));
- return app;
- }
-#if defined(OS_POSIX)
- void SubscribeForSignal() {
- sigset_t signal_set;
- sigemptyset(&signal_set);
- sigaddset(&signal_set, SIGINT);
- sigaddset(&signal_set, SIGTERM);
- pthread_sigmask(SIG_BLOCK, &signal_set, NULL);
- }
-#endif
-};
-
-namespace {
-void sig_handler(int sig) {
- switch (sig) {
- case SIGINT:
- break;
- case SIGTERM:
- break;
- case SIGSEGV:
- abort();
- default:
- exit(EXIT_FAILURE);
- }
-}
-} // namespace
-
-template <class Command>
-class HMIOnViNotifications : public commands_test::CommandsTest<kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-template <class Command>
-class HMIOnNotificationsListToHMI
- : public commands_test::CommandsTest<kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-template <class CommandT, hmi_apis::FunctionID::eType kCommandId>
-struct CommandPair {
- typedef CommandT CommandType;
- enum { kHMICommandId = kCommandId };
-};
-
-template <class Command>
-class HMIOnNotificationsEventDispatcher
- : public commands_test::CommandsTest<kIsNice> {
- public:
- typedef Command CommandType;
- NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
-};
-
-typedef Types<OnVIAccPedalPositionNotification,
- OnVIBeltStatusNotification,
- OnVIBodyInformationNotification,
- OnVIDeviceStatusNotification,
- OnVIDriverBrakingNotification,
- OnVIEngineTorqueNotification,
- OnVIExternalTemperatureNotification,
- OnVIFuelLevelNotification,
- OnVIFuelLevelStateNotification,
- OnVIGpsDataNotification,
- OnVIHeadLampStatusNotification,
- OnVIInstantFuelConsumptionNotification,
- OnVIMyKeyNotification,
- OnVIOdometerNotification,
- OnVIPrndlNotification,
- OnVIRpmNotification,
- OnVISpeedNotification,
- OnVISteeringWheelAngleNotification,
- OnVITirePressureNotification,
- OnVIVehicleDataNotification,
- OnVIVinNotification,
- OnVIWiperStatusNotification> HMIOnViNotificationsTypes;
-
-typedef Types<OnAppPermissionChangedNotification,
- OnAudioDataStreamingNotification,
- hmi::OnButtonSubscriptionNotification,
- OnFileRemovedNotification,
- OnPutFileNotification,
- OnResumeAudioSourceNotification,
- OnSDLCloseNotification,
- OnSDLConsentNeededNotification,
- OnSDLPersistenceCompleteNotification,
- OnStatusUpdateNotification,
- OnVideoDataStreamingNotification,
- OnRecordStartdNotification> HMIOnNotificationsListToHMITypes;
-
-typedef Types<
- CommandPair<OnAppActivatedNotification,
- hmi_apis::FunctionID::BasicCommunication_OnAppActivated>,
- CommandPair<OnAppDeactivatedNotification,
- hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated>,
- CommandPair<OnEventChangedNotification,
- hmi_apis::FunctionID::BasicCommunication_OnEventChanged>,
- CommandPair<hmi::OnTTSResetTimeoutNotification,
- hmi_apis::FunctionID::TTS_OnResetTimeout>,
- CommandPair<OnTTSStartedNotification, hmi_apis::FunctionID::TTS_Started>,
- CommandPair<OnTTSStoppedNotification, hmi_apis::FunctionID::TTS_Stopped>,
- CommandPair<hmi::OnUIResetTimeoutNotification,
- hmi_apis::FunctionID::UI_OnResetTimeout>,
- CommandPair<OnVRStartedNotification, hmi_apis::FunctionID::VR_Started>,
- CommandPair<OnVRStoppedNotification, hmi_apis::FunctionID::VR_Stopped> >
- HMIOnNotificationsEventDispatcherTypes;
-
-TYPED_TEST_CASE(HMIOnViNotifications, HMIOnViNotificationsTypes);
-TYPED_TEST_CASE(HMIOnNotificationsListToHMI, HMIOnNotificationsListToHMITypes);
-TYPED_TEST_CASE(HMIOnNotificationsEventDispatcher,
- HMIOnNotificationsEventDispatcherTypes);
-
-TYPED_TEST(HMIOnViNotifications, CommandsSendNotificationToMobile) {
- MessageSharedPtr message =
- commands_test::CommandsTest<kIsNice>::CreateMessage();
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>(message);
- EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TYPED_TEST(HMIOnNotificationsListToHMI, CommandsSendNotificationToHmi) {
- MessageSharedPtr message =
- commands_test::CommandsTest<kIsNice>::CreateMessage();
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>(message);
- EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
- SendMessageToHMI(_));
- command->Run();
- EXPECT_EQ(
- static_cast<int32_t>(kHmiProtocolType_),
- (*message)[am::strings::params][am::strings::protocol_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kProtocolVersion_),
- (*message)[am::strings::params][am::strings::protocol_version].asInt());
-}
-
-TYPED_TEST(HMIOnNotificationsEventDispatcher,
- CommandsNotificationEventDispatcher) {
- int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr message =
- commands_test::CommandsTest<kIsNice>::CreateMessage();
- utils::SharedPtr<typename TestFixture::CommandType::CommandType> command =
- this->template CreateCommand<
- typename TestFixture::CommandType::CommandType>(message);
- EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
- event_dispatcher())
- .WillOnce(ReturnRef(this->mock_event_dispatcher_));
- EXPECT_CALL(this->mock_event_dispatcher_, raise_event(_))
- .WillOnce(GetEventId(&event_id));
- command->Run();
- EXPECT_EQ(TestFixture::CommandType::kHMICommandId, event_id);
-}
-
-// notifications(SendNotificationToMobile)
-TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<hmi::OnButtonEventNotification>(message);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnNaviTBTClientStateNotification>(message);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnNaviWayPointChangeSendNotificationToMobile) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnNaviWayPointChangeNotification>(message);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnUICommandNotification>(message);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU),
- (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnUIKeyBoardInputSendNotificationToMobile) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<hmi::OnUIKeyBoardInputNotification>(message);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnKeyboardInputID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnUITouchEventSendNotificationToMobile) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<hmi::OnUITouchEventNotification>(message);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTouchEventID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAppRegisteredNotificationSendNotificationToHmi) {
- int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnAppRegisteredNotification>(message);
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(_));
- EXPECT_CALL(app_mngr_, event_dispatcher());
- EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
- .WillOnce(GetEventId(&event_id));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
- event_id);
- EXPECT_EQ(
- kHmiProtocolType_,
- (*message)[am::strings::params][am::strings::protocol_type].asInt());
- EXPECT_EQ(
- kProtocolVersion_,
- (*message)[am::strings::params][am::strings::protocol_version].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAppUnregisteredNotificationEventDispatcher) {
- int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnAppUnregisteredNotification>(message);
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(_));
- EXPECT_CALL(app_mngr_, event_dispatcher());
- EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
- .WillOnce(GetEventId(&event_id));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(
- hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered),
- event_id);
- EXPECT_EQ(
- kHmiProtocolType_,
- (*message)[am::strings::params][am::strings::protocol_type].asInt());
- EXPECT_EQ(
- kProtocolVersion_,
- (*message)[am::strings::params][am::strings::protocol_version].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) {
- int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<hmi::OnButtonPressNotification>(message);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_, event_dispatcher());
- EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
- .WillOnce(GetEventId(&event_id));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(hmi_apis::FunctionID::Buttons_OnButtonPress),
- event_id);
- EXPECT_EQ(static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) {
- int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnReadyNotification>(message);
-
- EXPECT_CALL(app_mngr_, OnHMIStartedCooperation());
- EXPECT_CALL(app_mngr_, event_dispatcher());
- EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
- .WillOnce(GetEventId(&event_id));
- command->Run();
- EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_OnReady, event_id);
-}
-
-// policy handler
-TEST_F(HMICommandsNotificationsTest,
- OnIgnitionCycleOverNotificationPolicyHandler) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnIgnitionCycleOverNotification>(message);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, OnIgnitionCycleOver());
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest, OnPolicyUpdateNotificationPolicyHandler) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command = CreateCommand<OnPolicyUpdate>(message);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, OnPTExchangeNeeded());
- command->Run();
-}
-
-#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
-TEST_F(HMICommandsNotificationsTest,
- OnReceivePolicyUpdateNotification_SUCCESS) {
- const std::string kFile = "./test_file.txt";
- EXPECT_TRUE(file_system::CreateFile(kFile));
- uint8_t tmp[] = {1u, 2u, 3u, 4u};
- std::vector<uint8_t> data(tmp, tmp + 4);
- EXPECT_TRUE(file_system::WriteBinaryFile(kFile, data));
-
- MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
- (*message)[am::strings::msg_params][am::hmi_notification::policyfile] = kFile;
- utils::SharedPtr<Command> command =
- CreateCommand<OnReceivedPolicyUpdate>(message);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, ReceiveMessageFromSDK(kFile, data));
- command->Run();
- EXPECT_TRUE(file_system::DeleteFile(kFile));
-}
-#endif
-
-TEST_F(HMICommandsNotificationsTest,
- OnReceivePolicyUpdateNotification_UNSUCCESS) {
- MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
- utils::SharedPtr<Command> command =
- CreateCommand<OnReceivedPolicyUpdate>(message);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
- EXPECT_CALL(policy_interface_, ReceiveMessageFromSDK(_, _)).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAppPermissionConsentNotificationPolicyHandlerNoAppId) {
- MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
- (*message)[am::strings::msg_params]["consentedFunctions"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- SmartObject& applications =
- (*message)[am::strings::msg_params]["consentedFunctions"];
-
- smart_objects::SmartObject hmi_application_temp(smart_objects::SmartType_Map);
- applications[0] = hmi_application_temp;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnAppPermissionConsentNotification>(message);
-
- int32_t connection_id = -1;
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
-#ifdef EXTERNAL_PROPRIETARY_MODE
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
-#else
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
-#endif
- .WillOnce(GetArg(&connection_id));
- command->Run();
- EXPECT_EQ(0, connection_id);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAppPermissionConsentNotificationPolicyHandlerWithAppId) {
- MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- (*message)[am::strings::msg_params]["consentedFunctions"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- smart_objects::SmartObjectSPtr consented_function =
- utils::MakeShared<smart_objects::SmartObject>();
- (*message)[am::strings::msg_params]["consentedFunctions"][0] =
- *consented_function;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnAppPermissionConsentNotification>(message);
-
- int32_t connection_id = -1;
- policy::PermissionConsent permission_consent;
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
-#ifdef EXTERNAL_PROPRIETARY_MODE
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
-#else
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
-#endif
- .WillOnce(
- GetConnectIdPermissionConsent(&connection_id, &permission_consent));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
- std::vector<policy::FunctionalGroupPermission>::const_iterator it =
- permission_consent.group_permissions.begin();
- for (; it != permission_consent.group_permissions.end(); ++it) {
- EXPECT_EQ(policy::kGroupUndefined, (*it).state);
- }
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowTrue) {
- MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
- (*message)[am::strings::msg_params]["consentedFunctions"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- (*message)[am::strings::msg_params]["source"] = "test_content_source";
-
- smart_objects::SmartObjectSPtr consented_function =
- utils::MakeShared<smart_objects::SmartObject>();
- (*consented_function)["allowed"] = true;
- (*consented_function)[am::strings::id] = 999;
- (*consented_function)[am::strings::name] = "test_group_alias";
- (*message)[am::strings::msg_params]["consentedFunctions"][0] =
- *consented_function;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnAppPermissionConsentNotification>(message);
-
- int32_t connection_id = -1;
- policy::PermissionConsent permission_consent;
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
-#ifdef EXTERNAL_PROPRIETARY_MODE
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
-#else
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
-#endif
- .WillOnce(
- GetConnectIdPermissionConsent(&connection_id, &permission_consent));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
-
- std::vector<policy::FunctionalGroupPermission>::const_iterator it =
- permission_consent.group_permissions.begin();
- for (; it != permission_consent.group_permissions.end(); ++it) {
- EXPECT_EQ(999, (*it).group_id);
- EXPECT_EQ("test_group_alias", (*it).group_alias);
- EXPECT_EQ(policy::kGroupAllowed, (*it).state);
- }
- EXPECT_EQ("test_content_source", permission_consent.consent_source);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowFalse) {
- MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
- (*message)[am::strings::msg_params]["consentedFunctions"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- (*message)[am::strings::msg_params]["source"] = "test_content_source";
-
- smart_objects::SmartObjectSPtr consented_function =
- utils::MakeShared<smart_objects::SmartObject>();
- (*consented_function)["allowed"] = false;
- (*consented_function)[am::strings::id] = 999;
- (*consented_function)[am::strings::name] = "test_group_alias";
- (*message)[am::strings::msg_params]["consentedFunctions"][0] =
- *consented_function;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnAppPermissionConsentNotification>(message);
-
- int32_t connection_id = -1;
- policy::PermissionConsent permission_consent;
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
-#ifdef EXTERNAL_PROPRIETARY_MODE
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
-#else
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
-#endif
- .WillOnce(
- GetConnectIdPermissionConsent(&connection_id, &permission_consent));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
-
- std::vector<policy::FunctionalGroupPermission>::const_iterator it =
- permission_consent.group_permissions.begin();
- for (; it != permission_consent.group_permissions.end(); ++it) {
- EXPECT_EQ(999, (*it).group_id);
- EXPECT_EQ("test_group_alias", (*it).group_alias);
- EXPECT_EQ(policy::kGroupDisallowed, (*it).state);
- }
- EXPECT_EQ("test_content_source", permission_consent.consent_source);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemErrorNotificationOnSystemErrorCode) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_notification::error] =
- hmi_apis::Common_SystemError::SYNC_REBOOTED;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemErrorNotification>(message);
-
- int32_t code = hmi_apis::Common_SystemError::INVALID_ENUM;
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, OnSystemError(_)).WillOnce(GetArg(&code));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(hmi_apis::Common_SystemError::SYNC_REBOOTED),
- code);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemInfoChangedNotificationCheckLanguage) {
- const uint32_t kLangCode = 5u;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] = kLangCode;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemInfoChangedNotification>(message);
-
- EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_));
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, OnSystemInfoChanged(_));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAllowSDLFunctionalityNotificationDeviceKeyNotExist) {
- const std::string kDeviceId = "";
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
- utils::SharedPtr<Command> command =
- CreateCommand<OnAllowSDLFunctionalityNotification>(message);
-
- bool value = false;
- std::string str;
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, OnAllowSDLFunctionalityNotification(_, _))
- .WillOnce(GetBoolValueAndString(&value, &str));
- command->Run();
- EXPECT_EQ(true, value);
- EXPECT_EQ(kDeviceId, str);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnAllowSDLFunctionalityNotificationDeviceKeyExist) {
- const std::string kDeviceId = "device_id";
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
- (*message)[am::strings::msg_params]["device"]["id"] = kDeviceId;
- utils::SharedPtr<Command> command =
- CreateCommand<OnAllowSDLFunctionalityNotification>(message);
-
- bool value;
- std::string str;
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, OnAllowSDLFunctionalityNotification(_, _))
- .WillOnce(GetBoolValueAndString(&value, &str));
- command->Run();
- EXPECT_EQ(true, value);
- EXPECT_EQ(kDeviceId, str);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnDeviceStateChangedNotificationDeviceStateNotUnpaired) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params]["deviceState"] =
- hmi_apis::Common_DeviceState::INVALID_ENUM;
- utils::SharedPtr<Command> command =
- CreateCommand<OnDeviceStateChangedNotification>(message);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
- EXPECT_CALL(policy_interface_, RemoveDevice(_)).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnDeviceStateChangedNotificationDeviceStateUnpaired) {
- // Random MAC adress for test. It must contain 12 symbols.
- const std::string device_id = "AA15F2204D6B";
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params]["deviceState"] =
- hmi_apis::Common_DeviceState::UNPAIRED;
- (*message)[am::strings::msg_params]["deviceInternalId"] = device_id;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnDeviceStateChangedNotification>(message);
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, RemoveDevice(_));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnDeviceStateChangedNotificationDeviceStateEmptyDeviceId) {
- const std::string empty_device_id = "";
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params]["deviceState"] =
- hmi_apis::Common_DeviceState::UNPAIRED;
- (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnDeviceStateChangedNotification>(message);
-
- std::string device_id = "default_id";
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, RemoveDevice(_)).WillOnce(GetArg(&device_id));
- command->Run();
- EXPECT_EQ(empty_device_id, device_id);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnDeviceStateChangedNotificationDeviceStateDeviceIdFromId) {
- const std::string empty_device_id = "";
- const std::string id = "id_string";
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params]["deviceState"] =
- hmi_apis::Common_DeviceState::UNPAIRED;
- (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
- (*message)[am::strings::msg_params]["deviceId"]["id"] = id;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnDeviceStateChangedNotification>(message);
-
- std::string device_id = "default_id";
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, RemoveDevice(_)).WillOnce(GetArg(&device_id));
- command->Run();
- EXPECT_EQ(id, device_id);
-}
-
-//~policy_handler
-TEST_F(HMICommandsNotificationsTest,
- OnExitAllApplicationsNotificationReasonIgnitionOff) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_request::reason] =
- hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitAllApplicationsNotification>(message);
-#if defined(OS_POSIX)
- am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason;
-
- EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_))
- .WillOnce(GetArg(&mob_reason));
- EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
-
- SubscribeForSignal();
- command->Run();
- utils::WaitTerminationSignals(sig_handler);
-
- EXPECT_EQ(am::mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF,
- mob_reason);
-#endif
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnExitAllApplicationsNotificationReasonMasterResetAndFactoryDefaults) {
- MessageSharedPtr message = CreateMessage();
-
- std::vector<hmi_apis::Common_ApplicationsCloseReason::eType> reason_list;
- reason_list.push_back(hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET);
- reason_list.push_back(
- hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS);
-
- std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
- mob_reason_list;
- mob_reason_list.push_back(
- mobile_apis::AppInterfaceUnregisteredReason::MASTER_RESET);
- mob_reason_list.push_back(
- mobile_apis::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS);
-
- std::vector<hmi_apis::Common_ApplicationsCloseReason::eType>::iterator
- it_reason = reason_list.begin();
- std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
- it_mob_reason = mob_reason_list.begin();
-
- for (; it_reason != reason_list.end(); ++it_reason, ++it_mob_reason) {
- (*message)[am::strings::msg_params][am::hmi_request::reason] = *it_reason;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitAllApplicationsNotification>(message);
-#if defined(OS_POSIX)
- am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
- *it_mob_reason;
-
- EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(mob_reason));
- EXPECT_CALL(app_mngr_, HeadUnitReset(mob_reason));
-
- SubscribeForSignal();
- command->Run();
- utils::WaitTerminationSignals(sig_handler);
-#endif
- }
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnExitAllApplicationsNotificationReasonSuspend) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_request::reason] =
- hmi_apis::Common_ApplicationsCloseReason::SUSPEND;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitAllApplicationsNotification>(message);
-
- MessageSharedPtr ethalon_message =
- CreateMessage(smart_objects::SmartType_Map);
- (*ethalon_message)[am::strings::params][am::strings::function_id] =
- hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
- (*ethalon_message)[am::strings::params][am::strings::message_type] =
- am::MessageType::kNotification;
- (*ethalon_message)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId_;
- MessageSharedPtr temp_message = CreateMessage();
-
- resumprion_test::MockResumeCtrl mock_resume_ctrl;
- EXPECT_CALL(app_mngr_, resume_controller())
- .WillOnce(ReturnRef(mock_resume_ctrl));
- EXPECT_CALL(mock_resume_ctrl, OnSuspend());
-
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(kCorrelationId_));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(GetMessage(temp_message));
-
- command->Run();
- EXPECT_EQ(
- static_cast<uint32_t>(
- hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete),
- (*temp_message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<uint32_t>(am::MessageType::kNotification),
- (*temp_message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(static_cast<uint32_t>(kCorrelationId_),
- (*temp_message)[am::strings::params][am::strings::correlation_id]
- .asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnExitAllApplicationsNotificationReasonInvalidEnum) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_request::reason] =
- hmi_apis::Common_ApplicationsCloseReason::INVALID_ENUM;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitAllApplicationsNotification>(message);
-
- EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_)).Times(0);
- EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()).Times(0);
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnExitApplicationNotificationManageMobileCommand) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
- (*notification)[am::strings::params][am::strings::function_id] =
- static_cast<int32_t>(
- mobile_apis::FunctionID::OnAppInterfaceUnregisteredID);
- (*notification)[am::strings::params][am::strings::message_type] =
- static_cast<int32_t>(am::MessageType::kNotification);
- (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
-
- std::vector<hmi_apis::Common_ApplicationExitReason::eType> reason_list;
- reason_list.push_back(hmi_apis::Common_ApplicationExitReason::
- UNAUTHORIZED_TRANSPORT_REGISTRATION);
- reason_list.push_back(
- hmi_apis::Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE);
-
- std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
- mobile_reason_list;
- mobile_reason_list.push_back(
- mobile_apis::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
- mobile_reason_list.push_back(
- mobile_apis::AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE);
-
- std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
- it_mobile_reason = mobile_reason_list.begin();
- std::vector<hmi_apis::Common_ApplicationExitReason::eType>::iterator
- it_reason = reason_list.begin();
-
- for (; it_reason != reason_list.end(); ++it_reason, ++it_mobile_reason) {
- (*message)[am::strings::msg_params][am::strings::reason] = *it_reason;
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitApplicationNotification>(message);
-
- (*notification)[am::strings::msg_params][am::strings::reason] =
- static_cast<int32_t>(*it_mobile_reason);
-
-#ifdef SDL_REMOTE_CONTROL
- functional_modules::PluginManager plugin_mng;
- EXPECT_CALL(app_mngr_, GetPluginManager())
- .WillRepeatedly(ReturnRef(plugin_mng));
-#endif // SDL_REMOTE_CONTROL
-
- EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(mock_message_helper_,
- GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_, *it_mobile_reason)).WillOnce(Return(notification));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(notification, Command::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_,
- UnregisterApplication(
- kAppId_, mobile_apis::Result::SUCCESS, false, false));
- command->Run();
- }
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnExitApplicationNotificationUnhandledReason) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
-
- (*message)[am::strings::msg_params][am::strings::reason] =
- hmi_apis::Common_ApplicationExitReason::INVALID_ENUM;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitApplicationNotification>(message);
-
-#ifdef SDL_REMOTE_CONTROL
- functional_modules::PluginManager plugin_mng;
- EXPECT_CALL(app_mngr_, GetPluginManager())
- .WillRepeatedly(ReturnRef(plugin_mng));
-#endif // SDL_REMOTE_CONTROL
-
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
- EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest, OnExitApplicationNotificationInvalidApp) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
-
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitApplicationNotification>(message);
-
- am::ApplicationSharedPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
- EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- DISABLED_OnExitApplicationNotificationDriverDistractionValidApp) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- (*message)[am::strings::msg_params][am::strings::reason] =
- hmi_apis::Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION;
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitApplicationNotification>(message);
-
- EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
-
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- SetRegularState(app_,
- mobile_apis::HMILevel::HMI_NONE,
- mobile_apis::AudioStreamingState::NOT_AUDIBLE,
- false));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnExitApplicationNotificationrUserExitValidApp) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- (*message)[am::strings::msg_params][am::strings::reason] =
- hmi_apis::Common_ApplicationExitReason::USER_EXIT;
- utils::SharedPtr<Command> command =
- CreateCommand<OnExitApplicationNotification>(message);
-
-#ifdef SDL_REMOTE_CONTROL
- functional_modules::PluginManager plugin_mng;
- EXPECT_CALL(app_mngr_, GetPluginManager())
- .WillRepeatedly(ReturnRef(plugin_mng));
-#endif // SDL_REMOTE_CONTROL
-
- EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- SetRegularState(app_,
- mobile_apis::HMILevel::HMI_NONE,
- mobile_apis::AudioStreamingState::NOT_AUDIBLE,
- false));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRCommandNotificationSwitchedAndValidApp) {
- const uint32_t cmd_id = 12u;
- const uint32_t max_cmd_id = 10u;
-
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::cmd_id] = cmd_id;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRCommandNotification>(message);
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- SetRegularState(_, mobile_apis::HMILevel::HMI_FULL, true));
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(max_cmd_id));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRCommandNotificationSwitchedAndInvalidApp) {
- const uint32_t kCmdId = 12u;
- const uint32_t kMaxCmdId = 10u;
-
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRCommandNotification>(message);
-
- am::ApplicationSharedPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(invalid_app));
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRCommandNotificationCmdIdEqualToMaxCmdId) {
- const uint32_t kCmdId = 11u;
- const uint32_t kMaxCmdId = 10u;
-
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRCommandNotification>(message);
-
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRCommandNotificationCmdIdLessMaxCmdIsInvalidApp) {
- const uint32_t kCmdId = 8u;
- const uint32_t kMaxCmdId = 10u;
-
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRCommandNotification>(message);
-
- am::ApplicationSharedPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRCommandNotificationActivePerformIteraction) {
- const uint32_t kCmdId = 8u;
- const uint32_t kMaxCmdId = 10u;
- const uint32_t kIsPerformInteractionActive = 1u;
- int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRCommandNotification>(message);
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
- EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
- .WillOnce(Return(kIsPerformInteractionActive));
- EXPECT_CALL(app_mngr_, event_dispatcher());
- EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
- .WillOnce(GetEventId(&event_id));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->Run();
- EXPECT_EQ(hmi_apis::FunctionID::VR_OnCommand, event_id);
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRCommandNotificationNotActivePerformIteraction) {
- const uint32_t kCmdId = 8u;
- const uint32_t kMaxCmdId = 10u;
- const uint32_t kIsPerformInteractionActive = 0u;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- (*message)[am::strings::msg_params][am::strings::function_id] =
- mobile_apis::FunctionID::eType::OnCommandID;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRCommandNotification>(message);
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
- EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
- .WillOnce(Return(kIsPerformInteractionActive));
-
- EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR),
- (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnVRLanguageChangeNotificationEmptyData) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRLanguageChangeNotification>(message);
-
- EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(*app_ptr_, app_id()).Times(0);
- EXPECT_CALL(*app_ptr_, language()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRLanguageChangeNotificationAppLangEqualMessageLang) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRLanguageChangeNotification>(message);
-
- application_set_.insert(app_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
- EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
-
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
- (*message)[am::strings::msg_params][am::strings::hmi_display_language]
- .asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnVRLanguageChangeNotificationAppLangNotEqualMessageLang) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] =
- mobile_apis::Language::EN_US;
- utils::SharedPtr<Command> command =
- CreateCommand<OnVRLanguageChangeNotification>(message);
-
- application_set_.insert(app_);
- smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
- (*notification)[am::strings::params][am::strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
- (*notification)[am::strings::params][am::strings::message_type] =
- static_cast<int32_t>(am::MessageType::kNotification);
- (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
- (*notification)[am::strings::msg_params][am::strings::reason] =
- static_cast<int32_t>(
- mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
-
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
- EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- SetRegularState(app_, mobile_apis::HMILevel::HMI_NONE, false));
- EXPECT_CALL(mock_message_helper_,
- GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_,
- mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
- .WillOnce(Return(notification));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(notification, Command::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_,
- UnregisterApplication(
- kAppId_, mobile_apis::Result::SUCCESS, false, false));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
- (*message)[am::strings::msg_params][am::strings::hmi_display_language]
- .asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnStartDeviceDiscoveryRun) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnStartDeviceDiscovery>(message);
- EXPECT_CALL(app_mngr_, StartDevicesDiscovery());
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnDeviceChosenNotificationDeviceInfoExists) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::device_info]
- [am::strings::id] = "2014";
- utils::SharedPtr<Command> command =
- CreateCommand<OnDeviceChosenNotification>(message);
- EXPECT_CALL(app_mngr_,
- ConnectToDevice(
- (*message)[am::strings::msg_params][am::strings::device_info]
- [am::strings::id].asString()));
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnDeviceChosenNotificationDeviceInfoNotExists) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnDeviceChosenNotification>(message);
- EXPECT_CALL(app_mngr_, ConnectToDevice(_)).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemContextNotificationValidActiveApplication) {
- MessageSharedPtr message = CreateMessage();
- std::vector<am::mobile_api::SystemContext::eType> system_context_list;
- system_context_list.push_back(
- am::mobile_api::SystemContext::SYSCTXT_VRSESSION);
- system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MENU);
- system_context_list.push_back(
- am::mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED);
-
- std::vector<am::mobile_api::SystemContext::eType>::iterator it =
- system_context_list.begin();
- for (; it != system_context_list.end(); ++it) {
- (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
- *it;
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemContextNotification>(message);
- EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(app_));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
- command->Run();
- }
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemContextNotificationInvalidActiveApplication) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
- am::mobile_api::SystemContext::SYSCTXT_VRSESSION;
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemContextNotification>(message);
- ApplicationSharedPtr invalid_app;
- EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(invalid_app));
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemContextNotificationInvalidSystemContext) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
- am::mobile_api::SystemContext::INVALID_ENUM;
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemContextNotification>(message);
- EXPECT_CALL(app_mngr_, active_application()).Times(0);
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemContextNotificationValidApplication) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- std::vector<am::mobile_api::SystemContext::eType> system_context_list;
- system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_ALERT);
- system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MAIN);
-
- std::vector<am::mobile_api::SystemContext::eType>::iterator it =
- system_context_list.begin();
- for (; it != system_context_list.end(); ++it) {
- (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
- *it;
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemContextNotification>(message);
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
- command->Run();
- }
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemContextNotificationAppIdDoesntExists) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
- am::mobile_api::SystemContext::SYSCTXT_ALERT;
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemContextNotification>(message);
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemRequestNotificationAppIdExistsAndValidApp) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemRequestNotification>(message);
-
- EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
- ON_CALL(app_mngr_, connection_handler())
- .WillByDefault(ReturnRef(mock_connection_handler_));
- ON_CALL(mock_connection_handler_, get_session_observer())
- .WillByDefault(ReturnRef(mock_session_observer_));
- const int32_t device_id = 1;
- ON_CALL(
- mock_session_observer_,
- GetDataOnDeviceID(
- testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
- .WillByDefault(Return(device_id));
-
- EXPECT_CALL(policy_interface_, GetUserConsentForDevice(_))
- .WillOnce(Return(policy::kDeviceAllowed));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemRequestNotificationAppIdExistsAndInvalidApp) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemRequestNotification>(message);
- ApplicationSharedPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(*app_ptr_, app_id()).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->Run();
- EXPECT_EQ(
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemRequestNotificationAppIdDoesntExistsAndValidApp) {
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemRequestNotification>(message);
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(policy_interface_));
- EXPECT_CALL(policy_interface_, GetAppIdForSending())
- .WillOnce(Return(kAppId_));
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
- ON_CALL(app_mngr_, connection_handler())
- .WillByDefault(ReturnRef(mock_connection_handler_));
- ON_CALL(mock_connection_handler_, get_session_observer())
- .WillByDefault(ReturnRef(mock_session_observer_));
- const int32_t device_id = 1;
- ON_CALL(
- mock_session_observer_,
- GetDataOnDeviceID(
- testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
- .WillByDefault(Return(device_id));
-
- EXPECT_CALL(policy_interface_, GetUserConsentForDevice(_))
- .WillOnce(Return(policy::kDeviceAllowed));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnSystemRequestNotificationAppIdDoesntExistsAndNullAppId) {
- const uint32_t kNullApppId = 0u;
- MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
- CreateCommand<OnSystemRequestNotification>(message);
- EXPECT_CALL(app_mngr_, GetPolicyHandler());
- EXPECT_CALL(policy_interface_, GetAppIdForSending())
- .WillOnce(Return(kNullApppId));
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest, OnTTSLanguageChangeNotificationEmptyData) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
- CreateCommand<OnTTSLanguageChangeNotification>(message);
-
- EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
- EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(*app_ptr_, app_id()).Times(0);
- EXPECT_CALL(*app_ptr_, language()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnTTSLanguageChangeNotificationAppLangEqualMessageLang) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
- CreateCommand<OnTTSLanguageChangeNotification>(message);
-
- application_set_.insert(app_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
- EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
-
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
- (*message)[am::strings::msg_params][am::strings::hmi_display_language]
- .asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnTTSLanguageChangeNotificationAppLangNotEqualMessageLang) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] =
- mobile_apis::Language::EN_US;
- utils::SharedPtr<Command> command =
- CreateCommand<OnTTSLanguageChangeNotification>(message);
-
- application_set_.insert(app_);
- smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
- (*notification)[am::strings::params][am::strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
- (*notification)[am::strings::params][am::strings::message_type] =
- static_cast<int32_t>(am::MessageType::kNotification);
- (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
- (*notification)[am::strings::msg_params][am::strings::reason] =
- static_cast<int32_t>(
- mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
-
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
- EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
- EXPECT_CALL(mock_message_helper_,
- GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_,
- mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
- .WillOnce(Return(notification));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(notification, Command::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_,
- UnregisterApplication(
- kAppId_, mobile_apis::Result::SUCCESS, false, false));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
- (*message)[am::strings::msg_params][am::strings::hmi_display_language]
- .asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnUILanguageChangeNotificationEmptyData) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
- CreateCommand<OnUILanguageChangeNotification>(message);
-
- EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
- EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(*app_ptr_, app_id()).Times(0);
- EXPECT_CALL(*app_ptr_, ui_language()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnUILanguageChangeNotificationAppLangEqualMessageLang) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
- CreateCommand<OnUILanguageChangeNotification>(message);
-
- application_set_.insert(app_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
- EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
-
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kLang),
- (*message)[am::strings::msg_params][am::strings::hmi_display_language]
- .asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnUILanguageChangeNotificationAppLangNotEqualMessageLang) {
- const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::language] =
- mobile_apis::Language::EN_US;
- utils::SharedPtr<Command> command =
- CreateCommand<OnUILanguageChangeNotification>(message);
-
- application_set_.insert(app_);
- smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
- (*notification)[am::strings::params][am::strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
- (*notification)[am::strings::params][am::strings::message_type] =
- static_cast<int32_t>(am::MessageType::kNotification);
- (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
- (*notification)[am::strings::msg_params][am::strings::reason] =
- static_cast<int32_t>(
- mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
-
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
- .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
- EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
- EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
- EXPECT_CALL(mock_message_helper_,
- GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_,
- mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
- .WillOnce(Return(notification));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(notification, Command::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_,
- UnregisterApplication(
- kAppId_, mobile_apis::Result::SUCCESS, false, false));
- command->Run();
- EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(mobile_apis::Language::EN_US),
- (*message)[am::strings::msg_params][am::strings::hmi_display_language]
- .asInt());
-}
-
-TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
- utils::SharedPtr<Command> command =
- CreateCommand<hmi::OnDriverDistractionNotification>(message);
-
- EXPECT_CALL(app_mngr_, set_driver_distraction_state(state));
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(*app_ptr_, app_id()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest,
- OnDriverDistractionNotificationInvalidApp) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
- utils::SharedPtr<Command> command =
- CreateCommand<hmi::OnDriverDistractionNotification>(message);
-
- ApplicationSharedPtr invalid_app;
- application_set_.insert(invalid_app);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(*app_ptr_, app_id()).Times(0);
- command->Run();
-}
-
-TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::mobile_notification::state] = state;
- utils::SharedPtr<Command> command =
- CreateCommand<hmi::OnDriverDistractionNotification>(message);
-
- application_set_.insert(app_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
- policy::CheckPermissionResult result;
- result.hmi_level_permitted = policy::kRpcAllowed;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_interface_));
- EXPECT_CALL(policy_interface_, CheckPermissions(_, _, _, _))
- .WillOnce(GetArg3(&result));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(GetMessage(message));
- EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
-
- command->Run();
- EXPECT_EQ(
- static_cast<int32_t>(am::mobile_api::FunctionID::OnDriverDistractionID),
- (*message)[am::strings::params][am::strings::function_id].asInt());
- EXPECT_EQ(
- static_cast<int32_t>(kAppId_),
- (*message)[am::strings::params][am::strings::connection_key].asInt());
- EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
- (*message)[am::strings::params][am::strings::message_type].asInt());
-}
-
-} // namespace hmi_notifications_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc
deleted file mode 100644
index 322f7dd398..0000000000
--- a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "hmi/request_to_hmi.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace mixing_audio_supported_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::RequestToHMI;
-using am::commands::MixingAudioSupportedRequest;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class MixingAudioSupportedRequestTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(MixingAudioSupportedRequestTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- RequestToHMIPtr command(
- CreateCommand<MixingAudioSupportedRequest>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace mixing_audio_supported_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc
deleted file mode 100644
index 89ba6c8bdb..0000000000
--- a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace mixing_audio_supported_response {
-
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::ResponseFromHMI;
-using am::commands::MixingAudioSupportedResponse;
-using am::commands::CommandImpl;
-using am::HMICapabilities;
-namespace hmi_response = ::application_manager::hmi_response;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class MixingAudioSupportedResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(MixingAudioSupportedResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- ResponseFromHMIPtr command(
- CreateCommand<MixingAudioSupportedResponse>(command_msg));
- MockHMICapabilities mock_hmi_capabilities;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
-
- const bool hmiResponse =
- (*command_msg)[strings::msg_params][hmi_response::attenuated_supported]
- .asBool();
-
- EXPECT_CALL(mock_hmi_capabilities, set_attenuated_supported(hmiResponse));
-
- command->Run();
-}
-
-} // namespace mixing_audio_supported_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
deleted file mode 100644
index c187cc75d9..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <utility>
-
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_audio_start_stream_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace commands = am::commands;
-using commands::MessageSharedPtr;
-using commands::AudioStartStreamRequest;
-using am::event_engine::Event;
-
-namespace {
-const uint32_t kHmiAppId = 13u;
-const am::HmiInterfaces::InterfaceID kHmiInterface =
- am::HmiInterfaces::HMI_INTERFACE_Navigation;
-} // namespace
-
-class AudioStartStreamRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- AudioStartStreamRequestTest() {
- ON_CALL(app_mngr_settings_, start_stream_retry_amount())
- .WillByDefault(ReturnRef(start_stream_retry_amount_));
- msg_ = CreateMessage();
- command_ = CreateCommand<AudioStartStreamRequest>(msg_);
- }
-
- std::pair<uint32_t, int32_t> start_stream_retry_amount_;
- MessageSharedPtr msg_;
- SharedPtr<AudioStartStreamRequest> command_;
-};
-
-TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
-
- command_->Run();
-}
-
-TEST_F(AudioStartStreamRequestTest,
- Run_HmiInterfaceAvailableButNoApp_NoRequest) {
- (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
- .WillOnce(Return(ApplicationSharedPtr()));
- EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
-
- command_->Run();
-}
-
-TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
- (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_audio_streaming_allowed(true));
- EXPECT_CALL(app_mngr_, SendMessageToHMI(msg_));
-
- command_->Run();
-}
-
-} // namespace navi_audio_start_stream_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc
deleted file mode 100644
index 825cca9185..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_is_ready_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::NaviIsReadyRequest;
-using am::event_engine::Event;
-
-namespace {
-const hmi_apis::FunctionID::eType kEventID =
- hmi_apis::FunctionID::Navigation_IsReady;
-} // namespace
-
-typedef SharedPtr<NaviIsReadyRequest> NaviIsReadyRequestPtr;
-
-class NaviIsReadyRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- NaviIsReadyRequestTest() : command_(CreateCommand<NaviIsReadyRequest>()) {
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(mock_hmi_capabilities_));
- }
-
- NaviIsReadyRequestPtr command_;
- MOCK(application_manager_test::MockHMICapabilities) mock_hmi_capabilities_;
-};
-
-TEST_F(NaviIsReadyRequestTest,
- OnEvent_HmiInterfaceIsAvailable_NaviCooperatingIsAvailable) {
- const bool is_hmi_interface_available = true;
-
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[am::strings::msg_params][am::strings::available] =
- is_hmi_interface_available;
-
- Event event(kEventID);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(mock_hmi_interfaces_,
- SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
- am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_is_navi_cooperating(is_hmi_interface_available));
-
- command_->on_event(event);
-}
-
-TEST_F(NaviIsReadyRequestTest,
- OnEvent_HmiInterfaceIsNotAvailable_NaviCooperatingIsNotAvailable) {
- const bool is_hmi_interface_available = false;
-
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[am::strings::msg_params][am::strings::available] =
- is_hmi_interface_available;
-
- Event event(kEventID);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(mock_hmi_interfaces_,
- SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
- am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_is_navi_cooperating(is_hmi_interface_available));
-
- command_->on_event(event);
-}
-
-TEST_F(NaviIsReadyRequestTest,
- OnEvent_AvailabilityFieldMissing_NaviCooperatingIsNotAvailable) {
- const bool is_hmi_interface_available = false;
-
- MessageSharedPtr event_msg = CreateMessage();
- Event event(kEventID);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_is_navi_cooperating(is_hmi_interface_available));
-
- command_->on_event(event);
-}
-
-} // namespace navi_is_ready_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc
deleted file mode 100644
index 7185a5f7ed..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_is_ready_responce {
-
-namespace am = ::application_manager;
-namespace commands = am::commands;
-
-using ::testing::ReturnRef;
-using ::utils::SharedPtr;
-using commands::ResponseFromHMI;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-
-class NaviIsReadyResponseTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(NaviIsReadyResponseTest, NaviIsReadyResponse_Run_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<commands::NaviIsReadyResponse>());
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
- command->Run();
-}
-
-} // namespace navi_is_ready_responce
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc
deleted file mode 100644
index 7c04aa724c..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the names of the copyright holders 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 <algorithm>
-
-#include "application_manager/commands/hmi/navi_set_video_config_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_set_video_config_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::NaviSetVideoConfigRequest;
-using am::event_engine::Event;
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kHmiAppId = 13u;
-const hmi_apis::FunctionID::eType kEventID =
- hmi_apis::FunctionID::Navigation_SetVideoConfig;
-} // namespace
-
-typedef SharedPtr<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr;
-
-class NaviSetVideoConfigRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- NaviSetVideoConfigRequestTest() {
- mock_app_ptr_ = CreateMockApp();
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(mock_hmi_interfaces_));
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_ptr_));
- ON_CALL(app_mngr_, application_by_hmi_app(_))
- .WillByDefault(Return(mock_app_ptr_));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(mock_event_dispatcher_));
- ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kAppId));
- ON_CALL(*mock_app_ptr_, hmi_app_id()).WillByDefault(Return(kHmiAppId));
- }
-
- MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
- MockAppPtr mock_app_ptr_;
- MockEventDispatcher mock_event_dispatcher_;
-};
-
-TEST_F(NaviSetVideoConfigRequestTest, OnEventWithSuccessResponse) {
- MessageSharedPtr request_msg = CreateMessage();
- (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
-
- NaviSetVideoConfigRequestPtr command =
- CreateCommand<NaviSetVideoConfigRequest>(request_msg);
-
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- Event event(kEventID);
- event.set_smart_object(*event_msg);
-
- std::vector<std::string> empty;
- EXPECT_CALL(
- app_mngr_,
- OnStreamingConfigured(
- kAppId, protocol_handler::ServiceType::kMobileNav, true, empty))
- .Times(1);
-
- command->on_event(event);
-}
-
-static bool ValidateList(std::vector<std::string>& expected,
- std::vector<std::string>& actual) {
- std::sort(expected.begin(), expected.end());
- std::sort(actual.begin(), actual.end());
- return std::equal(expected.begin(), expected.end(), actual.begin());
-}
-
-TEST_F(NaviSetVideoConfigRequestTest, OnEventWithRejectedResponse) {
- MessageSharedPtr request_msg = CreateMessage();
- (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*request_msg)[am::strings::msg_params][am::strings::config] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*request_msg)[am::strings::msg_params][am::strings::config]
- [am::strings::protocol] =
- hmi_apis::Common_VideoStreamingProtocol::RTP;
- (*request_msg)[am::strings::msg_params][am::strings::config]
- [am::strings::codec] =
- hmi_apis::Common_VideoStreamingCodec::H265;
- (*request_msg)[am::strings::msg_params][am::strings::config]
- [am::strings::height] = 640;
- (*request_msg)[am::strings::msg_params][am::strings::config]
- [am::strings::width] = 480;
-
- NaviSetVideoConfigRequestPtr command =
- CreateCommand<NaviSetVideoConfigRequest>(request_msg);
-
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::REJECTED;
-
- (*event_msg)[am::strings::msg_params][am::strings::rejected_params] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*event_msg)[am::strings::msg_params][am::strings::rejected_params][0] =
- "codec";
- (*event_msg)[am::strings::msg_params][am::strings::rejected_params][1] =
- "protocol";
- Event event(kEventID);
- event.set_smart_object(*event_msg);
-
- std::vector<std::string> rejected_params;
- EXPECT_CALL(app_mngr_,
- OnStreamingConfigured(
- kAppId, protocol_handler::ServiceType::kMobileNav, false, _))
- .WillOnce(SaveArg<3>(&rejected_params));
-
- command->on_event(event);
-
- ASSERT_EQ(2u, rejected_params.size());
- std::vector<std::string> expected_list;
- expected_list.push_back(std::string("protocol"));
- expected_list.push_back(std::string("codec"));
- ASSERT_TRUE(ValidateList(expected_list, rejected_params));
-}
-
-TEST_F(NaviSetVideoConfigRequestTest,
- OnEventWithRejectedResponseWithoutParams) {
- MessageSharedPtr request_msg = CreateMessage();
- (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
-
- NaviSetVideoConfigRequestPtr command =
- CreateCommand<NaviSetVideoConfigRequest>(request_msg);
-
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::REJECTED;
-
- Event event(kEventID);
- event.set_smart_object(*event_msg);
-
- std::vector<std::string> empty;
- EXPECT_CALL(
- app_mngr_,
- OnStreamingConfigured(
- kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
- .WillOnce(Return());
-
- command->on_event(event);
-}
-
-TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) {
- MessageSharedPtr request_msg = CreateMessage();
- (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
-
- NaviSetVideoConfigRequestPtr command =
- CreateCommand<NaviSetVideoConfigRequest>(request_msg);
-
- std::vector<std::string> empty;
- EXPECT_CALL(
- app_mngr_,
- OnStreamingConfigured(
- kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
- .WillOnce(Return());
-
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1);
-
- command->onTimeOut();
-}
-
-} // namespace navi_set_video_config_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc
deleted file mode 100644
index 753c2a9179..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the names of the copyright holders nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/hmi/navi_set_video_config_response.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_set_video_config_response {
-
-using utils::SharedPtr;
-using application_manager::commands::NaviSetVideoConfigResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-using testing::_;
-using testing::ReturnRef;
-using ::testing::NiceMock;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-class NaviSetVideoConfigResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<NaviSetVideoConfigResponse> command(
- CreateCommand<NaviSetVideoConfigResponse>(msg));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace navi_set_video_config_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
deleted file mode 100644
index 1327ff6dd6..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <utility>
-
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_start_stream_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace commands = am::commands;
-using commands::MessageSharedPtr;
-using commands::NaviStartStreamRequest;
-using am::event_engine::Event;
-
-namespace {
-const uint32_t kHmiAppId = 13u;
-const am::HmiInterfaces::InterfaceID kHmiInterface =
- am::HmiInterfaces::HMI_INTERFACE_Navigation;
-} // namespace
-
-class NaviStartStreamRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- NaviStartStreamRequestTest() {
- ON_CALL(app_mngr_settings_, start_stream_retry_amount())
- .WillByDefault(ReturnRef(start_stream_retry_amount_));
- msg_ = CreateMessage();
- command_ = CreateCommand<NaviStartStreamRequest>(msg_);
- }
-
- std::pair<uint32_t, int32_t> start_stream_retry_amount_;
- MessageSharedPtr msg_;
- SharedPtr<NaviStartStreamRequest> command_;
-};
-
-TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
-
- command_->Run();
-}
-
-TEST_F(NaviStartStreamRequestTest,
- Run_HmiInterfaceAvailableButNoApp_NoRequest) {
- (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
- .WillOnce(Return(ApplicationSharedPtr()));
- EXPECT_CALL(app_mngr_, SendMessageToHMI(_)).Times(0);
-
- command_->Run();
-}
-
-TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
- (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_video_streaming_allowed(true));
- EXPECT_CALL(app_mngr_, SendMessageToHMI(msg_));
-
- command_->Run();
-}
-
-} // namespace navi_start_stream_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
deleted file mode 100644
index 18f82cd645..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_stop_stream_requests {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace commands = am::commands;
-using commands::MessageSharedPtr;
-using am::event_engine::Event;
-
-namespace {
-const am::HmiInterfaces::InterfaceID kHmiInterface =
- am::HmiInterfaces::HMI_INTERFACE_Navigation;
-} // namespace
-
-template <typename Command>
-class NaviStopStreamRequestsTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- NaviStopStreamRequestsTest() {
- ON_CALL(this->app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(mock_hmi_interfaces_));
- msg_ = CreateMessage();
- command_ = CreateCommand<Command>(msg_);
- }
-
- MessageSharedPtr msg_;
- SharedPtr<Command> command_;
-};
-
-typedef testing::Types<commands::AudioStopStreamRequest,
- commands::NaviStopStreamRequest> RequestCommandsList;
-TYPED_TEST_CASE(NaviStopStreamRequestsTest, RequestCommandsList);
-
-TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceNotAvailable_NoRequest) {
- EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
- GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- EXPECT_CALL(TestFixture::app_mngr_, SendMessageToHMI(_)).Times(0);
-
- TestFixture::command_->Run();
-}
-
-TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceAvailable_SentRequest) {
- EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
- GetInterfaceState(kHmiInterface))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(TestFixture::app_mngr_, SendMessageToHMI(TestFixture::msg_));
-
- TestFixture::command_->Run();
-}
-
-} // namespace navi_stop_stream_requests
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc
deleted file mode 100644
index b8a8c68ece..0000000000
--- a/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "utils/shared_ptr.h"
-#include "utils/lock.h"
-#include "utils/make_shared.h"
-#include "utils/data_accessor.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "hmi/on_driver_distraction_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace on_driver_distraction_notification {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::Eq;
-using ::utils::SharedPtr;
-
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::hmi::OnDriverDistractionNotification;
-using namespace am::commands;
-
-typedef ::utils::SharedPtr<OnDriverDistractionNotification> NotificationPtr;
-
-class HMIOnDriverDistractionNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- ::sync_primitives::Lock app_set_lock_;
- policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
-};
-
-MATCHER_P2(CheckNotificationParams, function_id, state, "") {
- bool is_function_id_matched =
- function_id ==
- static_cast<am::mobile_api::FunctionID::eType>(
- (*arg)[am::strings::params][am::strings::function_id].asInt());
- bool is_state_matched =
- state ==
- static_cast<hmi_apis::Common_DriverDistractionState::eType>(
- (*arg)[am::strings::msg_params][am::mobile_notification::state]
- .asInt());
- return is_function_id_matched && is_state_matched;
-}
-
-ACTION_P(GetArg3, result) {
- arg3 = *result;
-}
-
-TEST_F(HMIOnDriverDistractionNotificationTest, Run_PushMobileMessage_SUCCESS) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
- MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
- (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
-
- NotificationPtr command(
- CreateCommand<OnDriverDistractionNotification>(commands_msg));
-
- EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
-
- MockAppPtr mock_app = CreateMockApp();
- am::ApplicationSet app_set;
- app_set.insert(mock_app);
-
- DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
- policy::CheckPermissionResult result;
- result.hmi_level_permitted = policy::kRpcDisallowed;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_interface_));
- EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
- .WillOnce(GetArg3(&result));
-
- EXPECT_CALL(*mock_app,
- PushMobileMessage(CheckNotificationParams(
- am::mobile_api::FunctionID::OnDriverDistractionID, state)));
-
- command->Run();
-}
-
-TEST_F(HMIOnDriverDistractionNotificationTest,
- Run_SendNotificationToMobile_SUCCESS) {
- const hmi_apis::Common_DriverDistractionState::eType state =
- hmi_apis::Common_DriverDistractionState::DD_ON;
- MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
- (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
-
- NotificationPtr command(
- CreateCommand<OnDriverDistractionNotification>(commands_msg));
-
- EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
-
- MockAppPtr mock_app = CreateMockApp();
- am::ApplicationSet app_set;
- app_set.insert(mock_app);
-
- DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
-
- policy::CheckPermissionResult result;
- result.hmi_level_permitted = policy::kRpcAllowed;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_interface_));
- EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
- .WillOnce(GetArg3(&result));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- CheckNotificationParams(
- am::mobile_api::FunctionID::OnDriverDistractionID, state),
- Command::CommandOrigin::ORIGIN_SDL));
-
- command->Run();
-}
-
-} // on_driver_distraction_notification
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc
deleted file mode 100644
index 90be018e74..0000000000
--- a/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace rc_get_capabilities_response {
-
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::RCGetCapabilitiesResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class RCGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][strings::rc_capability] =
- (capabilities_);
-
- return command_msg;
- }
-
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
-
- (*command_msg)[strings::msg_params][strings::system_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::rc_capability] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- smart_objects::SmartObject& remote_control_capability =
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::rc_capability];
-
- remote_control_capability["climateControlCapabilities"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- remote_control_capability["climateControlCapabilities"][0] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& climate_control_capability =
- remote_control_capability["climateControlCapabilities"][0];
-
- climate_control_capability["moduleName"] = "Climate";
- climate_control_capability["fanSpeedAvailable"] = true;
- climate_control_capability["desiredTemperatureAvailable"] = true;
- climate_control_capability["acEnableAvailable"] = true;
- climate_control_capability["acMaxEnableAvailable"] = true;
- climate_control_capability["circulateAirEnableAvailable"] = true;
- climate_control_capability["autoModeEnableAvailable"] = true;
- climate_control_capability["dualModeEnableAvailable"] = true;
-
- climate_control_capability["defrostZoneAvailable"] = true;
- climate_control_capability["defrostZone"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- climate_control_capability["defrostZone"][0] = "ALL";
-
- climate_control_capability["ventilationModeAvailable"] = true;
- climate_control_capability["ventilationMode"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- climate_control_capability["ventilationMode"][0] = "BOTH";
-
- remote_control_capability["radioControlCapabilities"] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- remote_control_capability["radioControlCapabilities"][0] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& radio_control_capability =
- remote_control_capability["radioControlCapabilities"][0];
-
- radio_control_capability["moduleName"] = "Radio";
- radio_control_capability["radioEnableAvailable"] = true;
- radio_control_capability["radioBandAvailable"] = true;
- radio_control_capability["radioFrequencyAvailable"] = true;
- radio_control_capability["hdChannelAvailable"] = true;
- radio_control_capability["rdsDataAvailable"] = true;
- radio_control_capability["availableHDsAvailable"] = true;
- radio_control_capability["stateAvailable"] = true;
- radio_control_capability["signalStrengthAvailable"] = true;
- radio_control_capability["signalChangeThresholdAvailable"] = true;
-
- remote_control_capability[hmi_response::button_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- remote_control_capability[hmi_response::button_capabilities][0] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& button_capability =
- remote_control_capability[hmi_response::button_capabilities][0];
-
- button_capability[strings::button_name] = "OK";
- button_capability["shortPressAvailable"] = true;
- button_capability["longPressAvailable"] = true;
- button_capability["upDownAvailable"] = true;
-
- RCGetCapabilitiesResponsePtr command(
- CreateCommand<RCGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject rc_capability_so =
- (*command_msg)[strings::msg_params][strings::rc_capability];
-
- EXPECT_CALL(mock_hmi_capabilities_, set_rc_capability(rc_capability_so));
- EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(true));
-
- command->Run();
-}
-
-} // namespace rc_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc
deleted file mode 100644
index 73a43342f1..0000000000
--- a/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/rc_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace rc_is_ready_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::RCIsReadyRequest;
-using am::event_engine::Event;
-
-typedef SharedPtr<RCIsReadyRequest> RCIsReadyRequestPtr;
-
-class RCIsReadyRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- RCIsReadyRequestTest() : command_(CreateCommand<RCIsReadyRequest>()) {}
-
- void SetUpExpectations(bool is_rc_cooperating_available,
- bool is_send_message_to_hmi,
- bool is_message_contain_param,
- am::HmiInterfaces::InterfaceState state) {
- if (is_send_message_to_hmi) {
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillRepeatedly(ReturnRef(mock_hmi_capabilities_));
- ExpectSendMessagesToHMI();
- } else {
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- }
- EXPECT_CALL(mock_hmi_capabilities_,
- set_is_rc_cooperating(is_rc_cooperating_available));
- if (!is_rc_cooperating_available) {
- EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(false));
- }
-
- if (is_message_contain_param) {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC, state));
- } else {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillOnce(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
- }
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC))
- .WillOnce(Return(state));
- }
-
- void ExpectSendMessagesToHMI() {
- smart_objects::SmartObjectSPtr capabilities(
- new smart_objects::SmartObject(smart_objects::SmartType_Map));
- EXPECT_CALL(mock_message_helper_,
- CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _))
- .WillOnce(Return(capabilities));
- EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
- }
-
- void PrepareEvent(bool is_message_contain_param,
- Event& event,
- bool is_rc_cooperating_available = false) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- if (is_message_contain_param) {
- (*msg)[am::strings::msg_params][am::strings::available] =
- is_rc_cooperating_available;
- }
- event.set_smart_object(*msg);
- }
-
- RCIsReadyRequestPtr command_;
- am::MockHmiInterfaces mock_hmi_interfaces_;
- application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
-};
-
-TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
- const bool is_rc_cooperating_available = false;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = false;
- Event event(hmi_apis::FunctionID::RC_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_rc_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_RESPONSE);
- command_->on_event(event);
-}
-
-TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
- const bool is_rc_cooperating_available = false;
- const bool is_send_message_to_hmi = false;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::RC_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_rc_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
- const bool is_rc_cooperating_available = true;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::RC_IsReady);
- PrepareEvent(is_message_contain_param, event, is_rc_cooperating_available);
- SetUpExpectations(is_rc_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
- ExpectSendMessagesToHMI();
- command_->onTimeOut();
-}
-
-} // namespace rc_is_ready_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc
deleted file mode 100644
index 157dff6216..0000000000
--- a/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/hmi/rc_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace rc_is_ready_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::RCIsReadyResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<RCIsReadyResponse> RCIsReadyResponsePtr;
-
-class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(RCIsReadyResponseTest, RUN_SUCCESS) {
- RCIsReadyResponsePtr command(CreateCommand<RCIsReadyResponse>());
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace rc_is_ready_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc
deleted file mode 100644
index 8ee86f098d..0000000000
--- a/src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "hmi/response_from_hmi.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace response_from_hmi {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::SaveArg;
-using ::testing::DoAll;
-
-using ::utils::SharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
-
-namespace am = ::application_manager;
-
-using am::commands::ResponseFromHMI;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-
-class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ResponseFromHMITest, BasicMethodsOverloads_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_NO_THROW(command->Run());
- EXPECT_TRUE(command->CleanUp());
-}
-
-TEST_F(ResponseFromHMITest, SendResponseToMobile_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(msg, _));
-
- command->SendResponseToMobile(msg, app_mngr_);
-
- const application_manager::MessageType received_message_tipe =
- static_cast<application_manager::MessageType>(
- (*msg)[am::strings::params][am::strings::message_type].asInt());
-
- EXPECT_EQ(application_manager::MessageType::kResponse, received_message_tipe);
-}
-
-TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- MessageSharedPtr result_msg;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(true)));
-
- const hmi_apis::FunctionID::eType posted_function_id =
- hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr dummy_msg_params = CreateMessage();
- command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
-
- ASSERT_TRUE(result_msg);
-
- const application_manager::MessageType received_message_tipe =
- static_cast<application_manager::MessageType>(
- (*result_msg)[am::strings::params][am::strings::message_type]
- .asInt());
-
- EXPECT_EQ(am::MessageType::kRequest, received_message_tipe);
-
- const hmi_apis::FunctionID::eType received_function_id =
- static_cast<hmi_apis::FunctionID::eType>(
- (*result_msg)[am::strings::params][am::strings::function_id].asInt());
-
- EXPECT_EQ(posted_function_id, received_function_id);
-}
-
-TEST_F(ResponseFromHMITest, CreateHMIRequest_CantManageCommand_Covering) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- MessageSharedPtr result_msg;
- ON_CALL(app_mngr_, GetNextHMICorrelationID()).WillByDefault(Return(1u));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(false)));
-
- const hmi_apis::FunctionID::eType posted_function_id =
- hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr dummy_msg_params = CreateMessage();
- command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
-}
-
-} // namespace response_from_hmi
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc
deleted file mode 100644
index d36b55ee25..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/lock.h"
-#include "utils/helpers.h"
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/command_request_test.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_state_controller.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_activate_app_request {
-
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::MessageSharedPtr;
-using am::commands::SDLActivateAppRequest;
-using am::ApplicationSet;
-using testing::Mock;
-using testing::Return;
-using testing::ReturnRef;
-using testing::Mock;
-using ::testing::NiceMock;
-using policy_test::MockPolicyHandlerInterface;
-using am::event_engine::Event;
-
-namespace {
-const uint32_t kCorrelationID = 1u;
-const uint32_t kAppID = 2u;
-const uint32_t kAppIDFirst = 1u;
-const connection_handler::DeviceHandle kHandle = 2u;
-} // namespace
-
-MATCHER_P2(CheckMsgParams, result, corr_id, "") {
- const bool is_func_id_valid =
- hmi_apis::FunctionID::SDL_ActivateApp ==
- static_cast<int32_t>(
- (*arg)[am::strings::params][am::strings::function_id].asInt());
-
- const bool is_result_code_valid =
- hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED ==
- static_cast<int32_t>(
- (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
-
- const bool is_result_valid =
- result == (*arg)[am::strings::msg_params][am::strings::success].asBool();
-
- const bool is_corr_id_valid =
- corr_id ==
- ((*arg)[am::strings::params][am::strings::correlation_id].asUInt());
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- is_func_id_valid,
- is_result_code_valid,
- is_result_valid,
- is_corr_id_valid);
-}
-
-class SDLActivateAppRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- ~SDLActivateAppRequestTest() {
- // Fix DataAccessor release and WinQt crash
- Mock::VerifyAndClearExpectations(&app_mngr_);
- }
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- MockAppPtr mock_app = CreateMockApp();
- CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
- ON_CALL((*mock_app), app_id()).WillByDefault(Return(kAppID));
- ON_CALL(app_mngr_, application_by_hmi_app(kAppID))
- .WillByDefault(Return(mock_app));
- }
- void SetCorrelationAndAppID(MessageSharedPtr msg) {
- (*msg)[am::strings::params][strings::correlation_id] = kCorrelationID;
- (*msg)[am::strings::msg_params][strings::app_id] = kAppID;
- }
-
- ApplicationSet app_list_;
- ::sync_primitives::Lock lock_;
- policy_test::MockPolicyHandlerInterface policy_handler_;
- application_manager_test::MockStateController mock_state_controller_;
- NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
-};
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
-
-TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler_));
- EXPECT_CALL(policy_handler_, OnActivateApp(kAppID, kCorrelationID));
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
- (*msg)[am::strings::msg_params][strings::function_id] =
- hmi_apis::FunctionID::SDL_ActivateApp;
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(true));
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp)))
- .WillOnce(Return(true));
-
- command->Run();
-}
-#else
-
-TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kAppID)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
-
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
- ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
-
- MockAppPtr mock_app_first(CreateMockApp());
- ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
- ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
-
- app_list_.insert(mock_app_first);
- DataAccessor<ApplicationSet> accessor(app_list_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
-
- ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
- EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
- ON_CALL(*mock_app_first, protocol_version())
- .WillByDefault(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
- ON_CALL(*mock_app, protocol_version())
- .WillByDefault(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
-
- const std::string url = "url";
- ON_CALL(*mock_app_first, SchemaUrl()).WillByDefault(Return(url));
- const std::string package = "package";
- ON_CALL(*mock_app_first, PackageName()).WillByDefault(Return(package));
-
- EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, AppIdNotFound_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kAppID))
- .WillOnce(Return(ApplicationSharedPtr()));
- EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
-
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
- ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
-
- DataAccessor<ApplicationSet> accessor(app_list_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
- app_list_ = accessor.GetData();
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
-
- DataAccessor<ApplicationSet> accessor(app_list_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
-
- app_list_ = accessor.GetData();
-
- MockAppPtr mock_app_first(CreateMockApp());
- ON_CALL(app_mngr_, application(kAppIDFirst))
- .WillByDefault(Return(mock_app_first));
-
- app_list_.insert(mock_app_first);
- ON_CALL(*mock_app_first, protocol_version())
- .WillByDefault(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
-
- ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
- EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
-
- EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, FirstAppNotActive_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler_));
- EXPECT_CALL(policy_handler_, OnActivateApp(kAppID, kCorrelationID));
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MockAppPtr mock_app(CreateMockApp());
-
- const std::string schema("schema");
- mock_app->SetShemaUrl(schema);
- const std::string package_name("package_name");
- mock_app->SetPackageName(package_name);
-
- ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
-
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
- MockAppPtr mock_app_first(CreateMockApp());
- ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
-
- app_list_.insert(mock_app_first);
- DataAccessor<ApplicationSet> accessor(app_list_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
- ON_CALL(*mock_app_first, protocol_version())
- .WillByDefault(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
- ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
- EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(true));
-
- EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, schema, package_name, _));
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
-
- MockAppPtr mock_app_first(CreateMockApp());
- ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
- ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
-
- app_list_.insert(mock_app_first);
- DataAccessor<ApplicationSet> accessor(app_list_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
- ON_CALL(*mock_app_first, protocol_version())
- .WillByDefault(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
- EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
-
- EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
-
- command->Run();
-}
-
-TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, state_controller())
- .WillOnce(ReturnRef(mock_state_controller_));
- EXPECT_CALL(mock_state_controller_,
- IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
- .WillOnce(Return(false));
- DataAccessor<ApplicationSet> accessor(app_list_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
-
- app_list_ = accessor.GetData();
-
- MockAppPtr mock_app_first(CreateMockApp());
- ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
- ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
-
- app_list_.insert(mock_app_first);
- ON_CALL(*mock_app_first, protocol_version())
- .WillByDefault(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
- EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
-
- EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
-
- command->Run();
-}
-#endif
-
-TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- SetCorrelationAndAppID(msg);
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
- ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
-
- command->onTimeOut();
-}
-
-TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[am::strings::params][strings::correlation_id] = kCorrelationID;
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>());
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
- event.set_smart_object(*event_msg);
- EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).Times(0);
-
- command->on_event(event);
-}
-
-TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) {
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
- kAppID;
-
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>());
-
- Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
- event.set_smart_object(*event_msg);
-
- MockAppPtr invalid_mock_app;
- EXPECT_CALL(app_mngr_, application_by_hmi_app(_))
- .WillOnce(Return(invalid_mock_app));
- EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
-
- command->on_event(event);
-}
-
-TEST_F(SDLActivateAppRequestTest, OnEvent_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- SharedPtr<SDLActivateAppRequest> command(
- CreateCommand<SDLActivateAppRequest>(msg));
-
- MessageSharedPtr event_msg = CreateMessage();
- (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
- kAppID;
-
- Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
- event.set_smart_object(*event_msg);
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppID));
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler_));
- EXPECT_CALL(policy_handler_, OnActivateApp(kAppID, kCorrelationID));
-
- command->on_event(event);
-}
-
-} // namespace sdl_activate_app_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc
deleted file mode 100644
index 5dff55f7c3..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_activate_app_response {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::SDLActivateAppResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class SDLActivateAppResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(SDLActivateAppResponseTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- SDLActivateAppResponsePtr command(
- CreateCommand<SDLActivateAppResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace sdl_activate_app_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
deleted file mode 100644
index 1bcdaebb35..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/command_request_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_get_list_of_permissions_request {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::SDLGetListOfPermissionsRequest;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using smart_objects::SmartObject;
-using testing::Return;
-using testing::ReturnRef;
-
-namespace {
-const uint32_t kCorrelationID = 1u;
-const uint32_t kAppID = 2u;
-const uint32_t kConnectionKey = 0u;
-} // namespace
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-class SDLGetListOfPermissionsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- mock_app_ = CreateMockApp();
- }
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
- ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
- }
- MockAppPtr mock_app_;
-};
-
-TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- (*msg)[strings::msg_params][strings::app_id] = kAppID;
-
- EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
- .WillOnce(Return(mock_app_));
-
- SharedPtr<SDLGetListOfPermissionsRequest> command(
- CreateCommand<SDLGetListOfPermissionsRequest>(msg));
-
- MockPolicyHandlerInterface policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler, OnGetListOfPermissions(kAppID, kCorrelationID));
-
- command->Run();
-}
-
-TEST_F(SDLGetListOfPermissionsRequestTest, Run_KeyDoesntExist_SUCCESS) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Binary);
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
-
- SharedPtr<SDLGetListOfPermissionsRequest> command(
- CreateCommand<SDLGetListOfPermissionsRequest>(msg));
-
- MockPolicyHandlerInterface policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler,
- OnGetListOfPermissions(kConnectionKey, kCorrelationID));
-
- command->Run();
-}
-
-} // namespace sdl_get_list_of_permissions_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc
deleted file mode 100644
index 988cdd18c7..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/command_request_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_get_status_update_request {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::SDLGetStatusUpdateRequest;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using testing::Return;
-using testing::ReturnRef;
-
-namespace {
-const uint32_t kCorrelationID = 1u;
-} // namespace
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-class SDLGetStatusUpdateRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
-
- SharedPtr<SDLGetStatusUpdateRequest> command(
- CreateCommand<SDLGetStatusUpdateRequest>(msg));
-
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler));
- EXPECT_CALL(mock_policy_handler, OnGetStatusUpdate(kCorrelationID));
-
- command->Run();
-}
-
-} // namespace sdl_get_status_update_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
deleted file mode 100644
index 66fedda3ca..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_state_controller.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "smart_objects/smart_object.h"
-#include "commands/command_request_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_get_user_friendly_message_request {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::SDLGetUserFriendlyMessageRequest;
-using application_manager::MockMessageHelper;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using test::components::application_manager_test::MockHMICapabilities;
-using testing::_;
-using testing::Return;
-using testing::ReturnRef;
-
-namespace {
-const uint32_t kCorrelationID = 1u;
-const uint32_t kAppID = 2u;
-const std::string kLanguageDe = "de-de";
-const std::string kLanguageEn = "en-gb";
-const std::string kMessageCodes = "messageCodes";
-const hmi_apis::Common_Language::eType kLanguage =
- hmi_apis::Common_Language::EN_GB;
-} // namespace
-
-namespace strings = ::application_manager::strings;
-
-class SDLGetUserFriendlyMessageRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- mock_app_ = CreateMockApp();
- }
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
- ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
- EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
- .WillOnce(Return(mock_app_));
- }
- MockAppPtr mock_app_;
- MockPolicyHandlerInterface mock_policy_handler_;
-};
-
-TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- (*msg)[strings::msg_params][strings::app_id] = kAppID;
-
- (*msg)[strings::msg_params][kMessageCodes] =
- SmartObject(smart_objects::SmartType_Array);
- (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
- (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
-
- (*msg)[strings::msg_params][strings::language] = kLanguage;
-
- SharedPtr<SDLGetUserFriendlyMessageRequest> command(
- CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
-
- EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
- .WillOnce(Return(kLanguageEn));
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_));
- std::vector<std::string> msg_codes;
- msg_codes.push_back(kLanguageDe);
- msg_codes.push_back(kLanguageEn);
- EXPECT_CALL(mock_policy_handler_,
- OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
-
- command->Run();
-}
-
-TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageNotSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- (*msg)[strings::msg_params][strings::app_id] = kAppID;
-
- (*msg)[strings::msg_params][kMessageCodes] =
- SmartObject(smart_objects::SmartType_Array);
- (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
- (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
-
- SharedPtr<SDLGetUserFriendlyMessageRequest> command(
- CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities, active_ui_language())
- .WillOnce(Return(kLanguage));
- EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
- .WillOnce(Return(kLanguageEn));
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_));
- std::vector<std::string> msg_codes;
- msg_codes.push_back(kLanguageDe);
- msg_codes.push_back(kLanguageEn);
- EXPECT_CALL(mock_policy_handler_,
- OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
-
- command->Run();
-}
-
-TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_NoMsgCodes_Canceled) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- (*msg)[strings::msg_params][strings::app_id] = kAppID;
-
- SharedPtr<SDLGetUserFriendlyMessageRequest> command(
- CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
-
- EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_)).Times(0);
- EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
- EXPECT_CALL(mock_policy_handler_, OnGetUserFriendlyMessage(_, _, _)).Times(0);
-
- command->Run();
-}
-
-} // namespace sdl_get_user_friendly_message_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/test/commands/hmi/simple_notifications_test.cc
deleted file mode 100644
index 9d7441fef7..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_notifications_test.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-
-#include "commands/commands_test.h"
-
-#include "hmi/notification_to_hmi.h"
-#include "application_manager/commands/command_notification_impl.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_notifications_test {
-
-using namespace application_manager;
-
-using ::testing::Types;
-
-template <typename Command>
-class SimpleNotificationsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<commands::CommandNotificationImpl, commands::NotificationToHMI>
- CommandsList;
-
-TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList);
-
-TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
-
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_NO_THROW(command->Run());
- EXPECT_TRUE(command->CleanUp());
-}
-
-} // namespace simple_notifications_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc
deleted file mode 100644
index 4f7a7a9f72..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "hmi/request_from_hmi.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_requests_from_hmi_test {
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::NotNull;
-using ::testing::NiceMock;
-
-using ::utils::SharedPtr;
-namespace commands = ::application_manager::commands;
-using commands::MessageSharedPtr;
-using ::application_manager::event_engine::EventObserver;
-using ::test::components::event_engine_test::MockEventDispatcher;
-
-class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- }
- NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
-};
-
-TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<commands::RequestFromHMI> command(
- CreateCommand<commands::RequestFromHMI>());
- application_manager::event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_ActivateApp);
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_TRUE(command->CleanUp());
- EXPECT_NO_THROW(command->Run());
- EXPECT_NO_THROW(command->on_event(event));
-}
-
-TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
- SharedPtr<commands::RequestFromHMI> command(
- CreateCommand<commands::RequestFromHMI>());
-
- const bool success = false;
- const uint32_t correlation_id = 1u;
- EXPECT_CALL(app_mngr_, ManageHMICommand(NotNull()));
-
- command->SendResponse(success,
- correlation_id,
- hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- hmi_apis::Common_Result::SUCCESS);
-}
-
-} // namespace simple_requests_to_hmi_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc
deleted file mode 100644
index 3fa3aaef3a..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the copyright holders nor the names of their contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/commands/hmi/allow_app_request.h"
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_get_way_points_request.h"
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-#include "application_manager/commands/hmi/navi_send_location_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/commands/hmi/vi_read_did_request.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/dial_number_request.h"
-#include "application_manager/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
-#include "application_manager/commands/hmi/tts_speak_request.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/tts_change_registration_request.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
-#include "application_manager/commands/hmi/tts_get_language_request.h"
-#include "application_manager/commands/hmi/close_popup_request.h"
-#include "application_manager/commands/hmi/ui_add_command_request.h"
-#include "application_manager/commands/hmi/ui_add_submenu_request.h"
-#include "application_manager/commands/hmi/ui_alert_request.h"
-#include "application_manager/commands/hmi/ui_change_registration_request.h"
-#include "application_manager/commands/hmi/ui_delete_command_request.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
-#include "application_manager/commands/hmi/ui_get_language_request.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
-#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
-#include "application_manager/commands/hmi/ui_show_request.h"
-#include "application_manager/commands/hmi/ui_slider_request.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vr_add_command_request.h"
-#include "application_manager/commands/hmi/vr_change_registration_request.h"
-#include "application_manager/commands/hmi/vr_delete_command_request.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/vr_get_language_request.h"
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "application_manager/commands/hmi/allow_app_request.h"
-#include "application_manager/commands/hmi/navi_send_location_request.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-#include "application_manager/commands/hmi/sdl_policy_update.h"
-#include "application_manager/commands/hmi/ui_set_icon_request.h"
-#include "application_manager/commands/hmi/dial_number_request.h"
-#include "application_manager/commands/hmi/ui_send_haptic_data_request.h"
-
-#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_requests_to_hmi_test {
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::NotNull;
-
-using ::utils::SharedPtr;
-
-namespace am_commands = application_manager::commands;
-using am_commands::MessageSharedPtr;
-using event_engine_test::MockEventDispatcher;
-
-class RequestToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<am_commands::RequestToHMI> command(
- CreateCommand<am_commands::RequestToHMI>());
-
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_NO_THROW(command->Run());
- EXPECT_TRUE(command->CleanUp());
-}
-
-TEST_F(RequestToHMITest, SendRequest_SUCCESS) {
- SharedPtr<am_commands::RequestToHMI> command(
- CreateCommand<am_commands::RequestToHMI>());
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(NotNull()));
-
- command->SendRequest();
-}
-
-template <typename Command>
-class RequestToHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-template <typename Command>
-class RequestToHMICommandsTest2 : public RequestToHMICommandsTest<Command> {};
-
-template <typename Command>
-class RequestToHMICommandsTest3
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<am_commands::VIGetVehicleTypeRequest,
- am_commands::VIReadDIDRequest,
- am_commands::VISubscribeVehicleDataRequest,
- am_commands::hmi::DialNumberRequest,
- am_commands::ClosePopupRequest,
- am_commands::TTSSetGlobalPropertiesRequest,
- am_commands::TTSSpeakRequest,
- am_commands::TTSStopSpeakingRequest,
- am_commands::TTSGetSupportedLanguagesRequest,
- am_commands::UIAddCommandRequest,
- am_commands::UIAddSubmenuRequest,
- am_commands::UIAlertRequest,
- am_commands::UIChangeRegistrationRequest,
- am_commands::UIDeleteCommandRequest,
- am_commands::UIDeleteSubmenuRequest,
- am_commands::UIEndAudioPassThruRequest,
- am_commands::UIGetCapabilitiesRequest,
- am_commands::UIGetLanguageRequest,
- am_commands::UIGetSupportedLanguagesRequest,
- am_commands::UIPerformAudioPassThruRequest,
- am_commands::UIPerformInteractionRequest,
- am_commands::VIDiagnosticMessageRequest,
- am_commands::VIGetDTCsRequest,
- am_commands::VIGetVehicleDataRequest,
- am_commands::UISetMediaClockTimerRequest,
- am_commands::UIShowRequest,
- am_commands::VIUnsubscribeVehicleDataRequest,
- am_commands::VRAddCommandRequest,
- am_commands::VRChangeRegistrationRequest,
- am_commands::VRDeleteCommandRequest,
- am_commands::UISliderRequest,
- am_commands::TTSChangeRegistrationRequest,
- am_commands::TTSGetCapabilitiesRequest,
- am_commands::TTSGetLanguageRequest,
- am_commands::AllowAllAppsRequest,
- am_commands::BasicCommunicationSystemRequest,
- am_commands::ButtonGetCapabilitiesRequest,
- am_commands::NaviSendLocationRequest,
- am_commands::NaviUnSubscribeWayPointsRequest,
- am_commands::NaviUpdateTurnListRequest,
- am_commands::NaviShowConstantTBTRequest,
- am_commands::NaviStopStreamRequest,
- am_commands::NaviSubscribeWayPointsRequest,
- am_commands::NaviAlertManeuverRequest,
- am_commands::AudioStopStreamRequest,
- am_commands::NaviGetWayPointsRequest,
- am_commands::UISetGlobalPropertiesRequest,
- am_commands::UISendHapticDataRequest> RequestCommandsList;
-
-typedef Types<am_commands::UIScrollableMessageRequest,
- am_commands::VRGetCapabilitiesRequest,
- am_commands::UISetAppIconRequest,
- am_commands::UiSetDisplayLayoutRequest,
- am_commands::VRGetSupportedLanguagesRequest,
- am_commands::VRGetLanguageRequest,
- am_commands::VRPerformInteractionRequest,
- am_commands::AllowAppRequest,
-// TODO (OKozlov). Need to clarify why UT fails
-// for UISetIconRequest
-// am_commands::UISetIconRequest,
-#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
- am_commands::SDLPolicyUpdate,
-#endif
- am_commands::hmi::DialNumberRequest> RequestCommandsList2;
-
-typedef Types<am_commands::VIIsReadyRequest,
- am_commands::TTSIsReadyRequest,
- am_commands::UIIsReadyRequest,
- am_commands::NaviIsReadyRequest,
- am_commands::VRIsReadyRequest> RequestCommandsList3;
-
-TYPED_TEST_CASE(RequestToHMICommandsTest, RequestCommandsList);
-TYPED_TEST_CASE(RequestToHMICommandsTest2, RequestCommandsList2);
-TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3);
-
-TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
- EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
-
- command->Run();
-}
-
-TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
- EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
-
- command->Run();
-}
-
-TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
-
- EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
-
- command->Run();
-}
-
-} // namespace simple_requests_to_hmi_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc
deleted file mode 100644
index f55b2e5835..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the copyright holders nor the names of their contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "hmi/activate_app_response.h"
-#include "hmi/basic_communication_system_response.h"
-#include "hmi/navi_alert_maneuver_response.h"
-#include "hmi/navi_audio_start_stream_response.h"
-#include "hmi/navi_audio_stop_stream_response.h"
-#include "hmi/navi_get_way_points_response.h"
-#include "hmi/navi_send_location_response.h"
-#include "hmi/navi_show_constant_tbt_response.h"
-#include "hmi/navi_start_stream_response.h"
-#include "hmi/navi_stop_stream_response.h"
-#include "hmi/navi_subscribe_way_points_response.h"
-#include "hmi/navi_unsubscribe_way_points_response.h"
-#include "hmi/navi_update_turn_list_response.h"
-#include "hmi/tts_change_registration_response.h"
-#include "hmi/ui_set_app_icon_response.h"
-#include "hmi/ui_set_display_layout_response.h"
-#include "hmi/ui_set_global_properties_response.h"
-#include "hmi/ui_scrollable_message_response.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "hmi/vi_read_did_response.h"
-#include "hmi/vi_subscribe_vehicle_data_response.h"
-#include "hmi/vi_get_vehicle_type_response.h"
-#include "hmi/vi_is_ready_response.h"
-#include "hmi/dial_number_response.h"
-#include "hmi/close_popup_response.h"
-#include "hmi/tts_set_global_properties_response.h"
-#include "hmi/tts_speak_response.h"
-#include "hmi/tts_stop_speaking_response.h"
-#include "hmi/tts_change_registration_response.h"
-#include "hmi/ui_add_command_response.h"
-#include "hmi/ui_add_submenu_response.h"
-#include "hmi/ui_alert_response.h"
-#include "hmi/ui_change_registration_response.h"
-#include "hmi/ui_delete_command_response.h"
-#include "hmi/ui_delete_submenu_response.h"
-#include "hmi/ui_end_audio_pass_thru_response.h"
-#include "hmi/ui_perform_audio_pass_thru_response.h"
-#include "hmi/ui_perform_interaction_response.h"
-#include "hmi/vi_diagnostic_message_response.h"
-#include "hmi/vi_get_dtcs_response.h"
-#include "hmi/ui_set_media_clock_timer_response.h"
-#include "hmi/ui_show_response.h"
-#include "hmi/ui_slider_response.h"
-#include "hmi/vi_unsubscribe_vehicle_data_response.h"
-#include "hmi/vr_add_command_response.h"
-#include "hmi/vr_change_registration_response.h"
-#include "hmi/vr_delete_command_response.h"
-#include "hmi/vr_perform_interaction_response.h"
-#include "hmi/activate_app_response.h"
-#include "hmi/basic_communication_system_response.h"
-#include "hmi/navi_unsubscribe_way_points_response.h"
-#include "hmi/navi_update_turn_list_response.h"
-#include "hmi/navi_send_location_response.h"
-#include "hmi/navi_show_constant_tbt_response.h"
-#include "hmi/navi_start_stream_response.h"
-#include "hmi/navi_subscribe_way_points_response.h"
-#include "hmi/on_find_applications.h"
-#include "hmi/on_update_device_list.h"
-#include "hmi/sdl_policy_update_response.h"
-#include "hmi/update_app_list_response.h"
-#include "hmi/update_device_list_response.h"
-#include "hmi/notification_from_hmi.h"
-#include "hmi/ui_send_haptic_data_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_response_from_hmi_test {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::Types;
-using ::testing::Eq;
-
-using ::utils::SharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
-
-namespace am = ::application_manager;
-namespace commands = am::commands;
-using commands::MessageSharedPtr;
-
-template <class CommandD>
-class ResponseFromHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef CommandD CommandData;
- MockEventDispatcher event_dispatcher_;
-
- ResponseFromHMICommandsTest() {
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- }
-};
-
-template <class Command>
-class EmptyResponseFromHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-template <class Command, hmi_apis::FunctionID::eType kExpectedEventId>
-struct CommandData {
- typedef Command CommandType;
- enum { kEventId = kExpectedEventId };
-};
-
-typedef Types<
- CommandData<commands::VIReadDIDResponse,
- hmi_apis::FunctionID::VehicleInfo_ReadDID>,
- CommandData<commands::TTSSpeakResponse, hmi_apis::FunctionID::TTS_Speak>,
- CommandData<commands::VISubscribeVehicleDataResponse,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData>,
- CommandData<commands::hmi::DialNumberResponse,
- hmi_apis::FunctionID::BasicCommunication_DialNumber>,
- CommandData<commands::UIDeleteSubmenuResponse,
- hmi_apis::FunctionID::UI_DeleteSubMenu>,
- CommandData<commands::UIEndAudioPassThruResponse,
- hmi_apis::FunctionID::UI_EndAudioPassThru>,
- CommandData<commands::TTSSetGlobalPropertiesResponse,
- hmi_apis::FunctionID::TTS_SetGlobalProperties>,
- CommandData<commands::TTSStopSpeakingResponse,
- hmi_apis::FunctionID::TTS_StopSpeaking>,
- CommandData<commands::UIAddCommandResponse,
- hmi_apis::FunctionID::UI_AddCommand>,
- CommandData<commands::UIAddSubmenuResponse,
- hmi_apis::FunctionID::UI_AddSubMenu>,
- CommandData<commands::UIAlertResponse, hmi_apis::FunctionID::UI_Alert>,
- CommandData<commands::UIChangeRegistratioResponse,
- hmi_apis::FunctionID::UI_ChangeRegistration>,
- CommandData<commands::UIDeleteCommandResponse,
- hmi_apis::FunctionID::UI_DeleteCommand>,
- CommandData<commands::UIPerformAudioPassThruResponse,
- hmi_apis::FunctionID::UI_PerformAudioPassThru>,
- CommandData<commands::UIPerformInteractionResponse,
- hmi_apis::FunctionID::UI_PerformInteraction>,
- CommandData<commands::UIDeleteSubmenuResponse,
- hmi_apis::FunctionID::UI_DeleteSubMenu>,
- CommandData<commands::UIEndAudioPassThruResponse,
- hmi_apis::FunctionID::UI_EndAudioPassThru>,
- CommandData<commands::VIDiagnosticMessageResponse,
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage>,
- CommandData<commands::VIGetDTCsResponse,
- hmi_apis::FunctionID::VehicleInfo_GetDTCs>,
- CommandData<commands::UISetMediaClockTimerResponse,
- hmi_apis::FunctionID::UI_SetMediaClockTimer>,
- CommandData<commands::UIShowResponse, hmi_apis::FunctionID::UI_Show>,
- CommandData<commands::VIUnsubscribeVehicleDataResponse,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData>,
- CommandData<commands::VRAddCommandResponse,
- hmi_apis::FunctionID::VR_AddCommand>,
- CommandData<commands::VRChangeRegistrationResponse,
- hmi_apis::FunctionID::VR_ChangeRegistration>,
- CommandData<commands::VRDeleteCommandResponse,
- hmi_apis::FunctionID::VR_DeleteCommand>,
- CommandData<commands::UISliderResponse, hmi_apis::FunctionID::UI_Slider>,
- CommandData<commands::TTSChangeRegistratioResponse,
- hmi_apis::FunctionID::TTS_ChangeRegistration>,
- CommandData<commands::ActivateAppResponse,
- hmi_apis::FunctionID::BasicCommunication_ActivateApp>,
- CommandData<commands::BasicCommunicationSystemResponse,
- hmi_apis::FunctionID::BasicCommunication_SystemRequest>,
- CommandData<commands::NaviAlertManeuverResponse,
- hmi_apis::FunctionID::Navigation_AlertManeuver>,
- CommandData<commands::AudioStartStreamResponse,
- hmi_apis::FunctionID::Navigation_StartAudioStream>,
- CommandData<commands::NaviGetWayPointsResponse,
- hmi_apis::FunctionID::Navigation_GetWayPoints>,
- CommandData<commands::NaviSendLocationResponse,
- hmi_apis::FunctionID::Navigation_SendLocation>,
- CommandData<commands::NaviShowConstantTBTResponse,
- hmi_apis::FunctionID::Navigation_ShowConstantTBT>,
- CommandData<commands::NaviStartStreamResponse,
- hmi_apis::FunctionID::Navigation_StartStream>,
- CommandData<commands::NaviSubscribeWayPointsResponse,
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints>,
- CommandData<commands::NaviUnsubscribeWayPointsResponse,
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints>,
- CommandData<commands::NaviUpdateTurnListResponse,
- hmi_apis::FunctionID::Navigation_UpdateTurnList>,
- CommandData<commands::UISetAppIconResponse,
- hmi_apis::FunctionID::UI_SetAppIcon>,
- CommandData<commands::UiSetDisplayLayoutResponse,
- hmi_apis::FunctionID::UI_SetDisplayLayout>,
- CommandData<commands::UISetGlobalPropertiesResponse,
- hmi_apis::FunctionID::UI_SetGlobalProperties>,
- CommandData<commands::UISetGlobalPropertiesResponse,
- hmi_apis::FunctionID::UI_SetGlobalProperties>,
- CommandData<commands::VRPerformInteractionResponse,
- hmi_apis::FunctionID::VR_PerformInteraction>,
- CommandData<commands::UIScrollableMessageResponse,
- hmi_apis::FunctionID::UI_ScrollableMessage>,
- CommandData<commands::UISendHapticDataResponse,
- hmi_apis::FunctionID::UI_SendHapticData> > ResponseCommandsList;
-
-typedef Types<commands::AudioStopStreamResponse,
- commands::NaviStopStreamResponse,
- commands::OnFindApplications,
- commands::OnUpdateDeviceList,
- commands::SDLPolicyUpdateResponse,
- commands::UpdateAppListResponse,
- commands::UpdateDeviceListResponse> EmptyResponseCommandsList;
-
-TYPED_TEST_CASE(ResponseFromHMICommandsTest, ResponseCommandsList);
-
-TYPED_TEST_CASE(EmptyResponseFromHMICommandsTest, EmptyResponseCommandsList);
-
-MATCHER_P(EventIdIsEqualTo, function_id, "") {
- return static_cast<hmi_apis::FunctionID::eType>(function_id) == arg.id();
-}
-
-TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandData CommandData;
- typedef typename CommandData::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
-
- EXPECT_CALL(this->event_dispatcher_,
- raise_event(EventIdIsEqualTo(CommandData::kEventId)));
-
- command->Run();
-}
-
-TYPED_TEST(EmptyResponseFromHMICommandsTest, Run_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
-
- command->Run();
-}
-
-class OtherResponseFromHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-MATCHER_P(VehicleTypeIsEqualTo, vehicle_type, "") {
- return (*vehicle_type) == arg.asString();
-}
-
-TEST_F(OtherResponseFromHMICommandsTest, VIGetVehicleTypeResponse_Run_SUCCESS) {
- const std::string kVehicleType = "Test";
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::hmi_response::vehicle_type] =
- kVehicleType;
-
- SharedPtr<commands::VIGetVehicleTypeResponse> command(
- CreateCommand<commands::VIGetVehicleTypeResponse>(command_msg));
-
- application_manager_test::MockHMICapabilities hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(hmi_capabilities));
-
- EXPECT_CALL(hmi_capabilities,
- set_vehicle_type(VehicleTypeIsEqualTo(&kVehicleType)));
-
- command->Run();
-}
-
-TEST_F(OtherResponseFromHMICommandsTest, VIIsReadyResponse_Run_SUCCESS) {
- SharedPtr<commands::VIIsReadyResponse> command(
- CreateCommand<commands::VIIsReadyResponse>());
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-MATCHER_P(CheckMsgType, msg_type, "") {
- return msg_type ==
- static_cast<int32_t>(
- (*arg)[am::strings::params][am::strings::message_type].asInt());
-}
-
-class NotificationFromHMITest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(NotificationFromHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<commands::NotificationFromHMI> command(
- CreateCommand<commands::NotificationFromHMI>());
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_TRUE(command->CleanUp());
- EXPECT_NO_THROW(command->Run());
-}
-
-TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::message_type] =
- static_cast<int32_t>(am::MessageType::kNotification);
-
- SharedPtr<commands::NotificationFromHMI> command(
- CreateCommand<commands::NotificationFromHMI>());
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(CheckMsgType(am::MessageType::kNotification),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- command->SendNotificationToMobile(command_msg);
-}
-
-TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params] = 0;
- SharedPtr<commands::NotificationFromHMI> command(
- CreateCommand<commands::NotificationFromHMI>(command_msg));
-
- const uint32_t correlation_id = 1u;
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(correlation_id));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(CheckMsgType(am::MessageType::kRequest)))
- .WillOnce(Return(false));
-
- command->CreateHMIRequest(hmi_apis::FunctionID::INVALID_ENUM,
- (*command_msg)[am::strings::msg_params]);
-}
-
-} // namespace simple_response_from_hmi_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc
deleted file mode 100644
index 3948d2bfe3..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_response_to_hmi_test {
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::NotNull;
-using ::utils::SharedPtr;
-
-namespace commands = ::application_manager::commands;
-using commands::MessageSharedPtr;
-
-template <class Command>
-class ResponseToHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<commands::SDLActivateAppResponse,
- commands::SDLGetListOfPermissionsResponse,
- commands::SDLGetStatusUpdateResponse,
- commands::SDLGetUserFriendlyMessageResponse> ResponseCommandsList;
-
-TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList);
-
-TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
-
- EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
-
- command->Run();
-}
-
-class ResponseToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<commands::ResponseToHMI> command(
- CreateCommand<commands::ResponseToHMI>());
-
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_TRUE(command->CleanUp());
-}
-
-TEST_F(ResponseToHMITest, Run_SUCCESS) {
- SharedPtr<commands::ResponseToHMI> command(
- CreateCommand<commands::ResponseToHMI>());
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(NotNull()));
-
- command->Run();
-}
-
-} // namespace simple_response_to_hmi_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc
deleted file mode 100644
index c7b5c76b40..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_get_capabilities_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::TTSGetCapabilitiesResponse;
-using test::components::application_manager_test::MockHMICapabilities;
-using utils::SharedPtr;
-using testing::_;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-namespace {
-const std::string kText = "TEXT";
-}
-
-class TTSGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
-};
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
- (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
- kText;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_speech_capabilities(SmartObject(kText)));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_prerecorded_speech(SmartObject(kText)));
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlySpeech_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_speech_capabilities(SmartObject(kText)));
- EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
- kText;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
- EXPECT_CALL(mock_hmi_capabilities_,
- set_prerecorded_speech(SmartObject(kText)));
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_Nothing_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
- EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-} // namespace tts_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc
deleted file mode 100644
index e0b2fad5b9..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_get_language_response {
-
-using utils::SharedPtr;
-using application_manager::commands::TTSGetLanguageResponse;
-using test::components::application_manager_test::MockHMICapabilities;
-using test::components::event_engine_test::MockEventDispatcher;
-using testing::_;
-using testing::ReturnRef;
-
-namespace strings = application_manager::strings;
-namespace hmi_response = application_manager::hmi_response;
-using namespace hmi_apis;
-
-namespace {
-const Common_Language::eType kLanguage = Common_Language::EN_GB;
-} // namespace
-
-class TTSGetLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
-
- SharedPtr<TTSGetLanguageResponse> command(
- CreateCommand<TTSGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities, set_active_tts_language(kLanguage));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(TTSGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<TTSGetLanguageResponse> command(
- CreateCommand<TTSGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities,
- set_active_tts_language(Common_Language::INVALID_ENUM));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace tts_get_language_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc
deleted file mode 100644
index 547fc02481..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_get_supported_languages_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::ResponseFromHMI;
-using am::commands::TTSGetSupportedLanguagesResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class TTSGetSupportedLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(TTSGetSupportedLanguageResponseTest, RUN_SUCCESS) {
- smart_objects::SmartObject supported_languages("EN_US");
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
- (*command_msg)[strings::msg_params][hmi_response::languages] =
- supported_languages;
-
- ResponseFromHMIPtr command(
- CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_tts_supported_languages((
- *command_msg)[strings::msg_params][hmi_response::languages]));
-
- command->Run();
-}
-TEST_F(TTSGetSupportedLanguageResponseTest, RUN_UNSUCCESS) {
- smart_objects::SmartObject supported_languages("EN_US");
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::WRONG_LANGUAGE;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- ResponseFromHMIPtr command(
- CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_tts_supported_languages(supported_languages)).Times(0);
-
- command->Run();
-
- EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
- am::hmi_response::languages));
-}
-
-} // namespace tts_get_supported_languages_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc
deleted file mode 100644
index 52c66ff877..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_is_ready_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::ResponseFromHMI;
-using am::commands::TTSIsReadyResponse;
-using am::commands::CommandImpl;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const bool kIsAvailable = true;
-const bool kIsNotAvailable = false;
-} // namespace
-
-class TTSIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(TTSIsReadyResponseTest, RUN_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<TTSIsReadyResponse>());
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace tts_is_ready_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc
deleted file mode 100644
index b02c9851ee..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the copyright holders nor the names of their contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_get_capabilities_response {
-
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::ResponseFromHMI;
-using am::commands::UIGetCapabilitiesResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class UIGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- return command_msg;
- }
-
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(UIGetCapabilitiesResponseTest, RUN_SetDisplay_SUCCESSS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][hmi_response::display_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- (*command_msg)[strings::msg_params][hmi_response::display_capabilities]
- [hmi_response::display_type] = "GEN2_8_DMA";
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject display_capabilities_so =
- (*command_msg)[strings::msg_params][hmi_response::display_capabilities];
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_display_capabilities(display_capabilities_so));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetSoftButton_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities]
- [hmi_response::image_supported] = true;
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject soft_button_capabilities_so = (*command_msg)
- [strings::msg_params][hmi_response::soft_button_capabilities];
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_soft_button_capabilities(soft_button_capabilities_so));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetHmiZone_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities][0] =
- "FRONT";
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject hmi_zone_capabilities_so =
- (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities];
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_hmi_zone_capabilities(hmi_zone_capabilities_so));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::audio_pass_thru_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject audio_pass_thru_capabilities_so = (*command_msg)
- [strings::msg_params][strings::audio_pass_thru_capabilities];
- EXPECT_CALL(
- mock_hmi_capabilities_,
- set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_so));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetNavigation_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- (*command_msg)[strings::msg_params][strings::hmi_capabilities]
- [strings::navigation] = true;
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject hmi_capabilities_so =
- (*command_msg)[strings::msg_params][strings::hmi_capabilities];
- EXPECT_CALL(mock_hmi_capabilities_,
- set_navigation_supported(
- hmi_capabilities_so[strings::navigation].asBool()));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetPhoneCall_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- (*command_msg)[strings::msg_params][strings::hmi_capabilities]
- [strings::phone_call] = true;
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject hmi_capabilities_so =
- (*command_msg)[strings::msg_params][strings::hmi_capabilities];
- EXPECT_CALL(mock_hmi_capabilities_,
- set_phone_call_supported(
- hmi_capabilities_so[strings::phone_call].asBool()));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreaming_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- (*command_msg)[strings::msg_params][strings::hmi_capabilities]
- [strings::video_streaming] = true;
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject hmi_capabilities_so =
- (*command_msg)[strings::msg_params][strings::hmi_capabilities];
- EXPECT_CALL(mock_hmi_capabilities_,
- set_video_streaming_supported(
- hmi_capabilities_so[strings::video_streaming].asBool()));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::system_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::navigation_capability]["sendLocationEnabled"] = true;
-
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::navigation_capability]["getWayPointsEnabled"] = true;
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject navigation_capability_so =
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::navigation_capability];
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_navigation_capability(navigation_capability_so));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::system_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::phone_capability]["dialNumberEnabled"] = true;
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject phone_capability_so =
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::phone_capability];
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_phone_capability(phone_capability_so));
-
- command->Run();
-}
-
-TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::system_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::video_streaming_capability] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- smart_objects::SmartObject& video_streaming_capability =
- (*command_msg)[strings::msg_params][strings::system_capabilities]
- [strings::video_streaming_capability];
-
- video_streaming_capability[strings::preferred_resolution] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- video_streaming_capability[strings::preferred_resolution]
- [strings::resolution_width] = 800;
- video_streaming_capability[strings::preferred_resolution]
- [strings::resolution_height] = 350;
-
- video_streaming_capability[strings::max_bitrate] = 10000;
-
- video_streaming_capability[strings::supported_formats] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- video_streaming_capability[strings::supported_formats][0] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- video_streaming_capability[strings::supported_formats][0][strings::protocol] =
- hmi_apis::Common_VideoStreamingProtocol::RAW;
-
- video_streaming_capability[strings::supported_formats][0][strings::codec] =
- hmi_apis::Common_VideoStreamingCodec::H264;
-
- video_streaming_capability[strings::haptic_spatial_data_supported] = true;
-
- ResponseFromHMIPtr command(
- CreateCommand<UIGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_video_streaming_capability(video_streaming_capability));
-
- command->Run();
-}
-
-} // namespace ui_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc
deleted file mode 100644
index e45e4583e5..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_application_manager.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_get_language_response {
-
-using utils::SharedPtr;
-using application_manager::commands::UIGetLanguageResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-using testing::_;
-using testing::ReturnRef;
-using ::testing::NiceMock;
-
-namespace strings = application_manager::strings;
-namespace hmi_response = application_manager::hmi_response;
-using namespace hmi_apis;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
-} // namespace
-
-class UIGetLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
-
- SharedPtr<UIGetLanguageResponse> command(
- CreateCommand<UIGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities, set_active_ui_language(kLanguage));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(UIGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<UIGetLanguageResponse> command(
- CreateCommand<UIGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities,
- set_active_ui_language(Common_Language::INVALID_ENUM));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace ui_get_language_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc
deleted file mode 100644
index 690c863ccb..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/application.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_get_supported_languages_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::UIGetSupportedLanguagesResponse;
-
-typedef SharedPtr<UIGetSupportedLanguagesResponse>
- UIGetSupportedLanguagesResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStringNum = "123";
-const std::string kLanguage = "EN_US";
-const smart_objects::SmartObject supported_languages(kLanguage);
-} // namespace
-
-class UIGetSupportedLanguagesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(UIGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
- (*command_msg)[strings::msg_params][hmi_response::languages] =
- supported_languages;
-
- UIGetSupportedLanguagesResponsePtr command(
- CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_ui_supported_languages((supported_languages)));
-
- command->Run();
-}
-TEST_F(UIGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::WRONG_LANGUAGE;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- UIGetSupportedLanguagesResponsePtr command(
- CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_ui_supported_languages(supported_languages)).Times(0);
-
- command->Run();
-
- EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
- am::hmi_response::languages));
-}
-
-} // namespace ui_get_supported_languages_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
deleted file mode 100644
index 66b1317870..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_is_ready_request {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using am::commands::MessageSharedPtr;
-using am::commands::UIIsReadyRequest;
-using am::event_engine::Event;
-
-typedef SharedPtr<UIIsReadyRequest> UIIsReadyRequestPtr;
-
-class UIIsReadyRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- UIIsReadyRequestTest() : command_(CreateCommand<UIIsReadyRequest>()) {}
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(mock_hmi_capabilities_));
- }
- void SetUpExpectations(bool is_ui_cooperating_available,
- bool is_send_message_to_hmi,
- bool is_message_contain_param,
- am::HmiInterfaces::InterfaceState state) {
- EXPECT_CALL(mock_hmi_capabilities_,
- set_is_ui_cooperating(is_ui_cooperating_available));
-
- if (is_message_contain_param) {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI, state));
- } else {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillOnce(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
- }
-
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillOnce(Return(state));
-
- if (is_send_message_to_hmi) {
- ExpectSendMessagesToHMI();
- }
- }
-
- void ExpectSendMessagesToHMI() {
- smart_objects::SmartObjectSPtr get_language(CreateMessage());
- (*get_language)[am::strings::params][am::strings::message_type] =
- static_cast<int>(am::MessageType::kRequest);
- (*get_language)[am::strings::msg_params] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- EXPECT_CALL(mock_message_helper_,
- CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, _))
- .WillOnce(Return(get_language));
-
- smart_objects::SmartObjectSPtr get_all_language(CreateMessage());
- (*get_all_language)[am::strings::params][am::strings::message_type] =
- static_cast<int>(am::MessageType::kRequest);
- (*get_all_language)[am::strings::msg_params] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- EXPECT_CALL(
- mock_message_helper_,
- CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages, _))
- .WillOnce(Return(get_all_language));
-
- smart_objects::SmartObjectSPtr get_capabilities(CreateMessage());
- (*get_capabilities)[am::strings::params][am::strings::message_type] =
- static_cast<int>(am::MessageType::kRequest);
- (*get_capabilities)[am::strings::msg_params] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- EXPECT_CALL(mock_message_helper_,
- CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetCapabilities, _))
- .WillOnce(Return(get_capabilities));
-
- EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*get_language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(get_language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(get_all_language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(get_capabilities));
- }
-
- void PrepareEvent(bool is_message_contain_param,
- Event& event,
- bool is_ui_cooperating_available = false) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- if (is_message_contain_param) {
- (*msg)[am::strings::msg_params][am::strings::available] =
- is_ui_cooperating_available;
- }
- event.set_smart_object(*msg);
- }
-
- UIIsReadyRequestPtr command_;
- application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
- policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
-};
-
-TEST_F(UIIsReadyRequestTest,
- OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
- const bool is_ui_cooperating_available = false;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = false;
- Event event(hmi_apis::FunctionID::UI_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_ui_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_RESPONSE);
-
- command_->on_event(event);
-}
-
-TEST_F(UIIsReadyRequestTest,
- OnEvent_KeyAvailableEqualToFalse_StateNotAvailable) {
- const bool is_ui_cooperating_available = false;
- const bool is_send_message_to_hmi = false;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::UI_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_ui_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(UIIsReadyRequestTest, OnEvent_KeyAvailableEqualToTrue_StateAvailable) {
- const bool is_ui_cooperating_available = true;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::UI_IsReady);
- PrepareEvent(is_message_contain_param, event, is_ui_cooperating_available);
- SetUpExpectations(is_ui_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(UIIsReadyRequestTest, OnTimeout_SUCCESS) {
- ExpectSendMessagesToHMI();
- command_->onTimeOut();
-}
-
-} // namespace ui_is_ready_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc
deleted file mode 100644
index d69ec0528e..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_is_ready_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::UIIsReadyResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<UIIsReadyResponse> UIIsReadyResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStringNum = "123";
-const bool kIsAvailable = true;
-const bool kIsNotAvailable = false;
-} // namespace
-
-class UIIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(UIIsReadyResponseTest, RUN_SUCCESS) {
- UIIsReadyResponsePtr command(CreateCommand<UIIsReadyResponse>());
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace ui_is_ready_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc
deleted file mode 100644
index 99eed48f71..0000000000
--- a/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/request_controller_settings.h"
-#include "application_manager/mock_application_manager_settings.h"
-#include "application_manager/commands/hmi/update_device_list_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace update_device_list_request {
-
-using ::utils::SharedPtr;
-using testing::_;
-using testing::ReturnRef;
-using testing::Return;
-using test::components::event_engine_test::MockEventDispatcher;
-using ::test::components::application_manager_test::
- MockApplicationManagerSettings;
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::event_engine::Event;
-using am::commands::UpdateDeviceListRequest;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class UpdateDeviceListRequestTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- return command_msg;
- }
-
- MockApplicationManagerSettings settings_;
- MockEventDispatcher mock_event_dispatcher_;
-};
-
-TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) {
- MessageSharedPtr command_msg = CreateCommandMsg();
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(
- CreateCommand<UpdateDeviceListRequest>(command_msg));
-
- EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
-
- EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(false));
-
- EXPECT_CALL(app_mngr_, IsHMICooperating()).Times(0);
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsTrue_SUCCESSS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(
- CreateCommand<UpdateDeviceListRequest>(command_msg));
-
- EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
-
- EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, IsHMICooperating()).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-TEST_F(UpdateDeviceListRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
- Event event(Event::EventID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
-
- command->on_event(event);
-}
-
-TEST_F(UpdateDeviceListRequestTest, OnEvent_SUCCESS) {
- Event event(Event::EventID::BasicCommunication_OnReady);
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_, _));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
-
- command->on_event(event);
-}
-
-} // namespace update_device_list_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc
deleted file mode 100644
index e9bf402aa7..0000000000
--- a/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/commands/hmi/update_sdl_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace update_sdl_request {
-
-using ::utils::SharedPtr;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::UpdateSDLRequest;
-
-typedef SharedPtr<UpdateSDLRequest> UpdateSDLRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 1u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class UpdateSDLRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(UpdateSDLRequestTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
-
- UpdateSDLRequestPtr command(CreateCommand<UpdateSDLRequest>(command_msg));
- policy_test::MockPolicyHandlerInterface policy_handler;
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler, PTExchangeAtUserRequest(kCorrelationId));
-
- command->Run();
-
- EXPECT_EQ(kCorrelationId,
- (*command_msg)[strings::params][strings::correlation_id].asUInt());
-}
-
-} // namespace update_sdl_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc
deleted file mode 100644
index e612f438cc..0000000000
--- a/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "hmi/update_sdl_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace update_sdl_response {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::UpdateSDLResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<UpdateSDLResponse> UpdateSDLResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class UpdateSDLResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(UpdateSDLResponseTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- UpdateSDLResponsePtr command(CreateCommand<UpdateSDLResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace update_sdl_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc
deleted file mode 100644
index e61f90a2fa..0000000000
--- a/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "hmi/vi_get_vehicle_data_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vi_get_vehicle_data_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::MessageSharedPtr;
-using am::commands::VIGetVehicleDataResponse;
-using am::event_engine::Event;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 1u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class VIGetVehicleDataResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(VIGetVehicleDataResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::message_type] =
- hmi_apis::messageType::response;
-
- VIGetVehicleDataResponsePtr command(
- CreateCommand<VIGetVehicleDataResponse>(command_msg));
-
- am::event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
- event.set_smart_object(*command_msg);
-
- policy_test::MockPolicyHandlerInterface policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler, OnVehicleDataUpdated(*command_msg));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(VIGetVehicleDataResponseTest, ErrorResponse_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::message_type] =
- hmi_apis::messageType::error_response;
- (*command_msg)[strings::params][strings::data][strings::slider_position] = 1;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
- (*command_msg)[am::strings::params][am::strings::error_msg] = "test_error";
- (*command_msg)[am::strings::params][am::strings::protocol_type] =
- am::commands::CommandImpl::hmi_protocol_type_;
- (*command_msg)[strings::params][strings::protocol_version] =
- am::commands::CommandImpl::protocol_version_;
-
- smart_objects::SmartObject result(smart_objects::SmartType_Map);
- result[strings::msg_params] = (*command_msg)[strings::params][strings::data];
- result[strings::params][hmi_response::code] =
- (*command_msg)[strings::params][hmi_response::code];
- result[strings::params][strings::correlation_id] =
- (*command_msg)[strings::params][strings::correlation_id];
- result[strings::params][strings::error_msg] =
- (*command_msg)[strings::params][strings::error_msg];
- result[strings::params][strings::message_type] =
- (*command_msg)[strings::params][strings::message_type];
- result[strings::params][strings::protocol_type] =
- (*command_msg)[strings::params][strings::protocol_type];
- result[strings::params][strings::protocol_version] =
- (*command_msg)[strings::params][strings::protocol_version];
-
- VIGetVehicleDataResponsePtr command(
- CreateCommand<VIGetVehicleDataResponse>(command_msg));
-
- am::event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
- event.set_smart_object(result);
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace vi_get_vehicle_data_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
deleted file mode 100644
index 557afa98d0..0000000000
--- a/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vi_is_ready_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-using ::testing::Return;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::VIIsReadyRequest;
-using am::event_engine::Event;
-
-typedef SharedPtr<VIIsReadyRequest> VIIsReadyRequestPtr;
-
-class VIIsReadyRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- VIIsReadyRequestTest() : command_(CreateCommand<VIIsReadyRequest>()) {}
-
- void SetUpExpectations(bool is_vi_cooperating_available,
- bool is_send_message_to_hmi,
- bool is_message_contain_param,
- am::HmiInterfaces::InterfaceState state) {
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_is_ivi_cooperating(is_vi_cooperating_available));
-
- if (is_message_contain_param) {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(mock_hmi_interfaces_,
- SetInterfaceState(
- am::HmiInterfaces::HMI_INTERFACE_VehicleInfo, state));
- } else {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillOnce(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
- }
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_interface_));
- EXPECT_CALL(mock_policy_handler_interface_, OnVIIsReady());
-
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VehicleInfo))
- .WillOnce(Return(state));
-
- if (is_send_message_to_hmi) {
- ExpectSendMessagesToHMI();
- }
- }
-
- void ExpectSendMessagesToHMI() {
- smart_objects::SmartObjectSPtr ivi_type;
- EXPECT_CALL(
- mock_message_helper_,
- CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
- .WillOnce(Return(ivi_type));
- EXPECT_CALL(app_mngr_, ManageHMICommand(ivi_type));
- }
-
- void PrepareEvent(bool is_message_contain_param,
- Event& event,
- bool is_vi_cooperating_available = false) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- if (is_message_contain_param) {
- (*msg)[am::strings::msg_params][am::strings::available] =
- is_vi_cooperating_available;
- }
- event.set_smart_object(*msg);
- }
-
- VIIsReadyRequestPtr command_;
- application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
- policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
-};
-
-TEST_F(VIIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
- const bool is_vi_cooperating_available = false;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = false;
- Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_vi_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_RESPONSE);
- command_->on_event(event);
-}
-
-TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
- const bool is_vi_cooperating_available = false;
- const bool is_send_message_to_hmi = false;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_vi_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
- const bool is_vi_cooperating_available = true;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
- PrepareEvent(is_message_contain_param, event, is_vi_cooperating_available);
- SetUpExpectations(is_vi_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(VIIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
- ExpectSendMessagesToHMI();
- command_->onTimeOut();
-}
-
-} // namespace vi_is_ready_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc
deleted file mode 100644
index 907a013972..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_get_capabilities_response {
-
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::VRGetCapabilitiesResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class VRGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- return command_msg;
- }
-
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(VRGetCapabilitiesResponseTest, RUN_SUCCESSS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::vr_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*command_msg)[strings::msg_params][strings::vr_capabilities][0] =
- "vrCapabilities";
-
- VRGetCapabilitiesResponsePtr command(
- CreateCommand<VRGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject vr_capabilities_so =
- (*command_msg)[strings::msg_params][strings::vr_capabilities];
-
- EXPECT_CALL(mock_hmi_capabilities_, set_vr_capabilities(vr_capabilities_so));
-
- command->Run();
-}
-
-} // namespace vr_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc
deleted file mode 100644
index 7d42e39548..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_application_manager.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_get_language_response {
-
-using utils::SharedPtr;
-using application_manager::commands::VRGetLanguageResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-using testing::_;
-using testing::ReturnRef;
-using ::testing::NiceMock;
-
-namespace strings = application_manager::strings;
-namespace hmi_response = application_manager::hmi_response;
-using namespace hmi_apis;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
-} // namespace
-
-class VRGetLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
-
- SharedPtr<VRGetLanguageResponse> command(
- CreateCommand<VRGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities, set_active_vr_language(kLanguage));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(VRGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<VRGetLanguageResponse> command(
- CreateCommand<VRGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities,
- set_active_vr_language(Common_Language::INVALID_ENUM));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace vr_get_language_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc
deleted file mode 100644
index 27be9e0f0f..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/application.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_get_supported_languages_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::VRGetSupportedLanguagesResponse;
-
-typedef SharedPtr<VRGetSupportedLanguagesResponse>
- VRGetSupportedLanguagesResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStringNum = "123";
-const std::string kLanguage = "EN_US";
-const smart_objects::SmartObject supported_languages(kLanguage);
-} // namespace
-
-class VRGetSupportedLanguagesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(VRGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
- (*command_msg)[strings::msg_params][hmi_response::languages] =
- supported_languages;
-
- VRGetSupportedLanguagesResponsePtr command(
- CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_vr_supported_languages((supported_languages)));
-
- command->Run();
-}
-TEST_F(VRGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::WRONG_LANGUAGE;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- VRGetSupportedLanguagesResponsePtr command(
- CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_vr_supported_languages(supported_languages)).Times(0);
-
- command->Run();
-
- EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
- am::hmi_response::languages));
-}
-
-} // namespace vr_get_supported_languages_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
deleted file mode 100644
index c9403b2f0e..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_is_ready_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::VRIsReadyRequest;
-using am::event_engine::Event;
-
-typedef SharedPtr<VRIsReadyRequest> VRIsReadyRequestPtr;
-
-class VRIsReadyRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- VRIsReadyRequestTest() : command_(CreateCommand<VRIsReadyRequest>()) {}
-
- void SetUpExpectations(bool is_vr_cooperating_available,
- bool is_send_message_to_hmi,
- bool is_message_contain_param,
- am::HmiInterfaces::InterfaceState state) {
- const bool is_send_message_by_timeout = false;
- if (is_send_message_to_hmi) {
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillRepeatedly(ReturnRef(mock_hmi_capabilities_));
- ExpectSendMessagesToHMI(is_send_message_by_timeout);
- } else {
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- }
- EXPECT_CALL(mock_hmi_capabilities_,
- set_is_vr_cooperating(is_vr_cooperating_available));
-
- if (is_message_contain_param) {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR, state));
- } else {
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillOnce(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
- }
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillOnce(Return(state));
- }
-
- void ExpectSendMessagesToHMI(bool is_send_message_by_timeout) {
- if (is_send_message_by_timeout) {
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- }
-
- smart_objects::SmartObjectSPtr language(
- new smart_objects::SmartObject(smart_objects::SmartType_Map));
- EXPECT_CALL(mock_message_helper_,
- CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _))
- .WillOnce(Return(language));
- EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language));
- EXPECT_CALL(app_mngr_, ManageHMICommand(language));
-
- smart_objects::SmartObjectSPtr support_language(
- new smart_objects::SmartObject(smart_objects::SmartType_Map));
- EXPECT_CALL(
- mock_message_helper_,
- CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _))
- .WillOnce(Return(support_language));
- EXPECT_CALL(app_mngr_, 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(app_mngr_, ManageHMICommand(capabilities));
- }
-
- void PrepareEvent(bool is_message_contain_param,
- Event& event,
- bool is_vr_cooperating_available = false) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- if (is_message_contain_param) {
- (*msg)[am::strings::msg_params][am::strings::available] =
- is_vr_cooperating_available;
- }
- event.set_smart_object(*msg);
- }
-
- VRIsReadyRequestPtr command_;
- application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
-};
-
-TEST_F(VRIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
- const bool is_vr_cooperating_available = false;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = false;
- Event event(hmi_apis::FunctionID::VR_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_vr_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_RESPONSE);
- command_->on_event(event);
-}
-
-TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
- const bool is_vr_cooperating_available = false;
- const bool is_send_message_to_hmi = false;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::VR_IsReady);
- PrepareEvent(is_message_contain_param, event);
- SetUpExpectations(is_vr_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_NOT_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
- const bool is_vr_cooperating_available = true;
- const bool is_send_message_to_hmi = true;
- const bool is_message_contain_param = true;
- Event event(hmi_apis::FunctionID::VR_IsReady);
- PrepareEvent(is_message_contain_param, event, is_vr_cooperating_available);
- SetUpExpectations(is_vr_cooperating_available,
- is_send_message_to_hmi,
- is_message_contain_param,
- am::HmiInterfaces::STATE_AVAILABLE);
- command_->on_event(event);
-}
-
-TEST_F(VRIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
- const bool is_send_message_by_timeout = true;
- ExpectSendMessagesToHMI(is_send_message_by_timeout);
- command_->onTimeOut();
-}
-
-} // namespace vr_is_ready_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc
deleted file mode 100644
index 37e945bc11..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_is_ready_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::VRIsReadyResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<VRIsReadyResponse> VRIsReadyResponsePtr;
-
-class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(VRIsReadyResponseTest, RUN_SUCCESS) {
- VRIsReadyResponsePtr command(CreateCommand<VRIsReadyResponse>());
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace vr_is_ready_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
deleted file mode 100644
index 471f0763de..0000000000
--- a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
+++ /dev/null
@@ -1,1084 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/add_command_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace add_command_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using ::testing::_;
-using ::utils::SharedPtr;
-using ::testing::Return;
-using ::testing::InSequence;
-using am::commands::AddCommandRequest;
-using NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr;
-using ::test::components::application_manager_test::MockApplication;
-using am::event_engine::EventObserver;
-using namespace smart_objects;
-
-namespace custom_str = utils::custom_string;
-namespace strings = ::application_manager::strings;
-namespace mobile_result = mobile_apis::Result;
-namespace hmi_response = ::application_manager::hmi_response;
-namespace hmi_request = ::application_manager::hmi_request;
-using namespace strings;
-
-namespace {
-const hmi_apis::FunctionID::eType kInvalidFunctionId =
- hmi_apis::FunctionID::INVALID_ENUM;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const std::string kMenuName = "LG";
-const uint32_t kFirstParentId = 10u;
-const uint32_t kSecondParentId = 1u;
-const std::string kErroredVRCommand = "l\namer";
-const std::string kFirstVrCommand = "lamer";
-const std::string kSecondVrCommand = "hacker";
-const uint32_t kFirstCommandId = 10u;
-const uint32_t kSecondCommandId = 11u;
-const int32_t kType = 34;
-const int32_t kGrammarId = 12;
-const int32_t kPosition = 10;
-} // namespace
-
-class AddCommandRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- AddCommandRequestTest()
- : msg_(CreateMessage())
- , default_app_name_("test_default_app_name_")
- , mock_app_(CreateMockApp()) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app_));
- InitGetters();
- InitBasicMessage();
- }
-
- protected:
- void InitBasicMessage() {
- (*msg_)[params][connection_key] = kConnectionKey;
- (*msg_)[msg_params][app_id] = kAppId;
- (*msg_)[msg_params][app_name] = default_app_name_;
- }
-
- void InitGetters() {
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
- ON_CALL(*mock_app_, FindCommand(kCmdId))
- .WillByDefault(Return(so_ptr_.get()));
- }
-
- void CreateBasicParamsUIRequest() {
- SmartObject menu_params = SmartObject(SmartType_Map);
- menu_params[position] = kPosition;
- menu_params[menu_name] = kMenuName;
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[cmd_id] = kCmdId;
- msg_params[strings::menu_params] = menu_params;
- msg_params[cmd_icon] = 1;
- msg_params[cmd_icon][value] = "10";
- msg_params[info] = "UI info";
- }
-
- void CreateBasicParamsVRRequest() {
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[cmd_id] = kCmdId;
- msg_params[vr_commands] = SmartObject(SmartType_Array);
- msg_params[vr_commands][0] = kFirstVrCommand;
- msg_params[type] = kPosition;
- msg_params[grammar_id] = kGrammarId;
- msg_params[info] = "VR info";
- }
-
- const am::CommandsMap CreateCommandsMap(SmartObject& first_command,
- SmartObject& second_command) {
- second_command[menu_params] = SmartObject(SmartType_Map);
- second_command[menu_params][hmi_request::parent_id] = kFirstParentId;
- second_command[menu_params][menu_name] = kMenuName;
- second_command[vr_commands] = SmartObject(SmartType_Array);
- second_command[vr_commands][0] = kSecondVrCommand;
- am::CommandsMap commands_map;
- commands_map.insert(std::make_pair(kFirstCommandId, &first_command));
- commands_map.insert(std::make_pair(kSecondCommandId, &second_command));
- return commands_map;
- }
-
- void CheckOnTimeOutCommandDeletion(
- const hmi_apis::FunctionID::eType incoming_cmd,
- const hmi_apis::FunctionID::eType cmd_to_delete) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId))
- .WillOnce(Return(so_ptr_.get()));
- SmartObject first_command = SmartObject(SmartType_Map);
- SmartObject second_command = SmartObject(SmartType_Map);
- const am::CommandsMap commands_map =
- CreateCommandsMap(first_command, second_command);
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
- commands_map, lock_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
- EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
- .WillOnce(Return(so_ptr_.get()));
- {
- InSequence dummy;
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- Event event(incoming_cmd);
- event.set_smart_object(*msg_);
- request_ptr->on_event(event);
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- EXPECT_CALL(app_mngr_, ManageHMICommand(HMIResultCodeIs(cmd_to_delete)))
- .WillOnce(Return(true));
- SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
- (*response)[strings::msg_params][strings::info] = "info";
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
- .WillOnce(Return(response));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(response,
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- utils::SharedPtr<CommandRequestImpl> base_class_request =
- static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr);
- base_class_request->onTimeOut();
- }
-
- MessageSharedPtr msg_;
- SmartObjectSPtr so_ptr_;
- const utils::custom_string::CustomString default_app_name_;
- sync_primitives::Lock lock_;
- MockAppPtr mock_app_;
-};
-
-TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) {
- CreateBasicParamsUIRequest();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest, Run_MenuNameHasSyntaxError_EXPECT_INVALID_DATA) {
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
- const std::string errored_menu_name = "L\nG";
- msg_params[menu_params][menu_name] = errored_menu_name;
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- SmartObject parent = SmartObject(SmartType_Map);
- EXPECT_CALL(*mock_app_, FindSubMenu(kFirstParentId))
- .WillOnce(Return(&parent));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest,
- Run_VRCommandsHaveSyntaxError_EXPECT_INVALID_DATA) {
- CreateBasicParamsVRRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[vr_commands][0] = kErroredVRCommand;
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest, Run_CMDIconHasError_EXPECT_INVALID_DATA) {
- MessageSharedPtr msg = CreateMessage();
- SmartObject& msg_params = (*msg)[strings::msg_params];
- (*msg)[params][connection_key] = kConnectionKey;
- msg_params[cmd_id] = kCmdId;
- msg_params[cmd_icon] = 1;
- const std::string errored_cmd_icon_value = "1\n0";
- msg_params[cmd_icon][value] = errored_cmd_icon_value;
- msg_params[vr_commands][0] = kFirstVrCommand;
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest, Run_CommandIDAlreadyExists_EXPECT_INVALID_ID) {
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest,
- Run_CommandNameAlreadyExists_EXPECT_DUPLICATE_NAME) {
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- SmartObject first_command = SmartObject(SmartType_Map);
- SmartObject second_command = SmartObject(SmartType_Map);
- const am::CommandsMap commands_map =
- CreateCommandsMap(first_command, second_command);
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest,
- Run_CmdAndMsgParentIDsAreDifferentSubmenuNotExisted_EXPECT_INVALID_ID) {
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- SmartObject first_command = SmartObject(SmartType_Map);
- SmartObject second_command = SmartObject(SmartType_Map);
- const am::CommandsMap commands_map =
- CreateCommandsMap(first_command, second_command);
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
- .WillOnce(Return(so_ptr_.get()));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest,
- Run_CmdAndMsgVrSynonymsAreTheSame_EXPECT_DUPLICATE_NAME) {
- CreateBasicParamsVRRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
- msg_params[vr_commands][0] = kSecondVrCommand;
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
-
- SmartObject first_command = SmartObject(SmartType_Map);
- SmartObject second_command = SmartObject(SmartType_Map);
- const am::CommandsMap commands_map =
- CreateCommandsMap(first_command, second_command);
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
- EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
- .WillOnce(Return(so_ptr_.get()));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest, Run_MsgDataEmpty_EXPECT_INVALID_DATA) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[params][connection_key] = kConnectionKey;
- SmartObject& msg_params = (*msg)[strings::msg_params];
- msg_params[app_id] = kAppId;
- msg_params[cmd_id] = kCmdId;
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest,
- Run_CmdAndMsg_UI_and_Vr_AreCorrect_EXPECT_VR_AND_UI_SENT) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
- SmartObject& image = msg_params[cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- SmartObject first_command = SmartObject(SmartType_Map);
- SmartObject second_command = SmartObject(SmartType_Map);
- const am::CommandsMap commands_map =
- CreateCommandsMap(first_command, second_command);
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
- EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
- .WillOnce(Return(so_ptr_.get()));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) {
- CreateBasicParamsUIRequest();
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
-
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-}
-
-TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) {
- CreateBasicParamsUIRequest();
- (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
-
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(
- Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
-
- Event event(hmi_apis::FunctionID::UI_AddCommand);
- event.set_smart_object(*msg_);
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- request_ptr->on_event(event);
-}
-
-TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) {
- CreateBasicParamsVRRequest();
- MessageSharedPtr msg = CreateMessage(SmartType_Map);
- (*msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
- (*msg)[msg_params][cmd_id] = kCmdId;
-
- Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*msg);
- EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
-
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(
- Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- request_ptr->on_event(event);
-}
-
-TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_VR_DeleteCommand) {
- CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::VR_AddCommand,
- hmi_apis::FunctionID::VR_DeleteCommand);
-}
-
-TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_UI_DeleteCommand) {
- CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::UI_AddCommand,
- hmi_apis::FunctionID::UI_DeleteCommand);
-}
-
-TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
- MessageSharedPtr command_msg = CreateMessage(SmartType_Map);
- (*command_msg)[params][connection_key] = kConnectionKey;
- MessageSharedPtr event_msg = CreateMessage(SmartType_Map);
- (*event_msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
- (*event_msg)[msg_params][cmd_id] = kCmdId;
-
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*event_msg);
-
- Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*event_msg);
-
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
-
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(command_msg);
- request_ptr->Run();
- request_ptr->on_event(event_ui);
- request_ptr->on_event(event_vr);
-}
-
-TEST_F(AddCommandRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
- request_ptr->on_event(event);
-}
-
-TEST_F(AddCommandRequestTest, OnEvent_AppNotExisted_UNSUCCESS) {
- CreateBasicParamsUIRequest();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()));
- Event event(hmi_apis::FunctionID::UI_AddCommand);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->on_event(event);
-}
-
-TEST_F(AddCommandRequestTest,
- OnEvent_HmiResponseCodeIsRejected_ExpectUICommandRemoved) {
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::REJECTED;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::REJECTED), _));
- Event event(hmi_apis::FunctionID::UI_AddCommand);
- event.set_smart_object(*msg_);
- request_ptr->on_event(event);
-}
-
-TEST_F(AddCommandRequestTest,
- OnEvent_HmiResponseCodeIsWarnings_ExpectCommandUpdated) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::WARNINGS;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::WARNINGS), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*msg_);
- Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*msg_);
- request_ptr->on_event(event_ui);
- request_ptr->on_event(event_vr);
-}
-
-TEST_F(
- AddCommandRequestTest,
- OnEvent_UI_HmiResponseCodeIsGenericError_VR_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
-
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*msg_);
- request_ptr->on_event(event_ui);
-
- Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
- (*msg_vr)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg_vr)[msg_params][cmd_id] = kCmdId;
- event_vr.set_smart_object(*msg_vr);
- request_ptr->on_event(event_vr);
-}
-
-TEST_F(
- AddCommandRequestTest,
- OnEvent_VR_HmiResponseCodeIsGenericError_UI_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
-
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-
- Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*msg_);
- request_ptr->on_event(event_vr);
-
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
- (*msg_ui)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg_ui)[msg_params][cmd_id] = kCmdId;
- event_ui.set_smart_object(*msg_ui);
- request_ptr->on_event(event_ui);
-}
-
-TEST_F(
- AddCommandRequestTest,
- OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_UI_NotAvailableInterfaceState_ExpectCommandRemoved) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*msg_);
- Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*msg_);
- request_ptr->on_event(event_ui);
- request_ptr->on_event(event_vr);
-}
-
-TEST_F(
- AddCommandRequestTest,
- OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_VR_NotAvailableInterfaceState_ExpectCommandRemoved) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillRepeatedly(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*msg_);
- Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*msg_);
- request_ptr->on_event(event_ui);
- request_ptr->on_event(event_vr);
-}
-
-TEST_F(
- AddCommandRequestTest,
- OnEvent_UI_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillRepeatedly(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
- Event event(hmi_apis::FunctionID::UI_AddCommand);
- event.set_smart_object(*msg_);
- request_ptr->on_event(event);
-}
-
-TEST_F(
- AddCommandRequestTest,
- OnEvent_VR_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
- CreateBasicParamsVRRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillRepeatedly(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
- Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*msg_);
- request_ptr->on_event(event);
-}
-
-TEST_F(AddCommandRequestTest,
- OnEvent_UI_EventWithNotSuccesResponseCode_ExpectVRCommandDelete) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-
- MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
- (*msg_ui)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::ABORTED;
- (*msg_ui)[msg_params][cmd_id] = kCmdId;
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*msg_ui);
- Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*msg_);
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
- request_ptr->on_event(event_ui);
- request_ptr->on_event(event_vr);
-}
-
-TEST_F(AddCommandRequestTest,
- OnEvent_UI_VR_Events_VRErrorPresent_ExpectRemoveCommand) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& params = (*msg_)[strings::params];
- params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
- SmartObject& image = (*msg_)[msg_params][cmd_icon];
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- am::CommandsMap commands_map;
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
-
- Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*msg_);
- request_ptr->on_event(event_ui);
- EXPECT_CALL(
- app_mngr_,
- 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);
- MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
- (*msg_vr)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::ABORTED;
- (*msg_vr)[msg_params][cmd_id] = kCmdId;
- event_vr.set_smart_object(*msg_vr);
- request_ptr->on_event(event_vr);
-}
-
-TEST_F(AddCommandRequestTest,
- OnTimeOut_AppNotExisted_NoAppRemoveCommandCalled) {
- CreateBasicParamsUIRequest();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()));
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
- SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
- (*response)[strings::msg_params][strings::info] = "info";
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
- .WillOnce(Return(response));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- response, am::commands::Command::CommandOrigin::ORIGIN_SDL));
- utils::SharedPtr<CommandRequestImpl> base_class_request =
- static_cast<utils::SharedPtr<CommandRequestImpl> >(
- CreateCommand<AddCommandRequest>(msg_));
- base_class_request->onTimeOut();
-}
-
-TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
- CreateBasicParamsVRRequest();
- CreateBasicParamsUIRequest();
- SmartObject& msg_params = (*msg_)[strings::msg_params];
- SmartObject& image = msg_params[cmd_icon];
- msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
- EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
- SmartObject first_command = SmartObject(SmartType_Map);
- SmartObject second_command = SmartObject(SmartType_Map);
- const am::CommandsMap commands_map =
- CreateCommandsMap(first_command, second_command);
- EXPECT_CALL(*mock_app_, commands_map())
- .WillRepeatedly(Return(
- DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
- EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
- .WillOnce(Return(so_ptr_.get()));
- {
- InSequence dummy;
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
- .WillOnce(Return(true));
- }
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
- CreateCommand<AddCommandRequest>(msg_);
- request_ptr->Run();
- EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
- (*response)[strings::msg_params][strings::info] = "info";
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
- .WillOnce(Return(response));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- response, am::commands::Command::CommandOrigin::ORIGIN_SDL));
- utils::SharedPtr<CommandRequestImpl> base_class_request =
- static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr);
- base_class_request->onTimeOut();
-}
-
-} // namespace add_command_test
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc
deleted file mode 100644
index f5bb7888d8..0000000000
--- a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "application_manager/commands/mobile/add_sub_menu_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace add_sub_menu_request {
-
-namespace am = ::application_manager;
-using am::commands::AddSubMenuRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using ::testing::_;
-using ::testing::Return;
-
-typedef SharedPtr<AddSubMenuRequest> AddSubMenuPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class AddSubMenuRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
- const uint32_t menu_id = 10u;
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::msg_params][am::strings::menu_id] = menu_id;
-
- utils::SharedPtr<AddSubMenuRequest> command =
- CreateCommand<AddSubMenuRequest>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app));
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
- EXPECT_CALL(*mock_app, AddSubMenu(menu_id, _));
- EXPECT_CALL(*mock_app, UpdateHash());
-
- MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
- (*ev_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
-
- Event event(hmi_apis::FunctionID::UI_AddSubMenu);
- event.set_smart_object(*ev_msg);
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
- command->Init();
- command->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*ui_command_result)[am::strings::msg_params].keyExists(
- am::strings::info)) {
- EXPECT_FALSE(
- (*ui_command_result)[am::strings::msg_params][am::strings::info]
- .asString()
- .empty());
- }
-}
-
-} // namespace add_sub_menu_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
deleted file mode 100644
index 90c6409fa8..0000000000
--- a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "event_engine/event.h"
-#include "application_manager/commands/mobile/alert_maneuver_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace alert_maneuver_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::AlertManeuverRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-
-typedef SharedPtr<AlertManeuverRequest> CommandPtr;
-
-class AlertManeuverRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
- const mobile_apis::Result::eType mobile_response,
- const am::HmiInterfaces::InterfaceState state,
- const bool success) {
- MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
- (*response)[am::strings::params][am::hmi_response::code] = hmi_response;
- (*response)[am::strings::msg_params][am::strings::info] = "test";
-
- am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*response);
-
- utils::SharedPtr<AlertManeuverRequest> command =
- CreateCommand<AlertManeuverRequest>(response);
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(state));
-
- MessageSharedPtr response_to_mobile;
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- _, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
- command->on_event(event);
-
- EXPECT_EQ(
- (*response_to_mobile)[am::strings::msg_params][am::strings::success]
- .asBool(),
- success);
- EXPECT_EQ(
- (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(mobile_response));
- }
-
- protected:
- NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
-};
-
-TEST_F(AlertManeuverRequestTest, Run_RequiredFieldsDoesNotExist_UNSUCCESS) {
- CommandPtr command(CreateCommand<AlertManeuverRequest>());
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(AlertManeuverRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
- (*msg)[am::strings::msg_params][am::strings::tts_chunks] = 0;
-
- CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
-
- ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(ApplicationSharedPtr()));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
- [am::strings::text] = "text";
-
- CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(policy_interface_));
-
- const mobile_apis::Result::eType kProcessingResult =
- mobile_apis::Result::ABORTED;
-
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
- .WillOnce(Return(kProcessingResult));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(kProcessingResult,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(AlertManeuverRequestTest, Run_IsWhiteSpaceExist_UNSUCCESS) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
- (*msg)[am::strings::msg_params][am::strings::tts_chunks] =
- SmartObject(smart_objects::SmartType_Array);
-
- SmartObject tts_chunk(smart_objects::SmartType_Map);
- tts_chunk[am::strings::text] = "wrong chunk syntax\t\n";
-
- (*msg)[am::strings::msg_params][am::strings::tts_chunks].asArray()->push_back(
- tts_chunk);
-
- CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
- [am::strings::text] = "text";
-
- CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(policy_interface_));
-
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
- .WillRepeatedly(
- Return(am::HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS));
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
-
- MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
- EXPECT_EQ(hmi_apis::FunctionID::Navigation_AlertManeuver,
- static_cast<hmi_apis::FunctionID::eType>(
- (*result_msg)[am::strings::params][am::strings::function_id]
- .asInt()));
-}
-
-TEST_F(AlertManeuverRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
- CommandPtr command(CreateCommand<AlertManeuverRequest>());
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- MessageSharedPtr result_msg(
- CatchMobileCommandResult(CallOnEvent(*command, event)));
- EXPECT_EQ(mobile_apis::Result::INVALID_ENUM,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(AlertManeuverRequestTest, OnEvent_SUCCESS) {
- CheckExpectations(hmi_apis::Common_Result::SUCCESS,
- mobile_apis::Result::SUCCESS,
- am::HmiInterfaces::STATE_AVAILABLE,
- true);
-}
-
-TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE) {
- CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_AVAILABLE,
- false);
-}
-
-TEST_F(AlertManeuverRequestTest, OnEvent_WARNINGS) {
- CheckExpectations(hmi_apis::Common_Result::WARNINGS,
- mobile_apis::Result::WARNINGS,
- am::HmiInterfaces::STATE_NOT_RESPONSE,
- true);
-}
-
-TEST_F(AlertManeuverRequestTest, OnEvent_GENERIC_ERROR) {
- CheckExpectations(hmi_apis::Common_Result::GENERIC_ERROR,
- mobile_apis::Result::GENERIC_ERROR,
- am::HmiInterfaces::STATE_NOT_RESPONSE,
- false);
-}
-
-} // namespace alert_maneuver_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_request_test.cc
deleted file mode 100644
index 5d9e507511..0000000000
--- a/src/components/application_manager/test/commands/mobile/alert_request_test.cc
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/alert_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace alert_request {
-
-namespace am = application_manager;
-using am::commands::AlertRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using ::utils::SharedPtr;
-using am::event_engine::Event;
-using policy_test::MockPolicyHandlerInterface;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-typedef SharedPtr<AlertRequest> CommandPtr;
-
-namespace {
-const int32_t kCommandId = 1;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kDefaultTimeout = 1000u;
-const uint32_t kCorrelationId = 2u;
-const mobile_apis::FunctionID::eType kFunctionId =
- mobile_apis::FunctionID::AlertID;
-} // namespace
-
-class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- AlertRequestTest() : mock_app_(CreateMockApp()), msg_(CreateMessage()) {}
-
- protected:
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- void PreConditions() {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(
- Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(
- Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
- }
-
- void Expectations() {
- (*msg_)[am::strings::params][am::strings::function_id] = kFunctionId;
- (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
-
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(
- *mock_app_,
- AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
- .WillByDefault(Return(false));
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
- ON_CALL(*mock_app_, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
- ON_CALL(*mock_app_, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
- }
-
- void AddAlertTextsToMsg() {
- (*msg_)[am::strings::msg_params][am::strings::alert_text1] = "alert_text1";
- (*msg_)[am::strings::msg_params][am::strings::alert_text2] = "alert_text2";
- (*msg_)[am::strings::msg_params][am::strings::alert_text3] = "alert_text3";
- }
- void AddTTSChunkToMsg() {
- (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "tts_chunk_text";
- }
-
- void ExpectCallHmiLevel(const mobile_apis::HMILevel::eType level) {
- EXPECT_CALL(*mock_app_, hmi_level()).WillRepeatedly(Return(level));
- }
-
- void ExpectManageMobileCommandWithResultCode(
- const mobile_apis::Result::eType code) {
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(code),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- }
-
- void ExpectManageHmiCommandTTSAndUI() {
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert)))
- .WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
- }
- sync_primitives::Lock lock_;
-
- MockAppPtr mock_app_;
- MessageSharedPtr msg_;
- MockPolicyHandlerInterface mock_policy_handler_;
-};
-
-TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
- PreConditions();
- MessageSharedPtr command_msg = CreateMessage(smart_objects::SmartType_Map);
- (*command_msg)[am::strings::msg_params][am::strings::result_code] =
- am::mobile_api::Result::GENERIC_ERROR;
- (*command_msg)[am::strings::msg_params][am::strings::success] = false;
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- utils::SharedPtr<AlertRequest> command = CreateCommand<AlertRequest>();
-
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
- .WillOnce(Return(command_msg));
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->onTimeOut();
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- false);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
-}
-
-TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
- PreConditions();
- MessageSharedPtr command_msg = CreateFullParamsUISO();
- (*command_msg)[am::strings::msg_params][am::strings::menu_params]
- [am::hmi_request::parent_id] = 10u;
- (*command_msg)[am::strings::msg_params][am::strings::menu_params]
- [am::strings::menu_name] = "menu_name";
-
- utils::SharedPtr<AlertRequest> command =
- CreateCommand<AlertRequest>(command_msg);
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
- (*msg)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
-
- MessageSharedPtr msg_tts = CreateMessage();
- (*msg_tts)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- Event event_vr(hmi_apis::FunctionID::TTS_Speak);
- event_vr.set_smart_object(*msg_tts);
-
- command->on_event(event_vr);
-
- Event event(hmi_apis::FunctionID::UI_Alert);
- event.set_smart_object(*msg);
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- ResultCommandExpectations(ui_command_result, "UI is not supported by system");
-}
-
-class CallOnTimeOut {
- public:
- CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
-
- void operator()() {
- command_.onTimeOut();
- }
-
- CommandRequestImpl& command_;
-};
-
-TEST_F(AlertRequestTest, Init_DurationExists_SUCCESS) {
- Expectations();
- (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
- (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- EXPECT_TRUE(command->Init());
-}
-
-TEST_F(AlertRequestTest, Init_DurationNotExists_SUCCESS) {
- Expectations();
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- EXPECT_TRUE(command->Init());
-}
-
-TEST_F(AlertRequestTest, OnTimeOut_SUCCESS) {
- Expectations();
- MessageSharedPtr result_msg(CreateMessage(smart_objects::SmartType_Null));
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
- .WillOnce(Return(result_msg));
-
- CommandPtr command(CreateCommand<AlertRequest>());
- MessageSharedPtr received_result_msg(
- CatchMobileCommandResult(CallOnTimeOut(*command)));
- EXPECT_EQ(result_msg, received_result_msg);
-}
-
-TEST_F(AlertRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- Expectations();
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(invalid_app));
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- ExpectManageMobileCommandWithResultCode(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- command->Run();
-}
-
-TEST_F(AlertRequestTest, Run_AlertFrequencyIsTooHigh_UNSUCCESS) {
- Expectations();
- EXPECT_CALL(
- *mock_app_,
- AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
- .WillOnce(Return(true));
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::REJECTED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(AlertRequestTest, Run_FailToProcessSoftButtons_UNSUCCESS) {
- Expectations();
- const mobile_apis::Result::eType result_code =
- mobile_apis::Result::INVALID_ENUM;
-
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(result_code));
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(result_code,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(AlertRequestTest, Run_MandatoryParametersAreMissed_UNSUCCESS) {
- Expectations();
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-}
-
-TEST_F(AlertRequestTest, Run_MandatoryParametersAreInvalid_UNSUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
- "invalid\t\nParam";
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-}
-
-TEST_F(AlertRequestTest, Run_SUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- AddTTSChunkToMsg();
-
- (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
- (*msg_)[am::strings::msg_params][am::strings::progress_indicator] =
- "progress_indicator";
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
-
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
-
- EXPECT_CALL(mock_message_helper_,
- SubscribeApplicationToSoftButton(
- (*msg_)[am::strings::msg_params], _, kFunctionId));
-
- ExpectManageHmiCommandTTSAndUI();
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-}
-
-TEST_F(AlertRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
- Expectations();
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
- event.set_smart_object(*msg_);
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, DISABLED_OnEvent_UI_OnResetTimeout_SUCCESS) {
- PreConditions();
- Expectations();
- AddAlertTextsToMsg();
-
- (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- EXPECT_TRUE(command->Init());
-
- EXPECT_CALL(
- app_mngr_,
- updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_ENUM);
-
- Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- AddTTSChunkToMsg();
-
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::WARNINGS;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
-
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
-
- ExpectManageHmiCommandTTSAndUI();
-
- command->Run();
-
- Event event(hmi_apis::FunctionID::UI_Alert);
- event.set_smart_object(*msg_);
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)));
-
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) {
- PreConditions();
- Expectations();
- AddTTSChunkToMsg();
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::WARNINGS;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
-
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
-
- Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSUnsupportedResource_SUCCESS) {
- Expectations();
- AddTTSChunkToMsg();
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
-
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
-
- Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*msg_);
- PreConditions();
-
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest,
- DISABLED_OnEvent_TTSUnsupportedResourceUiAlertSent_SUCCESS) {
- PreConditions();
-
- Expectations();
- AddAlertTextsToMsg();
- AddTTSChunkToMsg();
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
- (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(mock_message_helper_,
- SubscribeApplicationToSoftButton(
- (*msg_)[am::strings::msg_params], _, kFunctionId));
-
- ExpectManageHmiCommandTTSAndUI();
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
- .WillOnce(Return(true));
-
- Event ui_event(hmi_apis::FunctionID::UI_Alert);
- ui_event.set_smart_object(*msg_);
- command->on_event(ui_event);
-
- Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
- tts_stop_event.set_smart_object(*msg_);
- command->on_event(tts_stop_event);
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
-
- Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, OnEvent_TTSUnsupportedResourceUiAlertSuccess_SUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- AddTTSChunkToMsg();
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
- (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(mock_message_helper_,
- SubscribeApplicationToSoftButton(
- (*msg_)[am::strings::msg_params], _, kFunctionId));
- ExpectManageHmiCommandTTSAndUI();
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
- .WillOnce(Return(true));
-
- Event ui_event(hmi_apis::FunctionID::UI_Alert);
- ui_event.set_smart_object(*msg_);
- command->on_event(ui_event);
-
- Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
- tts_stop_event.set_smart_object(*msg_);
- command->on_event(tts_stop_event);
-
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
-
- Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) {
- Expectations();
- AddTTSChunkToMsg();
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::INVALID_ENUM;
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
- .WillOnce(Return(true));
-
- Event ui_event(hmi_apis::FunctionID::UI_Alert);
- ui_event.set_smart_object(*msg_);
- command->on_event(ui_event);
-
- Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
- tts_stop_event.set_smart_object(*msg_);
- command->on_event(tts_stop_event);
-
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
-
- Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) {
- Expectations();
- AddTTSChunkToMsg();
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
- .WillOnce(Return(true));
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::INVALID_ENUM;
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
- .WillOnce(Return(true));
-
- Event ui_event(hmi_apis::FunctionID::UI_Alert);
- ui_event.set_smart_object(*msg_);
- command->on_event(ui_event);
-
- Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
- tts_stop_event.set_smart_object(*msg_);
- command->on_event(tts_stop_event);
-
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::ABORTED;
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
-
- Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::WARNINGS;
- (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
-
- ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- ExpectManageHmiCommandTTSAndUI();
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
- .WillOnce(Return(true));
-
- Event ui_event(hmi_apis::FunctionID::UI_Alert);
- ui_event.set_smart_object(*msg_);
- command->on_event(ui_event);
-
- Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
- tts_stop_event.set_smart_object(*msg_);
- command->on_event(tts_stop_event);
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
-
- Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(AlertRequestTest, Run_InvalidAlert2_UNSUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
- "invalid_text_with_empty_str\\n";
-
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-}
-
-TEST_F(AlertRequestTest, Run_InvalidAlert3_UNSUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- (*msg_)[am::strings::msg_params][am::strings::alert_text3] =
- "invalid_text_with_empty_str\\n";
-
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-}
-
-TEST_F(AlertRequestTest, Run_InvalidTTSChunk_UNSUCCESS) {
- Expectations();
- AddAlertTextsToMsg();
- (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "invalid_text_with_empty_str\\n";
-
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- CommandPtr command(CreateCommand<AlertRequest>(msg_));
- command->Run();
-}
-
-} // namespace alert_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/test/commands/mobile/change_registration_test.cc
deleted file mode 100644
index 3d7671015c..0000000000
--- a/src/components/application_manager/test/commands/mobile/change_registration_test.cc
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/change_registration_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "utils/custom_string.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "policy/usage_statistics/mock_statistics_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace change_registration_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using ::testing::_;
-using ::utils::SharedPtr;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SetArgPointee;
-using am::commands::ChangeRegistrationRequest;
-using policy_test::MockPolicyHandlerInterface;
-using ::test::components::application_manager_test::MockApplication;
-
-namespace custom_str = utils::custom_string;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class ChangeRegistrationRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- ChangeRegistrationRequestTest()
- : mock_app_(CreateMockApp())
- , supported_languages_(CreateMessage(smart_objects::SmartType_Array)) {}
-
- MessageSharedPtr CreateMsgFromMobile() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::hmi_display_language] = mobile_apis::Language::EN_US;
- msg_params[strings::language] = mobile_apis::Language::EN_US;
- (*msg)[strings::msg_params] = msg_params;
- return msg;
- }
- void PrepareExpectationBeforeRun() {
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities_));
- (*supported_languages_)[0] =
- static_cast<int32_t>(mobile_apis::Language::EN_US);
- EXPECT_CALL(hmi_capabilities_, ui_supported_languages())
- .WillOnce(Return(supported_languages_.get()));
- EXPECT_CALL(hmi_capabilities_, vr_supported_languages())
- .WillOnce(Return(supported_languages_.get()));
- EXPECT_CALL(hmi_capabilities_, tts_supported_languages())
- .WillOnce(Return(supported_languages_.get()));
-
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
- .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
- .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
- .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- }
-
- void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
- const mobile_apis::Result::eType mobile_response,
- const am::HmiInterfaces::InterfaceState state,
- const bool success,
- const hmi_apis::Common_Result::eType ui_hmi_response =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- const hmi_apis::Common_Result::eType vr_hmi_response =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
-
- utils::SharedPtr<ChangeRegistrationRequest> command =
- CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
- am::ApplicationSet application_set;
- const utils::custom_string::CustomString name("name");
- MockAppPtr app = CreateMockApp();
- app->set_name(name);
-
- DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
-
- application_set.insert(app);
-
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
- EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
- PrepareExpectationBeforeRun();
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(state));
- command->Run();
-
- MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
- MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
- MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
- CreateResponseFromHMI(ui_response, ui_hmi_response, "ui_info");
- CreateResponseFromHMI(vr_response, vr_hmi_response, "unsupported_resource");
-
- (*tts_response)[strings::params][hmi_response::code] = hmi_response;
- (*tts_response)[strings::msg_params] = 0;
-
- am::event_engine::Event event_ui(
- hmi_apis::FunctionID::UI_ChangeRegistration);
- event_ui.set_smart_object(*ui_response);
- am::event_engine::Event event_vr(
- hmi_apis::FunctionID::VR_ChangeRegistration);
- event_vr.set_smart_object(*vr_response);
- am::event_engine::Event event_tts(
- hmi_apis::FunctionID::TTS_ChangeRegistration);
- event_tts.set_smart_object(*tts_response);
-
- MessageSharedPtr response_to_mobile;
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- _, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->on_event(event_ui);
- command->on_event(event_vr);
- command->on_event(event_tts);
-
- EXPECT_EQ(
- (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
- success);
- EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
- .asInt(),
- static_cast<int32_t>(mobile_response));
- }
-
- void CreateResponseFromHMI(MessageSharedPtr msg,
- hmi_apis::Common_Result::eType result,
- const std::string& info) {
- (*msg)[strings::params][hmi_response::code] = static_cast<int32_t>(result);
- (*msg)[strings::msg_params][strings::info] = info;
- }
-
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities_));
- }
-
- void ExpectationsHmiCapabilities(
- smart_objects::SmartObjectSPtr supported_languages) {
- EXPECT_CALL(hmi_capabilities_, ui_supported_languages())
- .WillOnce(Return(supported_languages.get()));
- EXPECT_CALL(hmi_capabilities_, vr_supported_languages())
- .WillOnce(Return(supported_languages.get()));
- EXPECT_CALL(hmi_capabilities_, tts_supported_languages())
- .WillOnce(Return(supported_languages.get()));
- }
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- typedef TypeIf<kMocksAreNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
- sync_primitives::Lock app_set_lock_;
- MockHMICapabilities hmi_capabilities_;
- MockAppPtr mock_app_;
- MessageSharedPtr supported_languages_;
- MockPolicyHandlerInterface mock_policy_handler_;
-};
-
-typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities;
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
- utils::SharedPtr<ChangeRegistrationRequest> command =
- CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
-
- am::ApplicationSet application_set;
- const utils::custom_string::CustomString name("name");
- MockAppPtr app = CreateMockApp();
- app->set_name(name);
-
- DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
-
- application_set.insert(app);
-
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
- EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
-
- smart_objects::SmartObjectSPtr supported_languages(
- CreateMessage(smart_objects::SmartType_Array));
- (*supported_languages)[0] =
- static_cast<int32_t>(mobile_apis::Language::EN_US);
-
- ExpectationsHmiCapabilities(supported_languages);
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
-
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- command->Run();
-
- MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
- MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
- MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
- CreateResponseFromHMI(
- ui_response, hmi_apis::Common_Result::WARNINGS, "ui_info");
- CreateResponseFromHMI(vr_response,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- "VR is not supported by system");
- CreateResponseFromHMI(
- tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
- (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
- (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
- (*tts_response)[am::strings::msg_params][am::strings::app_id] =
- kConnectionKey;
- am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
- event_ui.set_smart_object(*ui_response);
- am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
- event_vr.set_smart_object(*vr_response);
- am::event_engine::Event event_tts(
- hmi_apis::FunctionID::TTS_ChangeRegistration);
- event_tts.set_smart_object(*tts_response);
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- MessageSharedPtr response_to_mobile;
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->on_event(event_ui);
- command->on_event(event_tts);
- command->on_event(event_vr);
-
- ResultCommandExpectations(response_to_mobile,
- "ui_info, VR is not supported by system, tts_info");
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
- MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
- utils::SharedPtr<ChangeRegistrationRequest> command =
- CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
- am::ApplicationSet application_set;
- const utils::custom_string::CustomString name("name");
- MockAppPtr app = CreateMockApp();
- app->set_name(name);
- DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
- application_set.insert(app);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
- EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
-
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities_));
- (*supported_languages_)[0] =
- static_cast<int32_t>(mobile_apis::Language::EN_US);
- EXPECT_CALL(hmi_capabilities_, ui_supported_languages())
- .WillOnce(Return(supported_languages_.get()));
- EXPECT_CALL(hmi_capabilities_, vr_supported_languages())
- .WillOnce(Return(supported_languages_.get()));
- EXPECT_CALL(hmi_capabilities_, tts_supported_languages())
- .WillOnce(Return(supported_languages_.get()));
-
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- MessageSharedPtr response_to_mobile;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
- command->Run();
-
- EXPECT_EQ(
- (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
- false);
- EXPECT_EQ(
- (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
- static_cast<int32_t>(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_false) {
- CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_NOT_RESPONSE,
- false);
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_false) {
- CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_AVAILABLE,
- false);
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_UNSUPPORTED_RESOURCE_SUCCESS_STATE_AVAILABLE_Expect_true) {
- CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_AVAILABLE,
- true,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::SUCCESS);
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_SUCCESS_STATE_AVAILABLE_Expect_true) {
- CheckExpectations(hmi_apis::Common_Result::SUCCESS,
- mobile_apis::Result::SUCCESS,
- am::HmiInterfaces::STATE_AVAILABLE,
- true,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::SUCCESS);
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_WRONG_LANGUAGE_STATE_AVAILABLE_Expect_true) {
- CheckExpectations(hmi_apis::Common_Result::WRONG_LANGUAGE,
- mobile_apis::Result::WRONG_LANGUAGE,
- am::HmiInterfaces::STATE_AVAILABLE,
- true,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::SUCCESS);
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_INVALID_DATA_STATE_AVAILABLE_Expect_false) {
- CheckExpectations(hmi_apis::Common_Result::INVALID_DATA,
- mobile_apis::Result::INVALID_DATA,
- am::HmiInterfaces::STATE_AVAILABLE,
- false,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::SUCCESS);
-}
-
-TEST_F(ChangeRegistrationRequestTest,
- OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
-
- utils::SharedPtr<ChangeRegistrationRequest> command =
- CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
-
- am::ApplicationSet application_set;
- const utils::custom_string::CustomString name("name");
- MockAppPtr app = CreateMockApp();
- app->set_name(name);
-
- DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
-
- application_set.insert(app);
-
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
- EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
-
- smart_objects::SmartObjectSPtr supported_languages(
- CreateMessage(smart_objects::SmartType_Array));
- (*supported_languages)[0] =
- static_cast<int32_t>(mobile_apis::Language::EN_US);
-
- ExpectationsHmiCapabilities(supported_languages);
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- command->Run();
-
- MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
- MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
- MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
- CreateResponseFromHMI(ui_response,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- "unsupported_resource");
- CreateResponseFromHMI(
- vr_response, hmi_apis::Common_Result::WARNINGS, "vr_info");
- CreateResponseFromHMI(
- tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
- (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
- (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
- (*tts_response)[am::strings::msg_params][am::strings::app_id] =
- kConnectionKey;
- am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
- event_ui.set_smart_object(*ui_response);
- am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
- event_vr.set_smart_object(*vr_response);
- am::event_engine::Event event_tts(
- hmi_apis::FunctionID::TTS_ChangeRegistration);
- event_tts.set_smart_object(*tts_response);
-
- MessageSharedPtr response_to_mobile;
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->on_event(event_vr);
- command->on_event(event_tts);
- command->on_event(event_ui);
-
- ResultCommandExpectations(response_to_mobile,
- "unsupported_resource, vr_info, tts_info");
-}
-
-} // namespace change_registration_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
deleted file mode 100644
index c3513d2acb..0000000000
--- a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
+++ /dev/null
@@ -1,814 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
-#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace create_interaction_choice_set_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using ::testing::_;
-using ::utils::SharedPtr;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::AtLeast;
-using am::commands::CreateInteractionChoiceSetRequest;
-using am::commands::CreateInteractionChoiceSetResponse;
-using ::test::components::application_manager_test::MockApplication;
-
-namespace custom_str = utils::custom_string;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-typedef SharedPtr<CreateInteractionChoiceSetRequest>
- CreateInteractionChoiceSetRequestPtr;
-typedef SharedPtr<CreateInteractionChoiceSetResponse>
- CreateInteractionChoiceSetResponsePtr;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const hmi_apis::FunctionID::eType kInvalidFunctionId =
- hmi_apis::FunctionID::INVALID_ENUM;
-const int32_t kCommandId = 1;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 10u;
-const uint32_t kGrammarId = 10u;
-const int32_t kMenuId = 5;
-const uint32_t kChoiceSetId = 1u;
-const uint32_t kChoiceId1 = 2u;
-const uint32_t kChoiceId2 = 3u;
-const std::string kImage = "image";
-const std::string kSecondImage = "second_image";
-const std::string kVrCommands1 = "vr_commands_1";
-const std::string kVrCommands2 = "vr_commands_2";
-const std::string kMenuName = "menu_name";
-
-} // namespace
-
-class CreateInteractionChoiceSetRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- CreateInteractionChoiceSetRequestTest()
- : message_(CreateMessage())
- , command_(CreateCommand<CreateInteractionChoiceSetRequest>(message_))
- , mock_app_(CreateMockApp()) {}
-
- MessageSharedPtr CreateFullParamsVRSO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] = kCmdId;
- msg_params[strings::vr_commands] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- msg_params[strings::vr_commands][0] = "lamer";
- msg_params[strings::type] = 34;
- msg_params[strings::grammar_id] = 12;
- msg_params[strings::app_id] = kAppId;
- (*msg)[strings::msg_params] = msg_params;
-
- return msg;
- }
-
- void FillMessageFieldsItem1(MessageSharedPtr message) {
- (*message)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::menu_name] = kMenuName;
- (*message)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::image][am::strings::value] = kImage;
- (*message)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::choice_id] = kChoiceId1;
- (*message)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::vr_commands][0] = kVrCommands1;
- (*message)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_image][am::strings::value] = kSecondImage;
- }
- void FillMessageFieldsItem2(MessageSharedPtr message) {
- (*message)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::choice_id] = kChoiceId2;
- (*message)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::menu_name] = kMenuName;
- (*message)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::vr_commands][0] = kVrCommands2;
- (*message)[am::strings::msg_params]
- [am::strings::interaction_choice_set_id] = kChoiceSetId;
- }
-
- MessageSharedPtr message_;
- CreateInteractionChoiceSetRequestPtr command_;
- MockAppPtr mock_app_;
- sync_primitives::Lock lock_;
-};
-
-class CreateInteractionChoiceSetResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
- MessageSharedPtr msg_vr = CreateMessage(smart_objects::SmartType_Map);
- (*msg_vr)[strings::msg_params][strings::result_code] =
- am::mobile_api::Result::GENERIC_ERROR;
- (*msg_vr)[strings::msg_params][strings::success] = false;
-
- utils::SharedPtr<CreateInteractionChoiceSetRequest> req_vr =
- CreateCommand<CreateInteractionChoiceSetRequest>();
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app));
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(*mock_app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(*mock_app, RemoveCommand(_)).WillByDefault(Return());
-
- MessageSharedPtr vr_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
-
- req_vr->onTimeOut();
- EXPECT_EQ(
- (*vr_command_result)[strings::msg_params][strings::success].asBool(),
- false);
- EXPECT_EQ(
- (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
- static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_vr = CreateFullParamsVRSO();
- (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::choice_id] =
- 10;
- (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::menu_name] =
- "menu_name";
- (*msg_vr)[strings::msg_params][strings::interaction_choice_set_id] = 11;
- utils::SharedPtr<CreateInteractionChoiceSetRequest> req_vr =
- CreateCommand<CreateInteractionChoiceSetRequest>(msg_vr);
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
-
- smart_objects::SmartObject* null_obj = NULL;
- ON_CALL(*mock_app_, FindChoiceSet(_)).WillByDefault(Return(null_obj));
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[strings::msg_params][strings::info] = "VR is not supported by system";
- (*msg)[strings::msg_params][strings::cmd_id] = kCommandId;
-
- am::event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*msg);
-
- smart_objects::SmartObject* ptr = NULL;
- ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr));
- EXPECT_EQ(NULL, ptr);
-
- am::CommandsMap commands_map;
- ON_CALL(*mock_app_, commands_map())
- .WillByDefault(
- Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
-
- ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
- .WillByDefault(
- Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
-
- req_vr->Run();
-
- MessageSharedPtr vr_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
-
- req_vr->on_event(event);
-
- EXPECT_EQ(
- (*vr_command_result)[strings::msg_params][strings::success].asBool(),
- false);
- EXPECT_EQ(
- (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*vr_command_result)[strings::msg_params].keyExists(strings::info)) {
- EXPECT_EQ(
- (*vr_command_result)[strings::msg_params][strings::info].asString(),
- (*msg)[strings::msg_params][strings::info].asString());
- }
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
-
- command_->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest, Run_VerifyImageFail_UNSUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::image] = kImage;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_image] = kSecondImage;
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::INVALID_DATA));
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
-
- command_->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::image] = kImage;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_image] = kSecondImage;
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* invalid_choice_set_id =
- &((*message_)[am::strings::msg_params]
- [am::strings::interaction_choice_set_id]);
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(invalid_choice_set_id));
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command_->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- Run_CheckChoiceSet_InvalidChoiceId_UNSUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::menu_name] = kMenuName;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::image][am::strings::value] = kImage;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::choice_id] = kChoiceId1;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_image][am::strings::value] = kSecondImage;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::vr_commands][0] = kVrCommands1;
-
- FillMessageFieldsItem2(message_);
- (*message_)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::vr_commands][0] = kVrCommands1;
- (*message_)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::vr_commands][1] = " kVrCommands2\t";
- (*message_)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::vr_commands][0] = kVrCommands1;
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command_->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- Run_IsWhiteSpaceVRCommandsExist_InvalidMenuName_UNSUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::menu_name] = "menu_name\t";
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_text] = "secondary_text\t";
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::tertiary_text] = "tertiary_text\t";
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::image][am::strings::value] = "image\t";
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::choice_id] = kChoiceId1;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_image][am::strings::value] =
- "second_image\t";
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::vr_commands][0] = "vr_commands_1\t";
-
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillRepeatedly(Return(choice_set_id));
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
- .keyExists(am::strings::menu_name)) {
- CreateInteractionChoiceSetRequestPtr command(
- CreateCommand<CreateInteractionChoiceSetRequest>(message_));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command->Run();
- }
- if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
- .keyExists(am::strings::secondary_text)) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::menu_name] = kMenuName;
- CreateInteractionChoiceSetRequestPtr command(
- CreateCommand<CreateInteractionChoiceSetRequest>(message_));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command->Run();
- }
- if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
- .keyExists(am::strings::tertiary_text)) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_text] = "secondary_text";
- CreateInteractionChoiceSetRequestPtr command(
- CreateCommand<CreateInteractionChoiceSetRequest>(message_));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command->Run();
- }
- if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
- .keyExists(am::strings::vr_commands)) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::tertiary_text] = "tertiary_text";
- CreateInteractionChoiceSetRequestPtr command(
- CreateCommand<CreateInteractionChoiceSetRequest>(message_));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command->Run();
- }
- if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
- .keyExists(am::strings::image)) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::vr_commands][0] = "vr_commands";
- CreateInteractionChoiceSetRequestPtr command(
- CreateCommand<CreateInteractionChoiceSetRequest>(message_));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command->Run();
- }
- if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
- .keyExists(am::strings::secondary_image)) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::image][am::strings::value] = kImage;
- CreateInteractionChoiceSetRequestPtr command(
- CreateCommand<CreateInteractionChoiceSetRequest>(message_));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
- command->Run();
- }
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- Run_ValidAmountVrCommands_SUCCESS) {
- FillMessageFieldsItem1(message_);
- FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .Times(AtLeast(2))
- .WillOnce(Return(kConnectionKey))
- .WillOnce(Return(kConnectionKey));
- command_->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- Run_EmptyAmountVrCommands_SUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::menu_name] = kMenuName;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::image][am::strings::value] = kImage;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::choice_id] = kChoiceId1;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::secondary_image][am::strings::value] = kSecondImage;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::vr_commands][0] = kVrCommands1;
- (*message_)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::choice_id] = kChoiceId2;
- (*message_)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::menu_name] = kMenuName;
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
- (*message_)[am::strings::msg_params][am::strings::choice_set][1]
- [am::strings::vr_commands][0] = kVrCommands2;
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
- command_->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- OnEvent_InvalidEventId_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
- command_->on_event(event);
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- OnEvent_InvalidVrCommand_UNSUCCESS) {
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::WARNINGS;
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
-
- Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*message_);
-
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
- command_->on_event(event);
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) {
- Event event(hmi_apis::FunctionID::VR_AddCommand);
-
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::WARNINGS;
-
- FillMessageFieldsItem1(message_);
- FillMessageFieldsItem2(message_);
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- command_->Run();
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
- event.set_smart_object(*message_);
-
- command_->on_event(event);
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- OnEvent_InValidVrNoError_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::VR_AddCommand);
-
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::INVALID_DATA;
-
- FillMessageFieldsItem1(message_);
- FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- command_->Run();
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
- event.set_smart_object(*message_);
-
- command_->on_event(event);
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- OnEvent_ValidVrNoErrorAndExpectedChoiceLessThanReceiveChoice_SUCCESS) {
- Event event(hmi_apis::FunctionID::VR_AddCommand);
-
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::WARNINGS;
-
- FillMessageFieldsItem1(message_);
-
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- command_->Run();
-
- FillMessageFieldsItem2(message_);
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
- event.set_smart_object(*message_);
- command_->on_event(event);
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- OnTimeOut_InvalidErrorFromHMI_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
- am::commands::Command::ORIGIN_SDL));
-
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
- command_->onTimeOut();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- OnTimeOut_ValidErrorFromHMI_SUCCESS) {
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::INVALID_ENUM;
-
- FillMessageFieldsItem1(message_);
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- command_->Run();
-
- FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
- Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*message_);
- command_->on_event(event);
-
- EXPECT_CALL(*mock_app_, RemoveChoiceSet(kChoiceSetId));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
- command_->onTimeOut();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::INVALID_ENUM;
-
- FillMessageFieldsItem1(message_);
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- command_->Run();
-
- FillMessageFieldsItem2(message_);
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(2);
- Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*message_);
- command_->on_event(event);
-
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(invalid_app));
- EXPECT_CALL(*mock_app_, RemoveChoiceSet(_)).Times(0);
- command_->onTimeOut();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest,
- OnTimeOut_SuccessfulResponseReceived_UNSUCCESS) {
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
-
- FillMessageFieldsItem1(message_);
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
-
- smart_objects::SmartObject* choice_set_id = NULL;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
-
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
-
- command_->Run();
-
- FillMessageFieldsItem2(message_);
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
-
- Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*message_);
-
- command_->on_event(event);
-
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, RemoveChoiceSet(_));
-
- command_->onTimeOut();
-}
-
-TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
- MessageSharedPtr message(CreateMessage());
- (*message)[am::strings::msg_params][am::strings::success] = false;
- (*message)[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::INVALID_ENUM;
- CreateInteractionChoiceSetResponsePtr command(
- CreateCommand<CreateInteractionChoiceSetResponse>(message));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(message, false));
- command->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessTrue_SUCCESS) {
- MessageSharedPtr message(CreateMessage());
- (*message)[am::strings::msg_params][am::strings::success] = true;
- (*message)[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::SUCCESS;
- CreateInteractionChoiceSetResponsePtr command(
- CreateCommand<CreateInteractionChoiceSetResponse>(message));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(message, false));
- command->Run();
-}
-
-TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::VR_AddCommand);
-
- (*message_)[am::strings::params][am::strings::correlation_id] =
- kCorrelationId;
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::GENERIC_ERROR;
-
- FillMessageFieldsItem1(message_);
-
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
- .WillRepeatedly(Return(choice_set_id));
-
- EXPECT_CALL(app_mngr_, GenerateGrammarID())
- .WillRepeatedly(Return(kGrammarId));
- EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(2);
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- command_->Run();
-
- FillMessageFieldsItem2(message_);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
- am::commands::Command::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
- event.set_smart_object(*message_);
- command_->on_event(event);
- command_->Run();
-}
-
-} // namespace create_interaction_choice_set_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc
deleted file mode 100644
index c92ec81a1f..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "application_manager/commands/mobile/delete_command_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace delete_command_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::DeleteCommandRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using am::MockMessageHelper;
-using am::MockHmiInterfaces;
-
-typedef SharedPtr<DeleteCommandRequest> DeleteCommandPtr;
-
-namespace {
-const int32_t kCommandId = 1;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class DeleteCommandRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- DeleteCommandRequestTest() : mock_app_(CreateMockApp()) {}
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- MessageSharedPtr CreateFullParamsVRSO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::vr_commands] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- msg_params[am::strings::vr_commands][0] = "lamer";
- msg_params[am::strings::type] = 34;
- msg_params[am::strings::grammar_id] = 12;
- msg_params[am::strings::app_id] = kAppId;
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
- }
-
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockAppPtr mock_app_;
-};
-
-TEST_F(DeleteCommandRequestTest,
- OnEvent_VrHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr command_msg = CreateFullParamsVRSO();
- (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
-
- MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
- (*test_msg)[am::strings::vr_commands] = 0;
- (*test_msg)[am::strings::menu_params] = 0;
-
- ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- ON_CALL(hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(*mock_app_, FindCommand(kCommandId))
- .WillByDefault(Return(test_msg.get()));
- ON_CALL(*mock_app_, get_grammar_id()).WillByDefault(Return(kConnectionKey));
-
- MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
- event_ui.set_smart_object(*msg);
- command->Init();
- command->Run();
- command->on_event(event_ui);
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*event_msg)[am::strings::msg_params][am::strings::info] =
- "VR is not supported by system";
- Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
- event_vr.set_smart_object(*event_msg);
-
- EXPECT_CALL(*mock_app_, RemoveCommand(kCommandId));
-
- EXPECT_CALL(*mock_app_, UpdateHash());
-
- MessageSharedPtr vr_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
-
- command->on_event(event_vr);
-
- ResultCommandExpectations(vr_command_result, "VR is not supported by system");
-}
-
-TEST_F(DeleteCommandRequestTest,
- OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr command_msg = CreateFullParamsUISO();
- (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
-
- MockAppPtr app = CreateMockApp();
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
- (*test_msg)[am::strings::vr_commands] = 0;
- (*test_msg)[am::strings::menu_params] = 0;
-
- ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(*app, FindCommand(kCommandId)).WillByDefault(Return(test_msg.get()));
- ON_CALL(*app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
-
- MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
- event_vr.set_smart_object(*msg);
-
- command->Init();
- command->Run();
- command->on_event(event_vr);
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*event_msg)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
- Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
- event_ui.set_smart_object(*event_msg);
-
- EXPECT_CALL(*app, RemoveCommand(kCommandId));
-
- EXPECT_CALL(*app, UpdateHash());
-
- MessageSharedPtr result_msg(
- CatchMobileCommandResult(CallOnEvent(*command, event_ui)));
-
- ASSERT_TRUE(result_msg);
-
- ResultCommandExpectations(result_msg, "UI is not supported by system");
-}
-
-} // namespace delete_command_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/test/commands/mobile/delete_file_test.cc
deleted file mode 100644
index 3692f7298e..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_file_test.cc
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <vector>
-#include <string>
-#include <map>
-
-#include "mobile/delete_file_request.h"
-#include "mobile/delete_file_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_application_manager_settings.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/policies/policy_handler.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace delete_file {
-
-using ::testing::_;
-using ::testing::Test;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SetArgReferee;
-using ::testing::AtLeast;
-namespace am = ::application_manager;
-using am::commands::DeleteFileRequest;
-using am::commands::DeleteFileResponse;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using am::MockMessageHelper;
-
-typedef SharedPtr<DeleteFileRequest> DeleteFileRequestPtr;
-typedef SharedPtr<DeleteFileResponse> DeleteFileResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-ACTION_TEMPLATE(SetArgPointer,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_1_VALUE_PARAMS(vec)) {
- *std::tr1::get<k>(args) = *vec;
-}
-
-MATCHER_P(CheckMessageResultCode, result_code, "") {
- return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
- result_code;
-}
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const uint32_t kCorrelationId = 10u;
-const int32_t kMenuId = 5;
-} // namespace
-
-class DeleteFileRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- message_ = CreateMessage();
- command_ = CreateCommand<DeleteFileRequest>(message_);
- mock_app_ = CreateMockApp();
- }
- DeleteFileRequestPtr command_;
- MessageSharedPtr message_;
- MockAppPtr mock_app_;
-};
-
-class DeleteFileResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(DeleteFileRequestTest, Run_InvalidApp_UNSUCCESS) {
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_, get_settings()).Times(0);
-
- command_->Run();
-}
-
-TEST_F(DeleteFileRequestTest, Run_HMILevelNone_UNSUCCESS) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- const uint32_t num = 0;
- EXPECT_CALL(app_mngr_settings_, delete_file_in_none())
- .WillOnce(ReturnRef(num));
- EXPECT_CALL(*mock_app_, delete_file_in_none_count()).WillOnce(Return(1));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::REJECTED),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- command_->Run();
-}
-
-TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) {
- const std::string file_name = "test_file.txt";
- EXPECT_TRUE(file_system::CreateFile(file_name));
- (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app_));
- EXPECT_CALL(*mock_app_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kFullFilePath));
-
- am::AppFile file;
- file.file_name = file_name;
- file.file_type = mobile_apis::FileType::BINARY;
-
- EXPECT_CALL(*mock_app_, GetFile(_)).WillOnce(Return(&file));
- EXPECT_CALL(*mock_app_, DeleteFile(_));
- EXPECT_CALL(*mock_app_, increment_delete_file_in_none_count());
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::SUCCESS),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- command_->Run();
-}
-
-TEST_F(DeleteFileRequestTest, Run_InvalidFile_UNSUCCESS) {
- const std::string file_name = "test_file.txt";
- (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
-
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kFullFilePath));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- command_->Run();
-}
-
-TEST_F(DeleteFileResponseTest, Run_InvalidApp_UNSUCCESS) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(invalid_app));
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(CheckMessageResultCode(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED),
- false));
-
- command->Run();
-}
-
-TEST_F(DeleteFileResponseTest, Run_ValidApp_SUCCESS) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*message)[am::strings::msg_params][am::strings::success] = true;
-
- DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
- const uint32_t kAvailableDiskSpace = 10u;
- EXPECT_CALL(*app, GetAvailableDiskSpace())
- .WillOnce(Return(kAvailableDiskSpace));
-
- EXPECT_CALL(app_mngr_,
- SendMessageToMobile(
- CheckMessageResultCode(mobile_apis::Result::SUCCESS), _));
-
- command->Run();
-}
-
-} // namespace delete_file
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc
deleted file mode 100644
index 192cad12b0..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <map>
-
-#include "mobile/delete_interaction_choice_set_request.h"
-#include "mobile/delete_interaction_choice_set_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace delete_interaction_choice_set {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::InSequence;
-
-namespace am = ::application_manager;
-
-using am::commands::DeleteInteractionChoiceSetRequest;
-using am::commands::DeleteInteractionChoiceSetResponse;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-
-typedef SharedPtr<DeleteInteractionChoiceSetRequest>
- DeleteInteractionChoiceSetRequestPtr;
-typedef SharedPtr<DeleteInteractionChoiceSetResponse>
- DeleteInteractionChoiceSetResponsePtr;
-
-MATCHER_P(CheckMessageSuccess, success, "") {
- return success ==
- (*arg)[am::strings::msg_params][am::strings::success].asBool();
-}
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kChoiceSetId = 11u;
-const uint32_t kChoiceId = 110u;
-const uint32_t kGrammarId = 101u;
-} // namespace
-
-class DeleteInteractionChoiceSetRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- DeleteInteractionChoiceSetRequestTest()
- : accessor_(choice_set_map_, performinteraction_choice_set_lock_) {}
-
- ~DeleteInteractionChoiceSetRequestTest() {
- // Fix DataAccessor release and WinQt crash
- Mock::VerifyAndClearExpectations(&app_mngr_);
- }
-
- am::PerformChoiceSetMap choice_set_map_;
- mutable sync_primitives::Lock performinteraction_choice_set_lock_;
- DataAccessor<am::PerformChoiceSetMap> accessor_;
-
- protected:
- void SetUp() OVERRIDE {
- message_ = CreateMessage();
- command_ = CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
- app_ = CreateMockApp();
- }
-
- DeleteInteractionChoiceSetRequestPtr command_;
- MessageSharedPtr message_;
- MockAppPtr app_;
-};
-
-class DeleteInteractionChoiceSetResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- message_ = CreateMessage();
- command_ = CreateCommand<DeleteInteractionChoiceSetResponse>(message_);
- app_ = CreateMockApp();
- }
- DeleteInteractionChoiceSetResponsePtr command_;
- MessageSharedPtr message_;
- MockAppPtr app_;
-};
-
-TEST_F(DeleteInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_, FindChoiceSet(_)).Times(0);
- command_->Run();
-}
-
-TEST_F(DeleteInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
-
- smart_objects::SmartObject* choice_set_id = NULL;
- EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- command_->Run();
-}
-
-TEST_F(DeleteInteractionChoiceSetRequestTest, Run_ChoiceSetInUse_SUCCESS) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
-
- smart_objects::SmartObject* choice_set_id =
- &((*message_)[am::strings::msg_params]
- [am::strings::interaction_choice_set_id]);
-
- choice_set_map_[0].insert(
- std::make_pair(kChoiceSetId,
- &((*message_)[am::strings::msg_params]
- [am::strings::interaction_choice_set_id])));
-
- EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
- EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(true));
- EXPECT_CALL(*app_, performinteraction_choice_set_map())
- .WillOnce(Return(accessor_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- command_->Run();
-}
-
-TEST_F(DeleteInteractionChoiceSetRequestTest,
- Run_SendVrDeleteCommand_PerformInteractionFalse_UNSUCCESS) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
- smart_objects::SmartObject* choice_set_id =
- &((*message_)[am::strings::msg_params]
- [am::strings::interaction_choice_set_id]);
- smart_objects::SmartObject* invalid_choice_set_id = NULL;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(app_));
-
- InSequence seq;
-
- EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
- EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
- EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
-
- EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(invalid_choice_set_id));
-
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
- EXPECT_CALL(*app_, UpdateHash());
-
- DeleteInteractionChoiceSetRequestPtr command =
- CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
-
- command->Init();
- command->Run();
-}
-
-TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
- kChoiceSetId;
- (*message_)[am::strings::msg_params][am::strings::grammar_id] = kGrammarId;
- (*message_)[am::strings::msg_params][am::strings::choice_set][0]
- [am::strings::choice_id] = kChoiceId;
- smart_objects::SmartObject* choice_set_id =
- &((*message_)[am::strings::msg_params]);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(app_));
-
- InSequence seq;
-
- EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
- EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
- EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
-
- EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
- .WillOnce(Return(choice_set_id));
-
- EXPECT_CALL(*app_, app_id())
- .WillOnce(Return(kConnectionKey))
- .WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
- EXPECT_CALL(*app_, UpdateHash());
-
- DeleteInteractionChoiceSetRequestPtr command =
- CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
-
- command->Init();
- command->Run();
-}
-
-TEST_F(DeleteInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::success] = false;
-
- EXPECT_CALL(app_mngr_,
- SendMessageToMobile(CheckMessageSuccess(false), false));
- command_->Run();
-}
-
-TEST_F(DeleteInteractionChoiceSetResponseTest, Run_ValidResultCode_SUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::result_code] =
- hmi_apis::Common_Result::SUCCESS;
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageSuccess(true), false));
- command_->Run();
-}
-
-TEST_F(DeleteInteractionChoiceSetResponseTest,
- Run_InvalidResultCode_UNSUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::result_code] =
- hmi_apis::Common_Result::INVALID_ENUM;
-
- EXPECT_CALL(app_mngr_,
- SendMessageToMobile(CheckMessageSuccess(false), false));
- command_->Run();
-}
-
-} // namespace delete_interaction_choice_set
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc
deleted file mode 100644
index cc21e5366e..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "application_manager/commands/mobile/delete_sub_menu_request.h"
-#include "application_manager/commands/mobile/delete_sub_menu_response.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace delete_sub_menu_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::InSequence;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using am::MockHmiInterfaces;
-using am::MockMessageHelper;
-
-using am::commands::DeleteSubMenuRequest;
-using am::commands::DeleteSubMenuResponse;
-
-typedef SharedPtr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
-typedef SharedPtr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
-
-MATCHER_P(CheckMessageResultCode, result_code, "") {
- return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
- result_code;
-}
-
-MATCHER_P(CheckMessageConnectionKey, connection_key, "") {
- return (*arg)[am::strings::msg_params][am::strings::connection_key].asInt() ==
- connection_key;
-}
-
-ACTION_P(DeleteCommand, commands_map) {
- am::CommandsMap::iterator it = (*commands_map).begin();
- if ((*commands_map).end() != it) {
- (*commands_map).erase(it);
- }
-}
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 10u;
-const uint32_t kMenuId = 100u;
-const uint32_t kGrammarId = 101u;
-const int32_t kCmdId = 102;
-} // namespace
-
-class DeleteSubMenuRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- DeleteSubMenuRequestTest()
- : accessor_(commands_map_, commands_lock_)
- , message_(CreateMessage())
- , command_(CreateCommand<DeleteSubMenuRequest>(message_))
- , app_(CreateMockApp()) {}
-
- am::CommandsMap commands_map_;
- mutable sync_primitives::Lock commands_lock_;
- DataAccessor<am::CommandsMap> accessor_;
-
- MessageSharedPtr message_;
- DeleteSubMenuRequestPtr command_;
- MockAppPtr app_;
-};
-
-class DeleteSubMenuResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::msg_params][am::strings::menu_id] = 10u;
-
- utils::SharedPtr<DeleteSubMenuRequest> command =
- CreateCommand<DeleteSubMenuRequest>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app));
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
- EXPECT_CALL(*mock_app, RemoveSubMenu(_));
-
- MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
- (*ev_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
-
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- event.set_smart_object(*ev_msg);
-
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- am::CommandsMap commands_map;
- smart_objects::SmartObject commands_msg(smart_objects::SmartType_Map);
- commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &commands_msg));
- sync_primitives::Lock lock;
- DataAccessor<am::CommandsMap> accessor(commands_map, lock);
- EXPECT_CALL(*mock_app, commands_map())
- .WillOnce(Return(accessor))
- .WillOnce(Return(accessor));
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*ui_command_result)[am::strings::msg_params].keyExists(
- am::strings::info)) {
- EXPECT_FALSE(
- (*ui_command_result)[am::strings::msg_params][am::strings::info]
- .asString()
- .empty());
- }
-}
-
-TEST_F(DeleteSubMenuRequestTest, Run_InvalidApp_UNSUCCESS) {
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(CheckMessageResultCode(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_, FindSubMenu(_)).Times(0);
- command_->Run();
-}
-
-TEST_F(DeleteSubMenuRequestTest, Run_FindSubMenuFalse_UNSUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- smart_objects::SmartObject* invalid_sub_menu = NULL;
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
- EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(invalid_sub_menu));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- CheckMessageResultCode(mobile_apis::Result::INVALID_ID),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(*app_, app_id()).Times(0);
- command_->Run();
-}
-
-TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) {
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- smart_objects::SmartObject* sub_menu =
- &((*message_)[am::strings::msg_params][am::strings::menu_id]);
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
- EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(sub_menu));
-
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(kCorrelationId));
-
- command_->Run();
-}
-
-TEST_F(DeleteSubMenuRequestTest, OnEvent_UnknownEventId_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
- EXPECT_CALL(app_mngr_, application(_)).Times(0);
- command_->on_event(event);
-}
-
-TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
- event.set_smart_object(*message_);
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(*app_, RemoveSubMenu(_)).Times(0);
- command_->on_event(event);
-}
-
-TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::msg_params][am::strings::vr_commands] =
- "vr_commands";
- (*message_)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- (*message_)[am::strings::msg_params][am::strings::menu_params]
- [am::hmi_request::parent_id] = kMenuId;
- const hmi_apis::Common_Result::eType result_code =
- hmi_apis::Common_Result::SUCCESS;
- (*message_)[am::strings::params][am::hmi_response::code] = result_code;
- event.set_smart_object(*message_);
-
- commands_map_.insert(
- std::make_pair(0, &((*message_)[am::strings::msg_params])));
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
-
- InSequence seq;
- EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId));
-
- EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, RemoveCommand(_)).WillOnce(DeleteCommand(&commands_map_));
-
- EXPECT_CALL(*app_, RemoveSubMenu(_));
- EXPECT_CALL(*app_, UpdateHash());
-
- DeleteSubMenuRequestPtr command =
- CreateCommand<DeleteSubMenuRequest>(message_);
-
- command->Init();
- command->on_event(event);
-}
-
-TEST_F(DeleteSubMenuResponseTest, Run_SUCCESS) {
- MessageSharedPtr message(CreateMessage());
- (*message)[am::strings::msg_params][am::strings::connection_key] =
- kConnectionKey;
- DeleteSubMenuResponsePtr command(
- CreateCommand<DeleteSubMenuResponse>(message));
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(CheckMessageConnectionKey(kConnectionKey), _));
- command->Run();
-}
-
-TEST_F(DeleteSubMenuRequestTest,
- DeleteSubmenu_CommandhaventVrCommadsAndMenuParams_DontSendHMIRequest) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::params][am::hmi_response::code] =
- am::mobile_api::Result::SUCCESS;
- event.set_smart_object(*message_);
-
- commands_map_.insert(
- std::make_pair(0, &((*message_)[am::strings::msg_params])));
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
- EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
-
- command_->on_event(event);
-}
-
-TEST_F(DeleteSubMenuRequestTest,
- DeleteSubmenu_NotAChildOfMenupartam_DontSendHMIRequest) {
- Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
- (*message_)[am::strings::msg_params][am::strings::menu_params]
- [am::hmi_request::parent_id] = kMenuId + 1;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*message_)[am::strings::params][am::hmi_response::code] =
- am::mobile_api::Result::SUCCESS;
- event.set_smart_object(*message_);
-
- commands_map_.insert(
- std::make_pair(0, &((*message_)[am::strings::msg_params])));
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
- EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
-
- command_->on_event(event);
-}
-
-} // namespace delete_sub_menu_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
deleted file mode 100644
index 4f46a6f715..0000000000
--- a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/mobile/diagnostic_message_request.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace diagnostic_message_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::DiagnosticMessageRequest;
-using am::event_engine::Event;
-namespace mobile_result = mobile_apis::Result;
-
-typedef SharedPtr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kDiagnosticMode = 5u;
-} // namespace
-
-class DiagnosticMessageRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(DiagnosticMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DiagnosticMessageRequestPtr command(
- CreateCommand<DiagnosticMessageRequest>(command_msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(DiagnosticMessageRequestTest, Run_NotSupportedDiagnosticMode_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
- kDiagnosticMode;
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DiagnosticMessageRequestPtr command(
- CreateCommand<DiagnosticMessageRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
-
- const std::vector<uint32_t> empty_supported_diag_modes;
- EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
- .WillOnce(ReturnRef(empty_supported_diag_modes));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
-
- command->Run();
-}
-
-TEST_F(DiagnosticMessageRequestTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
- kDiagnosticMode;
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DiagnosticMessageRequestPtr command(
- CreateCommand<DiagnosticMessageRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
-
- std::vector<uint32_t> supported_diag_modes;
- supported_diag_modes.push_back(kDiagnosticMode);
-
- EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
- .WillOnce(ReturnRef(supported_diag_modes));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage)));
-
- command->Run();
-}
-
-TEST_F(DiagnosticMessageRequestTest, OnEvent_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- DiagnosticMessageRequestPtr command(
- CreateCommand<DiagnosticMessageRequest>());
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->on_event(event);
-}
-
-TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) {
- Event event(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
-
- MessageSharedPtr event_message(CreateMessage(smart_objects::SmartType_Map));
- (*event_message)[am::strings::msg_params] = 0;
- (*event_message)[am::strings::params][am::hmi_response::code] =
- mobile_result::SUCCESS;
- event.set_smart_object(*event_message);
-
- DiagnosticMessageRequestPtr command(
- CreateCommand<DiagnosticMessageRequest>());
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- command->on_event(event);
-}
-
-} // namespace diagnostic_message_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
deleted file mode 100644
index 33c84d305a..0000000000
--- a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/mobile/dial_number_request.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace dial_number_request {
-
-using ::testing::_;
-using ::testing::Return;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::DialNumberRequest;
-using am::event_engine::Event;
-namespace mobile_result = mobile_apis::Result;
-
-typedef SharedPtr<DialNumberRequest> DialNumberRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class DialNumberRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(DialNumberRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, Run_InvalidNumber_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "\t\n";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, Run_EmptyNumber_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "NotANumber";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_DialNumber)));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->on_event(event);
-}
-
-TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::SUCCESS;
- (*event_msg)[am::strings::params][am::strings::info] = "test_info";
-
- Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber);
- event.set_smart_object(*event_msg);
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
- command->on_event(event);
-}
-
-} // namespace dial_number_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc
deleted file mode 100644
index 27a8499c09..0000000000
--- a/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "commands/command_request_test.h"
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-#include "gtest/gtest.h"
-
-#include "mobile/add_command_request.h"
-#include "mobile/add_command_response.h"
-#include "mobile/add_sub_menu_request.h"
-#include "mobile/add_sub_menu_response.h"
-#include "mobile/alert_maneuver_request.h"
-#include "mobile/alert_maneuver_response.h"
-#include "mobile/alert_request.h"
-#include "mobile/alert_response.h"
-#include "mobile/change_registration_request.h"
-#include "mobile/change_registration_response.h"
-#include "mobile/create_interaction_choice_set_request.h"
-#include "mobile/create_interaction_choice_set_response.h"
-#include "mobile/delete_command_request.h"
-#include "mobile/delete_command_response.h"
-#include "mobile/delete_file_request.h"
-#include "mobile/delete_file_response.h"
-#include "mobile/delete_interaction_choice_set_request.h"
-#include "mobile/delete_interaction_choice_set_response.h"
-#include "mobile/delete_sub_menu_request.h"
-#include "mobile/delete_sub_menu_response.h"
-#include "mobile/diagnostic_message_request.h"
-#include "mobile/diagnostic_message_response.h"
-#include "mobile/dial_number_request.h"
-#include "mobile/dial_number_response.h"
-#include "mobile/end_audio_pass_thru_request.h"
-#include "mobile/end_audio_pass_thru_response.h"
-#include "mobile/generic_response.h"
-#include "mobile/get_dtcs_request.h"
-#include "mobile/get_dtcs_response.h"
-#include "mobile/get_vehicle_data_request.h"
-#include "mobile/get_vehicle_data_response.h"
-#include "mobile/get_way_points_request.h"
-#include "mobile/get_way_points_response.h"
-#include "mobile/list_files_request.h"
-#include "mobile/list_files_response.h"
-#include "mobile/on_app_interface_unregistered_notification.h"
-#include "mobile/on_audio_pass_thru_notification.h"
-#include "mobile/on_button_event_notification.h"
-#include "mobile/on_button_press_notification.h"
-#include "mobile/on_command_notification.h"
-#include "mobile/on_driver_distraction_notification.h"
-#include "mobile/on_hash_change_notification.h"
-#include "mobile/on_hmi_status_notification.h"
-#include "mobile/on_hmi_status_notification_from_mobile.h"
-#include "mobile/on_keyboard_input_notification.h"
-#include "mobile/on_language_change_notification.h"
-#include "mobile/on_permissions_change_notification.h"
-#include "mobile/on_system_request_notification.h"
-#include "mobile/on_tbt_client_state_notification.h"
-#include "mobile/on_touch_event_notification.h"
-#include "mobile/on_vehicle_data_notification.h"
-#include "mobile/on_way_point_change_notification.h"
-#include "mobile/perform_audio_pass_thru_request.h"
-#include "mobile/perform_audio_pass_thru_response.h"
-#include "mobile/perform_interaction_request.h"
-#include "mobile/perform_interaction_response.h"
-#include "mobile/put_file_request.h"
-#include "mobile/put_file_response.h"
-#include "mobile/read_did_request.h"
-#include "mobile/read_did_response.h"
-#include "mobile/register_app_interface_request.h"
-#include "mobile/register_app_interface_response.h"
-#include "mobile/reset_global_properties_request.h"
-#include "mobile/reset_global_properties_response.h"
-#include "mobile/scrollable_message_request.h"
-#include "mobile/scrollable_message_response.h"
-#include "mobile/send_location_request.h"
-#include "mobile/send_location_response.h"
-#include "mobile/set_app_icon_request.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/set_display_layout_request.h"
-#include "mobile/set_display_layout_response.h"
-#include "mobile/set_global_properties_request.h"
-#include "mobile/set_global_properties_response.h"
-#include "mobile/set_media_clock_timer_request.h"
-#include "mobile/set_media_clock_timer_response.h"
-#include "mobile/show_constant_tbt_request.h"
-#include "mobile/show_constant_tbt_response.h"
-#include "mobile/show_request.h"
-#include "mobile/show_response.h"
-#include "mobile/slider_request.h"
-#include "mobile/slider_response.h"
-#include "mobile/speak_request.h"
-#include "mobile/speak_response.h"
-#include "mobile/subscribe_button_request.h"
-#include "mobile/subscribe_button_response.h"
-#include "mobile/subscribe_vehicle_data_request.h"
-#include "mobile/subscribe_vehicle_data_response.h"
-#include "mobile/subscribe_way_points_request.h"
-#include "mobile/subscribe_way_points_response.h"
-#include "mobile/system_response.h"
-#include "mobile/unregister_app_interface_request.h"
-#include "mobile/unregister_app_interface_response.h"
-#include "mobile/unsubscribe_button_request.h"
-#include "mobile/unsubscribe_button_response.h"
-#include "mobile/unsubscribe_vehicle_data_request.h"
-#include "mobile/unsubscribe_vehicle_data_response.h"
-#include "mobile/unsubscribe_way_points_request.h"
-#include "mobile/unsubscribe_way_points_response.h"
-#include "mobile/update_turn_list_request.h"
-#include "mobile/update_turn_list_response.h"
-
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace am = application_manager;
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace dummy_mobile_commands_test {
-
-namespace commands = ::application_manager::commands;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-using commands::MessageSharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
-using ::test::components::application_manager_test::MockApplicationManager;
-using ::test::components::application_manager_test::
- MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
-
-namespace {
-const std::string kEmptyString_ = "";
-} // namespace
-
-template <class Command>
-class MobileCommandsTest : public components::commands_test::CommandRequestTest<
- CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
- ON_CALL(app_mngr_settings_, app_icons_folder())
- .WillByDefault(ReturnRef(kEmptyString_));
- }
-};
-
-template <class Command>
-class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
- public:
- using typename MobileCommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class MobileCommandsTestSecond : public MobileCommandsTest<Command> {
- public:
- using typename MobileCommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class MobileCommandsTestThird : public MobileCommandsTest<Command> {
- public:
- using typename MobileCommandsTest<Command>::CommandType;
-};
-
-/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
- * TYPED_TEST_CASE for HMI and mobile commands
- */
-
-typedef Types<commands::AddCommandRequest,
- commands::AddCommandResponse,
- commands::AddSubMenuRequest,
- commands::AddSubMenuResponse,
- commands::AlertManeuverRequest,
- commands::AlertManeuverResponse,
- commands::AlertRequest,
- commands::AlertResponse,
- commands::ChangeRegistrationRequest,
- commands::ChangeRegistrationResponse,
- commands::CreateInteractionChoiceSetRequest,
- commands::CreateInteractionChoiceSetResponse,
- commands::DeleteCommandRequest,
- commands::DeleteCommandResponse,
- commands::DeleteFileRequest,
- commands::DeleteFileResponse,
- commands::DeleteInteractionChoiceSetRequest,
- commands::DeleteInteractionChoiceSetResponse,
- commands::DeleteSubMenuRequest,
- commands::DeleteSubMenuResponse,
- commands::DiagnosticMessageRequest,
- commands::DiagnosticMessageResponse,
- commands::DialNumberRequest,
- commands::DialNumberResponse,
- commands::EndAudioPassThruRequest,
- commands::EndAudioPassThruResponse,
- commands::GenericResponse,
- commands::GetDTCsRequest,
- commands::GetDTCsResponse,
- commands::GetVehicleDataRequest,
- commands::GetVehicleDataResponse,
- commands::GetWayPointsRequest,
- commands::GetWayPointsResponse,
- commands::ListFilesRequest,
- commands::ListFilesResponse,
- commands::OnAppInterfaceUnregisteredNotification,
- commands::OnAudioPassThruNotification,
- commands::mobile::OnButtonEventNotification,
- commands::mobile::OnButtonPressNotification,
- commands::OnCommandNotification,
- commands::mobile::OnDriverDistractionNotification,
- commands::mobile::OnHashChangeNotification,
- commands::OnHMIStatusNotification,
- commands::OnHMIStatusNotificationFromMobile,
- commands::mobile::OnKeyBoardInputNotification,
- commands::OnLanguageChangeNotification,
- commands::OnPermissionsChangeNotification,
- commands::mobile::OnSystemRequestNotification,
- commands::OnTBTClientStateNotification,
- commands::mobile::OnTouchEventNotification>
- MobileCommandsListFirst;
-
-typedef Types<commands::OnVehicleDataNotification,
- commands::OnWayPointChangeNotification,
- commands::PerformAudioPassThruRequest,
- commands::PerformAudioPassThruResponse,
- commands::PerformInteractionRequest,
- commands::PerformInteractionResponse,
- commands::PutFileRequest,
- commands::PutFileResponse,
- commands::ReadDIDRequest,
- commands::ReadDIDResponse,
- commands::RegisterAppInterfaceRequest,
- commands::RegisterAppInterfaceResponse,
- commands::ResetGlobalPropertiesRequest,
- commands::ResetGlobalPropertiesResponse,
- commands::ScrollableMessageRequest,
- commands::ScrollableMessageResponse,
- commands::SendLocationRequest,
- commands::SendLocationResponse,
- commands::SetAppIconRequest,
- commands::SetAppIconResponse,
- commands::SetDisplayLayoutRequest,
- commands::SetDisplayLayoutResponse,
- commands::SetGlobalPropertiesRequest,
- commands::SetGlobalPropertiesResponse,
- commands::SetMediaClockRequest,
- commands::SetMediaClockTimerResponse,
- commands::ShowConstantTBTRequest,
- commands::ShowConstantTBTResponse,
- commands::ShowRequest,
- commands::ShowResponse,
- commands::SliderRequest,
- commands::SliderResponse,
- commands::SpeakRequest,
- commands::SpeakResponse,
- commands::SubscribeButtonRequest,
- commands::SubscribeButtonResponse,
- commands::SubscribeVehicleDataRequest,
- commands::SubscribeVehicleDataResponse,
- commands::SubscribeWayPointsRequest,
- commands::SubscribeWayPointsResponse,
- commands::SystemResponse,
- commands::UnregisterAppInterfaceRequest,
- commands::UnregisterAppInterfaceResponse,
- commands::UnsubscribeButtonRequest,
- commands::UnsubscribeButtonResponse,
- commands::UnsubscribeVehicleDataRequest> MobileCommandsListSecond;
-
-typedef Types<commands::UnsubscribeVehicleDataResponse,
- commands::UnSubscribeWayPointsRequest,
- commands::UnsubscribeWayPointsResponse,
- commands::UpdateTurnListRequest,
- commands::UpdateTurnListResponse> MobileCommandsListThird;
-
-TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
-TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond);
-TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
-
-TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-} // namespace dummy_mobile_commands_test
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc
deleted file mode 100644
index 6b1d909121..0000000000
--- a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace end_audio_pass_thru_request {
-
-namespace am = ::application_manager;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using am::commands::MessageSharedPtr;
-using am::commands::EndAudioPassThruRequest;
-using am::event_engine::Event;
-using am::MockMessageHelper;
-
-typedef SharedPtr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr;
-
-class EndAudioPassThruRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
- const uint32_t kConnectionKey = 2u;
- const uint32_t app_id = kConnectionKey;
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- EndAudioPassThruRequestPtr command(
- CreateCommand<EndAudioPassThruRequest>(command_msg));
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::msg_params] = 0;
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::UNSUPPORTED_RESOURCE;
-
- Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
-
- command->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*ui_command_result)[am::strings::msg_params].keyExists(
- am::strings::info)) {
- EXPECT_FALSE(
- (*ui_command_result)[am::strings::msg_params][am::strings::info]
- .asString()
- .empty());
- }
-}
-
-} // namespace end_audio_pass_thru_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
deleted file mode 100644
index 106a59803b..0000000000
--- a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/mobile/get_dtcs_request.h"
-#include "application_manager/mock_message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace get_dtcs_request {
-
-using ::testing::_;
-using ::testing::Return;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::GetDTCsRequest;
-using am::event_engine::Event;
-using am::MockMessageHelper;
-using testing::Mock;
-namespace mobile_result = mobile_apis::Result;
-
-typedef SharedPtr<GetDTCsRequest> GetDTCsRequestPtr;
-
-class GetDTCsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- GetDTCsRequestTest() : CommandRequestTest<CommandsTestMocks::kIsNice>() {}
-};
-
-TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(GetDTCsRequestTest, Run_SUCCESS) {
- const uint32_t kConnectionKey = 2u;
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::dtc_mask] = 0;
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs)));
-
- command->Run();
-}
-
-TEST_F(GetDTCsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->on_event(event);
-}
-
-TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) {
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::msg_params] = 0;
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::SUCCESS;
-
- Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
-
- GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
- command->on_event(event);
-}
-
-} // namespace get_dtcs_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
deleted file mode 100644
index 52aed6feb8..0000000000
--- a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/mobile/get_vehicle_data_request.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace get_vehicle_data_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::GetVehicleDataRequest;
-using am::event_engine::Event;
-namespace mobile_result = mobile_apis::Result;
-
-typedef SharedPtr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class GetVehicleDataRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest {
- public:
- UnwrappedGetVehicleDataRequest(const MessageSharedPtr& message,
- am::ApplicationManager& application_manager)
- : GetVehicleDataRequest(message, application_manager) {}
-
- policy::RPCParams& get_disallowed_params() {
- return removed_parameters_permissions_.disallowed_params;
- }
-
- using GetVehicleDataRequest::on_event;
-};
-
-#ifdef HMI_DBUS_API
-// HMI_DBUS_API currently not supported
-#else
-
-TEST_F(GetVehicleDataRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- GetVehicleDataRequestPtr command(CreateCommand<GetVehicleDataRequest>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(GetVehicleDataRequestTest, Run_TooHighFrequency_UNSUCCESS) {
- const mobile_apis::FunctionID::eType kFunctionId =
- mobile_apis::FunctionID::GetVehicleDataID;
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::function_id] = kFunctionId;
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- GetVehicleDataRequestPtr command(
- CreateCommand<GetVehicleDataRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(
- *app,
- AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::CONFIG_FILE))
- .WillOnce(Return(true));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
-
- command->Run();
-}
-
-TEST_F(GetVehicleDataRequestTest, Run_EmptyMsgParams_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- GetVehicleDataRequestPtr command(
- CreateCommand<GetVehicleDataRequest>(command_msg));
-
- const am::VehicleData kEmptyVehicleData;
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(kEmptyVehicleData));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(GetVehicleDataRequestTest,
- Run_EmptyMsgParamsAndHasDisallowedParams_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- SharedPtr<UnwrappedGetVehicleDataRequest> command(
- CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
-
- const am::VehicleData kEmptyVehicleData;
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillRepeatedly(ReturnRef(kEmptyVehicleData));
-
- policy::RPCParams& disallowed_params = command->get_disallowed_params();
- disallowed_params.insert("test_param");
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::DISALLOWED), _));
-
- command->Run();
-}
-
-TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) {
- const std::string kMsgParamKey("test_key");
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
-
- GetVehicleDataRequestPtr command(
- CreateCommand<GetVehicleDataRequest>(command_msg));
-
- am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(
- kMsgParamKey, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED));
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(vehicle_data));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData)));
-
- command->Run();
-}
-
-TEST_F(GetVehicleDataRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- SharedPtr<UnwrappedGetVehicleDataRequest> command(
- CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->on_event(event);
-}
-
-TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
- const hmi_apis::Common_Result::eType hmi_response_code =
- hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
- const mobile_result::eType mobile_response_code =
- mobile_result::DATA_NOT_AVAILABLE;
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- SharedPtr<UnwrappedGetVehicleDataRequest> command(
- CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
- (*event_msg)[am::strings::params][am::strings::error_msg] = "test_error";
- (*event_msg)[am::strings::msg_params][am::hmi_response::method] = 0;
-
- Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
- event.set_smart_object(*event_msg);
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
-
- command->on_event(event);
-}
-
-#endif // HMI_DBUS_API
-
-} // namespace get_vehicle_data_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc
deleted file mode 100644
index 979fb0cc83..0000000000
--- a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "mobile/get_way_points_request.h"
-#include "application_manager/smart_object_keys.h"
-#include "mock_message_helper.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_message_helper.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace get_way_points_request {
-
-using namespace mobile_apis::Result;
-using ::testing::Return;
-using ::testing::_;
-using application_manager::commands::GetWayPointsRequest;
-using application_manager::MockMessageHelper;
-using application_manager::MockHmiInterfaces;
-
-typedef SharedPtr<GetWayPointsRequest> CommandPtr;
-typedef mobile_apis::Result::eType MobileResult;
-typedef hmi_apis::Common_Result::eType HmiResult;
-
-namespace {
-const uint32_t kCorrelationId = 2u;
-const uint32_t kAppId = 3u;
-const uint32_t kConnectionKey = kAppId;
-const std::string kMethodName = "Navigation.GetWayPoints";
-}
-
-class GetWayPointsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- GetWayPointsRequestTest() : mock_app_(CreateMockApp()) {}
-
- void SetUp() OVERRIDE {
- message_ = utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map);
- (*message_)[am::strings::msg_params] =
- ::smart_objects::SmartObject(::smart_objects::SmartType_Map);
-
- command_sptr_ =
- CreateCommand<application_manager::commands::GetWayPointsRequest>(
- message_);
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
- }
-
- MockAppPtr mock_app_;
- MessageSharedPtr message_;
- utils::SharedPtr<application_manager::commands::GetWayPointsRequest>
- command_sptr_;
-};
-
-class GetWayPointsRequestOnEventTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- GetWayPointsRequestOnEventTest() : app_(CreateMockApp()) {}
-
- void CheckOnEventResponse(const std::string& wayPointsParam,
- const HmiResult ResultCode,
- const bool success) {
- Event event(Event::EventID::Navigation_GetWayPoints);
- CommandPtr command(CreateCommand<GetWayPointsRequest>());
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] = ResultCode;
- if ("0" == wayPointsParam) {
- (*event_msg)[am::strings::msg_params] = 0;
- } else {
- (*event_msg)[am::strings::msg_params][am::strings::way_points][0]["123"] =
- wayPointsParam;
- }
-
- event.set_smart_object(*event_msg);
-
- const MobileResult mobile_result = static_cast<MobileResult>(ResultCode);
-
- MessageSharedPtr result_msg(
- CatchMobileCommandResult(CallOnEvent(*command, event)));
- EXPECT_EQ(
- mobile_result,
- static_cast<MobileResult>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
- EXPECT_EQ(
- success,
- (*result_msg)[am::strings::msg_params][am::strings::success].asBool());
- }
-
- protected:
- MockAppPtr app_;
- MockHmiInterfaces hmi_interfaces_;
-};
-
-TEST_F(GetWayPointsRequestTest,
- Run_InvalidApp_ApplicationNotRegisteredResponce) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- utils::SharedPtr<am::Application> null_application_sptr;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(null_application_sptr));
-
- CallRun caller(*command_sptr_);
-
- MessageSharedPtr result_message = CatchMobileCommandResult(caller);
-
- const mobile_apis::Result::eType result =
- static_cast<mobile_apis::Result::eType>(
- (*result_message)[am::strings::msg_params][am::strings::result_code]
- .asInt());
-
- EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED, result);
-}
-
-TEST_F(GetWayPointsRequestTest, Run_ApplicationRegistered_Success) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- MockAppPtr application_sptr = CreateMockApp();
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(application_sptr));
- EXPECT_CALL(*application_sptr, app_id()).WillOnce(Return(1));
-
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(kCorrelationId));
-
- CallRun caller(*command_sptr_);
-
- MessageSharedPtr result_message = CatchHMICommandResult(caller);
-
- const hmi_apis::FunctionID::eType result_function_id =
- static_cast<hmi_apis::FunctionID::eType>(
- (*result_message)[am::strings::params][am::strings::function_id]
- .asInt());
-
- EXPECT_EQ(hmi_apis::FunctionID::Navigation_GetWayPoints, result_function_id);
- EXPECT_EQ(kCorrelationId,
- (*result_message)[am::strings::params][am::strings::correlation_id]
- .asUInt());
-}
-
-TEST_F(GetWayPointsRequestTest,
- OnEvent_NavigationGetWayPointsEvent_SendResponse) {
- am::event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
-
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- event.set_smart_object(*message_);
-
- CallOnEvent caller(*command_sptr_, event);
-
- MessageSharedPtr result_message = CatchMobileCommandResult(caller);
-
- const mobile_apis::Result::eType result =
- static_cast<mobile_apis::Result::eType>(
- (*result_message)[am::strings::msg_params][am::strings::result_code]
- .asInt());
-
- EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
-}
-
-TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) {
- am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- event.set_smart_object(*message_);
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
-
- CallOnEvent caller(*command_sptr_, event);
- caller();
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_WrongEventId_UNSUCCESS) {
- Event event(Event::EventID::INVALID_ENUM);
- CommandPtr command(CreateCommand<GetWayPointsRequest>());
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->on_event(event);
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case1) {
- CheckOnEventResponse("0", HmiResult::SUCCESS, true);
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case2) {
- CheckOnEventResponse("", HmiResult::SUCCESS, true);
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case3) {
- CheckOnEventResponse("test", HmiResult::SUCCESS, true);
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case1) {
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- CheckOnEventResponse(" ", HmiResult::GENERIC_ERROR, false);
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case2) {
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- CheckOnEventResponse("test\t", HmiResult::GENERIC_ERROR, false);
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case3) {
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- CheckOnEventResponse("test\n", HmiResult::GENERIC_ERROR, false);
-}
-
-TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case4) {
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- CheckOnEventResponse("test\t\n", HmiResult::GENERIC_ERROR, false);
-}
-
-} // namespace get_way_points_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/test/commands/mobile/list_files_request_test.cc
deleted file mode 100644
index ae0e523832..0000000000
--- a/src/components/application_manager/test/commands/mobile/list_files_request_test.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/commands/mobile/list_files_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace list_files_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SaveArg;
-namespace am = ::application_manager;
-using am::commands::ListFilesRequest;
-using am::commands::MessageSharedPtr;
-
-class ListFilesRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- ListFilesRequestTest() : kStoragePath_("storage"), kResponseSize_(1) {}
- const std::string kStoragePath_;
- const uint32_t kResponseSize_;
-};
-
-TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
-
- ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(SharedPtr<am::Application>()));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) {
- MockAppPtr app(CreateMockApp());
- SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_NONE));
-
- const uint32_t kListFilesInNoneAllowed = 1u;
- const uint32_t kListFilesInNoneCount = 2u;
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- ON_CALL(app_mngr_settings_, list_files_in_none())
- .WillByDefault(ReturnRef(kListFilesInNoneAllowed));
- ON_CALL(*app, list_files_in_none_count())
- .WillByDefault(Return(kListFilesInNoneCount));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::REJECTED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(ListFilesRequestTest, Run_SUCCESS) {
- MockAppPtr app(CreateMockApp());
- SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillRepeatedly(ReturnRef(app_mngr_settings_));
-
- ON_CALL(app_mngr_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kStoragePath_));
-
- ON_CALL(app_mngr_settings_, list_files_response_size())
- .WillByDefault(ReturnRef(kResponseSize_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- ON_CALL(*app, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
-
- ON_CALL(*app, increment_list_files_in_none_count()).WillByDefault(Return());
-
- ON_CALL(*app, GetAvailableDiskSpace()).WillByDefault(Return(0));
-
- am::AppFilesMap files_map;
- ON_CALL(*app, getAppFiles()).WillByDefault(ReturnRef(files_map));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::SUCCESS,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-} // namespace list_files_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
deleted file mode 100644
index 48f4497033..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-
-#include "application_manager/include/application_manager/commands/command_impl.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/commands/mobile/on_button_event_notification.h"
-#include "application_manager/commands/mobile/on_button_press_notification.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_button_notification {
-
-namespace am = ::application_manager;
-namespace commands = am::commands;
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::Return;
-
-using ::utils::SharedPtr;
-using am::commands::MessageSharedPtr;
-
-namespace {
-const uint32_t kAppId = 5u;
-const uint32_t kCustomButtonId = 3u;
-const mobile_apis::ButtonName::eType kButtonName = mobile_apis::ButtonName::OK;
-} // namespace
-
-template <class NotificationT,
- mobile_apis::FunctionID::eType kExpectedFunctionId>
-struct NotificationData {
- typedef NotificationT Notification;
- enum { kFunctionId = kExpectedFunctionId };
-};
-
-template <class NotificationDataT>
-class OnButtonNotificationCommandsTest
- : public CommandsTest<CommandsTestMocks::kNotNice>,
- public NotificationDataT {};
-
-typedef Types<NotificationData<commands::mobile::OnButtonEventNotification,
- mobile_apis::FunctionID::OnButtonEventID>,
- NotificationData<commands::mobile::OnButtonPressNotification,
- mobile_apis::FunctionID::OnButtonPressID> >
- OnButtonNotificationCommandsList;
-
-MATCHER_P(CheckNotificationMessage, function_id, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsFunctionIdCorrect =
- (*arg)[am::strings::params][am::strings::function_id].asInt() ==
- function_id;
-
- bool is_custom_button_id_correct = true;
- if ((*arg)[am::strings::msg_params].keyExists(
- am::hmi_response::custom_button_id)) {
- is_custom_button_id_correct =
- (*arg)[am::strings::msg_params][am::strings::custom_button_id] ==
- kCustomButtonId;
- }
-
- return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
- kIsNotificationCorrect && kIsFunctionIdCorrect &&
- is_custom_button_id_correct;
-}
-
-TYPED_TEST_CASE(OnButtonNotificationCommandsTest,
- OnButtonNotificationCommandsList);
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_NoAppId_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_NoCustomButtonId_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_AppNotRegistered_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params]
- [am::hmi_response::custom_button_id] = kCustomButtonId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- EXPECT_CALL(this->app_mngr_, application(kAppId))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_AppNotSubscribedToCustomButtonId_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params]
- [am::hmi_response::custom_button_id] = kCustomButtonId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
- .WillOnce(Return(false));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params]
- [am::hmi_response::custom_button_id] = kCustomButtonId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- ON_CALL(*mock_app, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
- EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
- .WillOnce(Return(true));
-
- EXPECT_CALL(this->app_mngr_,
- SendMessageToMobile(
- CheckNotificationMessage(TestFixture::kFunctionId), _));
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_NoSubscribedApps_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- const std::vector<ApplicationSharedPtr> empty_subscribed_apps_list;
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(empty_subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- std::vector<ApplicationSharedPtr> subscribed_apps_list;
- subscribed_apps_list.push_back(mock_app);
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
-
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_ButtonOkOnlyForHmiLevelFull_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- std::vector<ApplicationSharedPtr> subscribed_apps_list;
- subscribed_apps_list.push_back(mock_app);
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
-
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- std::vector<ApplicationSharedPtr> subscribed_apps_list;
- subscribed_apps_list.push_back(mock_app);
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
-
- ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
-
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_,
- SendMessageToMobile(
- CheckNotificationMessage(TestFixture::kFunctionId), _));
-
- command->Run();
-}
-
-} // namespace on_button_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
deleted file mode 100644
index def324bfb6..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/mobile/on_command_notification.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_command_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnCommandNotification;
-
-typedef ::utils::SharedPtr<OnCommandNotification> CommandPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kCommandId = 5u;
-} // namespace
-
-class OnCommandNotificationTest
- : public CommandsTest<CommandsTestMocks::kNotNice> {};
-
-TEST_F(OnCommandNotificationTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<OnCommandNotification>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->Run();
-}
-
-TEST_F(OnCommandNotificationTest, Run_NoAppsForTheCommand_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
-
- CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, FindCommand(kCommandId))
- .WillOnce(Return(static_cast<SmartObject*>(NULL)));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->Run();
-}
-
-MATCHER(CheckNotificationMessage, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
- kIsNotificationCorrect;
-}
-
-TEST_F(OnCommandNotificationTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
-
- CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- MessageSharedPtr dummy_msg(CreateMessage());
- EXPECT_CALL(*mock_app, FindCommand(kCommandId))
- .WillOnce(Return(dummy_msg.get()));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckNotificationMessage(), _));
-
- command->Run();
-}
-
-} // namespace on_command_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
deleted file mode 100644
index 6d7ccb1fa0..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_hash_change_notification.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_hash_change_notification {
-
-namespace strings = application_manager::strings;
-
-using application_manager::commands::mobile::OnHashChangeNotification;
-using application_manager::MockMessageHelper;
-using application_manager::commands::CommandImpl;
-using testing::Mock;
-using testing::Return;
-using testing::ReturnRef;
-using testing::_;
-
-class OnHashChangeNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) {
- const uint32_t kConnectionKey = 1u;
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- SharedPtr<OnHashChangeNotification> command =
- CreateCommand<OnHashChangeNotification>(msg);
-
- std::string return_string = "1234";
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, curHash()).WillOnce(ReturnRef(return_string));
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
- .WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
- ASSERT_EQ(CommandImpl::mobile_protocol_type_,
- (*msg)[strings::params][strings::protocol_type].asInt());
- ASSERT_EQ(CommandImpl::protocol_version_,
- (*msg)[strings::params][strings::protocol_version].asInt());
- ASSERT_EQ(return_string,
- (*msg)[strings::msg_params][strings::hash_id].asString());
-}
-
-TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) {
- const uint32_t kConnectionKey = 1u;
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- SharedPtr<OnHashChangeNotification> command =
- CreateCommand<OnHashChangeNotification>(msg);
-
- std::string return_string;
- MockAppPtr mock_app = CreateMockApp();
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
- EXPECT_CALL(*mock_app, curHash()).Times(0);
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-} // namespace on_hash_change_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
deleted file mode 100644
index 78875ad164..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include <application_manager/smart_object_keys.h>
-#include "application_manager/message.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/mock_message_helper.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_hmi_status_notification_from_mobile {
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const connection_handler::DeviceHandle kHandle = 2u;
-} // namespace
-
-namespace strings = application_manager::strings;
-
-using application_manager::commands::OnHMIStatusNotificationFromMobile;
-using protocol_handler::MajorProtocolVersion;
-using application_manager::ApplicationSet;
-using testing::Mock;
-using testing::Return;
-using testing::_;
-
-class OnHMIStatusNotificationFromMobileTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateMsgParams(
- const mobile_apis::HMILevel::eType kHMIState) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
- return msg;
- }
- ApplicationSet app_set_;
- sync_primitives::Lock lock_;
-};
-
-TEST_F(OnHMIStatusNotificationFromMobileTest,
- Run_CurrentStateForeground_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
- CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_foreground(true));
-
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
-
- DataAccessor<ApplicationSet> accessor(app_set_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
-
- EXPECT_CALL(*mock_app, protocol_version())
- .WillRepeatedly(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
- EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-TEST_F(OnHMIStatusNotificationFromMobileTest, Run_InvalidApp_NoNotification) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
- CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
- EXPECT_CALL(*mock_app, set_foreground(true)).Times(0);
-
- EXPECT_CALL(*mock_app, device()).Times(0);
- EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).Times(0);
-
- EXPECT_CALL(app_mngr_, applications()).Times(0);
-
- EXPECT_CALL(*mock_app, protocol_version()).Times(0);
- EXPECT_CALL(*mock_app, is_foreground()).Times(0);
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-TEST_F(OnHMIStatusNotificationFromMobileTest,
- Run_CurrentStateNotForeground_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
-
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
- CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_foreground(false));
-
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
-
- DataAccessor<ApplicationSet> accessor(app_set_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
-
- EXPECT_CALL(*mock_app, protocol_version())
- .WillRepeatedly(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
- EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-TEST_F(OnHMIStatusNotificationFromMobileTest,
- Run_ProtocolVersionKV3_NoNotification) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
-
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
- CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_foreground(false));
-
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
-
- DataAccessor<ApplicationSet> accessor(app_set_, lock_);
- EXPECT_CALL(app_mngr_, applications()).Times(0);
-
- EXPECT_CALL(*mock_app, protocol_version())
- .WillOnce(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
- EXPECT_CALL(*mock_app, is_foreground()).Times(0);
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-TEST_F(OnHMIStatusNotificationFromMobileTest,
- Run_AppNotRequestedBeforeAndKV3_NoNotification) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
- CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_foreground(true));
-
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
-
- EXPECT_CALL(app_mngr_, applications()).Times(0);
-
- EXPECT_CALL(*mock_app, protocol_version())
- .WillOnce(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
- EXPECT_CALL(*mock_app, is_foreground()).Times(0);
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-TEST_F(OnHMIStatusNotificationFromMobileTest,
- Run_AppNotRequestedBefore_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
- CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_foreground(true));
-
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
-
- EXPECT_CALL(*mock_app, protocol_version())
- .WillOnce(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
-
- EXPECT_CALL(app_mngr_, applications()).Times(0);
-
- EXPECT_CALL(*mock_app, is_foreground()).WillOnce(Return(true));
-
- EXPECT_CALL(mock_message_helper_, SendQueryApps(kConnectionKey, _));
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-TEST_F(OnHMIStatusNotificationFromMobileTest,
- Run_AnotherForegroundSDLApp_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
- CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_foreground(true));
-
- EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
- EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
-
- DataAccessor<ApplicationSet> accessor(app_set_, lock_);
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
-
- EXPECT_CALL(*mock_app, protocol_version())
- .WillRepeatedly(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
- EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(false));
-
- EXPECT_CALL(app_mngr_, MarkAppsGreyOut(kHandle, false));
- EXPECT_CALL(app_mngr_, SendUpdateAppList());
-
- command->Run();
-
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
-}
-
-} // namespace on_hmi_status_notification_from_mobile
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
deleted file mode 100644
index 9cb5610621..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/command_impl.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_hmi_status_notification {
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-} // namespace
-
-namespace strings = application_manager::strings;
-
-using application_manager::commands::OnHMIStatusNotification;
-using protocol_handler::MajorProtocolVersion;
-using application_manager::MockMessageHelper;
-using application_manager::commands::CommandImpl;
-using testing::Mock;
-using testing::Return;
-using testing::_;
-
-class OnHMIStatusNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateMsgParams(
- const mobile_apis::HMILevel::eType kHMIState) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
- return msg;
- }
-
- void SetSendNotificationExpectations(MessageSharedPtr& msg) {
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
- .WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
- }
-
- void VerifySendNotificationData(MessageSharedPtr& msg) {
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
- ASSERT_EQ(CommandImpl::mobile_protocol_type_,
- (*msg)[strings::params][strings::protocol_type].asInt());
- ASSERT_EQ(CommandImpl::protocol_version_,
- (*msg)[strings::params][strings::protocol_version].asInt());
- }
-};
-
-TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
-
- EXPECT_CALL(*mock_app, tts_properties_in_full()).Times(0);
- EXPECT_CALL(*mock_app, set_tts_properties_in_full(_)).Times(0);
- EXPECT_CALL(*mock_app, app_id()).Times(0);
- EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey))
- .Times(0);
-
- command->Run();
-}
-
-TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::INVALID_ENUM);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- SetSendNotificationExpectations(msg);
-
- command->Run();
-
- VerifySendNotificationData(msg);
-}
-
-TEST_F(OnHMIStatusNotificationTest, Run_BackgroundAndFalseProperties_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
- SetSendNotificationExpectations(msg);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, tts_properties_in_none()).WillOnce(Return(false));
- EXPECT_CALL(*mock_app, set_tts_properties_in_none(true));
- EXPECT_CALL(mock_message_helper_, SendTTSGlobalProperties(_, false, _));
-
- command->Run();
-
- VerifySendNotificationData(msg);
-}
-
-TEST_F(OnHMIStatusNotificationTest, Run_BackgroundAndTrueProperties_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, tts_properties_in_none()).WillOnce(Return(true));
-
- SetSendNotificationExpectations(msg);
-
- command->Run();
-
- VerifySendNotificationData(msg);
-}
-
-TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(false));
- EXPECT_CALL(*mock_app, set_tts_properties_in_full(true));
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey));
-
- SetSendNotificationExpectations(msg);
-
- command->Run();
-
- VerifySendNotificationData(msg);
-}
-
-TEST_F(OnHMIStatusNotificationTest, Run_FullAndTrueProperties_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(true));
-
- SetSendNotificationExpectations(msg);
-
- command->Run();
-
- VerifySendNotificationData(msg);
-}
-
-} // namespace on_hmi_status_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc
deleted file mode 100644
index 7313f32dca..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include <application_manager/smart_object_keys.h>
-#include "application_manager/message.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/command_impl.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_keyboard_input_notification {
-
-namespace strings = application_manager::strings;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-} // namespace
-
-using application_manager::commands::mobile::OnKeyBoardInputNotification;
-using application_manager::MockMessageHelper;
-using application_manager::commands::CommandImpl;
-using application_manager::ApplicationSet;
-using testing::Mock;
-using testing::Return;
-using testing::_;
-
-class OnKeyBoardInputNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- void SetSendNotificationExpectations(MessageSharedPtr msg) {
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
- .WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
- }
-
- void SetSendNotificationVariables(MessageSharedPtr msg) {
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
- ASSERT_EQ(CommandImpl::mobile_protocol_type_,
- (*msg)[strings::params][strings::protocol_type].asInt());
- ASSERT_EQ(CommandImpl::protocol_version_,
- (*msg)[strings::params][strings::protocol_version].asInt());
- }
-
- MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
- app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
- MockAppPtr app(CreateMockApp());
- app_set->insert(app);
- EXPECT_CALL(app_mngr_, applications())
- .WillOnce(Return(DataAccessor<ApplicationSet>(*app_set, lock_)));
- return app;
- }
-
- SharedPtr<ApplicationSet> app_set_;
- sync_primitives::Lock lock_;
-};
-
-TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<OnKeyBoardInputNotification> command =
- CreateCommand<OnKeyBoardInputNotification>(msg);
-
- MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
- EXPECT_CALL(*mock_app, is_perform_interaction_active()).WillOnce(Return(1));
- EXPECT_CALL(*mock_app, perform_interaction_layout())
- .WillOnce(Return(mobile_apis::LayoutMode::KEYBOARD));
- EXPECT_CALL(*mock_app, hmi_level()).Times(0);
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
-
- SetSendNotificationExpectations(msg);
-
- command->Run();
-
- SetSendNotificationVariables(msg);
-
- ASSERT_EQ(kConnectionKey,
- (*msg)[strings::params][strings::connection_key].asInt());
-}
-
-TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<OnKeyBoardInputNotification> command =
- CreateCommand<OnKeyBoardInputNotification>(msg);
-
- MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
- EXPECT_CALL(*mock_app, is_perform_interaction_active())
- .WillRepeatedly(Return(0));
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_FULL));
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
-
- SetSendNotificationExpectations(msg);
-
- command->Run();
-
- SetSendNotificationVariables(msg);
-
- ASSERT_EQ(kConnectionKey,
- (*msg)[strings::params][strings::connection_key].asInt());
-}
-
-TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<OnKeyBoardInputNotification> command =
- CreateCommand<OnKeyBoardInputNotification>(msg);
-
- MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
- EXPECT_CALL(*mock_app, is_perform_interaction_active())
- .WillRepeatedly(Return(0));
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_BACKGROUND));
-
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
-
- command->Run();
-}
-
-} // namespace on_keyboard_input_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
deleted file mode 100644
index 7840e35cec..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_system_request_notification.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_system_request_notification {
-
-namespace strings = application_manager::strings;
-
-using application_manager::commands::mobile::OnSystemRequestNotification;
-using application_manager::commands::CommandImpl;
-using application_manager::MockMessageHelper;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using namespace mobile_apis;
-using testing::Mock;
-using testing::Return;
-using testing::ReturnRef;
-using testing::_;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-} // namespace
-
-class OnSystemRequestNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
- const RequestType::eType kRequestType = RequestType::PROPRIETARY;
-
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][strings::request_type] = kRequestType;
-
- SharedPtr<OnSystemRequestNotification> command =
- CreateCommand<OnSystemRequestNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillRepeatedly(ReturnRef(mock_policy_handler));
- std::string policy_app_id;
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
- EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
- .WillOnce(Return(true));
-
-#ifdef PROPRIETARY_MODE
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .Times(2)
- .WillRepeatedly(ReturnRef(mock_policy_handler));
- EXPECT_CALL(mock_policy_handler, TimeoutExchangeSec()).WillOnce(Return(5u));
-#endif // PROPRIETARY_MODE
-
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
- .WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
-
- command->Run();
-
- ASSERT_EQ(FileType::JSON,
- (*msg)[strings::msg_params][strings::file_type].asInt());
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
- ASSERT_EQ(CommandImpl::mobile_protocol_type_,
- (*msg)[strings::params][strings::protocol_type].asInt());
- ASSERT_EQ(CommandImpl::protocol_version_,
- (*msg)[strings::params][strings::protocol_version].asInt());
-}
-
-TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
- const RequestType::eType kRequestType = RequestType::HTTP;
-
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][strings::request_type] = kRequestType;
-
- SharedPtr<OnSystemRequestNotification> command =
- CreateCommand<OnSystemRequestNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler));
- std::string policy_app_id;
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
- EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
- .WillOnce(Return(true));
-
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
- .WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
-
- command->Run();
-
- ASSERT_EQ(FileType::BINARY,
- (*msg)[strings::msg_params][strings::file_type].asInt());
- ASSERT_EQ(application_manager::MessageType::kNotification,
- (*msg)[strings::params][strings::message_type].asInt());
- ASSERT_EQ(CommandImpl::mobile_protocol_type_,
- (*msg)[strings::params][strings::protocol_type].asInt());
- ASSERT_EQ(CommandImpl::protocol_version_,
- (*msg)[strings::params][strings::protocol_version].asInt());
-}
-
-TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
- const RequestType::eType kRequestType = RequestType::HTTP;
-
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][strings::request_type] = kRequestType;
-
- SharedPtr<OnSystemRequestNotification> command =
- CreateCommand<OnSystemRequestNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
- EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
- EXPECT_CALL(*mock_app, policy_app_id()).Times(0);
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _)).Times(0);
-
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
-
- command->Run();
-}
-
-TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
- const RequestType::eType kRequestType = RequestType::HTTP;
-
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][strings::request_type] = kRequestType;
-
- SharedPtr<OnSystemRequestNotification> command =
- CreateCommand<OnSystemRequestNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler));
- std::string policy_app_id;
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(policy_app_id));
- EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
- .WillOnce(Return(false));
-
- EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
- ;
-
- command->Run();
-}
-
-} // namespace on_system_request_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
deleted file mode 100644
index 59cddc325f..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "utils/helpers.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_tbt_client_state_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnTBTClientStateNotification;
-
-typedef ::utils::SharedPtr<OnTBTClientStateNotification> NotificationPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-} // namespace
-
-class OnTBTClientStateNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnTBTClientStateNotificationTest()
- : command_(CreateCommand<OnTBTClientStateNotification>()) {}
-
- NotificationPtr command_;
-};
-
-TEST_F(OnTBTClientStateNotificationTest, Run_HmiLevelNone_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- std::vector<ApplicationSharedPtr> applications_with_navi;
- applications_with_navi.push_back(mock_app);
-
- EXPECT_CALL(app_mngr_, applications_with_navi())
- .WillOnce(Return(applications_with_navi));
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
-
- EXPECT_CALL(*mock_app, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command_->Run();
-}
-
-MATCHER(CheckMessageData, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect);
-}
-
-TEST_F(OnTBTClientStateNotificationTest,
- Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- std::vector<ApplicationSharedPtr> applications_with_navi;
- applications_with_navi.push_back(mock_app);
-
- EXPECT_CALL(app_mngr_, applications_with_navi())
- .WillOnce(Return(applications_with_navi));
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
-
- command_->Run();
-}
-
-} // namespace on_tbt_client_state_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
deleted file mode 100644
index c90991fdf7..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_touch_event_notification.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "utils/helpers.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_touch_event_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::MessageSharedPtr;
-using am::commands::mobile::OnTouchEventNotification;
-
-typedef ::utils::SharedPtr<OnTouchEventNotification> NotificationPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-} // namespace
-
-class OnTouchEventNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnTouchEventNotificationTest()
- : command_(CreateCommand<OnTouchEventNotification>()) {}
-
- NotificationPtr command_;
-};
-
-TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- std::vector<ApplicationSharedPtr> applications_with_navi;
- applications_with_navi.push_back(mock_app);
-
- std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
- applications_with_mobile_projection.push_back(mock_app);
-
- EXPECT_CALL(app_mngr_, applications_with_navi())
- .WillOnce(Return(applications_with_navi));
-
- EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
- .WillOnce(Return(applications_with_mobile_projection));
-
- EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(false));
-
- EXPECT_CALL(*mock_app, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command_->Run();
-}
-
-MATCHER(CheckMessageData, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect);
-}
-
-TEST_F(OnTouchEventNotificationTest, Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- std::vector<ApplicationSharedPtr> applications_with_navi;
- applications_with_navi.push_back(mock_app);
-
- std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
- applications_with_mobile_projection.push_back(mock_app);
-
- EXPECT_CALL(app_mngr_, applications_with_navi())
- .WillOnce(Return(applications_with_navi));
-
- EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
- .WillOnce(Return(applications_with_mobile_projection));
-
- EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(true));
-
- EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _)).Times(2);
-
- command_->Run();
-}
-
-} // namespace on_touch_event_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
deleted file mode 100644
index 05d97856e4..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <vector>
-#include <map>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
-#include "utils/shared_ptr.h"
-#include "utils/custom_string.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
-#include "utils/helpers.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_vehicle_data_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnVehicleDataNotification;
-
-typedef ::utils::SharedPtr<OnVehicleDataNotification> NotificationPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-} // namespace
-
-class OnVehicleDataNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnVehicleDataNotificationTest()
- : command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {}
-
- MessageSharedPtr command_msg_;
- NotificationPtr command_;
-};
-
-MATCHER_P2(CheckMessageData, key, value, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- const bool kAreMsgParamsCorrect =
- (*arg)[am::strings::msg_params][key].asInt() == value;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect,
- kAreMsgParamsCorrect);
-}
-
-TEST_F(OnVehicleDataNotificationTest,
- Run_NotEmptyListOfAppsSubscribedForEvent_SUCCESS) {
- am::VehicleData test_vehicle_data;
- test_vehicle_data.insert(am::VehicleData::value_type(
- am::strings::fuel_level,
- mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL));
-
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(test_vehicle_data));
-
- const int kFuelLevel = 100;
- (*command_msg_)[am::strings::msg_params][am::strings::fuel_level] =
- kFuelLevel;
-
- MockAppPtr mock_app(CreateMockApp());
- std::vector<ApplicationSharedPtr> applications;
- applications.push_back(mock_app);
-
- EXPECT_CALL(
- app_mngr_,
- IviInfoUpdated(mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL,
- kFuelLevel)).WillOnce(Return(applications));
-
- EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
- ::utils::custom_string::CustomString dummy_name("test_app");
- ON_CALL(*mock_app, name()).WillByDefault(ReturnRef(dummy_name));
-
- EXPECT_CALL(app_mngr_,
- SendMessageToMobile(
- CheckMessageData(am::strings::fuel_level, kFuelLevel), _));
-
- command_->Run();
-}
-
-} // namespace on_vehicle_data_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc
deleted file mode 100644
index b0dd3c142c..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <set>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_way_point_change_notification.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "utils/helpers.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_way_point_change_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnWayPointChangeNotification;
-
-typedef ::utils::SharedPtr<OnWayPointChangeNotification> NotificationPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-} // namespace
-
-class OnWayPointChangeNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnWayPointChangeNotificationTest()
- : command_(CreateCommand<OnWayPointChangeNotification>()) {}
-
- NotificationPtr command_;
-};
-
-MATCHER(CheckMessageData, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect);
-}
-
-TEST_F(OnWayPointChangeNotificationTest,
- Run_NotEmptyListOfAppsSubscribedForWayPoints_SUCCESS) {
- std::set<int32_t> apps_subscribed_for_way_points;
- apps_subscribed_for_way_points.insert(kAppId);
-
- EXPECT_CALL(app_mngr_, GetAppsSubscribedForWayPoints())
- .WillOnce(Return(apps_subscribed_for_way_points));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
-
- command_->Run();
-}
-
-} // namespace on_way_point_change_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
deleted file mode 100644
index a27bac970c..0000000000
--- a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
+++ /dev/null
@@ -1,801 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace perform_audio_pass_thru_request {
-
-namespace am = application_manager;
-using am::commands::PerformAudioPassThruRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::InSequence;
-
-namespace {
-const int32_t kCommandId = 1;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 2u;
-const std::string kCorrectPrompt = "CorrectPrompt";
-const std::string kCorrectType = "CorrectType";
-const std::string kCorrectDisplayText1 = "CorrectDisplayText1";
-const std::string kCorrectDisplayText2 = "CorrectDisplayText2";
-const std::string kFunctionId = "FunctionId";
-const uint32_t kTimeoutForTTSSpeak = 1u;
-} // namespace
-
-class PerformAudioPassThruRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- PerformAudioPassThruRequestTest()
- : mock_app_(CreateMockApp())
- , message_(utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map))
- , msg_params_((*message_)[am::strings::msg_params]) {}
-
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- void TestWrongSyntaxInField(const std::string& field) {
- if (field == am::strings::initial_prompt) {
- msg_params_[field][0][am::strings::text] = "prompt\\n";
- } else {
- msg_params_[field] = "prompt\\n";
- }
-
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- CallRun caller(*command_sptr_);
- MessageSharedPtr result_message = CatchMobileCommandResult(caller);
-
- const am::mobile_api::Result::eType result =
- static_cast<am::mobile_api::Result::eType>(
- (*result_message)[am::strings::msg_params][am::strings::result_code]
- .asInt());
-
- EXPECT_EQ(am::mobile_api::Result::INVALID_DATA, result);
- }
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- command_sptr_ =
- CreateCommand<am::commands::PerformAudioPassThruRequest>(message_);
-
- application_sptr_ = CreateMockApp();
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(application_sptr_));
- }
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- sync_primitives::Lock lock_;
- MockAppPtr mock_app_;
- MessageSharedPtr message_;
- ::smart_objects::SmartObject& msg_params_;
- utils::SharedPtr<am::commands::PerformAudioPassThruRequest> command_sptr_;
- MockAppPtr application_sptr_;
-};
-
-TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
- MessageSharedPtr msg_ui = CreateMessage(smart_objects::SmartType_Map);
- (*msg_ui)[am::strings::msg_params][am::strings::result_code] =
- am::mobile_api::Result::GENERIC_ERROR;
- (*msg_ui)[am::strings::msg_params][am::strings::success] = false;
-
- MessageSharedPtr message =
- utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map);
- (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
-
- utils::SharedPtr<PerformAudioPassThruRequest> command =
- CreateCommand<PerformAudioPassThruRequest>(message);
-
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
-
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
- .WillOnce(Return(msg_ui));
-
- MessageSharedPtr vr_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
-
- command->onTimeOut();
- EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- false);
- EXPECT_EQ(
- (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr mobile_request = CreateFullParamsUISO();
- (*mobile_request)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- smart_objects::SmartObject initial_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- initial_prompt[0] = smart_objects::SmartObject(smart_objects::SmartType_Map);
- initial_prompt[0][am::strings::text] = "tts chunk text";
- initial_prompt[0][am::strings::type] = 0;
- (*mobile_request)[am::strings::msg_params][am::strings::initial_prompt] =
- initial_prompt;
-
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
- utils::SharedPtr<PerformAudioPassThruRequest> command =
- CreateCommand<PerformAudioPassThruRequest>(mobile_request);
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- MessageSharedPtr response_msg_tts =
- CreateMessage(smart_objects::SmartType_Map);
- (*response_msg_tts)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*response_msg_tts)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
- event_tts.set_smart_object(*response_msg_tts);
-
- MessageSharedPtr response_ui = CreateMessage(smart_objects::SmartType_Map);
- (*response_ui)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*response_ui)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
- (*response_ui)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
- am::event_engine::Event event_ui(
- hmi_apis::FunctionID::UI_PerformAudioPassThru);
- event_ui.set_smart_object(*response_ui);
-
- MessageSharedPtr response_to_mobile;
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->Run();
- command->on_event(event_tts);
- command->on_event(event_ui);
-
- EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
- .asBool(),
- false);
- EXPECT_EQ(
- (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::info]
- .asString(),
- "UI is not supported by system");
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- Run_InvalidApp_ApplicationNotRegisteredResponce) {
- utils::SharedPtr<am::Application> null_application_sptr;
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(null_application_sptr));
-
- CallRun caller(*command_sptr_);
- MessageSharedPtr result_message = CatchMobileCommandResult(caller);
-
- const am::mobile_api::Result::eType result =
- static_cast<am::mobile_api::Result::eType>(
- (*result_message)[am::strings::msg_params][am::strings::result_code]
- .asInt());
- EXPECT_EQ(am::mobile_api::Result::APPLICATION_NOT_REGISTERED, result);
-}
-
-TEST_F(PerformAudioPassThruRequestTest, Run_HmiLevelNone_Rejected) {
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
-
- CallRun caller(*command_sptr_);
- MessageSharedPtr result_message = CatchMobileCommandResult(caller);
-
- const am::mobile_api::Result::eType result =
- static_cast<am::mobile_api::Result::eType>(
- (*result_message)[am::strings::msg_params][am::strings::result_code]
- .asInt());
- EXPECT_EQ(am::mobile_api::Result::REJECTED, result);
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- Run_WhitespaceInInitialPrompt_InvalidData) {
- TestWrongSyntaxInField(am::strings::initial_prompt);
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- Run_WhitespaceInAudioPassDisplayText1_InvalidData) {
- TestWrongSyntaxInField(am::strings::audio_pass_display_text1);
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- Run_WhitespaceInAudioPassDisplayText2_InvalidData) {
- TestWrongSyntaxInField(am::strings::audio_pass_display_text2);
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- Run_InitPromptCorrect_TTSSpeakIsAbsent) {
- // First we need to call SendSpeakRequest()
- // to enable the "is_active_tts_speak" key
-
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- msg_params_[am::strings::initial_prompt][0][am::strings::text] =
- kCorrectPrompt;
- msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
-
- MessageSharedPtr speak_reqeust_result_msg;
- MessageSharedPtr perform_result_msg;
- {
- InSequence dummy;
- // Send speak request sending
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
-
- // Perform audio path thru request sending
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
- }
- CallRun run_caller(*command_sptr_);
- run_caller();
-
- const ::smart_objects::SmartObject& speak_msg_params =
- (*speak_reqeust_result_msg)[am::strings::msg_params];
-
- const std::string result_initial_prompt =
- speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
- .asString();
- const std::string result_prompt_type =
- speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
- .asString();
-
- EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
- EXPECT_EQ(kCorrectType, result_prompt_type);
-
- // Now we recieve on_event()
-
- am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::GENERIC_ERROR;
- event.set_smart_object(*message_);
-
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
-
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_StopSpeaking))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- CallOnEvent on_event_caller(*command_sptr_, event);
- MessageSharedPtr command_result = CatchHMICommandResult(on_event_caller);
-
- const hmi_apis::FunctionID::eType result_function_id =
- static_cast<hmi_apis::FunctionID::eType>(
- (*command_result)[am::strings::params][am::strings::function_id]
- .asInt());
-
- EXPECT_EQ(hmi_apis::FunctionID::TTS_StopSpeaking, result_function_id);
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteTrue) {
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- msg_params_[am::strings::initial_prompt][0][am::strings::text] =
- kCorrectPrompt;
- msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
- msg_params_[am::strings::audio_pass_display_text1] = kCorrectDisplayText1;
- msg_params_[am::strings::audio_pass_display_text2] = kCorrectDisplayText2;
-
- MessageSharedPtr speak_reqeust_result_msg;
- MessageSharedPtr perform_result_msg;
- {
- InSequence dummy;
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
-
- // Perform audio path thru request sending
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
- }
- CallRun caller(*command_sptr_);
- caller();
-
- const ::smart_objects::SmartObject& speak_msg_params =
- (*speak_reqeust_result_msg)[am::strings::msg_params];
- const ::smart_objects::SmartObject& perform_msg_params =
- (*perform_result_msg)[am::strings::msg_params];
-
- const std::string result_initial_prompt =
- speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
- .asString();
- const std::string result_prompt_type =
- speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
- .asString();
- const std::string result_display_text_1 =
- perform_msg_params[am::hmi_request::audio_pass_display_texts][0]
- [am::hmi_request::field_text].asString();
- const std::string result_display_text_2 =
- perform_msg_params[am::hmi_request::audio_pass_display_texts][1]
- [am::hmi_request::field_text].asString();
-
- EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
- EXPECT_EQ(kCorrectType, result_prompt_type);
- EXPECT_EQ(kCorrectDisplayText1, result_display_text_1);
- EXPECT_EQ(kCorrectDisplayText2, result_display_text_2);
-
- EXPECT_EQ(true, perform_msg_params[am::strings::mute_audio].asBool());
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteFalse) {
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- msg_params_[am::strings::initial_prompt][0][am::strings::text] =
- kCorrectPrompt;
- msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
-
- const bool muted = false;
-
- msg_params_[am::strings::mute_audio] = muted;
-
- MessageSharedPtr speak_reqeust_result_msg;
- MessageSharedPtr perform_result_msg;
- {
- InSequence dummy;
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
-
- // Perform audio path thru request sending
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
- }
- CallRun caller(*command_sptr_);
- caller();
-
- EXPECT_EQ(
- muted,
- (*perform_result_msg)[am::strings::msg_params][am::strings::mute_audio]
- .asBool());
-}
-
-TEST_F(
- PerformAudioPassThruRequestTest,
- Run_InitPromptEmpty_PerformAndRecordStartNotificationsAndStartRecording) {
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- MessageSharedPtr start_record_result_msg;
- MessageSharedPtr perform_result_msg;
- {
- InSequence dummy;
-
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- // Perform audio path thru request sending
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
-
- // Perform audio path thru request sending
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_OnRecordStart))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- // Start recording notification sending
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&start_record_result_msg), Return(true)));
- }
-
- // Start microphone recording cals
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
- EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
-
- CallRun caller(*command_sptr_);
- caller();
-
- const hmi_apis::FunctionID::eType start_record_result_function_id =
- static_cast<hmi_apis::FunctionID::eType>(
- (*start_record_result_msg)[am::strings::params]
- [am::strings::function_id].asInt());
- EXPECT_EQ(hmi_apis::FunctionID::UI_OnRecordStart,
- start_record_result_function_id);
-}
-
-TEST_F(PerformAudioPassThruRequestTest, OnEvent_UIPAPT_Rejected) {
- am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
-
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::REJECTED;
- event.set_smart_object(*message_);
-
- CallOnEvent caller(*command_sptr_, event);
-
- MessageSharedPtr result_message = CatchMobileCommandResult(caller);
-
- const am::mobile_api::Result::eType result_code =
- static_cast<am::mobile_api::Result::eType>(
- (*result_message)[am::strings::msg_params][am::strings::result_code]
- .asInt());
-
- EXPECT_EQ(am::mobile_api::Result::REJECTED, result_code);
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- OnEvent_TTSSpeakSuccess_UpdateRequestTimeout) {
- am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
-
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- event.set_smart_object(*message_);
-
- // Start recording notification sending
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
-
- // Start microphone recording cals
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
- EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
-
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- CallOnEvent caller(*command_sptr_, event);
- caller();
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- DISABLED_OnEvent_PAPTunsupportedResource_CorrectInfo) {
- const std::string return_info = "Unsupported phoneme type sent in a prompt";
-
- am::event_engine::Event event_speak(hmi_apis::FunctionID::TTS_Speak);
- am::event_engine::Event event_perform(
- hmi_apis::FunctionID::UI_PerformAudioPassThru);
-
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- event_speak.set_smart_object(*message_);
-
- (*message_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- event_perform.set_smart_object(*message_);
-
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- // First call on_event for setting result_tts_speak_ to UNSUPPORTED_RESOURCE
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- CallOnEvent caller_speak(*command_sptr_, event_speak);
- caller_speak();
-
- // Second call for test correct behavior of UI_PerformAudioPassThru event
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
- EXPECT_CALL(app_mngr_, StopAudioPassThru(_)).Times(0);
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- CallOnEvent caller_perform(*command_sptr_, event_perform);
-
- MessageSharedPtr perform_event_result =
- CatchMobileCommandResult(caller_perform);
-
- EXPECT_EQ(return_info,
- (*perform_event_result)[am::strings::msg_params][am::strings::info]
- .asString());
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- DISABLED_OnEvent_TTSSpeak_UpdateTimeout) {
- am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
-
- msg_params_[am::strings::connection_key] = kConnectionKey;
- msg_params_[am::strings::function_id] = kFunctionId;
- msg_params_[am::strings::correlation_id] = kCorrelationId;
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
-
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
-
- EXPECT_CALL(
- app_mngr_,
- StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- CallOnEvent caller(*command_sptr_, event);
- caller();
-
- EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
- EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- DISABLED_OnEvent_TTSOnResetTimeout_UpdateTimeout) {
- am::event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-
- msg_params_[am::strings::connection_key] = kConnectionKey;
- msg_params_[am::strings::function_id] = kFunctionId;
-
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
-
- EXPECT_CALL(
- app_mngr_,
- StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- CallOnEvent caller(*command_sptr_, event);
- caller();
-
- EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
- EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
-}
-
-TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) {
- am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).Times(0);
-
- CallOnEvent caller(*command_sptr_, event);
- caller();
-}
-
-TEST_F(PerformAudioPassThruRequestTest, Init_CorrectTimeout) {
- const uint32_t kDefaultTimeout = command_sptr_->default_timeout();
- const uint32_t kMaxDuration = 10000u;
-
- msg_params_[am::strings::max_duration] = kMaxDuration;
-
- command_sptr_->Init();
-
- EXPECT_EQ(kDefaultTimeout + kMaxDuration, command_sptr_->default_timeout());
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- onTimeOut_ttsSpeakNotActive_DontSendHMIReqeust) {
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
-
- // For setting current_state_ -> kCompleted
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
-
- command_sptr_->onTimeOut();
-}
-
-TEST_F(PerformAudioPassThruRequestTest,
- DISABLED_onTimeOut_ttsSpeakActive_SendHMIReqeust) {
- uint32_t app_id = kConnectionKey;
- EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
-
- EXPECT_CALL(*application_sptr_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
-
- msg_params_[am::strings::initial_prompt][0][am::strings::text] =
- kCorrectPrompt;
- msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
- MessageSharedPtr speak_reqeust_result_msg;
- MessageSharedPtr perform_result_msg;
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
-
- // Perform audio path thru request sending
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
- .WillOnce(Return(msg));
-
- // For setting is_active_tts_speak -> true
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .Times(2)
- .WillRepeatedly(Return(false));
- CallRun caller(*command_sptr_);
- caller();
-
- // For setting current_state_ -> kCompleted
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL));
- command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
- .WillOnce(Return(false));
-
- command_sptr_->onTimeOut();
-}
-
-} // namespace perform_audio_pass_thru_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc
deleted file mode 100644
index a272234e82..0000000000
--- a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/perform_interaction_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace perform_interaction_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using ::testing::_;
-using ::utils::SharedPtr;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using am::commands::PerformInteractionRequest;
-using ::test::components::application_manager_test::MockApplication;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-namespace {
-const int32_t kCommandId = 1;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class PerformInteractionRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- PerformInteractionRequestTest() : mock_app_(CreateMockApp()) {}
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- }
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- sync_primitives::Lock lock_;
- MockAppPtr mock_app_;
-};
-
-TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
- MessageSharedPtr response_msg_vr =
- CreateMessage(smart_objects::SmartType_Map);
- (*response_msg_vr)[strings::params][hmi_response::code] =
- static_cast<uint64_t>(hmi_apis::Common_Result::SUCCESS);
- (*response_msg_vr)[strings::msg_params][strings::info] = "info";
- MessageSharedPtr request_msg = CreateMessage(smart_objects::SmartType_Map);
- (*request_msg)[strings::msg_params][strings::interaction_mode] =
- mobile_apis::InteractionMode::BOTH;
- utils::SharedPtr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(request_msg);
- MockAppPtr mock_app;
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
-
- Event event(hmi_apis::FunctionID::VR_PerformInteraction);
- event.set_smart_object(*response_msg_vr);
-
- command->Init();
- command->on_event(event);
- MessageSharedPtr response_to_mobile =
- CreateMessage(smart_objects::SmartType_Map);
- (*response_to_mobile)[strings::msg_params][strings::result_code] =
- static_cast<uint64_t>(am::mobile_api::Result::GENERIC_ERROR);
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
- .WillOnce(Return(response_to_mobile));
-
- MessageSharedPtr vr_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
- command->onTimeOut();
-
- EXPECT_EQ(
- (*vr_command_result)[strings::msg_params][strings::success].asBool(),
- false);
- EXPECT_EQ(
- (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
- static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
-}
-
-TEST_F(PerformInteractionRequestTest,
- OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_from_mobile =
- CreateMessage(smart_objects::SmartType_Map);
- (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
- mobile_apis::InteractionMode::VR_ONLY;
- utils::SharedPtr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
- command->Init();
-
- MockAppPtr mock_app;
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
-
- MessageSharedPtr response_msg_vr =
- CreateMessage(smart_objects::SmartType_Map);
- (*response_msg_vr)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*response_msg_vr)[strings::msg_params][strings::cmd_id] = kCommandId;
- (*response_msg_vr)[am::strings::msg_params][am::strings::info] =
- "VR is not supported by system";
-
- am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
- event_vr.set_smart_object(*response_msg_vr);
-
- MessageSharedPtr response_msg_ui =
- CreateMessage(smart_objects::SmartType_Map);
- (*response_msg_ui)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
- event_ui.set_smart_object(*response_msg_ui);
-
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- MessageSharedPtr response_to_mobile;
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->on_event(event_vr);
- command->on_event(event_ui);
-
- ResultCommandExpectations(response_to_mobile,
- "VR is not supported by system");
-}
-
-TEST_F(PerformInteractionRequestTest,
- OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_from_mobile =
- CreateMessage(smart_objects::SmartType_Map);
- (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
- mobile_apis::InteractionMode::VR_ONLY;
- utils::SharedPtr<PerformInteractionRequest> command =
- CreateCommand<PerformInteractionRequest>(msg_from_mobile);
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- MessageSharedPtr response_msg_vr =
- CreateMessage(smart_objects::SmartType_Map);
- (*response_msg_vr)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
- event_vr.set_smart_object(*response_msg_vr);
-
- MessageSharedPtr response_msg_ui =
- CreateMessage(smart_objects::SmartType_Map);
- (*response_msg_ui)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*response_msg_ui)[strings::msg_params][strings::cmd_id] = kCommandId;
- (*response_msg_ui)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
-
- am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
- event_ui.set_smart_object(*response_msg_ui);
-
- MessageSharedPtr response_to_mobile;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->on_event(event_vr);
-
- EXPECT_CALL(*mock_app_, is_perform_interaction_active())
- .WillOnce(Return(false));
- EXPECT_CALL(*mock_app_, DeletePerformInteractionChoiceSet(_));
-
- command->on_event(event_ui);
-
- ResultCommandExpectations(response_to_mobile,
- "UI is not supported by system");
-}
-
-} // namespace perform_interaction_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/put_file_test.cc b/src/components/application_manager/test/commands/mobile/put_file_test.cc
deleted file mode 100644
index b48ac67501..0000000000
--- a/src/components/application_manager/test/commands/mobile/put_file_test.cc
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-
-#include "mobile/put_file_response.h"
-#include "mobile/put_file_request.h"
-
-#include "utils/make_shared.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace put_file {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::AtLeast;
-
-namespace am = ::application_manager;
-
-using am::commands::PutFileRequest;
-using am::commands::PutFileResponse;
-using am::commands::MessageSharedPtr;
-using policy_test::MockPolicyHandlerInterface;
-
-typedef SharedPtr<PutFileRequest> PutFileRequestPtr;
-typedef SharedPtr<PutFileResponse> PutFileResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const std::string kFileName = "sync_file_name.txt";
-const int64_t kOffset = 10u;
-const int64_t kZeroOffset = 0u;
-const std::string kStorageFolder = "./storage";
-const std::string kAppFolder = "app_folder";
-}
-
-class PutFileRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- PutFileRequestTest()
- : msg_(CreateMessage(::smart_objects::SmartType_Map))
- , mock_app_(CreateMockApp()) {}
-
- void SetUp() OVERRIDE {
- binary_data_.push_back(1u);
-
- (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_)[am::strings::msg_params][am::strings::sync_file_name] = kFileName;
- (*msg_)[am::strings::msg_params][am::strings::persistent_file] = true;
- (*msg_)[am::strings::msg_params][am::strings::file_type] =
- mobile_apis::FileType::JSON;
- (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
-
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
- ON_CALL(*mock_app_, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
- }
-
- void ExpectReceiveMessageFromSDK() {
- EXPECT_CALL(mock_policy_handler_,
- ReceiveMessageFromSDK(kFileName, binary_data_))
- .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
- }
- void ExpectManageMobileCommandWithResultCode(
- const mobile_apis::Result::eType code) {
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(code),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- }
-
- MessageSharedPtr msg_;
- MockAppPtr mock_app_;
- MockPolicyHandlerInterface mock_policy_handler_;
- std::vector<uint8_t> binary_data_;
-};
-
-class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- PutFileResponceTest() : message_(CreateMessage()) {}
-
- void SetUp() OVERRIDE {
- command_sptr_ = CreateCommand<PutFileResponse>(message_);
- }
-
- MessageSharedPtr message_;
- SharedPtr<PutFileResponse> command_sptr_;
-};
-
-TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) {
- ::smart_objects::SmartObject& message_ref = *message_;
-
- message_ref[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- utils::SharedPtr<am::Application> null_application_sptr;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(null_application_sptr));
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(
- MobileResultCodeIs(mobile_apis::Result::APPLICATION_NOT_REGISTERED),
- _));
- command_sptr_->Run();
-}
-
-TEST_F(PutFileResponceTest, Run_ApplicationRegistered_Success) {
- ::smart_objects::SmartObject& message_ref = *message_;
-
- message_ref[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- message_ref[am::strings::msg_params][am::strings::success] = true;
-
- utils::SharedPtr<am::Application> application_sptr =
- utils::MakeShared<MockApplication>();
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(application_sptr));
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
- command_sptr_->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()));
- ExpectManageMobileCommandWithResultCode(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_HmiLevelNone_UNSUCCESS) {
- EXPECT_CALL(*mock_app_, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
-
- const uint32_t settings_put_file_in_none = 1u;
- const uint32_t app_put_file_in_none_count = 2u;
- EXPECT_CALL(app_mngr_settings_, put_file_in_none())
- .WillOnce(ReturnRef(settings_put_file_in_none));
- EXPECT_CALL(*mock_app_, put_file_in_none_count())
- .WillOnce(Return(app_put_file_in_none_count));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_BinaryDataDoesNotExists_UNSUCCESS) {
- (*msg_)[am::strings::params].erase(am::strings::binary_data);
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_SyncFileNameDoesNotExists_UNSUCCESS) {
- (*msg_)[am::strings::msg_params].erase(am::strings::sync_file_name);
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_FileTypeDoesNotExists_UNSUCCESS) {
- (*msg_)[am::strings::msg_params].erase(am::strings::file_type);
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_BinaryDataGreaterThanAvaliableSpace_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
-
- const uint32_t avaliable_space = 0u;
- EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
- .WillOnce(Return(avaliable_space));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::OUT_OF_MEMORY);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_IvalidCreationDirectory_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
-
- ExpectReceiveMessageFromSDK();
-
- const std::string storage_folder = "/storage";
- EXPECT_CALL(app_mngr_settings_, system_files_path())
- .WillOnce(ReturnRef(storage_folder));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::GENERIC_ERROR);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_IvalidUpdateFile_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
-
- const uint32_t avaliable_space = 2u;
- EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
- .WillOnce(Return(avaliable_space))
- .WillOnce(Return(avaliable_space));
-
- const std::string file_path = kStorageFolder + "/" + kAppFolder;
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(false));
- EXPECT_CALL(*mock_app_, UpdateFile(_)).WillOnce(Return(false));
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_AddFile_SUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
-
- const uint32_t avaliable_space = 2u;
- EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
- .WillOnce(Return(avaliable_space))
- .WillOnce(Return(avaliable_space));
-
- const std::string file_path = kStorageFolder + "/" + kAppFolder;
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(true));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, system_files_path())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnPutFile)))
- .WillOnce(Return(true));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_InvalidPutFile_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, system_files_path())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-} // namespace put_file
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
deleted file mode 100644
index c88f4626f0..0000000000
--- a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/mobile/read_did_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace read_did_request {
-
-using ::testing::_;
-using ::testing::DoAll;
-using ::testing::Return;
-using ::testing::SaveArg;
-namespace am = ::application_manager;
-using am::commands::ReadDIDRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using ::utils::SharedPtr;
-
-class ReadDIDRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
- Event event(Event::EventID::INVALID_ENUM);
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->on_event(event);
-}
-
-TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
- Event event(Event::EventID::VehicleInfo_ReadDID);
-
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
-
- const hmi_apis::Common_Result::eType hmi_response_code =
- hmi_apis::Common_Result::SUCCESS;
- const mobile_apis::Result::eType mobile_response_code =
- mobile_apis::Result::SUCCESS;
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
- (*event_msg)[am::strings::msg_params] = 0;
-
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
-
- command->on_event(event);
-}
-
-TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
-
- ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(SharedPtr<am::Application>()));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) {
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(true));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::REJECTED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(ReadDIDRequestTest, Run_EmptyDidLocation_UNSUCCESS) {
- MockAppPtr app(CreateMockApp());
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(ReadDIDRequestTest, Run_SUCCESS) {
- MockAppPtr app(CreateMockApp());
- MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
- (*msg)[am::strings::msg_params][am::strings::did_location]["SomeData"] = 0;
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(msg));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
-
- MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
- EXPECT_EQ(hmi_apis::FunctionID::VehicleInfo_ReadDID,
- static_cast<hmi_apis::FunctionID::eType>(
- (*result_msg)[am::strings::params][am::strings::function_id]
- .asInt()));
-}
-
-} // namespace read_did_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
deleted file mode 100644
index b7a004f199..0000000000
--- a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "mobile/register_app_interface_request.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "protocol_handler/mock_session_observer.h"
-#include "connection_handler/mock_connection_handler.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_resume_ctrl.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "utils/data_accessor.h"
-#include "utils/custom_string.h"
-#include "utils/lock.h"
-#include "utils/macro.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace register_app_interface_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-
-namespace am = ::application_manager;
-
-using ::utils::SharedPtr;
-using am::commands::MessageSharedPtr;
-using am::commands::RegisterAppInterfaceRequest;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const hmi_apis::Common_Language::eType kHmiLanguage =
- hmi_apis::Common_Language::EN_US;
-const mobile_apis::Language::eType kMobileLanguage =
- mobile_apis::Language::EN_US;
-const std::string kMacAddress = "test_mac_address";
-const std::string kAppId = "test_app_id";
-const std::string kDummyString = "test_string";
-const std::vector<uint32_t> kDummyDiagModes;
-} // namespace
-
-class RegisterAppInterfaceRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- RegisterAppInterfaceRequestTest()
- : msg_(CreateMessage())
- , command_(CreateCommand<RegisterAppInterfaceRequest>(msg_))
- , app_name_("test_app_name_")
- , mock_application_helper_(
- application_manager_test::MockApplicationHelper::
- application_helper_mock()) {
- InitGetters();
- InitLanguage();
- }
-
- void SetUp() OVERRIDE {
- testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
- }
-
- void TearDown() OVERRIDE {
- testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
- }
-
- void InitBasicMessage() {
- (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*msg_)[am::strings::msg_params][am::strings::app_name] = app_name_;
- (*msg_)[am::strings::msg_params][am::strings::language_desired] =
- kHmiLanguage;
- (*msg_)[am::strings::msg_params]
- [am::strings::hmi_display_language_desired] = kHmiLanguage;
- }
-
- MockAppPtr CreateBasicMockedApp() {
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(*mock_app, name()).WillByDefault(ReturnRef(app_name_));
- ON_CALL(*mock_app, mac_address()).WillByDefault(ReturnRef(kMacAddress));
- ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(kDummyString));
- ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
- ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
- ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId));
- return mock_app;
- }
-
- void InitLanguage(
- hmi_apis::Common_Language::eType ui_language = kHmiLanguage,
- hmi_apis::Common_Language::eType vr_language = kHmiLanguage,
- hmi_apis::Common_Language::eType tts_language = kHmiLanguage) {
- ON_CALL(mock_hmi_capabilities_, active_vr_language())
- .WillByDefault(Return(vr_language));
- ON_CALL(mock_hmi_capabilities_, active_ui_language())
- .WillByDefault(Return(ui_language));
- ON_CALL(mock_hmi_capabilities_, active_tts_language())
- .WillByDefault(Return(tts_language));
- }
-
- void InitGetters() {
- ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(true));
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
- ON_CALL(app_mngr_, resume_controller())
- .WillByDefault(ReturnRef(mock_resume_crt_));
- ON_CALL(app_mngr_, connection_handler())
- .WillByDefault(ReturnRef(mock_connection_handler_));
- ON_CALL(mock_connection_handler_, get_session_observer())
- .WillByDefault(ReturnRef(mock_session_observer_));
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(mock_hmi_capabilities_));
- ON_CALL(app_mngr_settings_, sdl_version())
- .WillByDefault(ReturnRef(kDummyString));
- ON_CALL(mock_hmi_capabilities_, ccpu_version())
- .WillByDefault(ReturnRef(kDummyString));
- ON_CALL(app_mngr_settings_, supported_diag_modes())
- .WillByDefault(ReturnRef(kDummyDiagModes));
- ON_CALL(mock_policy_handler_, GetAppRequestTypes(_))
- .WillByDefault(Return(std::vector<std::string>()));
- ON_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
- .WillByDefault(Return(policy::DeviceConsent::kDeviceAllowed));
- ON_CALL(app_mngr_, GetDeviceTransportType(_))
- .WillByDefault(Return(hmi_apis::Common_TransportType::WIFI));
- ON_CALL(app_mngr_, IsAppInReconnectMode(_)).WillByDefault(Return(false));
- ON_CALL(app_mngr_, application_by_policy_id(_))
- .WillByDefault(Return(ApplicationSharedPtr()));
- ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- }
-
- void SetCommonExpectionsOnSwitchedApplication(
- MockAppPtr mock_app, mobile_apis::Result::eType response_result_code) {
- EXPECT_CALL(mock_policy_handler_, AddApplication(_, _)).Times(0);
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(response_result_code), _));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
- .Times(0);
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
- .Times(0);
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_ChangeRegistration))).Times(0);
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_ChangeRegistration))).Times(0);
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0);
-
- EXPECT_CALL(
- app_mngr_,
- OnApplicationSwitched(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app)));
- }
-
- MessageSharedPtr msg_;
- SharedPtr<RegisterAppInterfaceRequest> command_;
-
- const utils::custom_string::CustomString app_name_;
- sync_primitives::Lock lock_;
- am::ApplicationSet app_set_;
-
- typedef IsNiceMock<policy_test::MockPolicyHandlerInterface,
- kMocksAreNice>::Result MockPolicyHandlerInterface;
-
- typedef IsNiceMock<resumprion_test::MockResumeCtrl, kMocksAreNice>::Result
- MockResumeCtrl;
-
- typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
- kMocksAreNice>::Result MockConnectionHandler;
-
- typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
- kMocksAreNice>::Result MockSessionObserver;
-
- typedef IsNiceMock<application_manager_test::MockHMICapabilities,
- kMocksAreNice>::Result MockHMICapabilities;
-
- MockPolicyHandlerInterface mock_policy_handler_;
- MockResumeCtrl mock_resume_crt_;
- MockConnectionHandler mock_connection_handler_;
- MockSessionObserver mock_session_observer_;
- MockHMICapabilities mock_hmi_capabilities_;
- application_manager_test::MockApplicationHelper& mock_application_helper_;
-};
-
-TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) {
- EXPECT_TRUE(command_->Init());
-}
-
-TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
- InitBasicMessage();
- (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId;
- EXPECT_CALL(app_mngr_, IsStopping())
- .WillOnce(Return(false))
- .WillOnce(Return(true))
- .WillOnce(Return(false));
- ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
-
- MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()))
- .WillRepeatedly(Return(mock_app));
-
- ON_CALL(app_mngr_, applications())
- .WillByDefault(Return(DataAccessor<am::ApplicationSet>(app_set_, lock_)));
- ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
- ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
- .WillByDefault(Return(true));
- policy::StatusNotifier notify_upd_manager =
- utils::MakeShared<utils::CallNothing>();
- ON_CALL(mock_policy_handler_, AddApplication(_, _))
- .WillByDefault(Return(notify_upd_manager));
-
- EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
- .Times(2);
- command_->Run();
-}
-
-MATCHER_P(CheckHMIInterfacesRealtedData, expected_data, "") {
- const bool is_result_id_correct =
- mobile_apis::Result::SUCCESS ==
- static_cast<mobile_apis::Result::eType>(
- (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
-
- const bool are_ui_related_data_exist =
- (*arg)[am::strings::msg_params].keyExists(
- am::hmi_response::display_capabilities);
-
- const bool are_vi_related_data_exist =
- (*arg)[am::strings::msg_params][am::hmi_response::vehicle_type] ==
- (*expected_data)[am::hmi_response::vehicle_type];
-
- const bool are_vr_related_data_exist =
- (*arg)[am::strings::msg_params][am::strings::vr_capabilities] ==
- (*expected_data)[am::strings::vr_capabilities];
-
- return is_result_id_correct && are_ui_related_data_exist &&
- are_vi_related_data_exist && are_vr_related_data_exist;
-}
-
-TEST_F(RegisterAppInterfaceRequestTest,
- Run_HmiInterfacesStateAvailable_SUCCESS) {
- InitBasicMessage();
-
- EXPECT_CALL(app_mngr_, IsStopping())
- .WillOnce(Return(false))
- .WillOnce(Return(true))
- .WillOnce(Return(false));
- ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
- EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
- EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
-
- MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()))
- .WillRepeatedly(Return(mock_app));
-
- MessageSharedPtr expected_message =
- CreateMessage(smart_objects::SmartType_Map);
-
- (*expected_message)[am::hmi_response::vehicle_type] = "test_vehicle_type";
- (*expected_message)[am::strings::vr_capabilities] = "test_vr_capabilities";
- (*expected_message)[am::hmi_response::display_capabilities] = 0;
- SmartObject& display_capabilities =
- (*expected_message)[am::hmi_response::display_capabilities];
- display_capabilities[am::hmi_response::display_type] = "test_display_type";
- display_capabilities[am::hmi_response::text_fields] = "test_text_fields";
- display_capabilities[am::hmi_response::image_fields] = "test_image_fields";
- display_capabilities[am::hmi_response::media_clock_formats] =
- "test_media_clock_formats";
- display_capabilities[am::hmi_response::num_custom_presets_available] =
- "test_num_custom_presets_available";
- display_capabilities[am::hmi_response::graphic_supported] =
- "test_graphic_supported";
- display_capabilities[am::hmi_response::templates_available] =
- "test_templates_available";
- display_capabilities[am::hmi_response::screen_params] = "test_screen_params";
-
- ON_CALL(mock_hmi_capabilities_, vehicle_type())
- .WillByDefault(
- Return(&(*expected_message)[am::hmi_response::vehicle_type]));
- ON_CALL(mock_hmi_capabilities_, vr_capabilities())
- .WillByDefault(
- Return(&(*expected_message)[am::strings::vr_capabilities]));
- ON_CALL(mock_hmi_capabilities_, display_capabilities())
- .WillByDefault(
- Return(&(*expected_message)[am::hmi_response::display_capabilities]));
-
- ON_CALL(app_mngr_, applications())
- .WillByDefault(Return(DataAccessor<am::ApplicationSet>(app_set_, lock_)));
- ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
- ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
- .WillByDefault(Return(true));
- policy::StatusNotifier notify_upd_manager =
- utils::MakeShared<utils::CallNothing>();
- ON_CALL(mock_policy_handler_, AddApplication(_, _))
- .WillByDefault(Return(notify_upd_manager));
-
- EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_ChangeRegistration)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
- .Times(2);
-
- command_->Run();
-}
-
-TEST_F(RegisterAppInterfaceRequestTest,
- SwitchApplication_CorrectHash_ExpectNoCleanupSuccess) {
- InitBasicMessage();
-
- const std::string request_hash_id = "abc123";
- (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
-
- MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
- .WillRepeatedly(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
-
- EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
-
- EXPECT_CALL(
- mock_resume_crt_,
- CheckApplicationHash(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
- request_hash_id)).WillOnce(Return(true));
-
- EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0);
-
- EXPECT_CALL(mock_application_helper_, RecallApplicationData(_, _)).Times(0);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
-
- SetCommonExpectionsOnSwitchedApplication(mock_app,
- mobile_apis::Result::SUCCESS);
-
- command_->Run();
-}
-
-TEST_F(RegisterAppInterfaceRequestTest,
- SwitchApplication_WrongHash_ExpectCleanupResumeFailed) {
- InitBasicMessage();
-
- const std::string request_hash_id = "abc123";
- (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
-
- MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
- .WillRepeatedly(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
-
- EXPECT_CALL(
- mock_resume_crt_,
- CheckApplicationHash(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
- request_hash_id)).WillOnce(Return(false));
-
- EXPECT_CALL(
- mock_application_helper_,
- RecallApplicationData(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
- _));
-
- EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
-
- SetCommonExpectionsOnSwitchedApplication(mock_app,
- mobile_apis::Result::RESUME_FAILED);
-
- command_->Run();
-}
-
-TEST_F(RegisterAppInterfaceRequestTest,
- SwitchApplication_NoHash_ExpectCleanupResumeFailed) {
- InitBasicMessage();
-
- MockAppPtr mock_app = CreateBasicMockedApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
- .WillRepeatedly(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
-
- EXPECT_CALL(
- mock_application_helper_,
- RecallApplicationData(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
- _));
-
- EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
-
- SetCommonExpectionsOnSwitchedApplication(mock_app,
- mobile_apis::Result::RESUME_FAILED);
-
- command_->Run();
-}
-
-} // namespace register_app_interface_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc
deleted file mode 100644
index 69fee02262..0000000000
--- a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "mobile/reset_global_properties_request.h"
-#include "mobile/reset_global_properties_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace reset_global_properties {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-namespace am = ::application_manager;
-
-using am::commands::ResetGlobalPropertiesRequest;
-using am::commands::ResetGlobalPropertiesResponse;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using am::MockMessageHelper;
-
-typedef SharedPtr<ResetGlobalPropertiesRequest> ResetGlobalPropertiesRequestPtr;
-typedef SharedPtr<ResetGlobalPropertiesResponse>
- ResetGlobalPropertiesResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 10u;
-} // namespace
-
-class ResetGlobalPropertiesRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- ResetGlobalPropertiesRequestTest()
- : msg_(CreateMessage()), mock_app_(CreateMockApp()) {}
-
- void SetUp() OVERRIDE {
- (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
-
- command_ = CreateCommand<ResetGlobalPropertiesRequest>(msg_);
-
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillByDefault(Return(kCorrelationId));
- }
-
- MessageSharedPtr msg_;
- MockAppPtr mock_app_;
- ResetGlobalPropertiesRequestPtr command_;
-};
-
-class ResetGlobalPropertiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidApp_UNSUCCESS) {
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
-
- MessageSharedPtr command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
-
- command_->Run();
- EXPECT_EQ(
- (*command_result)[am::strings::msg_params][am::strings::success].asBool(),
- false);
- EXPECT_EQ(
- (*command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(mobile_apis::Result::APPLICATION_NOT_REGISTERED));
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidVrHelp_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::HELPPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][1] =
- mobile_apis::GlobalProperty::TIMEOUTPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][2] =
- mobile_apis::GlobalProperty::VRHELPTITLE;
- (*msg_)[am::strings::msg_params][am::strings::properties][3] =
- mobile_apis::GlobalProperty::MENUNAME;
- (*msg_)[am::strings::msg_params][am::strings::properties][4] =
- mobile_apis::GlobalProperty::MENUICON;
- (*msg_)[am::strings::msg_params][am::strings::properties][5] =
- mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
-
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- smart_objects::SmartObject so_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
-
- std::vector<std::string> time_out_prompt;
- time_out_prompt.push_back("time_out");
- EXPECT_CALL(app_mngr_settings_, time_out_promt())
- .WillOnce(ReturnRef(time_out_prompt));
-
- smart_objects::SmartObject timeout_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- timeout_prompt[am::strings::text] = time_out_prompt[0];
- timeout_prompt[am::strings::type] =
- hmi_apis::Common_SpeechCapabilities::SC_TEXT;
-
- smart_objects::SmartObject so_time_out_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- so_time_out_prompt[0] = timeout_prompt;
-
- EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
-
- EXPECT_CALL(*mock_app_, reset_vr_help_title());
- EXPECT_CALL(*mock_app_, reset_vr_help());
-
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- smart_objects::SmartObjectSPtr vr_help; // = NULL;
- EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
- .WillOnce(Return(vr_help));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
-
- command_->Run();
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::HELPPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][1] =
- mobile_apis::GlobalProperty::TIMEOUTPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][2] =
- mobile_apis::GlobalProperty::VRHELPTITLE;
- (*msg_)[am::strings::msg_params][am::strings::properties][3] =
- mobile_apis::GlobalProperty::MENUNAME;
- (*msg_)[am::strings::msg_params][am::strings::properties][4] =
- mobile_apis::GlobalProperty::MENUICON;
- (*msg_)[am::strings::msg_params][am::strings::properties][5] =
- mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
-
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- smart_objects::SmartObject so_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
-
- std::vector<std::string> time_out_prompt;
- time_out_prompt.push_back("time_out");
- EXPECT_CALL(app_mngr_settings_, time_out_promt())
- .WillOnce(ReturnRef(time_out_prompt));
-
- smart_objects::SmartObject timeout_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- timeout_prompt[am::strings::text] = time_out_prompt[0];
- timeout_prompt[am::strings::type] =
- hmi_apis::Common_SpeechCapabilities::SC_TEXT;
-
- smart_objects::SmartObject so_time_out_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- so_time_out_prompt[0] = timeout_prompt;
-
- EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
-
- EXPECT_CALL(*mock_app_, reset_vr_help_title());
- EXPECT_CALL(*mock_app_, reset_vr_help());
-
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- smart_objects::SmartObjectSPtr vr_help =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
- .WillOnce(Return(vr_help));
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::hmi_request::menu_title] = "";
-
- EXPECT_CALL(*mock_app_,
- set_menu_title(msg_params[am::hmi_request::menu_title]));
-
- const smart_objects::SmartObjectSPtr so_help_prompt =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(so_help_prompt.get()));
- EXPECT_CALL(*mock_app_, timeout_prompt())
- .WillOnce(Return(so_help_prompt.get()));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
- .WillOnce(Return(true));
-
- command_->Run();
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command_->on_event(event);
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest,
- OnEvent_UI_SetGlobalProperties_SUCCESS) {
- Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- const hmi_apis::Common_Result::eType result_code =
- hmi_apis::Common_Result::SUCCESS;
- (*msg_)[am::strings::params][am::hmi_response::code] = result_code;
-
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::VRHELPTITLE;
-
- EXPECT_CALL(*mock_app_, reset_vr_help_title());
- EXPECT_CALL(*mock_app_, reset_vr_help());
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- smart_objects::SmartObjectSPtr vr_help =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
- .WillOnce(Return(vr_help));
-
- command_->Run();
-
- event.set_smart_object(*msg_);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
- am::commands::Command::ORIGIN_SDL));
-
- command_->on_event(event);
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest,
- OnEvent_TTS_SetGlobalProperties_SUCCESS) {
- Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
-
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::TIMEOUTPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][1] =
- mobile_apis::GlobalProperty::MENUICON;
-
- std::vector<std::string> time_out_prompt;
- time_out_prompt.push_back("time_out");
- EXPECT_CALL(app_mngr_settings_, time_out_promt())
- .WillOnce(ReturnRef(time_out_prompt));
-
- EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
-
- smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
- *prompt = "prompt";
-
- EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
-
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- MessageSharedPtr ui_msg = CreateMessage();
- (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
- (*ui_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
-
- Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- ui_event.set_smart_object(*ui_msg);
-
- command_->Run();
- command_->on_event(ui_event);
- event.set_smart_object(*msg_);
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::WARNINGS),
- am::commands::Command::ORIGIN_SDL));
-
- command_->on_event(event);
-}
-
-TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) {
- MessageSharedPtr message(CreateMessage());
- ResetGlobalPropertiesResponsePtr command(
- CreateCommand<ResetGlobalPropertiesResponse>(message));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(message, _));
- command->Run();
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) {
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
-
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::VRHELPTITLE;
-
- EXPECT_CALL(*mock_app_, reset_vr_help_title());
- EXPECT_CALL(*mock_app_, reset_vr_help());
-
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- smart_objects::SmartObjectSPtr vr_help =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
- .WillOnce(Return(vr_help));
-
- EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
-
- ResetGlobalPropertiesRequestPtr command =
- CreateCommand<ResetGlobalPropertiesRequest>(msg_);
- command->Run();
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
- am::commands::Command::ORIGIN_SDL));
-
- Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest,
- Run_WaitTTS_Timeout_GENERIC_ERROR_TTSNotRespond) {
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
-
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::TIMEOUTPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][1] =
- mobile_apis::GlobalProperty::MENUICON;
-
- std::vector<std::string> time_out_prompt;
- time_out_prompt.push_back("time_out");
- EXPECT_CALL(app_mngr_settings_, time_out_promt())
- .WillOnce(ReturnRef(time_out_prompt));
-
- EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
-
- smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
- *prompt = "prompt";
-
- EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
-
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
- .WillOnce(Return(true));
-
- ResetGlobalPropertiesRequestPtr command =
- CreateCommand<ResetGlobalPropertiesRequest>(msg_);
- command->Run();
-
- // Received response only from UI
- MessageSharedPtr ui_msg = CreateMessage();
- (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
- (*ui_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
- (*ui_msg)[am::strings::msg_params] =
- SmartObject(smart_objects::SmartType_Map);
- Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- ui_event.set_smart_object(*ui_msg);
- command->on_event(ui_event);
-
- // TTS doesn't respond, so timeout should send generic error
- smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
- (*response)[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::GENERIC_ERROR;
- EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
- .WillOnce(Return(response));
- const std::string info = "TTS component does not respond";
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
- am::commands::Command::ORIGIN_SDL));
- command->onTimeOut();
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest,
- Run_WaitUI_Timeout_GENERIC_ERROR_UINotRespond) {
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
-
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::TIMEOUTPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][1] =
- mobile_apis::GlobalProperty::MENUICON;
-
- std::vector<std::string> time_out_prompt;
- time_out_prompt.push_back("time_out");
- EXPECT_CALL(app_mngr_settings_, time_out_promt())
- .WillOnce(ReturnRef(time_out_prompt));
-
- EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
-
- smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
- *prompt = "prompt";
-
- EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
-
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
- .WillOnce(Return(true));
-
- command_->Run();
-
- // Received response only from TTS
- MessageSharedPtr tts_msg = CreateMessage();
- (*tts_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
- (*tts_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
-
- Event tts_event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- tts_event.set_smart_object(*tts_msg);
- command_->on_event(tts_event);
-
- // UI doesn't respond, so timeout should send generic error
- smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
- (*response)[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::GENERIC_ERROR;
- EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
- .WillOnce(Return(response));
-
- const std::string info = "UI component does not respond";
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
- am::commands::Command::ORIGIN_SDL));
- command_->onTimeOut();
-}
-
-TEST_F(ResetGlobalPropertiesRequestTest,
- Run_WaitUIAndTTS_Timeout_GENERIC_ERROR_TTSAndUINotRespond) {
- Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
-
- (*msg_)[am::strings::msg_params][am::strings::properties][0] =
- mobile_apis::GlobalProperty::TIMEOUTPROMPT;
- (*msg_)[am::strings::msg_params][am::strings::properties][1] =
- mobile_apis::GlobalProperty::MENUICON;
-
- std::vector<std::string> time_out_prompt;
- time_out_prompt.push_back("time_out");
- EXPECT_CALL(app_mngr_settings_, time_out_promt())
- .WillOnce(ReturnRef(time_out_prompt));
-
- EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
-
- smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
- *prompt = "prompt";
-
- EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
-
- EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SetGlobalProperties)))
- .WillOnce(Return(true));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::TTS_SetGlobalProperties)))
- .WillOnce(Return(true));
-
- command_->Run();
- // TTS and UI don't respond, so timeout should send generic error
- std::string info = "TTS, UI component does not respond";
- smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
- (*response)[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::GENERIC_ERROR;
- EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
- .WillOnce(Return(response));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
- am::commands::Command::ORIGIN_SDL));
- command_->onTimeOut();
-}
-
-} // namespace reset_global_properties
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc
deleted file mode 100644
index 4520e1b120..0000000000
--- a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/scrollable_message_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace scrollable_message_request {
-
-namespace am = application_manager;
-namespace hmi_response = am::hmi_response;
-namespace mobile_result = mobile_apis::Result;
-namespace am = ::application_manager;
-
-using am::commands::ScrollableMessageRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Eq;
-using ::testing::Ref;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-using namespace am::strings;
-using test::components::policy_test::MockPolicyHandlerInterface;
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kTimeOut = 30000u;
-const uint32_t kCorrelationId = 10u;
-const uint32_t kFunctionID = 3u;
-} // namespace
-
-class ScrollableMessageRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- typedef TypeIf<kMocksAreNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
- sync_primitives::Lock lock_;
-
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- void SetUp() OVERRIDE {
- mock_app_ = CreateMockApp();
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
- command_ = CreateCommand<ScrollableMessageRequest>(msg_);
- }
-
- MockPolicyHandlerInterface mock_policy_handler_;
- MockAppPtr mock_app_;
- MessageSharedPtr msg_;
- SharedPtr<ScrollableMessageRequest> command_;
-};
-
-typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities;
-
-TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_ui = CreateFullParamsUISO();
- (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
-
- utils::SharedPtr<ScrollableMessageRequest> command =
- CreateCommand<ScrollableMessageRequest>(msg_ui);
-
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app));
-
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
-
- MockHMICapabilities hmi_capabilities;
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities));
- ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::info] = "info1";
-
- Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
- event.set_smart_object(*msg);
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*ui_command_result)[am::strings::msg_params].keyExists(
- am::strings::info)) {
- EXPECT_FALSE(
- (*ui_command_result)[am::strings::msg_params][am::strings::info]
- .asString()
- .empty());
- }
-}
-
-TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_SUCCESS) {
- (*msg_)[msg_params][timeout] = kTimeOut;
- (*msg_)[msg_params][interaction_mode] =
- mobile_apis::InteractionMode::MANUAL_ONLY;
- EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
- command_->Init();
- EXPECT_EQ(kTimeOut, command_->default_timeout());
-}
-
-TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_UNSUCCESS) {
- (*msg_)[msg_params][interaction_mode] =
- mobile_apis::InteractionMode::MANUAL_ONLY;
- EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
- command_->Init();
- EXPECT_EQ(kTimeOut, command_->default_timeout());
-}
-
-TEST_F(ScrollableMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
- command_->Run();
-}
-
-TEST_F(ScrollableMessageRequestTest,
- Run_SoftButtonProcessingResultWrogParameters_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
- const mobile_apis::Result::eType processing_result =
- mobile_apis::Result::ABORTED;
- smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
- EXPECT_CALL(
- mock_message_helper_,
- ProcessSoftButtons(
- msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
- .WillOnce(Return(processing_result));
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command_)));
- EXPECT_EQ(processing_result,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][result_code].asInt()));
-}
-
-TEST_F(ScrollableMessageRequestTest, Run_SoftButtonProcessingResult_SUCCESS) {
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
- smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
- (*msg_)[am::strings::params][am::strings::function_id] = kFunctionID;
- (*msg_)[am::strings::msg_params][am::strings::soft_buttons][0]
- [am::strings::soft_button_id] = 0;
- EXPECT_CALL(
- mock_message_helper_,
- ProcessSoftButtons(
- msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
- EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
-
- MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
- EXPECT_EQ(hmi_apis::FunctionID::UI_ScrollableMessage,
- static_cast<hmi_apis::FunctionID::eType>(
- (*result_msg)[params][function_id].asInt()));
-}
-
-TEST_F(ScrollableMessageRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
- command_->on_event(event);
-}
-
-TEST_F(ScrollableMessageRequestTest,
- OnEvent_ReceivedUIOnResetTimeoutEvent_SUCCESS) {
- (*msg_)[params][connection_key] = kConnectionKey;
- (*msg_)[params][correlation_id] = kCorrelationId;
- EXPECT_CALL(
- app_mngr_,
- updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout_));
- Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*msg_);
- command_->on_event(event);
-}
-
-TEST_F(ScrollableMessageRequestTest,
- DISABLED_OnEvent_ReceivedUIScrollableMessage_SUCCESS) {
- (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
- Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
- event.set_smart_object(*msg_);
- command_->on_event(event);
-}
-
-TEST_F(ScrollableMessageRequestTest,
- DISABLED_OnEvent_UnsupportedRCAndUICoop_SUCCESS) {
- (*msg_)[params][hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
- Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
- event.set_smart_object(*msg_);
- command_->on_event(event);
-}
-
-} // namespace scrollable_message_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc
deleted file mode 100644
index 2a3b5d922a..0000000000
--- a/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Xevo Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-
-#include "mobile/send_haptic_data_request.h"
-#include "mobile/send_haptic_data_response.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace send_haptic_data {
-
-using ::testing::_;
-using ::testing::Return;
-
-namespace am = ::application_manager;
-
-using am::commands::SendHapticDataRequest;
-using am::commands::SendHapticDataResponse;
-using am::commands::MessageSharedPtr;
-
-typedef SharedPtr<SendHapticDataRequest> SendHapticDataRequestPtr;
-typedef SharedPtr<SendHapticDataResponse> SendHapticDataResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-}
-
-class SendHapticDataRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- SendHapticDataRequestTest()
- : msg_(CreateMessage(::smart_objects::SmartType_Map))
- , mock_app_(CreateMockApp()) {}
-
- void SetUp() OVERRIDE {
- (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- }
-
- MessageSharedPtr msg_;
- MockAppPtr mock_app_;
-};
-
-class SendHapticDataResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- SendHapticDataResponseTest() : message_(CreateMessage()) {}
-
- void SetUp() OVERRIDE {
- command_sptr_ = CreateCommand<SendHapticDataResponse>(message_);
- }
-
- MessageSharedPtr message_;
- SharedPtr<SendHapticDataResponse> command_sptr_;
-};
-
-TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(
- HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData)))
- .WillOnce(Return(true));
-
- SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
-
- command->Init();
- command->Run();
-}
-
-TEST_F(SendHapticDataRequestTest, Run_DISALLOWED) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(false));
-
- EXPECT_CALL(*mock_app_, mobile_projection_enabled()).WillOnce(Return(false));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).WillOnce(Return(true));
-
- SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
-
- command->Init();
- command->Run();
-}
-
-TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) {
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
- am::commands::Command::ORIGIN_SDL));
-
- (*msg_)[am::strings::msg_params] = 0;
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
- Event event(hmi_apis::FunctionID::UI_SendHapticData);
- event.set_smart_object(*msg_);
- SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
-
- command->Init();
- command->on_event(event);
-}
-
-TEST_F(SendHapticDataResponseTest, Run_Success) {
- ::smart_objects::SmartObject& message_ref = *message_;
- message_ref[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::SUCCESS;
-
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
- command_sptr_->Init();
- command_sptr_->Run();
-}
-
-} // namespace send_haptic_data
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc
deleted file mode 100644
index c5786675d6..0000000000
--- a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/send_location_request.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "utils/shared_ptr.h"
-#include "commands/command_request_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace send_location_request {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::SendLocationRequest;
-using application_manager::MockMessageHelper;
-using test::components::application_manager_test::MockHMICapabilities;
-using smart_objects::SmartObject;
-using utils::SharedPtr;
-using testing::_;
-using testing::Return;
-using testing::ReturnRef;
-
-namespace strings = application_manager::strings;
-namespace hmi_response = application_manager::hmi_response;
-namespace Common_TextFieldName = hmi_apis::Common_TextFieldName;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const uint32_t kFunctionID = 2u;
-const uint32_t kAppID = 3u;
-const double kLongitudeDegrees = 13.4;
-const std::string kLocationDescription = "Location_Description";
-const std::string kNewLine = "\\n";
-const std::string kAddressLine = "Address_Line";
-const std::string kPhoneNumber = "Phone_number";
-const std::string kCorrectAddress = "Correct address";
-const std::string kEmptyAddress = "";
-const std::string kAddressWithWrongSyntax = "Wrong Syntax\\n";
-} // namespace
-
-class SendLocationRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- class UnwrappedSendLocationRequest : public SendLocationRequest {
- public:
- UnwrappedSendLocationRequest(
- const MessageSharedPtr& message,
- application_manager::ApplicationManager& application_manager)
- : SendLocationRequest(message, application_manager) {}
-
- ::application_manager::CommandParametersPermissions&
- get_parameters_permissions() {
- return parameters_permissions_;
- }
- };
-
- typedef SharedPtr<UnwrappedSendLocationRequest> CommandSPrt;
-
- SendLocationRequestTest() {
- mock_app_ = CreateMockApp();
- disp_cap_ = utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
- message_ = CreateMessage();
- command_ = CreateCommand<UnwrappedSendLocationRequest>(message_);
- }
-
- void InitialSetup(MessageSharedPtr message_) {
- (*message_)[strings::params][strings::connection_key] = kConnectionKey;
- (*message_)[strings::params][strings::function_id] = kFunctionID;
- (*message_)[strings::msg_params] =
- SmartObject(smart_objects::SmartType_Map);
- (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- AllowMandatoryFields();
- }
-
- void HMICapabilitiesSetupHelper() {
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
- .WillOnce(Return(true));
- }
-
- void HMICapabilitiesSetupWithArguments(
- Common_TextFieldName::eType field_name) {
- HMICapabilitiesSetupHelper();
- (*disp_cap_)[hmi_response::text_fields] =
- SmartObject(smart_objects::SmartType_Array);
- (*disp_cap_)[hmi_response::text_fields][0] =
- SmartObject(smart_objects::SmartType_Map);
- (*disp_cap_)[hmi_response::text_fields][0][strings::name] = field_name;
- EXPECT_CALL(mock_hmi_capabilities_, display_capabilities())
- .Times(2)
- .WillRepeatedly(Return(disp_cap_.get()));
- }
-
- void FinishSetup() {
- EXPECT_CALL(*mock_app_, hmi_app_id()).WillOnce(Return(kAppID));
- EXPECT_CALL(app_mngr_,
- 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(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(result), _));
- }
-
- void AllowMandatoryFields() {
- application_manager::CommandParametersPermissions& permissions =
- command_->get_parameters_permissions();
- permissions.allowed_params.insert(strings::longitude_degrees);
- permissions.allowed_params.insert(strings::latitude_degrees);
- }
-
- MockAppPtr mock_app_;
- MockHMICapabilities mock_hmi_capabilities_;
- SharedPtr<SmartObject> disp_cap_;
- MessageSharedPtr message_;
- CommandSPrt command_;
-};
-
-TEST_F(SendLocationRequestTest, Run_InvalidApp_Success) {
- (*message_)[strings::params][strings::connection_key] = kConnectionKey;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
- FinishSetupCancelled(mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_DeliveryMode_Success) {
- InitialSetup(message_);
- SmartObject msg_params = (*message_)[strings::msg_params];
- msg_params[strings::delivery_mode] = SmartObject();
- (*message_)[strings::msg_params] = msg_params;
- msg_params.erase(strings::delivery_mode);
- FinishSetup();
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationNameIsAllowed_Success) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
- FinishSetup();
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationNameIsNotAllowed_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
- FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationNameWrongSyntax_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_name] = "Location_Name\\n";
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
- FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsAllowed_Success) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_description] =
- kLocationDescription;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
- FinishSetup();
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsNotAllowed_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_description] =
- kLocationDescription;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
- FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationDescriptionWrongSyntax_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_description] =
- kLocationDescription + kNewLine;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
- FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_AddressLinesAreAllowed_Success) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::address_lines] =
- SmartObject(smart_objects::SmartType_Array);
- (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
- FinishSetup();
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_AddressLinesAreNotAllowed_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::address_lines] =
- SmartObject(smart_objects::SmartType_Array);
- (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
- FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_AddressLinesWrongSyntax_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::address_lines] =
- SmartObject(smart_objects::SmartType_Array);
- (*message_)[strings::msg_params][strings::address_lines][0] =
- kAddressLine + kNewLine;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
- FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_PhoneNumberIsAllowed_Success) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
- FinishSetup();
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_PhoneNumberIsNotAllowed_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
- FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_PhoneNumberWrongSyntax_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::phone_number] =
- kPhoneNumber + kNewLine;
- HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
- FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_AddressesContainWrongSyntax_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::address] =
- SmartObject(smart_objects::SmartType_Array);
- (*message_)[strings::msg_params][strings::address]["Address 1"] =
- kCorrectAddress;
- (*message_)[strings::msg_params][strings::address]["Address 2"] =
- kAddressWithWrongSyntax;
- FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationImageValid_Success) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_image] =
- SmartObject(smart_objects::SmartType_Map);
- (*message_)[strings::msg_params][strings::location_image][strings::value] =
- "1";
- EXPECT_CALL(
- mock_message_helper_,
- VerifyImage(
- (*message_)[strings::msg_params][strings::location_image], _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- FinishSetup();
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_LocationImageInvalid_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::location_image] =
- SmartObject(smart_objects::SmartType_Map);
- (*message_)[strings::msg_params][strings::location_image][strings::value] =
- "1";
- EXPECT_CALL(
- mock_message_helper_,
- VerifyImage(
- (*message_)[strings::msg_params][strings::location_image], _, _))
- .WillOnce(Return(mobile_apis::Result::ABORTED));
- FinishSetupCancelled(mobile_apis::Result::ABORTED);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, Run_HMIUINotCoop_Cancelled) {
- InitialSetup(message_);
- (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
- (*disp_cap_)[hmi_response::text_fields] =
- SmartObject(smart_objects::SmartType_Array);
- (*disp_cap_)[hmi_response::text_fields][0] =
- SmartObject(smart_objects::SmartType_Map);
- (*disp_cap_)[hmi_response::text_fields][0][strings::name] =
- Common_TextFieldName::phoneNumber;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
- .WillOnce(Return(false));
- FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
- command_->Run();
-}
-
-TEST_F(SendLocationRequestTest, OnEvent_Success) {
- mobile_apis::Result::eType response_code = mobile_apis::Result::SUCCESS;
- (*message_)[strings::params][hmi_response::code] = response_code;
- (*message_)[strings::params][strings::connection_key] = kConnectionKey;
-
- Event event(hmi_apis::FunctionID::Navigation_SendLocation);
- event.set_smart_object(*message_);
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(app));
-
- command_->on_event(event);
-}
-
-TEST_F(SendLocationRequestTest, OnEvent_Cancelled) {
- (*message_)[strings::params][hmi_response::code] =
- mobile_apis::Result::SUCCESS;
- Event event(hmi_apis::FunctionID::Navigation_OnWayPointChange);
- event.set_smart_object(*message_);
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
- .Times(0);
- command_->on_event(event);
-}
-
-TEST_F(SendLocationRequestTest, Run_MandatoryParamsDisallowed_InvalidData) {
- (*message_)[strings::params][strings::connection_key] = kConnectionKey;
- (*message_)[strings::params][strings::function_id] = kFunctionID;
- (*message_)[strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
- (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
- (*message_)[strings::msg_params][strings::longitude_degrees] =
- kLongitudeDegrees;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- application_manager::CommandParametersPermissions& permissions =
- command_->get_parameters_permissions();
- // 1st one allowed
- permissions.allowed_params.insert(strings::longitude_degrees);
- // 2nd one disallowed
- permissions.disallowed_params.insert(strings::latitude_degrees);
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- command_->Run();
-}
-
-} // namespace send_location_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc
deleted file mode 100644
index b278479df8..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/set_app_icon_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_app_icon_request {
-
-namespace am = application_manager;
-using am::commands::SetAppIconRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class SetAppIconRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-};
-
-TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
- const std::string file_path = "file_path";
- MessageSharedPtr msg_vr = CreateFullParamsUISO();
- (*msg_vr)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_vr)[am::strings::msg_params][am::strings::sync_file_name]
- [am::strings::value] = file_path;
-
- const std::string dir_path = "./";
- ON_CALL(app_mngr_settings_, app_icons_folder())
- .WillByDefault(ReturnRef(dir_path));
-
- utils::SharedPtr<SetAppIconRequest> req_vr =
- CreateCommand<SetAppIconRequest>(msg_vr);
-
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app));
-
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(*mock_app, set_app_icon_path(_)).WillByDefault(Return(true));
- ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(file_path));
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::info] = "info1";
-
- Event event(hmi_apis::FunctionID::UI_SetAppIcon);
- event.set_smart_object(*msg);
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- req_vr->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*ui_command_result)[am::strings::msg_params].keyExists(
- am::strings::info)) {
- EXPECT_FALSE(
- (*ui_command_result)[am::strings::msg_params][am::strings::info]
- .asString()
- .empty());
- }
-}
-
-} // namespace set_app_icon_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc
deleted file mode 100644
index 8444b88d63..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/set_display_layout_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_display_layout_request {
-
-namespace am = application_manager;
-namespace mobile_result = mobile_apis::Result;
-using am::commands::SetDisplayLayoutRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-typedef ::utils::SharedPtr<SetDisplayLayoutRequest> CommandPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationKey = 2u;
-} // namespace
-
-MATCHER_P(CheckMshCorrId, corr_id, "") {
- return (*arg)[am::strings::params][am::strings::correlation_id].asUInt() ==
- corr_id;
-}
-
-class SetDisplayLayoutRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- SetDisplayLayoutRequestTest() : mock_app_(CreateMockApp()) {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- }
-
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
- typedef TypeIf<kMocksAreNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- false);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- sync_primitives::Lock lock_;
- MockAppPtr mock_app_;
-};
-
-typedef SetDisplayLayoutRequestTest::MockHMICapabilities MockHMICapabilities;
-
-TEST_F(SetDisplayLayoutRequestTest,
- OnEvent_UIHmiUnsupportedResource_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_ui = CreateFullParamsUISO();
- (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
-
- utils::SharedPtr<SetDisplayLayoutRequest> command =
- CreateCommand<SetDisplayLayoutRequest>(msg_ui);
-
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app));
-
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
- (*msg)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
-
- Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
- event.set_smart_object(*msg);
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- ResultCommandExpectations(ui_command_result, "UI is not supported by system");
-}
-
-TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) {
- MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
-
- MockAppPtr invalid_mock_app;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(invalid_mock_app));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- command->Run();
-}
-
-TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
- MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(kCorrelationKey));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetDisplayLayout))
- .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(CheckMshCorrId(kCorrelationKey)))
- .WillOnce(Return(true));
-
- command->Run();
-}
-
-TEST_F(SetDisplayLayoutRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
- CommandPtr command(CreateCommand<SetDisplayLayoutRequest>());
- am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
- SmartObject msg(smart_objects::SmartType_Map);
-
- event.set_smart_object(msg);
-
- EXPECT_CALL(app_mngr_, hmi_capabilities()).Times(0);
- command->on_event(event);
-}
-
-TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
- am::event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
- MessageSharedPtr msg = CreateMessage();
-
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*msg)[am::strings::msg_params][am::hmi_response::display_capabilities] = 0;
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- event.set_smart_object(*msg);
-
- MockHMICapabilities hmi_capabilities;
- MessageSharedPtr dispaly_capabilities_msg = CreateMessage();
- (*dispaly_capabilities_msg)[am::hmi_response::templates_available] =
- "templates_available";
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(hmi_capabilities));
-
- EXPECT_CALL(hmi_capabilities, display_capabilities())
- .WillOnce(Return(dispaly_capabilities_msg.get()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
- command->on_event(event);
-}
-
-} // namespace set_display_layout_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc
deleted file mode 100644
index 641e5636a9..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc
+++ /dev/null
@@ -1,1229 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/set_global_properties_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_global_properties_request {
-
-namespace am = application_manager;
-using am::commands::SetGlobalPropertiesRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using am::CommandsMap;
-using utils::custom_string::CustomString;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-namespace {
-const int32_t kCommandId = 1;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 1u;
-const std::string kText = "one";
-const uint32_t kPosition = 1u;
-} // namespace
-
-class SetGlobalPropertiesRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- SetGlobalPropertiesRequestTest() : mock_app_(CreateMockApp()) {}
-
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- msg_params[am::strings::vr_help_title] = "vr_help_title";
- msg_params[am::strings::vr_help][0][am::strings::text] = "vr_help";
- msg_params[am::strings::vr_help][0][am::strings::position] = 1u;
- msg_params[am::strings::help_prompt][0][am::strings::text] = "help_promt";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- MessageSharedPtr CreateMsgParams() {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- return msg;
- }
-
- void VRArraySetupHelper(MessageSharedPtr msg,
- SmartObject& vr_help_title,
- SmartObject& vr_help_array) {
- (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
- vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
- vr_help_array[0][am::strings::text] = kText;
- vr_help_array[0][am::strings::position] = kPosition;
- (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- }
-
- void OnEventUISetupHelper(MessageSharedPtr msg,
- SharedPtr<SetGlobalPropertiesRequest> command) {
- SmartObject vr_help_title("yes");
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- VRArraySetupHelper(msg, vr_help_title, vr_help_array);
- EXPECT_CALL(mock_message_helper_,
- VerifyImageVrHelpItems(vr_help_array, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(app_mngr_,
- RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
- EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
- EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
- EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- command->Run();
- }
-
- void OnEventTTSSetupHelper(MessageSharedPtr msg,
- SharedPtr<SetGlobalPropertiesRequest> command) {
- SmartObject help_prompt(smart_objects::SmartType_Array);
- help_prompt[0][am::strings::text] = "Help_Prompt_One";
- (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
- SmartObject timeout_prompt(smart_objects::SmartType_Array);
- timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
- (*msg)[am::strings::msg_params][am::strings::timeout_prompt] =
- timeout_prompt;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_,
- RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
- EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
- EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
- EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
- EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- command->Run();
- }
-
- void EmptyExpectationsSetupHelper() {
- EXPECT_CALL(*mock_app_, set_vr_help_title(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_vr_help(_)).Times(0);
- EXPECT_CALL(*mock_app_, vr_help_title()).Times(0);
- EXPECT_CALL(*mock_app_, vr_help()).Times(0);
- EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
- }
-
- void ExpectInvalidData() {
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
- am::commands::Command::ORIGIN_SDL));
- }
-
- void ExpectVerifyImageVrHelpSuccess(SmartObject& smart_obj) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(smart_obj, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
- }
-
- void ExpectVerifyImageVrHelpUnsuccess() {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
- }
-
- void ExpectVerifyImageSuccess(SmartObject& smart_obj) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(smart_obj, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
- }
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- }
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- void ExpectationsHmiInterface_Run() {
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- }
- sync_primitives::Lock lock_;
- MockAppPtr mock_app_;
-};
-
-TEST_F(SetGlobalPropertiesRequestTest,
- OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_vr = CreateFullParamsUISO();
- (*msg_vr)[am::strings::msg_params][am::strings::vr_commands][0] =
- "vr_command";
-
- utils::SharedPtr<SetGlobalPropertiesRequest> command =
- CreateCommand<SetGlobalPropertiesRequest>(msg_vr);
-
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- const smart_objects::SmartObject* vr_help_title =
- &((*msg_vr)[am::strings::msg_params][am::strings::vr_help_title]);
- const smart_objects::SmartObject* vr_help =
- &((*msg_vr)[am::strings::msg_params][am::strings::vr_help]);
- const smart_objects::SmartObject* vr_help_prompt =
- &((*msg_vr)[am::strings::msg_params][am::strings::help_prompt]);
- ON_CALL(*mock_app_, vr_help_title()).WillByDefault(Return(vr_help_title));
- ON_CALL(*mock_app_, vr_help()).WillByDefault(Return(vr_help));
- ON_CALL(*mock_app_, help_prompt()).WillByDefault(Return(vr_help_prompt));
-
- ExpectationsHmiInterface_Run();
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
- (*msg)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
-
- Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*msg);
-
- ON_CALL(mock_message_helper_,
- VerifyImageVrHelpItems(
- (*msg_vr)[am::strings::msg_params][am::strings::vr_help], _, _))
- .WillByDefault(Return(mobile_apis::Result::SUCCESS));
-
- ON_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillByDefault(Return(mobile_apis::Result::SUCCESS));
-
- (*msg_vr)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- Event event_vr(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- event_vr.set_smart_object(*msg_vr);
-
- command->Run();
- command->on_event(event_vr);
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- ResultCommandExpectations(ui_command_result, "UI is not supported by system");
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) {
- MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
- (*response)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*response)[am::strings::msg_params][am::strings::info] = "test";
-
- am::event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- event.set_smart_object(*response);
-
- utils::SharedPtr<SetGlobalPropertiesRequest> command =
- CreateCommand<SetGlobalPropertiesRequest>(response);
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .Times(0);
- command->on_event(event);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest,
- OnEvent_UNSUPPORTED_RESOURCE_Expect_false) {
- MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
- (*response)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*response)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*response)[am::strings::msg_params][am::strings::info] = "qwe";
-
- am::event_engine::Event event_tts(
- hmi_apis::FunctionID::TTS_SetGlobalProperties);
- event_tts.set_smart_object(*response);
- am::event_engine::Event event_ui(
- hmi_apis::FunctionID::UI_SetGlobalProperties);
- event_tts.set_smart_object(*response);
- utils::SharedPtr<SetGlobalPropertiesRequest> command =
- CreateCommand<SetGlobalPropertiesRequest>(response);
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- MessageSharedPtr response_to_mobile;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->Run();
- command->on_event(event_ui);
- command->on_event(event_tts);
-
- EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
- .asBool(),
- false);
- EXPECT_EQ(
- (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(mobile_apis::Result::INVALID_DATA));
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- OnEventUISetupHelper(msg, command);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help_title("yes");
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- VRArraySetupHelper(msg, vr_help_title, vr_help_array);
- (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
- SmartObject menu_title("Menu_Title");
- (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
- SmartObject menu_icon(smart_objects::SmartType_Map);
- menu_icon[am::strings::value] = "1";
- (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
- SmartObject keyboard_properties(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
- keyboard_properties;
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
- EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
- EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
- EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
- EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
- EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
-
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help_title("yes");
- (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
- SmartObject menu_icon(smart_objects::SmartType_Map);
- menu_icon[am::strings::value] = "1";
- (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
- .WillOnce((Return(mobile_apis::Result::ABORTED)));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenVRHelp_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help_title("yes");
- SmartObject menu_icon(smart_objects::SmartType_Map);
- menu_icon[am::strings::value] = "1";
- (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- VRArraySetupHelper(msg, vr_help_title, vr_help_array);
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
- .WillOnce((Return(mobile_apis::Result::ABORTED)));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRIncorrectSyntax_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- SmartObject vr_help_title("wrong syntax string\\n");
- SmartObject menu_icon(smart_objects::SmartType_Map);
- menu_icon[am::strings::value] = "1";
- (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- VRArraySetupHelper(msg, vr_help_title, vr_help_array);
-
- EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingTitle_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
- vr_help_array[0][am::strings::text] = kText;
- vr_help_array[0][am::strings::position] = kPosition;
- (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingArray_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help_title("yes");
- (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRWrongOrder_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help_title("yes");
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- VRArraySetupHelper(msg, vr_help_title, vr_help_array);
- vr_help_array[1] = SmartObject(smart_objects::SmartType_Map);
- vr_help_array[1][am::strings::text] = "two";
- vr_help_array[1][am::strings::position] = 3u;
- (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
-
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
- .WillOnce((Return(mobile_apis::Result::SUCCESS)));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject keyboard_properties(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
- keyboard_properties;
- SmartObject menu_title("Menu_Title");
- (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("Menu_Title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
- EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
- EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_VRCouldNotGenerate_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject keyboard_properties(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
- keyboard_properties;
- SmartObject menu_title("Menu_Title");
- (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject* vr_help_title = NULL;
- CommandsMap commands_map;
- SmartObject empty_msg(smart_objects::SmartType_Map);
- commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &empty_msg));
- DataAccessor<CommandsMap> accessor(commands_map, lock_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(vr_help_title));
- EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
- am::commands::Command::ORIGIN_SDL));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject keyboard_properties(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
- keyboard_properties;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title(smart_objects::SmartType_Null);
- EXPECT_CALL(*mock_app_, vr_help_title())
- .WillOnce(Return(&vr_help_title))
- .WillOnce(Return(&vr_help_title));
-
- CommandsMap commands_map;
- DataAccessor<CommandsMap> accessor(commands_map, lock_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
- const CustomString name("name");
- EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
- EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
- EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_keyboard_props(_));
- EXPECT_CALL(*mock_app_, app_id());
-
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject keyboard_properties(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
- keyboard_properties;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title(smart_objects::SmartType_Null);
- EXPECT_CALL(*mock_app_, vr_help_title())
- .Times(2)
- .WillRepeatedly(Return(&vr_help_title));
-
- CommandsMap commands_map;
- SmartObject command_text(smart_objects::SmartType_Map);
- commands_map[0] = &command_text;
- (*commands_map[0])[am::strings::vr_commands] = SmartObject("one");
- DataAccessor<CommandsMap> accessor(commands_map, lock_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
- EXPECT_CALL(*mock_app_, set_vr_help(_));
- const CustomString name("name");
- EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
- EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
- EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataFromSynonyms_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject keyboard_properties(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
- keyboard_properties;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title(smart_objects::SmartType_Null);
- EXPECT_CALL(*mock_app_, vr_help_title())
- .Times(2)
- .WillRepeatedly(Return(&vr_help_title));
-
- CommandsMap commands_map;
- DataAccessor<CommandsMap> accessor(commands_map, lock_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
- vr_help_array[0][am::strings::text] = kText;
- vr_help_array[0][am::strings::position] = kPosition;
- SmartObject vr_synonyms(smart_objects::SmartType_Array);
- vr_synonyms[0] = vr_help_array;
- const CustomString name("name");
- EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
- EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
- EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject help_prompt(smart_objects::SmartType_Array);
- help_prompt[0][am::strings::text] = "Help_Prompt_One";
- (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
- SmartObject timeout_prompt(smart_objects::SmartType_Array);
- timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
- (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
- EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
- EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
- EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
- EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject help_prompt(smart_objects::SmartType_Array);
- help_prompt[0][am::strings::text] = "Help_Prompt_One";
- (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
- EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
- EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
- EXPECT_CALL(*mock_app_, set_timeout_prompt(_)).Times(0);
- EXPECT_CALL(*mock_app_, timeout_prompt()).Times(0);
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject timeout_prompt(smart_objects::SmartType_Array);
- timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
- (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
- EXPECT_CALL(*mock_app_, set_help_prompt(_)).Times(0);
- EXPECT_CALL(*mock_app_, help_prompt()).Times(0);
- EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
- EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
- EXPECT_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_TTSIncorrectSyntax_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject timeout_prompt(smart_objects::SmartType_Array);
- timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One\\n";
- (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidHelpPromptText_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject help_prompt(smart_objects::SmartType_Array);
- help_prompt[0][am::strings::text] =
- "invalid help prompt text with empty line in the end\\n";
- (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
-
- ExpectVerifyImageVrHelpUnsuccess();
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- ExpectInvalidData();
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidVrHelpText_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help(smart_objects::SmartType_Array);
- vr_help[0][am::strings::text] =
- "invalid vr_help text with empty line in the end\\n";
- (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
-
- ExpectVerifyImageVrHelpSuccess(vr_help);
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- ExpectInvalidData();
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidImageValue_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject vr_help(smart_objects::SmartType_Array);
- vr_help[0][am::strings::text] = "vr_help";
- vr_help[0][am::strings::image][am::strings::value] =
- "invalid value text with empty line in the end\\n";
- (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
-
- ExpectVerifyImageVrHelpSuccess(vr_help);
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- ExpectInvalidData();
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuIcon_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject menu_icon(smart_objects::SmartType_Array);
- menu_icon[am::strings::value] =
- "invalid menu icon text with empty line in the end\\n";
- (*msg)[am::strings::msg_params][am::strings::menu_icon] = menu_icon;
-
- ExpectVerifyImageSuccess(menu_icon);
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- ExpectInvalidData();
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuTitle_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject menu_title(smart_objects::SmartType_Array);
- menu_title = "invalid menu title text with empty line in the end\\n";
- (*msg)[am::strings::msg_params][am::strings::menu_title] = menu_title;
-
- ExpectVerifyImageVrHelpUnsuccess();
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- ExpectInvalidData();
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest,
- Run_InvalidLimitedCharacterList_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject limited_character_list(smart_objects::SmartType_Array);
- limited_character_list[0] =
- "invalid limited character list text with empty line in the end\\n";
- (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
- [am::strings::limited_character_list] = limited_character_list;
-
- ExpectVerifyImageVrHelpUnsuccess();
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- ExpectInvalidData();
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest,
- Run_InvalidAutoCompleteText_INVALID_DATA) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject auto_complete_text(smart_objects::SmartType_Array);
- auto_complete_text =
- "invalid auto completetext with empty line in the end\\n";
- (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
- [am::strings::auto_complete_text] = auto_complete_text;
-
- ExpectVerifyImageVrHelpUnsuccess();
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- ExpectInvalidData();
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_NoData_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- ExpectVerifyImageVrHelpUnsuccess();
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidApp_Canceled) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
-
- ExpectVerifyImageVrHelpUnsuccess();
-
- EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- command->Run();
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- hmi_apis::Common_Result::eType response_code =
- hmi_apis::Common_Result::SUCCESS;
- (*msg)[am::strings::params][am::hmi_response::code] = response_code;
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*msg);
-
- command->on_event(event);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- hmi_apis::Common_Result::eType response_code =
- hmi_apis::Common_Result::SUCCESS;
- (*msg)[am::strings::params][am::hmi_response::code] = response_code;
-
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
- OnEventUISetupHelper(msg, command);
-
- Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*msg);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
- .WillOnce(Return(true));
-
- command->on_event(event);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- hmi_apis::Common_Result::eType response_code =
- hmi_apis::Common_Result::WARNINGS;
- (*msg)[am::strings::params][am::hmi_response::code] = response_code;
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- OnEventUISetupHelper(msg, command);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*msg);
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
- .WillOnce(Return(true));
-
- command->on_event(event);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- hmi_apis::Common_Result::eType response_code =
- hmi_apis::Common_Result::WARNINGS;
- (*msg)[am::strings::params][am::hmi_response::code] = response_code;
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- OnEventUISetupHelper(msg, command);
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(MockAppPtr()));
-
- EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
-
- Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*msg);
-
- command->on_event(event);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).Times(0);
- EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
-
- Event event(hmi_apis::FunctionID::TTS_Stopped);
- event.set_smart_object(*msg);
-
- command->on_event(event);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest,
- OnEvent_TTSAndSuccessResultCode_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- hmi_apis::Common_Result::eType response_code =
- hmi_apis::Common_Result::SUCCESS;
- (*msg)[am::strings::params][am::hmi_response::code] = response_code;
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- OnEventTTSSetupHelper(msg, command);
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
- .WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- event.set_smart_object(*msg);
-
- command->on_event(event);
-}
-
-TEST_F(SetGlobalPropertiesRequestTest,
- OnEvent_TTSAndWarningsResultCode_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- const hmi_apis::Common_Result::eType response_code =
- hmi_apis::Common_Result::WARNINGS;
- (*msg)[am::strings::params][am::hmi_response::code] = response_code;
- ON_CALL(
- mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
- CreateCommand<SetGlobalPropertiesRequest>(msg));
-
- OnEventTTSSetupHelper(msg, command);
-
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- event.set_smart_object(*msg);
-
- command->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::WARNINGS));
-}
-
-} // namespace set_global_properties_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc
deleted file mode 100644
index cf668c8b36..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_media_clock_timer_request {
-
-namespace am = ::application_manager;
-using am::commands::SetMediaClockRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using am::MockMessageHelper;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-namespace UpdateMode = mobile_apis::UpdateMode;
-
-typedef SharedPtr<SetMediaClockRequest> SetMediaClockRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 2u;
-const uint32_t kAppID = 2u;
-const uint32_t kHours = 2u;
-const uint32_t kMinutes = 26u;
-const uint32_t kSeconds = 1u;
-} // namespace
-
-class SetMediaClockRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- SetMediaClockRequestTest() : mock_app_(CreateMockApp()) {}
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- }
-
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
- }
-
- MessageSharedPtr CreateMsgParams() {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- return msg;
- }
-
- void ExpectationsSetupHelper(bool is_media) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(is_media));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- }
-
- MockAppPtr mock_app_;
-};
-
-TEST_F(SetMediaClockRequestTest,
- OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
-
- utils::SharedPtr<SetMediaClockRequest> command =
- CreateCommand<SetMediaClockRequest>(msg);
-
- MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
- (*ev_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
- (*ev_msg)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
-
- Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
- event.set_smart_object(*ev_msg);
-
- EXPECT_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- ResultCommandExpectations(ui_command_result, "UI is not supported by system");
-}
-
-TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[am::strings::msg_params][am::strings::update_mode] =
- UpdateMode::COUNTUP;
- (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::start_time]
- [am::strings::minutes] = kMinutes;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
- kMinutes;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
- kSeconds;
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[am::strings::msg_params][am::strings::update_mode] =
- UpdateMode::COUNTDOWN;
- (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::start_time]
- [am::strings::minutes] = kMinutes;
- (*msg)[am::strings::msg_params][am::strings::start_time]
- [am::strings::seconds] = kSeconds;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
- kMinutes;
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
- .WillOnce(Return(kCorrelationId));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(mock_hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, Run_UpdateCountUpWrongTime_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[am::strings::msg_params][am::strings::update_mode] =
- UpdateMode::COUNTUP;
- (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::start_time]
- [am::strings::minutes] = kMinutes;
- (*msg)[am::strings::msg_params][am::strings::start_time]
- [am::strings::seconds] = kSeconds;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
- kMinutes;
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- ExpectationsSetupHelper(true);
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, Run_UpdateCountDownWrongTime_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[am::strings::msg_params][am::strings::update_mode] =
- UpdateMode::COUNTDOWN;
- (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::start_time]
- [am::strings::minutes] = kMinutes;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
- kHours;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
- kMinutes;
- (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
- kSeconds;
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[am::strings::msg_params][am::strings::update_mode] =
- UpdateMode::COUNTDOWN;
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- ExpectationsSetupHelper(true);
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- ExpectationsSetupHelper(true);
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- ExpectationsSetupHelper(false);
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, Run_InvalidApp_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
- EXPECT_CALL(*mock_app_, is_media_application()).Times(0);
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
-
- command->Run();
-}
-
-TEST_F(SetMediaClockRequestTest, OnEvent_Success) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Null);
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
-
- Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
- event.set_smart_object(*msg);
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
- command->on_event(event);
-}
-
-TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<SetMediaClockRequest> command(
- CreateCommand<SetMediaClockRequest>(msg));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- Event event(hmi_apis::FunctionID::UI_Slider);
- event.set_smart_object(*msg);
-
- command->on_event(event);
-}
-
-} // namespace set_media_clock_timer_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc
deleted file mode 100644
index 4752bac0fd..0000000000
--- a/src/components/application_manager/test/commands/mobile/show_test.cc
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/show_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace show_request {
-
-namespace am = application_manager;
-using am::commands::ShowRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-namespace {
-const int32_t kCommandId = 1;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kFunctionID = 3u;
-} // namespace
-
-class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- ShowRequestTest() {
- mock_app_ = CreateMockApp();
- }
- sync_primitives::Lock lock_;
-
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- MessageSharedPtr CreateMsgParams() {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
- return msg;
- }
-
- void TestSetupHelper(MessageSharedPtr msg,
- hmi_apis::Common_TextFieldName::eType field_name,
- const char* field) {
- SmartObject msg_params(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
- msg_params[field] = text_field_;
- (*msg)[am::strings::msg_params] = msg_params;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- msg_params.erase(field);
- msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_name] =
- static_cast<int32_t>(field_name);
- msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] =
- text_field_;
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
- }
-
- void TestSetupHelperWrongSyntax(
- MessageSharedPtr msg,
- hmi_apis::Common_TextFieldName::eType field_name,
- const char* field) {
- SmartObject msg_params(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- msg_params[field] = text_field_;
- (*msg)[am::strings::msg_params] = msg_params;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
- }
-
- void TestSetupHelperWithMetadata(
- MessageSharedPtr msg,
- hmi_apis::Common_TextFieldName::eType field_name,
- const char* field,
- size_t num_tags,
- int32_t* field_tags,
- bool set_field_text = true) {
- SmartObject msg_params(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
- if (set_field_text) {
- msg_params[field] = text_field_;
- }
- msg_params[am::strings::metadata_tags][field] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- for (size_t i = 0; i < num_tags; ++i) {
- const int32_t current_tag = field_tags[i];
- msg_params[am::strings::metadata_tags][field][i] = current_tag;
- }
- (*msg)[am::strings::msg_params] = msg_params;
-
- EXPECT_EQ((*msg)[am::strings::msg_params], msg_params);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params.erase(field);
- msg_params.erase(am::strings::metadata_tags);
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- if (set_field_text) {
- msg_params[am::hmi_request::show_strings][0]
- [am::hmi_request::field_name] =
- static_cast<int32_t>(field_name);
- msg_params[am::hmi_request::show_strings][0]
- [am::hmi_request::field_text] = text_field_;
- msg_params[am::hmi_request::show_strings][0]
- [am::hmi_request::field_types] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- for (size_t i = 0; i < num_tags; ++i) {
- const int32_t current_tag = field_tags[i];
- msg_params[am::hmi_request::show_strings][0]
- [am::hmi_request::field_types][i] = current_tag;
- }
- }
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
- }
-
- MockAppPtr mock_app_;
- std::string text_field_;
-};
-
-TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_vr = CreateFullParamsUISO();
- (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
- [am::hmi_request::parent_id] = 10u;
- (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
- [am::strings::menu_name] = "menu_name";
-
- utils::SharedPtr<ShowRequest> command = CreateCommand<ShowRequest>(msg_vr);
-
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app));
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
-
- Event event(hmi_apis::FunctionID::UI_Show);
- event.set_smart_object(*msg);
-
- MessageSharedPtr vr_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
-
- command->on_event(event);
-
- EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*vr_command_result)[am::strings::msg_params].keyExists(
- am::strings::info)) {
- EXPECT_FALSE(
- (*vr_command_result)[am::strings::msg_params][am::strings::info]
- .asString()
- .empty());
- }
-}
-
-TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[am::strings::soft_buttons] = "Soft_Buttons";
- (*msg)[am::strings::msg_params] = msg_params;
- SmartObject creation_msg_params(msg_params);
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler));
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- EXPECT_CALL(
- mock_message_helper_,
- SubscribeApplicationToSoftButton(creation_msg_params, _, kFunctionID));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[am::strings::soft_buttons] = "";
- (*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- EXPECT_CALL(*mock_app_, UnsubscribeFromSoftButtons(kFunctionID));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[am::strings::soft_buttons] = "Soft_Buttons";
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler));
- EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
- .WillOnce(Return(mobile_apis::Result::ABORTED));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
-
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
-
- EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _))
- .Times(0);
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject graphic(smart_objects::SmartType_Map);
- graphic[am::strings::value] = "1";
- msg_params[am::strings::graphic] = graphic;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject graphic(smart_objects::SmartType_Map);
- graphic[am::strings::value] = "1";
- msg_params[am::strings::graphic] = graphic;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
- .WillOnce(Return(mobile_apis::Result::ABORTED));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject graphic(smart_objects::SmartType_Map);
- graphic[am::strings::value] = "\\n";
- msg_params[am::strings::graphic] = graphic;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject graphic(smart_objects::SmartType_Map);
- graphic[am::strings::value] = "1";
- msg_params[am::strings::secondary_graphic] = graphic;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject graphic(smart_objects::SmartType_Map);
- graphic[am::strings::value] = "1";
- msg_params[am::strings::secondary_graphic] = graphic;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
- .WillOnce(Return(mobile_apis::Result::ABORTED));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject graphic(smart_objects::SmartType_Map);
- graphic[am::strings::value] = "";
- msg_params[am::strings::secondary_graphic] = graphic;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_1";
- TestSetupHelper(msg,
- hmi_apis::Common_TextFieldName::mainField1,
- am::strings::main_field_1);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_1\\n";
- TestSetupHelperWrongSyntax(msg,
- hmi_apis::Common_TextFieldName::mainField1,
- am::strings::main_field_1);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_2";
- TestSetupHelper(msg,
- hmi_apis::Common_TextFieldName::mainField2,
- am::strings::main_field_2);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_2\\n";
- TestSetupHelperWrongSyntax(msg,
- hmi_apis::Common_TextFieldName::mainField2,
- am::strings::main_field_2);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_3";
- TestSetupHelper(msg,
- hmi_apis::Common_TextFieldName::mainField3,
- am::strings::main_field_3);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_3\\n";
- TestSetupHelperWrongSyntax(msg,
- hmi_apis::Common_TextFieldName::mainField3,
- am::strings::main_field_3);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_4";
- TestSetupHelper(msg,
- hmi_apis::Common_TextFieldName::mainField4,
- am::strings::main_field_4);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_4\\n";
- TestSetupHelperWrongSyntax(msg,
- hmi_apis::Common_TextFieldName::mainField4,
- am::strings::main_field_4);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_1";
- const size_t num_tags = 1;
- int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
- TestSetupHelperWithMetadata(msg,
- hmi_apis::Common_TextFieldName::mainField1,
- am::strings::main_field_1,
- num_tags,
- tags);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_1";
- const size_t num_tags = 5;
- int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaTitle,
- hmi_apis::Common_MetadataType::mediaArtist,
- hmi_apis::Common_MetadataType::rating,
- hmi_apis::Common_MetadataType::humidity,
- hmi_apis::Common_MetadataType::currentTemperature};
- TestSetupHelperWithMetadata(msg,
- hmi_apis::Common_TextFieldName::mainField1,
- am::strings::main_field_1,
- num_tags,
- tags);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_2";
- const size_t num_tags = 1;
- int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
- TestSetupHelperWithMetadata(msg,
- hmi_apis::Common_TextFieldName::mainField2,
- am::strings::main_field_2,
- num_tags,
- tags);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_3";
- const size_t num_tags = 1;
- int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
- TestSetupHelperWithMetadata(msg,
- hmi_apis::Common_TextFieldName::mainField3,
- am::strings::main_field_3,
- num_tags,
- tags);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_4";
- const size_t num_tags = 1;
- int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
- TestSetupHelperWithMetadata(msg,
- hmi_apis::Common_TextFieldName::mainField4,
- am::strings::main_field_4,
- num_tags,
- tags);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Main_Field_1";
- const size_t num_tags = 1;
- int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
- TestSetupHelperWithMetadata(msg,
- hmi_apis::Common_TextFieldName::mainField1,
- am::strings::main_field_1,
- num_tags,
- tags,
- false);
- command->Run();
-
- MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
- (*ev_msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
- (*ev_msg)[am::strings::msg_params][am::strings::info] = "";
-
- Event event(hmi_apis::FunctionID::UI_Show);
- event.set_smart_object(*ev_msg);
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(mobile_apis::Result::WARNINGS));
-}
-
-TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Media_Clock";
- TestSetupHelper(msg,
- hmi_apis::Common_TextFieldName::mediaClock,
- am::strings::media_clock);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Media_Clock\\n";
- TestSetupHelperWrongSyntax(msg,
- hmi_apis::Common_TextFieldName::mediaClock,
- am::strings::media_clock);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Media_Track";
- TestSetupHelper(msg,
- hmi_apis::Common_TextFieldName::mediaTrack,
- am::strings::media_track);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Media_Track\\n";
- TestSetupHelperWrongSyntax(msg,
- hmi_apis::Common_TextFieldName::mediaTrack,
- am::strings::media_track);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Status_Bar";
- TestSetupHelper(
- msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_StatusBar_WrongSyntax) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- text_field_ = "Status_Bar\\n";
- TestSetupHelperWrongSyntax(
- msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[am::strings::alignment] = "Alignment";
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject custom_presets(smart_objects::SmartType_Array);
- custom_presets[0] = "Custom_Presets";
- msg_params[am::strings::custom_presets] = custom_presets;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
-
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_));
- EXPECT_CALL(*mock_app_, set_show_command(msg_params));
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
- MessageSharedPtr msg = CreateMsgParams();
- SmartObject msg_params(smart_objects::SmartType_Map);
- SmartObject custom_presets(smart_objects::SmartType_Array);
- custom_presets[0] = "Custom_Presets\\t";
- msg_params[am::strings::custom_presets] = custom_presets;
- (*msg)[am::strings::msg_params] = msg_params;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
- MessageSharedPtr msg = CreateMsgParams();
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*mock_app_, app_id()).Times(0);
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
- EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
-
- command->Run();
-}
-
-TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
- (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _));
-
- Event event(hmi_apis::FunctionID::UI_Show);
- event.set_smart_object(*msg);
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
-
- command->on_event(event);
-}
-
-TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::WARNINGS;
- (*msg)[am::strings::params][am::hmi_response::message] = "Response Info";
- (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
-
- Event event(hmi_apis::FunctionID::UI_Show);
- event.set_smart_object(*msg);
-
- EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
-
- command->on_event(event);
-}
-
-TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::SUCCESS;
-
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- Event event(hmi_apis::FunctionID::UI_Alert);
- event.set_smart_object(*msg);
-
- command->on_event(event);
-}
-
-} // namespace show_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc
deleted file mode 100644
index 7ded373d29..0000000000
--- a/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_message_helper.h"
-#include "command_impl.h"
-#include "commands/commands_test.h"
-#include "mobile/on_app_interface_unregistered_notification.h"
-#include "mobile/on_audio_pass_thru_notification.h"
-#include "mobile/on_driver_distraction_notification.h"
-#include "mobile/on_language_change_notification.h"
-#include "mobile/on_permissions_change_notification.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace simple_notification_commands_test {
-
-namespace am = ::application_manager;
-namespace commands = am::commands;
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::Return;
-
-template <class Command>
-class MobileNotificationCommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<commands::OnAppInterfaceUnregisteredNotification,
- commands::OnAudioPassThruNotification,
- commands::OnLanguageChangeNotification,
- commands::OnPermissionsChangeNotification,
- commands::mobile::OnDriverDistractionNotification>
- NotificationCommandsList;
-
-MATCHER(CheckNotificationMessage, "") {
- return (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- commands::CommandImpl::mobile_protocol_type_ &&
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- commands::CommandImpl::protocol_version_ &&
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- application_manager::MessageType::kNotification;
-}
-
-TYPED_TEST_CASE(MobileNotificationCommandsTest, NotificationCommandsList);
-
-TYPED_TEST(MobileNotificationCommandsTest, Run_SendMessageToMobile_SUCCESS) {
- ::utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- EXPECT_CALL(this->app_mngr_,
- SendMessageToMobile(CheckNotificationMessage(), _));
- command->Run();
-}
-
-} // namespace simple_notification_commands_test
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
deleted file mode 100644
index d80a7e0551..0000000000
--- a/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/helpers.h"
-#include "utils/shared_ptr.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "mobile/read_did_response.h"
-#include "mobile/delete_command_response.h"
-#include "mobile/alert_maneuver_response.h"
-#include "mobile/alert_response.h"
-#include "mobile/list_files_response.h"
-#include "mobile/subscribe_button_response.h"
-#include "mobile/add_sub_menu_response.h"
-#include "mobile/diagnostic_message_response.h"
-#include "mobile/dial_number_response.h"
-#include "mobile/end_audio_pass_thru_response.h"
-#include "mobile/get_dtcs_response.h"
-#include "mobile/get_vehicle_data_response.h"
-#include "mobile/unregister_app_interface_response.h"
-#include "mobile/unsubscribe_button_response.h"
-#include "mobile/unsubscribe_way_points_response.h"
-#include "mobile/update_turn_list_response.h"
-#include "mobile/slider_response.h"
-#include "mobile/speak_response.h"
-#include "mobile/subscribe_vehicle_data_response.h"
-#include "mobile/subscribe_way_points_response.h"
-#include "mobile/system_response.h"
-#include "mobile/get_way_points_response.h"
-#include "mobile/perform_interaction_response.h"
-#include "mobile/perform_audio_pass_thru_response.h"
-#include "mobile/set_global_properties_response.h"
-#include "mobile/set_media_clock_timer_response.h"
-#include "mobile/show_constant_tbt_response.h"
-#include "mobile/show_response.h"
-#include "mobile/add_command_response.h"
-#include "mobile/send_location_response.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/set_display_layout_response.h"
-#include "mobile/generic_response.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/scrollable_message_response.h"
-#include "mobile/change_registration_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace simple_response_commands_test {
-
-namespace commands = ::application_manager::commands;
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-
-using commands::MessageSharedPtr;
-
-template <class Command>
-class MobileResponseCommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<commands::ListFilesResponse,
- commands::ReadDIDResponse,
- commands::DeleteCommandResponse,
- commands::AlertManeuverResponse,
- commands::AlertResponse,
- commands::SubscribeButtonResponse,
- commands::AddSubMenuResponse,
- commands::DiagnosticMessageResponse,
- commands::DialNumberResponse,
- commands::EndAudioPassThruResponse,
- commands::GetDTCsResponse,
- commands::GetVehicleDataResponse,
- commands::UnregisterAppInterfaceResponse,
- commands::UnsubscribeWayPointsResponse,
- commands::UpdateTurnListResponse,
- commands::UnsubscribeButtonResponse,
- commands::SliderResponse,
- commands::SpeakResponse,
- commands::SubscribeVehicleDataResponse,
- commands::SubscribeWayPointsResponse,
- commands::SystemResponse,
- commands::GetWayPointsResponse,
- commands::PerformInteractionResponse,
- commands::PerformAudioPassThruResponse,
- commands::SetGlobalPropertiesResponse,
- commands::SetMediaClockTimerResponse,
- commands::ShowConstantTBTResponse,
- commands::ShowResponse,
- commands::SystemResponse,
- commands::AddCommandResponse,
- commands::SendLocationResponse,
- commands::SetAppIconResponse,
- commands::SetDisplayLayoutResponse,
- commands::ChangeRegistrationResponse> ResponseCommandsList;
-
-TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
-
-TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
- ::utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(NotNull(), _));
- command->Run();
-}
-
-class GenericResponseFromHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-MATCHER_P2(CheckMessageParams, success, result, "") {
- const bool is_msg_type_correct =
- (am::MessageType::kResponse) ==
- static_cast<int32_t>(
- (*arg)[am::strings::params][am::strings::message_type].asInt());
- const bool is_success_correct =
- success == (*arg)[am::strings::msg_params][am::strings::success].asBool();
- const bool is_result_code_correct =
- result ==
- static_cast<int32_t>(
- (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(
- true, is_msg_type_correct, is_success_correct, is_result_code_correct);
-}
-
-TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
-
- SharedPtr<commands::GenericResponse> command(
- CreateCommand<commands::GenericResponse>(command_msg));
-
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(
- CheckMessageParams(false, mobile_apis::Result::INVALID_DATA), false));
-
- command->Run();
-}
-
-class ScrollableMessageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::SUCCESS;
-
- MockAppPtr app(CreateMockApp());
-
- SharedPtr<am::commands::ScrollableMessageResponse> command(
- CreateCommand<am::commands::ScrollableMessageResponse>(message));
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app));
- EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_));
- command->Run();
-}
-
-} // namespace simple_response_commands_test
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc
deleted file mode 100644
index 54ac3cccc0..0000000000
--- a/src/components/application_manager/test/commands/mobile/slider_test.cc
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/slider_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace slider_request {
-
-namespace am = application_manager;
-using am::commands::SliderRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using policy_test::MockPolicyHandlerInterface;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-typedef SharedPtr<SliderRequest> CommandPtr;
-
-namespace {
-const int32_t kCommandId = 1;
-const uint32_t kAppId = 1u;
-const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kDefaultTimeout = 1000u;
-const uint32_t kCorrelationId = 2u;
-const uint32_t kFunctionId = 3u;
-const uint32_t kNumTicks = 2u;
-const uint32_t kPositionGreaterTicks = 3u;
-const uint32_t kPositionLessTicks = 1u;
-} // namespace
-
-class SliderRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- SliderRequestTest()
- : mock_app_(CreateMockApp())
- , msg_(CreateMessage(smart_objects::SmartType_Map)) {}
-
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
- }
-
- void PreConditions() {
- (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_)[am::strings::msg_params][am::strings::num_ticks] = kNumTicks;
- (*msg_)[am::strings::msg_params][am::strings::position] =
- kPositionLessTicks;
- (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
- "slider_footer1";
- (*msg_)[am::strings::msg_params][am::strings::slider_footer][1] =
- "slider_footer2";
- (*msg_)[am::strings::msg_params][am::strings::slider_header] =
- "slider_header";
-
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- }
-
- void ExpectManageMobileCommandWithResultCode(
- const mobile_apis::Result::eType code) {
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(code),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- }
-
- sync_primitives::Lock lock_;
-
- MockAppPtr mock_app_;
- MessageSharedPtr msg_;
- MockPolicyHandlerInterface mock_policy_handler_;
-};
-
-TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_ui = CreateFullParamsUISO();
- (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
-
- utils::SharedPtr<SliderRequest> command =
- CreateCommand<SliderRequest>(msg_ui);
-
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app));
-
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
-
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::info] = "info";
-
- Event event(hmi_apis::FunctionID::UI_Slider);
- event.set_smart_object(*msg);
-
- MessageSharedPtr ui_command_result;
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
- command->on_event(event);
-
- EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
- .asBool(),
- true);
- EXPECT_EQ(
- (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
- .asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- if ((*ui_command_result)[am::strings::msg_params].keyExists(
- am::strings::info)) {
- EXPECT_FALSE(
- (*ui_command_result)[am::strings::msg_params][am::strings::info]
- .asString()
- .empty());
- }
-}
-
-class CallOnTimeOut {
- public:
- CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
-
- void operator()() {
- command_.onTimeOut();
- }
-
- CommandRequestImpl& command_;
-};
-
-TEST_F(SliderRequestTest, Init_SUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- EXPECT_TRUE(command->Init());
-}
-
-TEST_F(SliderRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- PreConditions();
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(ApplicationSharedPtr()));
- ExpectManageMobileCommandWithResultCode(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED);
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- command->Run();
-}
-
-TEST_F(SliderRequestTest, Run_PositionGreaterTicks_UNSUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::position] =
- kPositionGreaterTicks;
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
- command->Run();
-}
-
-TEST_F(SliderRequestTest, Run_SliderFooterNotEqToNumticks_UNSUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::slider_footer][2] =
- "slider_footer3";
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
- command->Run();
-}
-
-TEST_F(SliderRequestTest, Run_InvalidSliderHeader_UNSUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::slider_header] =
- "invalid_test_with_empty_str\\n";
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- command->Run();
-}
-
-TEST_F(SliderRequestTest, Run_InvalidSliderFooter_UNSUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
- "invalid_test_with_empty_str\\n";
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- command->Run();
-}
-
-TEST_F(SliderRequestTest, Run_SUCCESS) {
- PreConditions();
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider)));
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- command->Run();
-}
-
-TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
- (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- EXPECT_TRUE(command->Init());
-
- EXPECT_CALL(
- app_mngr_,
- updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
-
- Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*msg_);
- command->on_event(event);
-}
-
-TEST_F(SliderRequestTest, OnEvent_UI_UnknownEventId_UNSUCCESS) {
- PreConditions();
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
- event.set_smart_object(*msg_);
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- command->on_event(event);
-}
-
-TEST_F(SliderRequestTest, OnEvent_UISliderPositionExists_SUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::TIMED_OUT;
- (*msg_)[am::strings::params][am::strings::data]
- [am::strings::slider_position] = "position";
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::TIMED_OUT);
-
- Event event(hmi_apis::FunctionID::UI_Slider);
- event.set_smart_object(*msg_);
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- command->on_event(event);
-}
-
-TEST_F(SliderRequestTest, OnEvent_UISliderAborted_SUCCESS) {
- PreConditions();
- (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
- (*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::ABORTED;
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
-
- Event event(hmi_apis::FunctionID::UI_Slider);
- event.set_smart_object(*msg_);
-
- CommandPtr command(CreateCommand<SliderRequest>(msg_));
- command->on_event(event);
-}
-
-} // namespace slider_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/test/commands/mobile/speak_request_test.cc
deleted file mode 100644
index f07012d315..0000000000
--- a/src/components/application_manager/test/commands/mobile/speak_request_test.cc
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "gtest/gtest.h"
-#include "mobile/speak_request.h"
-#include "utils/shared_ptr.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/application.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace speak_request {
-
-namespace am = application_manager;
-namespace mobile_result = mobile_apis::Result;
-namespace hmi_response = ::application_manager::hmi_response;
-namespace strings = ::application_manager::strings;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using ::testing::_;
-using ::utils::SharedPtr;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using am::commands::SpeakRequest;
-using ::test::components::application_manager_test::MockApplication;
-
-typedef SharedPtr<SpeakRequest> CommandPtr;
-
-namespace {
-const uint32_t kAppId = 10u;
-const uint32_t kConnectionKey = 5u;
-}
-
-class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- SpeakRequestTest()
- : request_(CreateMessage(smart_objects::SmartType_Map))
- , response_(CreateMessage(smart_objects::SmartType_Map))
- , app_(CreateMockApp()) {}
-
- void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
- const mobile_apis::Result::eType mobile_response,
- const am::HmiInterfaces::InterfaceState state,
- const bool success) {
- utils::SharedPtr<SpeakRequest> command =
- CreateCommand<SpeakRequest>(request_);
-
- (*response_)[strings::params][hmi_response::code] = hmi_response;
- (*response_)[strings::msg_params] = 0;
-
- am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
- event_tts.set_smart_object(*response_);
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
-
- MessageSharedPtr response_to_mobile;
- EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
- .WillRepeatedly(Return(state));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- _, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->on_event(event_tts);
-
- EXPECT_EQ(
- (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
- success);
- EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
- .asInt(),
- static_cast<int32_t>(mobile_response));
- }
-
- MessageSharedPtr request_;
- MessageSharedPtr response_;
- MockAppPtr app_;
-};
-
-TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) {
- utils::SharedPtr<SpeakRequest> command =
- CreateCommand<SpeakRequest>(request_);
-
- (*response_)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*response_)[strings::msg_params] = 0;
-
- am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
- event_tts.set_smart_object(*response_);
-
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
-
- MessageSharedPtr response_to_mobile;
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
-
- command->on_event(event_tts);
-
- EXPECT_EQ(
- (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
- static_cast<int32_t>(mobile_apis::Result::SUCCESS));
-}
-
-TEST_F(SpeakRequestTest,
- OnEvent_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_true) {
- CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_AVAILABLE,
- true);
-}
-
-TEST_F(SpeakRequestTest,
- OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
- CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_NOT_AVAILABLE,
- false);
-}
-
-TEST_F(SpeakRequestTest,
- OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_true) {
- CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_NOT_RESPONSE,
- true);
-}
-
-TEST_F(SpeakRequestTest, Run_ApplicationIsNotRegistered) {
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgWithWhiteSpace_InvalidData) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = " ";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar1_InvalidData) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "sd\\t";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar2_InvalidData) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "sd\\n";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar3_InvalidData) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "sd\tdf";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar4_InvalidData) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "sd\n rer";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgWithIncorrectCharInfirstPlace_InvalidData) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "\n";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgWithEmptyString_Success) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
- ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, Run_MsgCorrect_Success) {
- (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "asda";
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
- ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
-
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
-
- command->Run();
-}
-
-TEST_F(SpeakRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
- Event event(Event::EventID::INVALID_ENUM);
- CommandPtr command(CreateCommand<SpeakRequest>());
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->on_event(event);
-}
-
-TEST_F(SpeakRequestTest, OnEvent_TTS_Speak_SUCCESS) {
- Event event(Event::EventID::TTS_Speak);
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS;
- (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "1234";
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
- (*event_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- event.set_smart_object(*event_msg);
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
- command->on_event(event);
-}
-
-TEST_F(SpeakRequestTest, OnEvent_TTS_SpeakWithWarning_WarningWithSuccess) {
- Event event(Event::EventID::TTS_Speak);
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::WARNINGS;
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
- (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "asda";
- event.set_smart_object(*event_msg);
- CommandPtr command(CreateCommand<SpeakRequest>());
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::WARNINGS), _));
- command->on_event(event);
-}
-
-TEST_F(SpeakRequestTest, OnEvent_TTS_OnResetTimeout_UpdateTimeout) {
- Event event(Event::EventID::TTS_OnResetTimeout);
- (*request_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*request_)[am::strings::params][am::strings::correlation_id] = kAppId;
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- EXPECT_CALL(app_mngr_, updateRequestTimeout(kConnectionKey, kAppId, _));
-
- command->on_event(event);
-}
-
-TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) {
- const hmi_apis::Common_Result::eType hmi_result =
- hmi_apis::Common_Result::SUCCESS;
-
- Event event(Event::EventID::TTS_Speak);
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
- [am::strings::text] = "text";
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
- (*event_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- event.set_smart_object(*event_msg);
- CommandPtr command(CreateCommand<SpeakRequest>(request_));
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- command->on_event(event);
-}
-
-} // namespace speak_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace component
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc
deleted file mode 100644
index 8d31b67a53..0000000000
--- a/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/include/application_manager/commands/mobile/subscribe_button_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace subscribe_button_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SaveArg;
-namespace am = ::application_manager;
-using am::commands::SubscribeButtonRequest;
-using am::commands::MessageSharedPtr;
-
-typedef SharedPtr<SubscribeButtonRequest> CommandPtr;
-
-class SubscribeButtonRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- typedef TypeIf<kMocksAreNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
-};
-
-typedef SubscribeButtonRequestTest::MockHMICapabilities MockHMICapabilities;
-
-TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<SubscribeButtonRequest>());
-
- ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(SharedPtr<am::Application>()));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_SubscriptionNotAllowed_UNSUCCESS) {
- MessageSharedPtr msg(CreateMessage());
- (*msg)[am::strings::msg_params][am::strings::button_name] =
- mobile_apis::ButtonName::SEEKLEFT;
- CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::REJECTED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_UiIsNotSupported_UNSUCCESS) {
- CommandPtr command(CreateCommand<SubscribeButtonRequest>());
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- MockHMICapabilities hmi_capabilities;
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities));
- ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(false));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::UNSUPPORTED_RESOURCE,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_IsSubscribedToButton_UNSUCCESS) {
- const mobile_apis::ButtonName::eType kButtonName =
- mobile_apis::ButtonName::SEEKLEFT;
-
- MessageSharedPtr msg(CreateMessage());
- (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
- CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
-
- MockHMICapabilities hmi_capabilities;
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities));
- ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
-
- MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
-
- ON_CALL(hmi_capabilities, button_capabilities())
- .WillByDefault(Return(button_caps_ptr.get()));
-
- ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(true));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::IGNORED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
- const mobile_apis::ButtonName::eType kButtonName =
- mobile_apis::ButtonName::SEEKLEFT;
-
- MessageSharedPtr msg(CreateMessage());
- (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
- CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
-
- MockHMICapabilities hmi_capabilities;
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities));
- ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
-
- MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
-
- ON_CALL(hmi_capabilities, button_capabilities())
- .WillByDefault(Return(button_caps_ptr.get()));
-
- ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
-
- MessageSharedPtr hmi_result_msg;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
-
- MessageSharedPtr mobile_result_msg(
- CatchMobileCommandResult(CallRun(*command)));
-
- EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
- static_cast<hmi_apis::FunctionID::eType>(
- (*hmi_result_msg)[am::strings::params][am::strings::function_id]
- .asInt()));
-
- EXPECT_EQ(mobile_apis::Result::SUCCESS,
- static_cast<mobile_apis::Result::eType>(
- (*mobile_result_msg)[am::strings::msg_params]
- [am::strings::result_code].asInt()));
-}
-
-} // namespace subscribe_button_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
deleted file mode 100644
index 87127231be..0000000000
--- a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace subscribe_way_points_request {
-
-using ::testing::_;
-using ::testing::A;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SaveArg;
-using ::testing::InSequence;
-namespace am = ::application_manager;
-using am::commands::SubscribeWayPointsRequest;
-using am::commands::MessageSharedPtr;
-
-typedef SharedPtr<SubscribeWayPointsRequest> CommandPtr;
-
-class SubscribeWayPointsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
- CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
- MockAppPtr app(CreateMockApp());
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(A<am::ApplicationSharedPtr>()))
- .WillByDefault(Return(false));
- ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
- .WillByDefault(Return(true));
-
- {
- InSequence dummy;
- EXPECT_CALL(app_mngr_,
- SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
- EXPECT_CALL(*app, UpdateHash());
- }
-
- command->Init();
- MessageSharedPtr mobile_result_msg(
- CatchMobileCommandResult(CallRun(*command)));
-
- EXPECT_EQ(mobile_apis::Result::SUCCESS,
- static_cast<mobile_apis::Result::eType>(
- (*mobile_result_msg)[am::strings::msg_params]
- [am::strings::result_code].asInt()));
-}
-
-TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
- CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
- MockAppPtr app(CreateMockApp());
- Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- const hmi_apis::Common_Result::eType result_code =
- hmi_apis::Common_Result::SUCCESS;
- (*event_msg)[am::strings::params][am::hmi_response::code] = result_code;
- (*event_msg)[am::strings::msg_params] = 0;
-
- event.set_smart_object(*event_msg);
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- {
- InSequence dummy;
- EXPECT_CALL(app_mngr_,
- SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
- EXPECT_CALL(mock_message_helper_, HMIToMobileResult(result_code))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
- EXPECT_CALL(*app, UpdateHash());
- }
-
- command->Init();
- command->on_event(event);
-}
-
-} // namespace subscribe_way_points_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/system_request_test.cc b/src/components/application_manager/test/commands/mobile/system_request_test.cc
deleted file mode 100644
index 0e07889b4b..0000000000
--- a/src/components/application_manager/test/commands/mobile/system_request_test.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "gtest/gtest.h"
-
-#include "application_manager/commands/mobile/system_request.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace system_request {
-
-namespace am = application_manager;
-using am::commands::SystemRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockHmiInterfaces;
-using am::event_engine::Event;
-using policy_test::MockPolicyHandlerInterface;
-using ::utils::SharedPtr;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kAppPolicyId = "fake-app-id";
-const uint32_t kDefaultTimeout = 1000u;
-const std::string kAppFolderName = "fake-app-name";
-const std::string kAppStorageFolder = "fake-storage";
-const std::string kSystemFilesPath = "/fake/system/files";
-const std::string kFileName = "Filename";
-} // namespace
-
-class SystemRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- SystemRequestTest() : mock_app_(CreateMockApp()) {}
-
- protected:
- MessageSharedPtr CreateIVSUMessage() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg)[am::strings::msg_params][am::strings::request_type] =
- mobile_apis::RequestType::HTTP;
- (*msg)[am::strings::msg_params][am::strings::file_name] = kFileName;
- return msg;
- }
-
- void PreConditions() {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
-
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kAppPolicyId));
- ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kAppFolderName));
-
- ON_CALL(app_mngr_settings_, system_files_path())
- .WillByDefault(ReturnRef(kSystemFilesPath));
- ON_CALL(app_mngr_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
-
- ON_CALL(mock_policy_handler_, IsRequestTypeAllowed(kAppPolicyId, _))
- .WillByDefault(Return(true));
- }
-
- void ExpectManageMobileCommandWithResultCode(
- const mobile_apis::Result::eType code) {
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(code),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- }
-
- MockAppPtr mock_app_;
- MockPolicyHandlerInterface mock_policy_handler_;
-};
-
-TEST_F(SystemRequestTest, Run_HTTP_FileName_no_binary_data_REJECTED) {
- PreConditions();
- MessageSharedPtr msg = CreateIVSUMessage();
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
-
- SharedPtr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
- command->Run();
-}
-
-} // namespace system_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
deleted file mode 100644
index 3d083f5c45..0000000000
--- a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/mobile/unregister_app_interface_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unregister_app_interface_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-
-using am::commands::UnregisterAppInterfaceRequest;
-using am::commands::MessageSharedPtr;
-
-typedef ::utils::SharedPtr<UnregisterAppInterfaceRequest> CommandPtr;
-
-class UnregisterAppInterfaceRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(UnregisterAppInterfaceRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) {
- const uint32_t kConnectionKey = 1u;
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
-
- const mobile_apis::AppInterfaceUnregisteredReason::eType kUnregisterReason =
- mobile_apis::AppInterfaceUnregisteredReason::INVALID_ENUM;
-
- MessageSharedPtr dummy_msg(CreateMessage());
- EXPECT_CALL(mock_message_helper_,
- GetOnAppInterfaceUnregisteredNotificationToMobile(
- kConnectionKey, kUnregisterReason))
- .WillOnce(Return(dummy_msg));
- {
- ::testing::InSequence sequence;
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(dummy_msg, _));
-
- EXPECT_CALL(app_mngr_,
- UnregisterApplication(
- kConnectionKey, mobile_apis::Result::SUCCESS, _, _));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
- }
-
- command->Run();
-}
-
-} // namespace unregister_app_interface_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
deleted file mode 100644
index 46a1ce02eb..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/mobile/unsubscribe_button_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unsubscribe_button_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-
-using am::commands::UnsubscribeButtonRequest;
-using am::commands::MessageSharedPtr;
-
-typedef ::utils::SharedPtr<UnsubscribeButtonRequest> CommandPtr;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
-} // namespace
-
-class UnsubscribeButtonRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- typedef TypeIf<kMocksAreNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
-};
-
-TEST_F(UnsubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<UnsubscribeButtonRequest>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(UnsubscribeButtonRequestTest,
- Run_UnsubscribeNotSubscribedButton_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
-
- CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
-
- UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(hmi_capabilities));
- EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true));
-
- MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
- EXPECT_CALL(hmi_capabilities, button_capabilities())
- .WillOnce(Return(button_caps_ptr.get()));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
- .WillOnce(Return(false));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
-
- command->Run();
-}
-
-TEST_F(UnsubscribeButtonRequestTest,
- Run_UnsubscribeNotAllowedByHmiCapabilities_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
- CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(hmi_capabilities));
- EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true));
-
- MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- EXPECT_CALL(hmi_capabilities, button_capabilities())
- .WillOnce(Return(button_caps_ptr.get()));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::UNSUPPORTED_RESOURCE), _));
-
- command->Run();
-}
-
-TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
-
- CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
-
- UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(hmi_capabilities));
- EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true));
-
- MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
- EXPECT_CALL(hmi_capabilities, button_capabilities())
- .WillOnce(Return(button_caps_ptr.get()));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
-
- EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
- .WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Buttons_OnButtonSubscription)));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- EXPECT_CALL(*mock_app, UpdateHash());
- command->Init();
- command->Run();
-}
-
-} // namespace unsubscribe_button_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
deleted file mode 100644
index bb4824e8f7..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unsubscribe_vehicle_data_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-
-using am::commands::UnsubscribeVehicleDataRequest;
-using am::commands::MessageSharedPtr;
-
-typedef ::utils::SharedPtr<UnsubscribeVehicleDataRequest> CommandPtr;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const std::string kMsgParamKey = "test_key";
-const mobile_apis::VehicleDataType::eType kVehicleType =
- mobile_apis::VehicleDataType::VEHICLEDATA_SPEED;
-} // namespace
-
-class UnsubscribeVehicleRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- void UnsubscribeSuccessfully();
- sync_primitives::Lock app_set_lock_;
-};
-
-TEST_F(UnsubscribeVehicleRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>());
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleRequestTest,
- Run_DataToUnsubscribeIsNotExisted_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][am::strings::button_name] =
- kVehicleType;
-
- am::VehicleData data;
- EXPECT_CALL(mock_message_helper_, vehicle_data()).WillOnce(ReturnRef(data));
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleRequestTest,
- Run_UnsubscribeNotSubscribedBeforeData_IGNORED) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][kMsgParamKey] = kVehicleType;
-
- am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(vehicle_data));
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
-
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleRequestTest,
- Run_UnsubscribeNotSubscribedBeforeData_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
-
- am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(vehicle_data));
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
-
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleRequestTest, Run_UnsubscribeDataDisabled_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(vehicle_data));
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-void UnsubscribeVehicleRequestTest::UnsubscribeSuccessfully() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
-
- am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
-
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(vehicle_data));
-
- am::ApplicationSet application_set_;
- MockAppPtr mock_app(CreateMockApp());
- application_set_.insert(mock_app);
- DataAccessor<am::ApplicationSet> accessor(application_set_, app_set_lock_);
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
-
- EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType))
- .WillRepeatedly(Return(true));
-
- EXPECT_CALL(*mock_app, UnsubscribeFromIVI(kVehicleType))
- .WillRepeatedly(Return(true));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleRequestTest, Run_UnsubscribeData_SUCCESS) {
- UnsubscribeSuccessfully();
-}
-
-TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
-
- am::VehicleData vehicle_data;
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
- vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(mock_message_helper_, vehicle_data())
- .WillOnce(ReturnRef(vehicle_data));
- EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType))
- .WillRepeatedly(Return(false));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
- command->Init();
- command->Run();
-
- am::event_engine::Event test_event(
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
- SmartObject message(smart_objects::SmartType_Map);
- const hmi_apis::Common_Result::eType hmi_result =
- hmi_apis::Common_Result::SUCCESS;
- message[am::strings::params][am::hmi_response::code] = hmi_result;
- message[am::strings::msg_params][kMsgParamKey] = true;
- test_event.set_smart_object(message);
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
- EXPECT_CALL(*mock_app, UpdateHash());
-
- command->on_event(test_event);
-}
-
-TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) {
- UnsubscribeSuccessfully();
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
- MockAppPtr mock_app(CreateMockApp());
-
- am::event_engine::Event test_event(
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
- SmartObject message(smart_objects::SmartType_Map);
- const hmi_apis::Common_Result::eType hmi_result =
- hmi_apis::Common_Result::SUCCESS;
- message[am::strings::params][am::hmi_response::code] = hmi_result;
- message[am::strings::msg_params][kMsgParamKey] = true;
- test_event.set_smart_object(message);
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- command->on_event(test_event);
-}
-
-} // namespace unsubscribe_vehicle_data_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
deleted file mode 100644
index 532948e5db..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
-#include <stdint.h>
-#include <string>
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_application_manager.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unsubscribe_vehicle_data_response {
-
-namespace commands = ::application_manager::commands;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-
-using commands::MessageSharedPtr;
-namespace am = ::application_manager;
-
-class UnsubscribeVehicleResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-MATCHER_P(ResultCodeIs, result_code, "") {
- return result_code ==
- static_cast<mobile_apis::Result::eType>(
- (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
-}
-
-TEST_F(UnsubscribeVehicleResponseTest,
- Run_SendFalseResponseToMobile_SendInvalidEnum) {
- MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
- (*command_msg)[am::strings::msg_params][am::strings::success] = false;
-
- ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
- CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(ResultCodeIs(mobile_apis::Result::INVALID_ENUM), _));
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleResponseTest,
- Run_SendSuccessfulResponseToMobile_SUCCESS) {
- MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
- (*command_msg)[am::strings::msg_params][am::strings::success] = true;
- ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
- CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(ResultCodeIs(mobile_apis::Result::SUCCESS), _));
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleResponseTest,
- Run_SendResponseToMobile_SendCodeToMobile) {
- MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
- (*command_msg)[am::strings::msg_params][am::strings::success] = true;
-
- mobile_apis::Result::eType result_type = mobile_apis::Result::WARNINGS;
- (*command_msg)[am::strings::msg_params][am::strings::result_code] =
- result_type;
- ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
- CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
- EXPECT_CALL(app_mngr_, SendMessageToMobile(ResultCodeIs(result_type), _));
- command->Run();
-}
-
-} // namespace unsubscribe_vehicle_data_response
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
deleted file mode 100644
index 5615b0cabd..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "mobile/unsubscribe_way_points_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unsubscribe_way_points_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::UnSubscribeWayPointsRequest;
-using am::commands::MessageSharedPtr;
-
-namespace {
-const uint32_t kConnectionKey = 3u;
-const uint32_t kAppId = 5u;
-} // namespace
-
-class UnSubscribeWayPointsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- UnSubscribeWayPointsRequestTest()
- : command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<UnSubscribeWayPointsRequest>(command_msg_)) {
- (*command_msg_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- }
-
- MessageSharedPtr command_msg_;
- ::utils::SharedPtr<UnSubscribeWayPointsRequest> command_;
-};
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- Run_ApplicationIsNotRegistered_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- Run_AppIsNotSubscribedForWayPoints_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_,
- IsAppSubscribedForWayPoints(
- ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
- .WillOnce(Return(false));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_,
- IsAppSubscribedForWayPoints(
- ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
- .WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints)));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- command_->on_event(event);
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- OnEvent_ReceivedNavigationUnSubscribeWayPointsEvent_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillRepeatedly(Return(mock_app));
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::msg_params] = 0;
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_result::SUCCESS;
- Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(app_mngr_,
- UnsubscribeAppFromWayPoints(
- ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- command_->on_event(event);
-}
-
-} // namespace unsubscribe_way_points_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
deleted file mode 100644
index dacabba5fd..0000000000
--- a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/update_turn_list_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace update_turn_list_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::Ref;
-using ::testing::Eq;
-
-using am::commands::UpdateTurnListRequest;
-using am::commands::MessageSharedPtr;
-using application_manager_test::MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 3u;
-const hmi_apis::FunctionID::eType kFunctionId =
- hmi_apis::FunctionID::Buttons_OnButtonEvent;
-const uint32_t kAppId = 5u;
-} // namespace
-
-class UpdateTurnListRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- UpdateTurnListRequestTest()
- : command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<UpdateTurnListRequest>(command_msg_)) {
- (*command_msg_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg_)[am::strings::params][am::strings::function_id] =
- kFunctionId;
- }
-
- MessageSharedPtr command_msg_;
- ::utils::SharedPtr<UpdateTurnListRequest> command_;
- TypeIf<kMocksAreNice,
- NiceMock<policy_test::MockPolicyHandlerInterface>,
- policy_test::MockPolicyHandlerInterface>::Result mock_policy_handler_;
-};
-
-TEST_F(UpdateTurnListRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command_->Run();
-}
-
-TEST_F(UpdateTurnListRequestTest, Run_InvalidNavigationText_UNSUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::navigation_text] = "invalid_navigation_text\t\n";
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command_->Run();
-}
-
-TEST_F(UpdateTurnListRequestTest, Run_InvalidTurnIcon_UNSUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::navigation_text] = "valid_navigation_text";
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::turn_icon][am::strings::value] =
- "invalid_turn_icon\t\n";
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command_->Run();
-}
-
-TEST_F(UpdateTurnListRequestTest,
- Run_ProcessSoftButtonsNotSucceeded_UNSUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::navigation_text] = "valid_navigation_text";
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::turn_icon][am::strings::value] =
- "valid_turn_icon";
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_));
-
- const mobile_result::eType kExpectedResult = mobile_result::INVALID_ENUM;
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
- Eq(mock_app),
- Ref(mock_policy_handler_),
- Ref(app_mngr_)))
- .WillOnce(Return(kExpectedResult));
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(kExpectedResult), _));
-
- command_->Run();
-}
-
-TEST_F(UpdateTurnListRequestTest, Run_NoTurnList_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_));
-
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
- Eq(mock_app),
- Ref(mock_policy_handler_),
- Ref(app_mngr_)))
- .WillOnce(Return(mobile_result::SUCCESS));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command_->Run();
-}
-
-TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
- const std::string kNavigationText = "valid_navigation_text";
-
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::navigation_text] = kNavigationText;
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::turn_icon][am::strings::value] =
- "valid_turn_icon";
- (*command_msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler_));
-
- EXPECT_CALL(mock_message_helper_,
- ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
- Eq(mock_app),
- Ref(mock_policy_handler_),
- Ref(app_mngr_)))
- .WillOnce(Return(mobile_result::SUCCESS));
-
- EXPECT_CALL(
- mock_message_helper_,
- VerifyImage(
- (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
- [am::strings::turn_icon],
- Eq(mock_app),
- Ref(app_mngr_))).WillOnce(Return(mobile_result::SUCCESS));
-
- EXPECT_CALL(mock_message_helper_,
- SubscribeApplicationToSoftButton(_, _, kFunctionId));
-
- MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
- ASSERT_TRUE(result_msg);
- EXPECT_EQ(
- hmi_apis::FunctionID::Navigation_UpdateTurnList,
- (*result_msg)[am::strings::params][am::strings::function_id].asInt());
-
- ASSERT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- .keyExists(am::hmi_request::navi_text));
-
- EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text].keyExists(
- am::hmi_request::field_name));
- EXPECT_EQ(
- hmi_apis::Common_TextFieldName::turnText,
- (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text][am::hmi_request::field_name]
- .asInt());
-
- EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text].keyExists(
- am::hmi_request::field_text));
- EXPECT_EQ(
- kNavigationText,
- (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
- [am::hmi_request::navi_text][am::hmi_request::field_text]
- .asString());
-}
-
-TEST_F(UpdateTurnListRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command_->on_event(event);
-}
-
-TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) {
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- const hmi_apis::Common_Result::eType hmi_response_code =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- const mobile_result::eType mobile_response_code =
- mobile_result::UNSUPPORTED_RESOURCE;
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
- (*event_msg)[am::strings::msg_params] = 0;
-
- Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
-
- command_->on_event(event);
-}
-
-TEST_F(UpdateTurnListRequestTest,
- OnEvent_ReceivedNavigationUpdateTurnListEvent_SUCCESS) {
- const hmi_apis::Common_Result::eType hmi_response_code =
- hmi_apis::Common_Result::SUCCESS;
- const mobile_result::eType mobile_response_code = mobile_result::SUCCESS;
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
- (*event_msg)[am::strings::msg_params] = 0;
-
- Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
-
- command_->on_event(event);
-}
-
-} // namespace update_turn_list_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
index 440763d4c3..de0b5afb3c 100644
--- a/src/components/application_manager/test/event_engine_test.cc
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -38,7 +38,7 @@
#include "application_manager/mock_event_observer.h"
#include "application_manager/mock_event_dispatcher.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "interfaces/HMI_API.h"
namespace test {
diff --git a/src/components/application_manager/test/help_prompt_manager_test.cc b/src/components/application_manager/test/help_prompt_manager_test.cc
new file mode 100644
index 0000000000..f921eb1dde
--- /dev/null
+++ b/src/components/application_manager/test/help_prompt_manager_test.cc
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_impl.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_resumption_data.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+#include "utils/file_system.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kCorrelationKey = 2u;
+const uint32_t kAppId = 10u;
+const uint32_t kCmdId = 1u;
+const std::string kPolicyAppId = "fake_app_id";
+const uint32_t kTimeout = 10000u;
+const std::string kText = "one";
+const uint32_t kPosition = 1u;
+const std::string kFirstVrCommand = "first";
+const int32_t kGrammarId = 12;
+const std::string kDirectoryName = "./test_storage";
+const uint8_t expected_tread_pool_size = 2u;
+const uint8_t stop_streaming_timeout = 1u;
+const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"};
+} // namespace
+
+using namespace application_manager;
+using namespace policy;
+using namespace test::components::commands_test;
+using namespace mobile_apis;
+
+using am::HmiStatePtr;
+using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest;
+using testing::_;
+using testing::Mock;
+using testing::NiceMock;
+using testing::Return;
+using testing::ReturnRef;
+using usage_statistics_test::MockStatisticsManager;
+
+class ApplicationImplTest : public ApplicationImpl {
+ public:
+ ApplicationImplTest(
+ uint32_t application_id,
+ const std::string& policy_app_id,
+ const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
+ const custom_str::CustomString& app_name,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
+ ApplicationManager& application_manager,
+ MockHelpPromptManager& mock_help_prompt_manager)
+ : ApplicationImpl(application_id,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ statistics_manager,
+ application_manager)
+ , mock_help_prompt_manager_(mock_help_prompt_manager) {}
+
+ HelpPromptManager& help_prompt_manager() OVERRIDE {
+ return mock_help_prompt_manager_;
+ }
+
+ private:
+ MockHelpPromptManager& mock_help_prompt_manager_;
+};
+
+class HelpPromptManagerTest : public ::testing::Test {
+ public:
+ HelpPromptManagerTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+ void SetUp() OVERRIDE;
+ void TearDown() OVERRIDE;
+ MessageSharedPtr CreateMsgParams();
+ void VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array);
+ void CreateBasicParamsVRRequest(MessageSharedPtr msg);
+ void CreateApplication(MockHelpPromptManager& mock_help_prompt_manager);
+ HmiStatePtr CreateTestHmiState();
+
+ template <class Command>
+ std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) {
+ return std::make_shared<Command>(msg,
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
+ }
+
+ protected:
+ typedef CommandsTest<CommandsTestMocks::kIsNice>::MockAppManager
+ MockAppManager;
+ MockAppManager app_mngr_;
+ std::shared_ptr<ApplicationImplTest> app_impl_;
+ MockHmiInterfaces mock_hmi_interfaces_;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
+ sync_primitives::Lock app_lock_;
+ MockRPCService mock_rpc_service_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_;
+ MockMessageHelper& mock_message_helper_;
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager_;
+};
+
+void HelpPromptManagerTest::SetUp() {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_SDL));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kTimeout));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(app_mngr_settings_, audio_data_stopped_timeout())
+ .WillByDefault(Return(0));
+ ON_CALL(app_mngr_settings_, video_data_stopped_timeout())
+ .WillByDefault(Return(0));
+
+ mock_help_prompt_manager_ =
+ std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
+
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ HmiState::STATE_ID_REGULAR);
+
+ std::string path = file_system::CreateDirectory("storage");
+ file_system::CreateFile(path + "/" + "certificate");
+
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
+}
+
+void HelpPromptManagerTest::TearDown() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+MessageSharedPtr HelpPromptManagerTest::CreateMsgParams() {
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+}
+
+void HelpPromptManagerTest::VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array) {
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+}
+
+void HelpPromptManagerTest::CreateBasicParamsVRRequest(MessageSharedPtr msg) {
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ msg_params[strings::cmd_id] = kCmdId;
+ msg_params[strings::vr_commands] =
+ SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands][0] = kFirstVrCommand;
+ msg_params[strings::type] = kPosition;
+ msg_params[strings::grammar_id] = kGrammarId;
+ msg_params[strings::info] = "VR info";
+}
+
+HmiStatePtr HelpPromptManagerTest::CreateTestHmiState() {
+ HmiStatePtr testState = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(app_impl_),
+ app_mngr_,
+ HmiState::STATE_ID_REGULAR);
+ testState->set_hmi_level(HMILevel::INVALID_ENUM);
+ testState->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ testState->set_system_context(SystemContext::SYSCTXT_MAIN);
+ return testState;
+}
+
+void HelpPromptManagerTest::CreateApplication(
+ MockHelpPromptManager& mock_help_prompt_manager) {
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1;
+ const custom_str::CustomString app_name("");
+
+ app_impl_.reset(
+ new ApplicationImplTest(kAppId,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ std::make_shared<MockStatisticsManager>(),
+ app_mngr_,
+ mock_help_prompt_manager));
+ HmiStatePtr initial_state = CreateTestHmiState();
+ app_impl_->SetInitialState(initial_state);
+}
+
+TEST_F(HelpPromptManagerTest, AddCommand_OnVrCommandAdded) {
+ CreateApplication(*mock_help_prompt_manager_.get());
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ CreateBasicParamsVRRequest(msg);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[strings::msg_params][strings::cmd_id] = kCmdId;
+
+ app_impl_->AddCommand(kCmdId, (*msg)[strings::msg_params]);
+}
+
+TEST_F(HelpPromptManagerTest, RemoveCommand_OnVrCommandDeleted) {
+ CreateApplication(*mock_help_prompt_manager_.get());
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ CreateBasicParamsVRRequest(msg);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[strings::msg_params][strings::cmd_id] = kCmdId;
+
+ app_impl_->AddCommand(kCmdId, (*msg)[strings::msg_params]);
+ app_impl_->RemoveCommand(kCmdId);
+}
+
+TEST_F(HelpPromptManagerTest,
+ Request_OnSetGlobalPropertiesReceived_TTS_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(HelpPromptManagerTest,
+ Request_OnSetGlobalPropertiesReceived_UI_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json
index 9db6ee78ae..ca67d81d8c 100644
--- a/src/components/application_manager/test/hmi_capabilities.json
+++ b/src/components/application_manager/test/hmi_capabilities.json
@@ -42,6 +42,7 @@
],
"displayCapabilities": {
"displayType": "GEN2_8_DMA",
+ "displayName": "GENERIC_DISPLAY",
"textFields": [
{
"name": "mainField1",
@@ -215,7 +216,9 @@
"imageFields": [
{
"name": "softButtonImage",
- "imageTypeSupported": [],
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -223,7 +226,9 @@
},
{
"name": "choiceImage",
- "imageTypeSupported": [],
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -231,7 +236,9 @@
},
{
"name": "choiceSecondaryImage",
- "imageTypeSupported": [],
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -239,7 +246,9 @@
},
{
"name": "menuIcon",
- "imageTypeSupported": [],
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -247,7 +256,9 @@
},
{
"name": "cmdIcon",
- "imageTypeSupported": [],
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -255,7 +266,9 @@
},
{
"name": "appIcon",
- "imageTypeSupported": [],
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -263,7 +276,19 @@
},
{
"name": "graphic",
- "imageTypeSupported": [],
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "secondaryGraphic",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
"imageResolution": {
"resolutionWidth": 35,
"resolutionHeight": 35
@@ -659,6 +684,12 @@
"upDownAvailable": true
},
{
+ "name": "PLAY_PAUSE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ },
+ {
"name": "SEEKLEFT",
"shortPressAvailable": true,
"longPressAvailable": true,
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index b8369528aa..ae95fca35f 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -41,12 +41,13 @@
#include "application_manager/mock_message_helper.h"
#include "smart_objects/enum_schema_item.h"
#include "interfaces/HMI_API.h"
-#include "utils/make_shared.h"
+
#include "application_manager/hmi_capabilities_for_testing.h"
#include "utils/file_system.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/state_controller.h"
#include "resumption/last_state_impl.h"
#include "application_manager/resumption/resume_ctrl.h"
@@ -81,7 +82,7 @@ class HMICapabilitiesTest : public ::testing::Test {
EXPECT_CALL(mock_application_manager_settings_, launch_hmi())
.WillOnce(Return(false));
hmi_capabilities_test =
- utils::MakeShared<HMICapabilitiesForTesting>(app_mngr_);
+ std::make_shared<HMICapabilitiesForTesting>(app_mngr_);
hmi_capabilities_test->Init(&last_state_);
}
@@ -99,8 +100,9 @@ class HMICapabilitiesTest : public ::testing::Test {
event_engine_test::MockEventDispatcher mock_event_dispatcher;
resumption::LastStateImpl last_state_;
MockApplicationManagerSettings mock_application_manager_settings_;
- utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities_test;
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities_test;
const std::string file_name_;
+ application_manager_test::MockRPCService mock_rpc_service_;
};
const char* const cstring_values_[] = {
@@ -186,6 +188,8 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
if (file_system::FileExists("./app_info_data")) {
EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
}
+ EXPECT_CALL(app_mngr_, IsSOStructValid(_, _)).WillOnce(Return(true));
+
EXPECT_TRUE(hmi_capabilities_test->LoadCapabilitiesFromFile());
// Check active languages
@@ -251,7 +255,7 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
// Count of buttons in json file
const uint32_t btn_length = buttons_capabilities_so.length();
- EXPECT_EQ(15u, btn_length);
+ EXPECT_EQ(16u, btn_length);
for (uint32_t i = 0; i < btn_length; ++i) {
EXPECT_TRUE((buttons_capabilities_so[i]).keyExists(strings::name));
EXPECT_TRUE((buttons_capabilities_so[i]).keyExists("shortPressAvailable"));
@@ -269,6 +273,9 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
static_cast<hmi_apis::Common_DisplayType::eType>(
display_capabilities_so[hmi_response::display_type].asInt()));
+ EXPECT_EQ("GENERIC_DISPLAY",
+ display_capabilities_so[hmi_response::display_name].asString());
+
EXPECT_TRUE(display_capabilities_so["graphicSupported"].asBool());
// Check text fields
@@ -499,8 +506,8 @@ TEST_F(HMICapabilitiesTest,
EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
}
- utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities =
- utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr);
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities =
+ std::make_shared<HMICapabilitiesForTesting>(mock_app_mngr);
hmi_capabilities->Init(&last_state_);
// Check system capabilities; only phone capability is available
@@ -539,8 +546,8 @@ TEST_F(HMICapabilitiesTest,
EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
}
- utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities =
- utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr);
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities =
+ std::make_shared<HMICapabilitiesForTesting>(mock_app_mngr);
hmi_capabilities->Init(&last_state_);
// Check system capabilities; only navigation capability is valid, the other
@@ -562,6 +569,7 @@ TEST_F(HMICapabilitiesTest,
TEST_F(HMICapabilitiesTest, VerifyImageType) {
const int32_t image_type = 1;
smart_objects::SmartObject sm_obj;
+ EXPECT_CALL(app_mngr_, IsSOStructValid(_, _)).WillOnce(Return(true));
sm_obj[hmi_response::image_capabilities][0] = image_type;
hmi_capabilities_test->set_display_capabilities(sm_obj);
@@ -575,7 +583,8 @@ void HMICapabilitiesTest::SetCooperating() {
smart_objects::SmartObjectSPtr test_so;
EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
CreateModuleInfoSO(_, _)).WillRepeatedly(Return(test_so));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillRepeatedly(Return(true));
}
TEST_F(HMICapabilitiesTest, SetVRCooperating) {
diff --git a/src/components/application_manager/test/hmi_language_handler_test.cc b/src/components/application_manager/test/hmi_language_handler_test.cc
index 2020da5052..ec88075212 100644
--- a/src/components/application_manager/test/hmi_language_handler_test.cc
+++ b/src/components/application_manager/test/hmi_language_handler_test.cc
@@ -42,10 +42,10 @@
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/smart_object_keys.h"
#include "test/resumption/mock_last_state.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/lock.h"
namespace test {
@@ -56,7 +56,6 @@ namespace am = ::application_manager;
using am::event_engine::Event;
using am::ApplicationSet;
-using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -72,8 +71,9 @@ typedef NiceMock<
typedef NiceMock< ::test::components::event_engine_test::MockEventDispatcher>
MockEventDispatcher;
typedef NiceMock<application_manager_test::MockApplication> MockApp;
+typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
-typedef SharedPtr<MockApp> ApplicationSharedPtr;
+typedef std::shared_ptr<MockApp> ApplicationSharedPtr;
typedef am::HMILanguageHandler::Apps Apps;
namespace {
@@ -82,11 +82,12 @@ const uint32_t kDefaultAppsSize = 0u;
class HmiLanguageHandlerTest : public ::testing::Test {
public:
- HmiLanguageHandlerTest() {
+ HmiLanguageHandlerTest()
+ : app_set_lock_(std::make_shared<sync_primitives::Lock>()) {
EXPECT_CALL(app_manager_, event_dispatcher())
.WillOnce(ReturnRef(event_dispatcher_));
hmi_language_handler_ =
- ::utils::MakeShared<am::HMILanguageHandler>(app_manager_);
+ std::make_shared<am::HMILanguageHandler>(app_manager_);
}
void InitHMIActiveLanguages(hmi_apis::Common_Language::eType ui_language,
@@ -111,7 +112,7 @@ class HmiLanguageHandlerTest : public ::testing::Test {
ApplicationSharedPtr CreateMockApp(const uint32_t app_id,
bool expect_call = false) const {
- ApplicationSharedPtr app = ::utils::MakeShared<MockApp>();
+ ApplicationSharedPtr app = std::make_shared<MockApp>();
if (expect_call) {
EXPECT_CALL(*app, app_id()).WillRepeatedly(Return(app_id));
} else {
@@ -132,9 +133,10 @@ class HmiLanguageHandlerTest : public ::testing::Test {
MockApplicationManager app_manager_;
MockHMICapabilities hmi_capabilities_;
MockEventDispatcher event_dispatcher_;
- SharedPtr<am::HMILanguageHandler> hmi_language_handler_;
- ::sync_primitives::Lock app_set_lock_;
+ std::shared_ptr<am::HMILanguageHandler> hmi_language_handler_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_;
resumption_test::MockLastState last_state_;
+ MockRPCService mock_rpc_service_;
};
TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) {
@@ -164,7 +166,8 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) {
// So if they same app_manager_'s method `applications`
// will never be called.
EXPECT_CALL(app_manager_, applications()).Times(0);
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, GetRPCService()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
hmi_language_handler_->on_event(tts_event);
@@ -201,7 +204,8 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_SUCCESS) {
// the `applications` will be called and
// app data will checked by `CheckApplication` method
ON_CALL(app_manager_, applications()).WillByDefault(Return(data_accessor));
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, GetRPCService()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
@@ -311,12 +315,14 @@ TEST_F(HmiLanguageHandlerTest,
// Needed to call of `ManageMobileCommand` method
ON_CALL(*am::MockMessageHelper::message_helper_mock(),
GetOnAppInterfaceUnregisteredNotificationToMobile(_, _))
- .WillByDefault(Return(::utils::MakeShared<smart_objects::SmartObject>()));
+ .WillByDefault(Return(std::make_shared<smart_objects::SmartObject>()));
// Wait for `ManageMobileCommand` call twice.
// First time in `SendOnLanguageChangeToMobile`
// method, second time in `HandleWrongLanguageApp`.
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(2);
+ EXPECT_CALL(app_manager_, GetRPCService())
+ .WillRepeatedly(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(2);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(1);
hmi_language_handler_->on_event(event);
}
@@ -344,7 +350,8 @@ TEST_F(HmiLanguageHandlerTest, OnUnregisterApp_SUCCESS) {
InitHMIActiveLanguages(hmi_apis::Common_Language::eType::RU_RU,
hmi_apis::Common_Language::eType::RU_RU,
hmi_apis::Common_Language::eType::RU_RU);
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, GetRPCService()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
hmi_language_handler_->on_event(event);
}
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 e5a45c1549..1980ffa100 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
@@ -36,12 +36,13 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
+
#include "application_manager/event_engine/event.h"
namespace test {
@@ -94,7 +95,7 @@ class CommandRequestTest : public CommandsTest<kIsNice> {
MessageSharedPtr CatchMobileCommandResult(CallableT delegate,
bool call_return = true) {
MessageSharedPtr result_msg;
- EXPECT_CALL(this->app_mngr_, ManageMobileCommand(_, _))
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return)));
delegate();
return result_msg;
@@ -104,7 +105,7 @@ class CommandRequestTest : public CommandsTest<kIsNice> {
MessageSharedPtr CatchHMICommandResult(CallableT delegate,
bool call_return = true) {
MessageSharedPtr result_msg;
- EXPECT_CALL(this->app_mngr_, ManageHMICommand(_))
+ EXPECT_CALL(this->mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return)));
delegate();
return result_msg;
diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
index 553126091f..9a961ea1a9 100644
--- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
@@ -36,15 +36,18 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application_manager.h"
#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
+#include "application_manager/test/include/application_manager/mock_hmi_interface.h"
+#include "application_manager/test/include/application_manager/mock_application.h"
+#include "application_manager/test/include/application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_rpc_service.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
namespace test {
namespace components {
namespace commands_test {
@@ -57,7 +60,6 @@ using ::testing::NiceMock;
using ::testing::Mock;
using ::testing::_;
-using ::utils::SharedPtr;
using ::smart_objects::SmartObject;
using am::commands::MessageSharedPtr;
using ::test::components::application_manager_test::MockApplicationManager;
@@ -94,13 +96,14 @@ class CommandsTest : public ::testing::Test {
enum { kMocksAreNice = kIsNice };
typedef NiceMock<MockApplicationManagerSettings> MockAppManagerSettings;
+ typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
typedef typename TypeIf<kIsNice,
NiceMock<MockApplicationManager>,
MockApplicationManager>::Result MockAppManager;
typedef typename TypeIf<kIsNice,
NiceMock<MockApplication>,
MockApplication>::Result MockApp;
- typedef SharedPtr<MockApp> MockAppPtr;
+ typedef std::shared_ptr<MockApp> MockAppPtr;
virtual ~CommandsTest() {
Mock::VerifyAndClearExpectations(&mock_message_helper_);
@@ -108,50 +111,65 @@ class CommandsTest : public ::testing::Test {
static MessageSharedPtr CreateMessage(
const smart_objects::SmartType type = smart_objects::SmartType_Null) {
- return ::utils::MakeShared<SmartObject>(type);
+ return std::make_shared<SmartObject>(type);
}
static MockAppPtr CreateMockApp() {
- return ::utils::MakeShared<MockApp>();
+ return std::make_shared<MockApp>();
}
template <class Command>
- SharedPtr<Command> CreateCommand(const uint32_t timeout,
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateCommand(const uint32_t timeout,
+ MessageSharedPtr& msg) {
InitCommand(timeout);
- return ::utils::MakeShared<Command>((msg ? msg : msg = CreateMessage()),
- app_mngr_);
+ return std::make_shared<Command>((msg ? msg : msg = CreateMessage()),
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
}
template <class Command>
- SharedPtr<Command> CreateCommand(MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) {
return CreateCommand<Command>(kDefaultTimeout_, msg);
}
template <class Command>
- SharedPtr<Command> CreateCommand(const uint32_t timeout = kDefaultTimeout_) {
+ std::shared_ptr<Command> CreateCommand(
+ const uint32_t timeout = kDefaultTimeout_) {
InitCommand(timeout);
MessageSharedPtr msg = CreateMessage();
- return ::utils::MakeShared<Command>(msg, app_mngr_);
+ return std::make_shared<Command>(msg,
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
}
enum { kDefaultTimeout_ = 100 };
MockAppManager app_mngr_;
+ MockRPCService mock_rpc_service_;
+ testing::NiceMock<application_manager_test::MockHMICapabilities>
+ mock_hmi_capabilities_;
+ testing::NiceMock<policy_test::MockPolicyHandlerInterface>
+ mock_policy_handler_;
MockAppManagerSettings app_mngr_settings_;
MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
am::MockMessageHelper& mock_message_helper_;
protected:
virtual void InitCommand(const uint32_t& timeout) {
+ timeout_ = timeout;
ON_CALL(app_mngr_, get_settings())
.WillByDefault(ReturnRef(app_mngr_settings_));
ON_CALL(app_mngr_settings_, default_timeout())
- .WillByDefault(ReturnRef(timeout));
+ .WillByDefault(ReturnRef(timeout_));
}
CommandsTest()
- : mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) {
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
+ , timeout_(0) {
ON_CALL(app_mngr_, hmi_interfaces())
.WillByDefault(ReturnRef(mock_hmi_interfaces_));
ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
@@ -209,6 +227,9 @@ class CommandsTest : public ::testing::Test {
MobileResult::DATA_NOT_AVAILABLE);
link_hmi_to_mob_result(HMIResult::READ_ONLY, MobileResult::READ_ONLY);
}
+
+ private:
+ uint32_t timeout_;
};
MATCHER_P(MobileResultCodeIs, result_code, "") {
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index 5bf2f2368e..fe16e8ce6e 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -38,6 +38,7 @@
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/usage_statistics.h"
+#include "utils/semantic_version.h"
namespace test {
namespace components {
@@ -50,9 +51,6 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(curHash, const std::string&());
MOCK_METHOD0(UpdateHash, void());
- DEPRECATED MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
- DEPRECATED MOCK_METHOD1(set_flag_sending_hash_change_after_awake,
- void(bool flag));
MOCK_CONST_METHOD0(IsHashChangedDuringSuspend, bool());
MOCK_METHOD1(SetHashChangedDuringSuspend, void(const bool flag));
MOCK_CONST_METHOD0(is_application_data_changed, bool());
@@ -106,16 +104,22 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType());
MOCK_CONST_METHOD0(audio_streaming_state,
const mobile_apis::AudioStreamingState::eType());
+ MOCK_CONST_METHOD0(video_streaming_state,
+ const mobile_apis::VideoStreamingState::eType());
MOCK_CONST_METHOD0(app_icon_path, const std::string&());
MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
+ MOCK_CONST_METHOD0(secondary_device, connection_handler::DeviceHandle());
MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(IsAllowedToChangeAudioSource, bool());
MOCK_CONST_METHOD0(PostponedHmiState,
const application_manager::HmiStatePtr());
MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
MOCK_METHOD0(tts_properties_in_none, bool());
MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
MOCK_METHOD0(tts_properties_in_full, bool());
+ MOCK_METHOD1(set_keep_context, void(bool keep_context));
+ MOCK_METHOD0(keep_context, bool());
MOCK_METHOD1(set_version,
void(const ::application_manager::Version& version));
MOCK_METHOD1(set_name, void(const custom_str::CustomString& name));
@@ -126,6 +130,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
MOCK_METHOD1(set_app_allowed, void(const bool allowed));
MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
+ MOCK_METHOD1(set_secondary_device,
+ void(connection_handler::DeviceHandle secondary_device));
MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
MOCK_METHOD1(set_grammar_id, void(uint32_t value));
MOCK_METHOD1(
@@ -135,6 +141,10 @@ class MockApplication : public ::application_manager::Application {
::protocol_handler::MajorProtocolVersion());
MOCK_METHOD1(set_is_resuming, void(bool));
MOCK_CONST_METHOD0(is_resuming, bool());
+ MOCK_METHOD1(set_deferred_resumption_hmi_level,
+ void(application_manager::mobile_api::HMILevel::eType level));
+ MOCK_CONST_METHOD0(deferred_resumption_hmi_level,
+ application_manager::mobile_api::HMILevel::eType());
MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file));
MOCK_CONST_METHOD0(getAppFiles, const ::application_manager::AppFilesMap&());
MOCK_METHOD1(UpdateFile, bool(const ::application_manager::AppFile& file));
@@ -148,14 +158,15 @@ class MockApplication : public ::application_manager::Application {
bool(mobile_apis::ButtonName::eType btn_name));
MOCK_METHOD1(UnsubscribeFromButton,
bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type));
- MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type));
- MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type));
MOCK_METHOD0(ResetDataInNone, void());
MOCK_METHOD2(AreCommandLimitsExceeded,
bool(mobile_apis::FunctionID::eType cmd_id,
::application_manager::TLimitSource source));
MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
+ MOCK_METHOD0(help_prompt_manager,
+ ::application_manager::HelpPromptManager&());
+ MOCK_CONST_METHOD0(help_prompt_manager,
+ const ::application_manager::HelpPromptManager&());
MOCK_METHOD1(SetInitialState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetPostponedState,
@@ -170,6 +181,7 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
MOCK_CONST_METHOD0(IsAudioApplication, bool());
+ MOCK_CONST_METHOD0(IsVideoApplication, bool());
MOCK_METHOD0(LoadPersistentFiles, void());
// InitialApplicationData methods
MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
@@ -180,6 +192,7 @@ class MockApplication : public ::application_manager::Application {
const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(language, const mobile_apis::Language::eType&());
MOCK_CONST_METHOD0(ui_language, const mobile_apis::Language::eType&());
+ MOCK_CONST_METHOD0(msg_version, const utils::SemanticVersion&());
MOCK_METHOD1(set_app_types,
void(const smart_objects::SmartObject& app_types));
MOCK_METHOD1(set_vr_synonyms,
@@ -192,6 +205,7 @@ class MockApplication : public ::application_manager::Application {
void(const mobile_apis::Language::eType& language));
MOCK_METHOD1(set_ui_language,
void(const mobile_apis::Language::eType& ui_language));
+ MOCK_METHOD1(set_msg_version, void(const utils::SemanticVersion& version));
// DynamicApplicationData methods
MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
@@ -203,12 +217,12 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(
SubscribedButtons,
DataAccessor< ::application_manager::ButtonSubscriptions>());
- MOCK_CONST_METHOD0(
- SubscribedIVI,
- DataAccessor< ::application_manager::VehicleInfoSubscriptions>());
MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(day_color_scheme, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(night_color_scheme, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(display_layout, const std::string&());
MOCK_METHOD1(load_global_properties,
void(const smart_objects::SmartObject& so));
MOCK_METHOD1(set_help_prompt,
@@ -232,6 +246,11 @@ class MockApplication : public ::application_manager::Application {
void(const smart_objects::SmartObject& menu_title));
MOCK_METHOD1(set_menu_icon,
void(const smart_objects::SmartObject& menu_icon));
+ MOCK_METHOD1(set_day_color_scheme,
+ void(const smart_objects::SmartObject& color_scheme));
+ MOCK_METHOD1(set_night_color_scheme,
+ void(const smart_objects::SmartObject& color_scheme));
+ MOCK_METHOD1(set_display_layout, void(const std::string& layout));
MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t());
MOCK_METHOD1(set_audio_stream_retry_number,
void(const uint32_t& audio_stream_retry_number));
@@ -297,7 +316,6 @@ class MockApplication : public ::application_manager::Application {
SwapMobileMessageQueue,
void(::application_manager::MobileMessageQueue& mobile_messages));
-#ifdef SDL_REMOTE_CONTROL
MOCK_METHOD1(
set_system_context,
void(const application_manager::mobile_api::SystemContext::eType&));
@@ -320,11 +338,10 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(AddExtension,
bool(application_manager::AppExtensionPtr extention));
MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid));
- MOCK_METHOD0(RemoveExtensions, void());
- MOCK_CONST_METHOD0(SubscribesIVI,
- const application_manager::VehicleInfoSubscriptions&());
-
-#endif // SDL_REMOTE_CONTROL
+ MOCK_CONST_METHOD0(Extensions,
+ const std::list<application_manager::AppExtensionPtr>&());
+ MOCK_CONST_METHOD0(is_remote_control_supported, bool());
+ MOCK_METHOD1(set_remote_control_supported, void(const bool allow));
};
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/include/application_manager/mock_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_command_factory.h
new file mode 100644
index 0000000000..c49b5e7ce2
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_command_factory.h
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
+
+#include <gmock/gmock.h>
+#include "application_manager/command_factory.h"
+#include "application_manager/commands/command.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockCommandFactory : public application_manager::CommandFactory {
+ public:
+ MOCK_METHOD2(CreateCommand,
+ application_manager::CommandSharedPtr(
+ const application_manager::commands::MessageSharedPtr&,
+ application_manager::commands::Command::CommandSource));
+ MOCK_CONST_METHOD2(
+ IsAbleToProcess,
+ bool(const int32_t,
+ const application_manager::commands::Command::CommandSource));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
new file mode 100644
index 0000000000..a415f94d56
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
+#include "gmock/gmock.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using namespace application_manager;
+
+class MockHelpPromptManager : public ::application_manager::HelpPromptManager {
+ public:
+ MockHelpPromptManager() {}
+ MOCK_METHOD3(OnVrCommandAdded,
+ void(uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool should_send_requests));
+ MOCK_METHOD2(OnVrCommandDeleted,
+ void(uint32_t cmd_id, const bool should_send_requests));
+ MOCK_METHOD2(OnSetGlobalPropertiesReceived,
+ void(const smart_objects::SmartObject& msg, bool is_response));
+ MOCK_CONST_METHOD0(GetSendingType, SendingType());
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h
deleted file mode 100644
index cf40d7b98b..0000000000
--- a/src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
-
-#include <gmock/gmock.h>
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/command.h"
-#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
-
-namespace test {
-namespace components {
-namespace application_manager_test {
-
-class MockHMICommandFactory {
- public:
- MOCK_METHOD2(CreateCommand,
- utils::SharedPtr<application_manager::commands::Command>(
- const utils::SharedPtr<smart_objects::SmartObject>&,
- application_manager::ApplicationManager&));
-
- static MockHMICommandFactory* mock_hmi_command_factory();
-};
-
-} // namespace application_manager_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index 93db0d9795..84a3b6bc87 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
@@ -46,6 +46,12 @@ namespace application_manager {
class MockMessageHelper {
public:
+ MOCK_METHOD2(CreateNotification,
+ smart_objects::SmartObjectSPtr(mobile_apis::FunctionID::eType,
+ uint32_t));
+ MOCK_METHOD1(CreateHMINotification,
+ smart_objects::SmartObjectSPtr(hmi_apis::FunctionID::eType));
+
MOCK_METHOD1(GetHashUpdateNotification,
smart_objects::SmartObjectSPtr(const uint32_t app_id));
MOCK_METHOD2(SendHashUpdateNotification,
@@ -119,6 +125,9 @@ class MockMessageHelper {
ApplicationManager& application_manager,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority));
+ MOCK_METHOD2(CreateMessageForHMI,
+ smart_objects::SmartObjectSPtr(hmi_apis::messageType::eType,
+ const uint32_t));
MOCK_METHOD2(SendHMIStatusNotification,
void(const Application& application_impl,
ApplicationManager& application_manager));
@@ -174,8 +183,10 @@ class MockMessageHelper {
MOCK_METHOD1(CreateAddVRCommandRequestFromChoiceToHMI,
smart_objects::SmartObjectList(ApplicationConstSharedPtr app));
MOCK_METHOD1(SendGlobalPropertiesToHMI, void(ApplicationConstSharedPtr app));
- MOCK_METHOD1(GetIVISubscriptionRequests,
- smart_objects::SmartObjectList(ApplicationSharedPtr app));
+ MOCK_METHOD3(VerifyTtsFiles,
+ mobile_apis::Result::eType(smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
MOCK_METHOD3(VerifyImageFiles,
mobile_apis::Result::eType(smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
@@ -184,6 +195,9 @@ class MockMessageHelper {
mobile_apis::Result::eType(smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr));
+ MOCK_METHOD1(CheckChoiceSetVRCommands,
+ MessageHelper::ChoiceSetVRCommandsStatus(
+ const smart_objects::SmartObject&));
MOCK_METHOD6(GetBCActivateAppRequestToHMI,
smart_objects::SmartObjectSPtr(
@@ -194,7 +208,7 @@ class MockMessageHelper {
bool send_policy_priority,
ApplicationManager& app_mngr));
MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile,
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr(
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr(
int32_t connection_key,
mobile_apis::AppInterfaceUnregisteredReason::eType reason));
MOCK_METHOD4(ProcessSoftButtons,
@@ -225,6 +239,12 @@ class MockMessageHelper {
MOCK_METHOD2(SendUIChangeRegistrationRequestToHMI,
void(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr));
+ MOCK_METHOD5(CreateDeviceInfo,
+ bool(connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output));
MOCK_METHOD5(CreateHMIApplicationStruct,
bool(ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
@@ -288,10 +308,6 @@ class MockMessageHelper {
void(mobile_apis::ButtonName::eType button,
ApplicationSharedPtr application,
ApplicationManager& app_mngr));
- MOCK_METHOD3(SendUnsubscribeIVIRequest,
- void(int32_t ivi_id,
- ApplicationSharedPtr application,
- ApplicationManager& app_mngr));
static MockMessageHelper* message_helper_mock();
};
diff --git a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
index fb264b7d82..0fa7a898be 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
@@ -50,13 +50,21 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
MOCK_METHOD0(OnSuspend, void());
MOCK_METHOD0(OnIgnitionOff, void());
MOCK_METHOD0(OnAwake, void());
+ MOCK_CONST_METHOD0(LowVoltageTime, time_t());
+ MOCK_CONST_METHOD0(WakeUpTime, time_t());
+ MOCK_METHOD0(SaveLowVoltageTime, void());
+ MOCK_METHOD0(SaveWakeUpTime, void());
+ MOCK_METHOD0(ResetLowVoltageTime, void());
+ MOCK_METHOD0(ResetWakeUpTime, void());
MOCK_CONST_METHOD0(is_suspended, bool());
MOCK_METHOD0(StopSavePersistentDataTimer, void());
+ MOCK_METHOD0(StartSavePersistentDataTimer, void());
MOCK_METHOD2(StartResumption,
bool(app_mngr::ApplicationSharedPtr application,
const std::string& hash));
MOCK_METHOD1(StartResumptionOnlyHMILevel,
bool(app_mngr::ApplicationSharedPtr application));
+ MOCK_METHOD1(RetryResumption, void(const uint32_t app_id));
MOCK_METHOD1(CheckPersistenceFilesForResumption,
bool(app_mngr::ApplicationSharedPtr application));
MOCK_METHOD2(CheckApplicationHash,
@@ -95,7 +103,8 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
#ifdef BUILD_TESTS
MOCK_METHOD1(set_resumption_storage,
- void(utils::SharedPtr<resumption::ResumptionData> mock_storage));
+ void(std::shared_ptr<resumption::ResumptionData> mock_storage));
+ MOCK_CONST_METHOD0(get_resumption_active, bool());
#endif // BUILD_TESTS
};
diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
index cfec034653..38d1944dba 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
@@ -66,6 +66,10 @@ class MockResumptionData : public ::resumption::ResumptionData {
const std::string& device_id,
std::string& hash_id));
MOCK_METHOD0(OnAwake, void());
+ MOCK_METHOD0(IncrementGlobalIgnOnCounter, void());
+ MOCK_CONST_METHOD0(GetGlobalIgnOnCounter, uint32_t());
+ MOCK_METHOD0(ResetGlobalIgnOnCount, void());
+
MOCK_METHOD0(DecrementIgnOffCount, void());
MOCK_CONST_METHOD3(GetSavedApplication,
bool(const std::string& policy_app_id,
diff --git a/src/components/application_manager/test/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
index 436c8c165e..4e614c4d9f 100644
--- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
@@ -39,6 +39,7 @@
#include "application_manager/usage_statistics.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_app_extension.h"
#include "utils/data_accessor.h"
#include "config_profile/profile.h"
#include "application_manager/policies/policy_handler.h"
@@ -68,12 +69,17 @@ class ResumptionDataTest : public ::testing::Test {
, kCountOfSubmenues_(3u)
, kCountOfFiles_(8u)
, kCountOfVrhelptitle_(2u)
- , kMacAddress_("12345") {}
+ , kMacAddress_("12345")
+ , sublock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , comlock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , setlock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , btnlock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , ivilock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
// Check structure in saved application
void CheckSavedApp(sm::SmartObject& saved_data);
// Set data for resumption
virtual void PrepareData();
- utils::SharedPtr<NiceMock<application_manager_test::MockApplication> >
+ std::shared_ptr<NiceMock<application_manager_test::MockApplication> >
app_mock;
profile::Profile profile_;
@@ -119,7 +125,8 @@ class ResumptionDataTest : public ::testing::Test {
void CheckMenuIcon(sm::SmartObject& res_list);
void CheckHelpPrompt(sm::SmartObject& res_list);
void CheckTimeoutPrompt(sm::SmartObject& res_list);
- void CheckVRHelp(NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list);
+ void CheckVRHelp(
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list);
void CheckVRTitle(sm::SmartObject& res_list);
void CheckSubscriptions(sm::SmartObject& res_list);
@@ -137,16 +144,18 @@ class ResumptionDataTest : public ::testing::Test {
am::AppFilesMap app_files_map_;
am::ButtonSubscriptions btn_subscr;
- am::VehicleInfoSubscriptions ivi;
- sync_primitives::Lock sublock_;
- sync_primitives::Lock comlock_;
- sync_primitives::Lock setlock_;
- sync_primitives::Lock btnlock_;
- sync_primitives::Lock ivilock_;
+ std::shared_ptr<sync_primitives::Lock> sublock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> comlock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> setlock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> btnlock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> ivilock_ptr_;
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
application_manager_test::MockApplicationManager mock_application_manager_;
+ std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> >
+ mock_app_extension_;
+ std::list<application_manager::AppExtensionPtr> extensions_;
};
} // namespace resumption_test
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt
index 8ebb2dea0e..d115ad8b40 100755
--- a/src/components/application_manager/test/message_helper/CMakeLists.txt
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt
@@ -47,13 +47,6 @@ set(LIBRARIES
Utils
)
-if(REMOTE_CONTROL)
- SET (LIBRARIES
- FunctionalModule
- ${LIBRARIES}
- )
-endif(REMOTE_CONTROL)
-
set(SOURCES
${COMPONENTS_DIR}/application_manager/test/message_helper/message_helper_test.cc
)
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 289e4f5d05..15a09c33cc 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
@@ -35,13 +35,16 @@
#include "gmock/gmock.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
+
#include "application_manager/policies/policy_handler.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "utils/custom_string.h"
+#include "utils/lock.h"
#include "policy/mock_policy_settings.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
@@ -60,9 +63,9 @@ namespace MobileResults = mobile_apis::Result;
using namespace application_manager;
-typedef utils::SharedPtr<MockApplication> MockApplicationSharedPtr;
+typedef std::shared_ptr<MockApplication> MockApplicationSharedPtr;
typedef std::vector<std::string> StringArray;
-typedef utils::SharedPtr<application_manager::Application> ApplicationSharedPtr;
+typedef std::shared_ptr<application_manager::Application> ApplicationSharedPtr;
using testing::AtLeast;
using testing::ReturnRefOfCopy;
@@ -84,7 +87,7 @@ TEST(MessageHelperTestCreate,
application_manager::MessageHelper::CreateBlockedByPoliciesResponse(
function_id, result, correlation_id, connection_key);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -106,7 +109,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) {
smart_objects::SmartObjectSPtr ptr =
MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -125,7 +128,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) {
smart_objects::SmartObjectSPtr ptr =
MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -140,12 +143,19 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) {
TEST(MessageHelperTestCreate,
CreateGlobalPropertiesRequestsToHMI_SmartObject_EmptyList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
EXPECT_CALL(*appSharedMock, vr_help_title()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, vr_help()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, help_prompt()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, timeout_prompt()).Times(AtLeast(1));
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager =
+ std::make_shared<MockHelpPromptManager>();
+ EXPECT_CALL(*appSharedMock, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager));
+ EXPECT_CALL(*mock_help_prompt_manager, GetSendingType())
+ .WillRepeatedly(Return(HelpPromptManager::SendingType::kSendBoth));
+
smart_objects::SmartObjectList ptr =
MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
@@ -154,9 +164,9 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
smart_objects::SmartObjectSPtr objPtr =
- MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*objPtr)[0][strings::vr_help_title] = "111";
(*objPtr)[1][strings::vr_help] = "222";
@@ -189,6 +199,13 @@ TEST(MessageHelperTestCreate,
.WillRepeatedly(Return(&(*objPtr)[4]));
EXPECT_CALL(*appSharedMock, app_id()).WillRepeatedly(Return(0));
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager =
+ std::make_shared<MockHelpPromptManager>();
+ EXPECT_CALL(*appSharedMock, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager));
+ EXPECT_CALL(*mock_help_prompt_manager, GetSendingType())
+ .WillRepeatedly(Return(HelpPromptManager::SendingType::kSendBoth));
+
smart_objects::SmartObjectList ptr =
MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
@@ -208,10 +225,10 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
const smart_objects::SmartObject& object = *smartObjectPtr;
@@ -234,9 +251,10 @@ TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
TEST(MessageHelperTestCreate,
CreateAddCommandRequestToHMI_SendSmartObject_Empty) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
::application_manager::CommandsMap vis;
- DataAccessor<application_manager::CommandsMap> data_accessor(vis, true);
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, commands_map()).WillOnce(Return(data_accessor));
application_manager_test::MockApplicationManager mock_application_manager;
@@ -249,11 +267,12 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddCommandRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
CommandsMap vis;
- DataAccessor<CommandsMap> data_accessor(vis, true);
+ DataAccessor<CommandsMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -290,9 +309,10 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::ChoiceSetMap vis;
- DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, choice_set_map()).WillOnce(Return(data_accessor));
application_manager_test::MockApplicationManager mock_application_manager;
@@ -305,11 +325,12 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::ChoiceSetMap vis;
- DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -351,11 +372,12 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::SubMenuMap vis;
- DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::SubMenuMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -390,9 +412,10 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
TEST(MessageHelperTestCreate,
CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::SubMenuMap vis;
- DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::SubMenuMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, sub_menu_map()).WillOnce(Return(data_accessor));
@@ -412,7 +435,7 @@ TEST(MessageHelperTestCreate, CreateNegativeResponse_SendSmartObject_Equal) {
smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateNegativeResponse(
connection_key, function_id, correlation_id, result_code);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -571,6 +594,7 @@ class MessageHelperTest : public ::testing::Test {
protected:
application_manager_test::MockApplicationManager mock_application_manager;
+ application_manager_test::MockRPCService mock_rpc_service_;
const StringArray language_strings;
const StringArray hmi_result_strings;
const StringArray mobile_result_strings;
@@ -691,7 +715,7 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_WrongStrings_False) {
"soft_button1\\n",
"soft_button1\\t"};
for (size_t i = 0; i < wrong_strings.size(); ++i) {
- EXPECT_FALSE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ EXPECT_FALSE(MessageHelper::VerifyString(wrong_strings[i]));
}
}
@@ -702,33 +726,14 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_CorrectStrings_True) {
"soft_button1??....asd",
"soft_button12313fcvzxc./.,"};
for (size_t i = 0; i < wrong_strings.size(); ++i) {
- EXPECT_TRUE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ EXPECT_TRUE(MessageHelper::VerifyString(wrong_strings[i]));
}
}
TEST_F(MessageHelperTest,
- GetIVISubscriptionRequests_ValidApplication_HmiRequestNotEmpty) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
- // Creating data acessor
- application_manager::VehicleInfoSubscriptions vis;
- DataAccessor<application_manager::VehicleInfoSubscriptions> data_accessor(
- vis, true);
- // Calls for ApplicationManager
- EXPECT_CALL(*appSharedMock, app_id()).WillOnce(Return(1u));
- EXPECT_CALL(*appSharedMock, SubscribedIVI()).WillOnce(Return(data_accessor));
-
- smart_objects::SmartObjectList outList =
- MessageHelper::GetIVISubscriptionRequests(appSharedMock,
- mock_application_manager);
- // Expect not empty request
- EXPECT_FALSE(outList.empty());
-}
-
-TEST_F(MessageHelperTest,
ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
policy_handler_test::MockPolicySettings policy_settings_;
@@ -743,8 +748,8 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
ProcessSoftButtons_IncorectSoftButonValue_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
smart_objects::SmartObject& buttons = object[strings::soft_buttons];
@@ -761,11 +766,12 @@ TEST_F(MessageHelperTest,
}
TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::STATIC;
+ image[strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImage(
image, appSharedMock, mock_application_manager);
@@ -774,8 +780,8 @@ TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
}
TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -789,42 +795,44 @@ TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
}
TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageTypeIsStatic_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::STATIC;
image[strings::value] = "icon.png";
// Method call
- mobile_apis::Result::eType result = MessageHelper::VerifyImageApplyPath(
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
image, appSharedMock, mock_application_manager);
- // EXPECT
EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+ // EXPECT
EXPECT_EQ("icon.png", image[strings::value].asString());
}
TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageValueNotValid_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
// Invalid value
image[strings::value] = " ";
// Method call
- mobile_apis::Result::eType result = MessageHelper::VerifyImageApplyPath(
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
image, appSharedMock, mock_application_manager);
// EXPECT
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::STATIC;
images[1][strings::image_type] = mobile_apis::ImageType::STATIC;
+ images[0][strings::value] = "static_icon";
+ images[1][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles(
images, appSharedMock, mock_application_manager);
@@ -834,8 +842,8 @@ TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
TEST_F(MessageHelperTest,
VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -852,14 +860,17 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
mobile_apis::ImageType::STATIC;
message[1][strings::image][strings::image_type] =
mobile_apis::ImageType::STATIC;
+
+ message[0][strings::image][strings::value] = "static_icon";
+ message[1][strings::image][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems(
message, appSharedMock, mock_application_manager);
@@ -869,8 +880,8 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
@@ -931,7 +942,7 @@ TEST_F(MessageHelperTest, StringToHmiLevel_LevelString_EqEType) {
TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) {
// Create application mock
- MockApplicationSharedPtr appSharedPtr = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedPtr = std::make_shared<MockApplication>();
// Prepare data for method
smart_objects::SmartObject message_params;
size_t function_id = 1;
@@ -950,7 +961,10 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
permissions.push_back(permission);
smart_objects::SmartObjectSPtr result;
- EXPECT_CALL(mock_application_manager, ManageHMICommand(_))
+
+ ON_CALL(mock_application_manager, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const uint32_t correlation_id = 0u;
@@ -959,7 +973,7 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
correlation_id,
mock_application_manager);
- ASSERT_TRUE(result);
+ ASSERT_TRUE(result.get());
EXPECT_EQ(hmi_apis::FunctionID::SDL_GetListOfPermissions,
(*result)[strings::params][strings::function_id].asInt());
@@ -987,7 +1001,10 @@ TEST_F(MessageHelperTest,
entity_type_2, entity_id_2, entity_status_2));
smart_objects::SmartObjectSPtr result;
- EXPECT_CALL(mock_application_manager, ManageHMICommand(_))
+
+ ON_CALL(mock_application_manager, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
const uint32_t correlation_id = 0u;
@@ -996,7 +1013,7 @@ TEST_F(MessageHelperTest,
correlation_id,
mock_application_manager);
- ASSERT_TRUE(result);
+ ASSERT_TRUE(result.get());
smart_objects::SmartObject& msg_params = (*result)[strings::msg_params];
const std::string external_consent_status_key = "externalConsentStatus";
@@ -1031,7 +1048,9 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
smart_objects::SmartObjectSPtr result;
- EXPECT_CALL(mock_application_manager, ManageHMICommand(_))
+ ON_CALL(mock_application_manager, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
int32_t app_id = 123;
diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc
index 2fe28d8249..23957b61fb 100644
--- a/src/components/application_manager/test/mobile_message_handler_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_test.cc
@@ -41,7 +41,6 @@
#include "gmock/gmock.h"
#include "application_manager/message.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
namespace test {
namespace components {
@@ -106,12 +105,12 @@ class MobileMessageHandlerTest : public testing::Test {
size_t full_size = sizeof(uint8_t) * full_data.size();
- message_ptr_ = utils::MakeShared<RawMessage>(connection_key_,
- protocol_version,
- &full_data[0],
- full_size,
- ServiceType::kRpc,
- payload_size);
+ message_ptr_ = std::make_shared<RawMessage>(connection_key_,
+ protocol_version,
+ &full_data[0],
+ full_size,
+ ServiceType::kRpc,
+ payload_size);
return MobileMessageHandler::HandleIncomingMessageProtocol(message_ptr_);
}
@@ -170,7 +169,7 @@ class MobileMessageHandlerTest : public testing::Test {
uint32_t connection_key,
const std::string& json_msg,
const application_manager::BinaryData* data = NULL) {
- MobileMessage message = utils::MakeShared<Message>(
+ MobileMessage message = std::make_shared<Message>(
MessagePriority::FromServiceType(ServiceType::kRpc));
message->set_function_id(function_id);
message->set_correlation_id(correlation_id);
@@ -254,7 +253,7 @@ class MobileMessageHandlerTest : public testing::Test {
TEST(mobile_message_test, basic_test) {
// Example message
MobileMessage message =
- utils::MakeShared<Message>(protocol_handler::MessagePriority::kDefault);
+ std::make_shared<Message>(protocol_handler::MessagePriority::kDefault);
EXPECT_FALSE(message->has_binary_data());
application_manager::BinaryData binary_data;
binary_data.push_back('X');
diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
index a19ea991b9..5cbc28b20c 100644
--- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
@@ -40,7 +40,6 @@
#include "gmock/gmock.h"
#include "application_manager/message.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
using protocol_handler::RawMessage;
using protocol_handler::RawMessagePtr;
@@ -70,7 +69,7 @@ const unsigned char* data_v1 =
TEST(MobileMessageHandlerTestV1Test,
HandleIncomingMessageProtocolV1_SendJSONData_ExpectEqual) {
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key_p1, protocol_version_1, data_v1, data_json.length());
application_manager::Message* ptr =
@@ -90,7 +89,7 @@ TEST(MobileMessageHandlerTestV1Test,
const unsigned char* data_v1 =
reinterpret_cast<const unsigned char*>(full_data.c_str());
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key_p1, protocol_version_1, data_v1, full_data.length());
application_manager::Message* ptr =
@@ -108,7 +107,7 @@ TEST(MobileMessageHandlerTestV1Test,
uint32_t connection_key = 1;
application_manager::MobileMessage message =
- utils::MakeShared<application_manager::Message>(
+ std::make_shared<application_manager::Message>(
protocol_handler::MessagePriority::kDefault);
message->set_protocol_version(
diff --git a/src/components/application_manager/test/mock_hmi_command_factory.cc b/src/components/application_manager/test/mock_hmi_command_factory.cc
index c2b4644f86..375da26067 100644
--- a/src/components/application_manager/test/mock_hmi_command_factory.cc
+++ b/src/components/application_manager/test/mock_hmi_command_factory.cc
@@ -31,7 +31,7 @@
*/
#include <gmock/gmock.h>
-#include "application_manager/hmi_command_factory.h"
+#include "application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h"
#include "application_manager/mock_hmi_command_factory.h"
namespace test {
@@ -47,10 +47,11 @@ MockHMICommandFactory* MockHMICommandFactory::mock_hmi_command_factory() {
} // components
} // test
-namespace application_manager {
-CommandSharedPtr HMICommandFactory::CreateCommand(
- const commands::MessageSharedPtr& message,
- ApplicationManager& application_manager) {
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+app_mngr::CommandSharedPtr HMICommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager) {
return test::components::application_manager_test::MockHMICommandFactory::
mock_hmi_command_factory()->CreateCommand(message, application_manager);
}
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 24bba63e71..f091e183dc 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -39,6 +39,18 @@
namespace application_manager {
+smart_objects::SmartObjectSPtr MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id) {
+ return MockMessageHelper::message_helper_mock()->CreateNotification(
+ function_id, app_id);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateHMINotification(
+ hmi_apis::FunctionID::eType function_id) {
+ return MockMessageHelper::message_helper_mock()->CreateHMINotification(
+ function_id);
+}
+
void MessageHelper::SendHashUpdateNotification(uint32_t const app_id,
ApplicationManager& app_mngr) {
MockMessageHelper::message_helper_mock()->SendHashUpdateNotification(
@@ -230,7 +242,6 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path,
file_path, timeout, retries, app_mngr);
}
-#ifdef SDL_REMOTE_CONTROL
void MessageHelper::SendActivateAppToHMI(
uint32_t const app_id,
ApplicationManager& application_manager,
@@ -240,6 +251,12 @@ void MessageHelper::SendActivateAppToHMI(
app_id, application_manager, level, send_policy_priority);
}
+smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
+ hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
+ return MockMessageHelper::message_helper_mock()->CreateMessageForHMI(
+ message_type, correlation_id);
+}
+
void MessageHelper::SendHMIStatusNotification(
const Application& application_impl,
ApplicationManager& application_manager) {
@@ -247,8 +264,6 @@ void MessageHelper::SendHMIStatusNotification(
application_impl, application_manager);
}
-#endif // SDL_REMOTE_CONTROL
-
void MessageHelper::SendUpdateSDLResponse(const std::string& result,
uint32_t correlation_id,
ApplicationManager& app_mngr) {
@@ -309,10 +324,12 @@ void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
app);
}
-smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
- ApplicationSharedPtr app, ApplicationManager& app_mngr) {
- return MockMessageHelper::message_helper_mock()->GetIVISubscriptionRequests(
- app);
+mobile_apis::Result::eType MessageHelper::VerifyTtsFiles(
+ smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->VerifyTtsFiles(
+ message, app, app_mngr);
}
mobile_apis::Result::eType MessageHelper::VerifyImage(
@@ -323,6 +340,13 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
message, app, app_mngr);
}
+MessageHelper::ChoiceSetVRCommandsStatus
+MessageHelper::CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set) {
+ return MockMessageHelper::message_helper_mock()->CheckChoiceSetVRCommands(
+ choice_set);
+}
+
mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
@@ -352,7 +376,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
app_mngr);
}
-NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr
+ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
int32_t connection_key,
mobile_apis::AppInterfaceUnregisteredReason::eType reason) {
@@ -418,6 +442,16 @@ void MessageHelper::SendUIChangeRegistrationRequestToHMI(
->SendUIChangeRegistrationRequestToHMI(app, app_mngr);
}
+bool MessageHelper::CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output) {
+ return MockMessageHelper::message_helper_mock()->CreateDeviceInfo(
+ device_handle, session_observer, policy_handler, app_mngr, output);
+}
+
bool MessageHelper::CreateHMIApplicationStruct(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
@@ -538,11 +572,4 @@ void MessageHelper::SendUnsubscribeButtonNotification(
->SendUnsubscribeButtonNotification(button, application, app_mngr);
}
-void MessageHelper::SendUnsubscribeIVIRequest(int32_t ivi_id,
- ApplicationSharedPtr application,
- ApplicationManager& app_mngr) {
- return MockMessageHelper::message_helper_mock()->SendUnsubscribeIVIRequest(
- ivi_id, application, app_mngr);
-}
-
} // namespace application_manager
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index d9e1cefa01..a1471eff36 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -53,13 +53,13 @@
#include "json/value.h"
#include "smart_objects/smart_object.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
+
#include "utils/custom_string.h"
#include "policy/usage_statistics/counter.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_settings.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol_handler/mock_session_observer.h"
@@ -69,6 +69,7 @@
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_state_controller.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_rpc_service.h"
#include "policy/mock_policy_manager.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
@@ -90,6 +91,8 @@ using ::testing::DoAll;
using ::testing::SetArgReferee;
using ::testing::Mock;
+typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
+
const std::string kDummyData = "some_data";
class PolicyHandlerTest : public ::testing::Test {
@@ -105,7 +108,8 @@ class PolicyHandlerTest : public ::testing::Test {
, default_hmi_("fake_hmi")
, kPreloadPTFile_("sdl_preloaded_pt.json")
, kAppStorageFolder_("storage")
- , app_set(test_app, app_lock)
+ , app_lock_(std::make_shared<sync_primitives::Lock>())
+ , app_set(test_app, app_lock_)
, kAppId1_(10u)
, kAppId2_(11u)
, kConnectionKey_(1u)
@@ -130,14 +134,14 @@ class PolicyHandlerTest : public ::testing::Test {
protected:
NiceMock<MockPolicySettings> policy_settings_;
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
connection_handler_test::MockConnectionHandler conn_handler;
protocol_handler_test::MockSessionObserver mock_session_observer;
application_manager_test::MockStateController mock_state_controller;
components::usage_statistics_test::MockStatisticsManager
mock_statistics_manager_;
PolicyHandler policy_handler_;
- utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ std::shared_ptr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
application_manager_test::MockApplicationManager app_manager_;
const std::string kPolicyAppId_;
const std::string kMacAddr_;
@@ -149,7 +153,7 @@ class PolicyHandlerTest : public ::testing::Test {
const std::string kPreloadPTFile_;
const std::string kAppStorageFolder_;
ApplicationSet test_app;
- sync_primitives::Lock app_lock;
+ std::shared_ptr<sync_primitives::Lock> app_lock_;
DataAccessor<ApplicationSet> app_set;
const uint32_t kAppId1_;
const uint32_t kAppId2_;
@@ -164,6 +168,7 @@ class PolicyHandlerTest : public ::testing::Test {
const uint32_t kCallsCount_;
const uint32_t kTimeout_;
application_manager::MockMessageHelper& mock_message_helper_;
+ MockRPCService mock_rpc_service_;
virtual void SetUp() OVERRIDE {
Mock::VerifyAndClearExpectations(&mock_message_helper_);
@@ -174,15 +179,15 @@ class PolicyHandlerTest : public ::testing::Test {
std::string path = file_system::CreateDirectory("storage");
file_system::CreateFile(path + "/" + "certificate");
mock_policy_manager_ =
- utils::MakeShared<policy_manager_test::MockPolicyManager>();
- ASSERT_TRUE(mock_policy_manager_.valid());
+ std::make_shared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.use_count() != 0);
ON_CALL(app_manager_, connection_handler())
.WillByDefault(ReturnRef(conn_handler));
ON_CALL(conn_handler, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer));
- mock_app_ = utils::MakeShared<application_manager_test::MockApplication>();
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
}
virtual void TearDown() OVERRIDE {
@@ -297,7 +302,7 @@ class WaitAsync {
const uint32_t timeout_;
sync_primitives::ConditionalVariable cond_var_;
};
-}
+} // namespace
TEST_F(PolicyHandlerTest, LoadPolicyLibrary_Method_ExpectLibraryLoaded) {
// Check before policy enabled from ini file
@@ -439,7 +444,7 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_method_With2Parameters) {
}
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(invalid_app));
EXPECT_CALL(mock_message_helper_,
@@ -450,7 +455,7 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
}
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_InvalidApp_UNSUCCESS) {
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(mock_app_))
.WillOnce(Return(invalid_app));
@@ -769,8 +774,8 @@ TEST_F(PolicyHandlerTest, KmsChanged) {
void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
const uint32_t correlation_id) {
- utils::SharedPtr<application_manager_test::MockApplication> application1 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application1 =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, ActivateApplication(_))
.WillRepeatedly(Return(true));
EXPECT_CALL(app_manager_, application(connection_key))
@@ -786,12 +791,12 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
.WillRepeatedly(ReturnRef(conn_handler));
EXPECT_CALL(conn_handler, get_session_observer())
.WillOnce(ReturnRef(mock_session_observer));
- utils::SharedPtr<usage_statistics_test::MockStatisticsManager>
+ std::shared_ptr<usage_statistics_test::MockStatisticsManager>
mock_statistics_manager =
- utils::MakeShared<usage_statistics_test::MockStatisticsManager>();
+ std::make_shared<usage_statistics_test::MockStatisticsManager>();
UsageStatistics usage_stats(
"0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
mock_statistics_manager));
EXPECT_CALL(*application1, usage_report()).WillOnce(ReturnRef(usage_stats));
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
@@ -834,7 +839,7 @@ TEST_F(PolicyHandlerTest, OnActivateApp) {
TEST_F(PolicyHandlerTest, OnActivateApp_InvalidApp_UNSUCCESS) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application(kConnectionKey_))
.WillOnce(Return(invalid_app));
@@ -854,12 +859,12 @@ TEST_F(PolicyHandlerTest, OnActivateApp_AppIsRevoked_AppNotActivated) {
permissions.appRevoked = true;
#ifdef EXTERNAL_PROPRIETARY_MODE
- utils::SharedPtr<usage_statistics_test::MockStatisticsManager>
+ std::shared_ptr<usage_statistics_test::MockStatisticsManager>
mock_statistics_manager =
- utils::MakeShared<usage_statistics_test::MockStatisticsManager>();
+ std::make_shared<usage_statistics_test::MockStatisticsManager>();
UsageStatistics usage_stats(
"0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
mock_statistics_manager));
EXPECT_CALL(*mock_app_, usage_report()).WillOnce(ReturnRef(usage_stats));
const std::string default_mac = "00:00:00:00:00:00";
@@ -893,8 +898,8 @@ void PolicyHandlerTest::OnPendingPermissionChangePrecondition(
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
@@ -916,7 +921,7 @@ TEST_F(PolicyHandlerTest,
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
- RemovePendingPermissionChanges(kPolicyAppId_)).Times(0);
+ RemovePendingPermissionChanges(kPolicyAppId_));
// Act
policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
}
@@ -954,6 +959,7 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppLimitedAndRevoked) {
SetRegularState(_,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
true));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
@@ -991,8 +997,8 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appUnauthorized = true;
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
- utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr message =
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>();
// Check expectations
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
@@ -1005,8 +1011,10 @@ TEST_F(PolicyHandlerTest,
kAppId1_,
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
.WillOnce(Return(message));
- EXPECT_CALL(app_manager_,
- ManageMobileCommand(_, commands::Command::ORIGIN_SDL));
+ ON_CALL(app_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, commands::Command::SOURCE_SDL));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
@@ -1042,8 +1050,8 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appUnauthorized = true;
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
- utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr message =
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>();
// Check expectations
// Notification won't be sent
EXPECT_CALL(mock_message_helper_,
@@ -1057,8 +1065,10 @@ TEST_F(PolicyHandlerTest,
kAppId1_,
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
.WillOnce(Return(message));
- EXPECT_CALL(app_manager_,
- ManageMobileCommand(_, commands::Command::ORIGIN_SDL));
+ ON_CALL(app_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, commands::Command::SOURCE_SDL));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
@@ -1158,8 +1168,8 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
EXPECT_CALL(app_manager_, connection_handler())
@@ -1261,8 +1271,8 @@ TEST_F(PolicyHandlerTest, GetAppName) {
// Check expectations
const CustomString app_name("my_mobile_app");
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*application, name()).WillOnce(ReturnRef(app_name));
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
@@ -1299,8 +1309,8 @@ TEST_F(PolicyHandlerTest, SendOnAppPermissionsChanged) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
// Check expectations
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
@@ -1327,7 +1337,7 @@ TEST_F(PolicyHandlerTest, AddApplication) {
EXPECT_CALL(
*mock_policy_manager_,
AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)))
- .WillOnce(Return(utils::MakeShared<utils::CallNothing>()));
+ .WillOnce(Return(std::make_shared<utils::CallNothing>()));
// Act
policy_handler_.AddApplication(kPolicyAppId_,
HmiTypes(policy_table::AHT_DEFAULT));
@@ -1377,10 +1387,30 @@ TEST_F(PolicyHandlerTest, IsRequestTypeAllowed) {
mobile_apis::RequestType::eType type =
mobile_apis::RequestType::eType::EMERGENCY;
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypesState(kPolicyAppId_))
+ .WillOnce(Return(policy::RequestType::State::AVAILABLE));
+
EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(kPolicyAppId_))
- .WillOnce(Return(std::vector<std::string>()));
+ .WillOnce(Return(std::vector<std::string>({"HTTP"})));
+ // Act
+ EXPECT_FALSE(policy_handler_.IsRequestTypeAllowed(kPolicyAppId_, type));
+}
+
+TEST_F(PolicyHandlerTest, IsRequestSubTypeAllowed) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestSubTypesState(kPolicyAppId_))
+ .WillOnce(Return(policy::RequestSubType::State::AVAILABLE));
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestSubTypes(kPolicyAppId_))
+ .WillOnce(
+ Return(std::vector<std::string>({"fakeSubType", "fakeSubType2"})));
+
// Act
- policy_handler_.IsRequestTypeAllowed(kPolicyAppId_, type);
+ const std::string subtype = "fakeSubType";
+ EXPECT_TRUE(policy_handler_.IsRequestSubTypeAllowed(kPolicyAppId_, subtype));
}
TEST_F(PolicyHandlerTest, GetVehicleInfo) {
@@ -1923,8 +1953,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_full =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_in_full =
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_full_id = 1;
EXPECT_CALL(*mock_app_in_full, app_id())
.WillRepeatedly(Return(app_in_full_id));
@@ -1934,9 +1964,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_full);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_limited =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_limited_id = 2;
EXPECT_CALL(*mock_app_in_limited, app_id())
.WillRepeatedly(Return(app_in_limited_id));
@@ -1946,9 +1976,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_limited);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_background =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_background_id = 3;
EXPECT_CALL(*mock_app_in_background, app_id())
.WillRepeatedly(Return(app_in_background_id));
@@ -1958,8 +1988,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_background);
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_none =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_in_none =
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id = 4;
EXPECT_CALL(*mock_app_in_none, app_id())
.WillRepeatedly(Return(app_in_none_id));
@@ -1987,9 +2017,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_none_1 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id_1 = 1;
EXPECT_CALL(*mock_app_in_none_1, app_id())
.WillRepeatedly(Return(app_in_none_id_1));
@@ -1999,9 +2029,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
test_app.insert(mock_app_in_none_1);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_none_2 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id_2 = 2;
EXPECT_CALL(*mock_app_in_none_2, app_id())
.WillRepeatedly(Return(app_in_none_id_2));
@@ -2079,8 +2109,8 @@ TEST_F(PolicyHandlerTest,
// Expected to get 0 as application id so SDL does not have valid application
// with such id
EXPECT_CALL(app_manager_, application(0))
- .WillOnce(Return(
- utils::SharedPtr<application_manager_test::MockApplication>()));
+ .WillOnce(
+ Return(std::shared_ptr<application_manager_test::MockApplication>()));
EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url));
}
@@ -2092,8 +2122,8 @@ TEST_F(PolicyHandlerTest, CanUpdate) {
TEST_F(PolicyHandlerTest, CanUpdate_TwoApplicationForSending_SUCCESS) {
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> second_mock_app =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> second_mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*mock_app_, hmi_level())
.WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc
index 7faf3e36cb..b7caf635c9 100644
--- a/src/components/application_manager/test/rc_policy_handler_test.cc
+++ b/src/components/application_manager/test/rc_policy_handler_test.cc
@@ -46,7 +46,7 @@
#include "json/writer.h"
#include "json/value.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "utils/custom_string.h"
#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_settings.h"
@@ -67,11 +67,11 @@ using namespace application_manager;
using namespace policy;
using namespace utils::custom_string;
using testing::_;
+using ::testing::DoAll;
using ::testing::Mock;
+using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::testing::DoAll;
using ::testing::SetArgPointee;
class RCPolicyHandlerTest : public ::testing::Test {
@@ -83,7 +83,8 @@ class RCPolicyHandlerTest : public ::testing::Test {
, kDeviceId_("fake_device_id")
, kHmiLevel_("NONE")
, default_hmi_("fake_hmi")
- , app_set(test_app, app_lock)
+ , app_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , app_set(test_app, app_lock_ptr_)
, kAppId1_(10u)
, kAppId2_(11u)
, kConnectionKey_(1u)
@@ -93,13 +94,13 @@ class RCPolicyHandlerTest : public ::testing::Test {
protected:
NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
connection_handler_test::MockConnectionHandler conn_handler;
protocol_handler_test::MockSessionObserver mock_session_observer;
components::usage_statistics_test::MockStatisticsManager
mock_statistics_manager_;
PolicyHandler policy_handler_;
- utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ std::shared_ptr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
application_manager_test::MockApplicationManager app_manager_;
const std::string kPolicyAppId_;
const std::string kMacAddr_;
@@ -107,7 +108,7 @@ class RCPolicyHandlerTest : public ::testing::Test {
const std::string kHmiLevel_;
std::string default_hmi_;
ApplicationSet test_app;
- sync_primitives::Lock app_lock;
+ std::shared_ptr<sync_primitives::Lock> app_lock_ptr_;
DataAccessor<ApplicationSet> app_set;
const uint32_t kAppId1_;
const uint32_t kAppId2_;
@@ -121,15 +122,15 @@ class RCPolicyHandlerTest : public ::testing::Test {
ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set));
ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
mock_policy_manager_ =
- utils::MakeShared<policy_manager_test::MockPolicyManager>();
- ASSERT_TRUE(mock_policy_manager_.valid());
+ std::make_shared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.use_count() != 0);
ON_CALL(app_manager_, connection_handler())
.WillByDefault(ReturnRef(conn_handler));
ON_CALL(conn_handler, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer));
- mock_app_ = utils::MakeShared<application_manager_test::MockApplication>();
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
}
virtual void TearDown() OVERRIDE {
@@ -205,7 +206,7 @@ TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControl_SUCCESS) {
TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidApp_UNSUCCESS) {
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(invalid_app));
EXPECT_CALL(mock_message_helper_, StringToHMILevel(_)).Times(0);
@@ -292,7 +293,7 @@ TEST_F(RCPolicyHandlerTest,
TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_InvalidApp_UNSUCCESS) {
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app));
EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
@@ -378,7 +379,7 @@ TEST_F(RCPolicyHandlerTest, CheckHMIType_ValidTypes_SUCCESS) {
mobile_apis::AppHMIType::eType hmi = mobile_apis::AppHMIType::MEDIA;
const smart_objects::SmartObjectSPtr app_types =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Array);
(*app_types)[strings::app_hmi_type][0] = mobile_apis::AppHMIType::MEDIA;
(*app_types)[strings::app_hmi_type][1] =
diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc
index e053d51c34..112e3c1c39 100644
--- a/src/components/application_manager/test/request_controller/request_controller_test.cc
+++ b/src/components/application_manager/test/request_controller/request_controller_test.cc
@@ -36,12 +36,12 @@
#include "application_manager/request_controller.h"
#include "application_manager/request_info.h"
#include "application_manager/mock_request.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application_manager.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "resumption/last_state.h"
@@ -62,10 +62,11 @@ using ::application_manager::request_controller::RequestInfo;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
+using ::testing::_;
typedef NiceMock<application_manager_test::MockRequest> MRequest;
-typedef utils::SharedPtr<MRequest> RequestPtr;
-typedef utils::SharedPtr<RequestController> RequestControllerSPtr;
+typedef std::shared_ptr<MRequest> RequestPtr;
+typedef std::shared_ptr<RequestController> RequestControllerSPtr;
namespace {
const size_t kNumberOfRequests = 10u;
@@ -104,7 +105,7 @@ class RequestControllerTestClass : public ::testing::Test {
ON_CALL(mock_request_controller_settings_, thread_pool_size())
.WillByDefault(Return(kThreadPoolSize));
request_ctrl_ =
- utils::MakeShared<RequestController>(mock_request_controller_settings_);
+ std::make_shared<RequestController>(mock_request_controller_settings_);
}
RequestPtr GetMockRequest(
@@ -112,8 +113,9 @@ class RequestControllerTestClass : public ::testing::Test {
const uint32_t connection_key = kDefaultConnectionKey,
const uint32_t default_timeout = kDefaultTimeout) {
RequestPtr output =
- utils::MakeShared<MRequest>(connection_key, correlation_id);
+ std::make_shared<MRequest>(connection_key, correlation_id);
ON_CALL(*output, default_timeout()).WillByDefault(Return(default_timeout));
+ ON_CALL(*output, CheckPermissions()).WillByDefault(Return(true));
return output;
}
@@ -159,6 +161,40 @@ class RequestControllerTestClass : public ::testing::Test {
};
TEST_F(RequestControllerTestClass,
+ AddMobileRequest_DuplicateCorrelationId_INVALID_ID) {
+ RequestPtr request_valid = GetMockRequest();
+ TestAsyncWaiter waiter_valid;
+ ON_CALL(*request_valid, default_timeout()).WillByDefault(Return(0));
+ EXPECT_CALL(*request_valid, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*request_valid, Run())
+ .Times(1)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter_valid));
+
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(default_settings_,
+ request_valid,
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_TRUE(waiter_valid.WaitFor(1, 1000));
+
+ // The command should not be run if another command with the same
+ // correlation_id is waiting for a response
+ RequestPtr request_dup_corr_id = GetMockRequest();
+ TestAsyncWaiter waiter_dup;
+ ON_CALL(*request_dup_corr_id, default_timeout()).WillByDefault(Return(0));
+ EXPECT_CALL(*request_dup_corr_id, Init()).WillOnce(Return(true));
+ ON_CALL(*request_dup_corr_id, Run())
+ .WillByDefault(NotifyTestAsyncWaiter(&waiter_dup));
+
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(default_settings_,
+ request_dup_corr_id,
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_FALSE(waiter_dup.WaitFor(1, 1000));
+}
+
+TEST_F(RequestControllerTestClass,
CheckPosibilitytoAdd_ZeroValueLimiters_SUCCESS) {
// Test case than pending_requests_amount,
// app_time_scale_max_requests_ and
diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc
index 11b2d2f259..0abef44e9a 100644
--- a/src/components/application_manager/test/request_info_test.cc
+++ b/src/components/application_manager/test/request_info_test.cc
@@ -36,8 +36,6 @@
#include <vector>
#include <limits>
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
namespace request_info = application_manager::request_controller;
@@ -48,11 +46,11 @@ namespace application_manager_test {
class TestRequestInfo : public request_info::RequestInfo {
public:
TestRequestInfo(request_info::RequestPtr request,
- const RequestType requst_type,
- const TimevalStruct& start_time,
+ const RequestType request_type,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
- : RequestInfo(request, requst_type, start_time, timeout_msec) {}
- void SetEndTime(const TimevalStruct& end_time) {
+ : RequestInfo(request, request_type, start_time, timeout_msec) {}
+ void SetEndTime(const date_time::TimeDuration& end_time) {
end_time_ = end_time;
}
};
@@ -76,26 +74,26 @@ class RequestInfoTest : public ::testing::Test {
uint32_t default_timeout_;
uint32_t mobile_correlation_id;
- utils::SharedPtr<TestRequestInfo> CreateTestInfo(
+ std::shared_ptr<TestRequestInfo> CreateTestInfo(
uint32_t connection_key,
uint32_t correlation_id,
- request_info::RequestInfo::RequestType requst_type,
- const TimevalStruct& start_time,
+ request_info::RequestInfo::RequestType request_type,
+ const date_time::TimeDuration& start_time,
uint64_t timeout_msec) {
- utils::SharedPtr<MockRequest> mock_request =
- utils::MakeShared<MockRequest>(connection_key, correlation_id);
- utils::SharedPtr<TestRequestInfo> request =
- utils::MakeShared<TestRequestInfo>(
- mock_request, requst_type, start_time, timeout_msec);
+ std::shared_ptr<MockRequest> mock_request =
+ std::make_shared<MockRequest>(connection_key, correlation_id);
+ std::shared_ptr<TestRequestInfo> request =
+ std::make_shared<TestRequestInfo>(
+ mock_request, request_type, start_time, timeout_msec);
return request;
}
};
TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
- const TimevalStruct& time = date_time::DateTime::getCurrentTime();
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
+ const date_time::TimeDuration& time = date_time::getCurrentTime();
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request = CreateTestInfo(
+ std::shared_ptr<TestRequestInfo> request = CreateTestInfo(
i, i, request_info::RequestInfo::MobileRequest, time, default_timeout_);
request->SetEndTime(time);
EXPECT_TRUE(request_info_set_.Add(request));
@@ -105,11 +103,11 @@ TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(hmi_connection_key_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(request));
EXPECT_TRUE(request_info_set_.RemoveRequest(request));
@@ -119,15 +117,15 @@ TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
}
TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
// Add hmi requests
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(hmi_connection_key_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(request);
EXPECT_TRUE(request_info_set_.Add(request));
@@ -135,7 +133,7 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
// Delete every request
- std::vector<utils::SharedPtr<TestRequestInfo> >::iterator req_it =
+ std::vector<std::shared_ptr<TestRequestInfo> >::iterator req_it =
requests.begin();
for (; req_it != requests.end(); ++req_it) {
@@ -155,18 +153,18 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
}
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
- utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ std::shared_ptr<TestRequestInfo> mobile_request1 =
CreateTestInfo(mobile_connection_key1_,
12345,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request1));
- utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ std::shared_ptr<TestRequestInfo> mobile_request2 =
CreateTestInfo(mobile_connection_key2_,
54321,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request2));
EXPECT_EQ(2u, request_info_set_.Size());
@@ -175,15 +173,15 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
}
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
const uint32_t count_of_mobile_request1 = 200;
const uint32_t count_of_mobile_request2 = 100;
for (uint32_t i = 0; i < count_of_mobile_request1; ++i) {
- utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ std::shared_ptr<TestRequestInfo> mobile_request1 =
CreateTestInfo(mobile_connection_key1_,
i,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(mobile_request1);
@@ -192,11 +190,11 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
EXPECT_EQ(count_of_mobile_request1, request_info_set_.Size());
for (uint32_t i = 0; i < count_of_mobile_request2; ++i) {
- utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ std::shared_ptr<TestRequestInfo> mobile_request2 =
CreateTestInfo(mobile_connection_key2_,
i,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(mobile_request2);
@@ -214,20 +212,20 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
TEST_F(RequestInfoTest, RequestInfoSetFront) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
i);
request_info_set_.Add(request);
}
for (uint32_t i = 1; i < count_of_requests_for_test_; ++i) {
request_info::RequestInfoPtr request_info = request_info_set_.Front();
- EXPECT_TRUE(request_info.valid());
+ EXPECT_TRUE(request_info.use_count() != 0);
request_info = request_info_set_.FrontWithNotNullTimeout();
- EXPECT_TRUE(request_info.valid());
+ EXPECT_TRUE(request_info.use_count() != 0);
EXPECT_TRUE(request_info_set_.RemoveRequest(request_info));
}
EXPECT_EQ(1u, request_info_set_.Size());
@@ -248,27 +246,27 @@ TEST_F(RequestInfoTest, RequestInfoSetFind) {
appid_connection_id.end();
for (; req_it != end; ++req_it) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(req_it->first,
req_it->second,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
10);
EXPECT_TRUE(request_info_set_.Add(request));
}
request_info::RequestInfoPtr request = request_info_set_.Find(
count_of_requests_for_test_, count_of_requests_for_test_);
- EXPECT_FALSE(request.valid());
+ EXPECT_FALSE(request.use_count() != 0);
req_it = appid_connection_id.begin();
for (; req_it != end; ++req_it) {
request_info::RequestInfoPtr request =
request_info_set_.Find(req_it->first, req_it->second);
- EXPECT_TRUE(request.valid());
+ EXPECT_TRUE(request.use_count() != 0);
EXPECT_TRUE(request_info_set_.RemoveRequest(request));
request = request_info_set_.Find(req_it->first, req_it->second);
- EXPECT_FALSE(request.valid());
+ EXPECT_FALSE(request.use_count() != 0);
}
EXPECT_EQ(0u, request_info_set_.Size());
}
@@ -277,11 +275,11 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) {
request_info::RequestInfoSet request_info_set;
const uint32_t connection_key = 65483;
const uint32_t corr_id = 65483;
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(connection_key,
corr_id,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
10);
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
@@ -289,31 +287,33 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) {
EXPECT_EQ(1u, request_info_set.Size());
request_info::RequestInfoPtr found =
request_info_set.Find(connection_key, corr_id);
- EXPECT_TRUE(found.valid());
+ EXPECT_TRUE(found.use_count() != 0);
EXPECT_TRUE(request_info_set.RemoveRequest(found));
EXPECT_EQ(0u, request_info_set.Size());
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
found = request_info_set.FrontWithNotNullTimeout();
- EXPECT_TRUE(found.valid());
+ EXPECT_TRUE(found.use_count() != 0);
EXPECT_TRUE(request_info_set.RemoveRequest(found));
found = request_info_set.FrontWithNotNullTimeout();
- EXPECT_FALSE(found.valid());
+ EXPECT_FALSE(found.use_count() != 0);
found = request_info_set.Front();
- EXPECT_FALSE(found.valid());
+ EXPECT_FALSE(found.use_count() != 0);
EXPECT_EQ(0u, request_info_set.Size());
}
TEST_F(RequestInfoTest, EndTimeisExpired) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ // get just the seconds part of the current time
+ date_time::TimeDuration not_expired =
+ date_time::seconds(date_time::getSecs(date_time::getCurrentTime()));
+ not_expired += date_time::microseconds(std::numeric_limits<time_t>::min());
- TimevalStruct not_expired = date_time::DateTime::getCurrentTime();
- not_expired.tv_usec = std::numeric_limits<time_t>::min();
+ date_time::TimeDuration expired =
+ date_time::seconds(date_time::getSecs(date_time::getCurrentTime()));
+ expired += date_time::microseconds(std::numeric_limits<time_t>::max());
- TimevalStruct expired = date_time::DateTime::getCurrentTime();
- expired.tv_usec = std::numeric_limits<time_t>::max();
-
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -328,8 +328,8 @@ TEST_F(RequestInfoTest, EndTimeisExpired) {
}
TEST_F(RequestInfoTest, UpdateEndTime) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
- utils::SharedPtr<TestRequestInfo> request =
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -337,13 +337,13 @@ TEST_F(RequestInfoTest, UpdateEndTime) {
default_timeout_);
request->SetEndTime(time);
request->updateEndTime();
- TimevalStruct last_time = request->end_time();
- EXPECT_LE(time.tv_sec, last_time.tv_sec);
+ date_time::TimeDuration last_time = request->end_time();
+ EXPECT_LE(date_time::getSecs(time), date_time::getSecs(last_time));
}
TEST_F(RequestInfoTest, UpdateTimeOut) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
- utils::SharedPtr<TestRequestInfo> request =
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -353,9 +353,10 @@ TEST_F(RequestInfoTest, UpdateTimeOut) {
request->updateEndTime();
request->updateTimeOut(100);
- time = date_time::DateTime::getCurrentTime();
- TimevalStruct last_time = request->end_time();
- EXPECT_NEAR(time.tv_sec + 100, last_time.tv_sec, 500);
+ time = date_time::getCurrentTime();
+ date_time::TimeDuration last_time = request->end_time();
+ EXPECT_NEAR(
+ date_time::getSecs(time) + 100, date_time::getSecs(last_time), 500);
}
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index f3e49001fa..1c2339096c 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -37,12 +37,15 @@
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/usage_statistics.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_app_extension.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_resumption_data.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application.h"
#include "utils/data_accessor.h"
-#include "utils/make_shared.h"
+#include "config_profile/profile.h"
+
#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application_manager_settings.h"
@@ -55,14 +58,16 @@ namespace resumption_test {
using ::testing::_;
using ::testing::A;
-using ::testing::Return;
-using ::testing::ReturnRef;
+using ::testing::AtLeast;
using ::testing::DoAll;
-using ::testing::SetArgReferee;
+using ::testing::Eq;
using ::testing::Mock;
using ::testing::NiceMock;
-using ::testing::AtLeast;
-using ::testing::Eq;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgReferee;
+using ::testing::ReturnPointee;
+using ::testing::SaveArg;
using namespace application_manager_test;
using namespace resumption;
@@ -80,51 +85,87 @@ class ResumeCtrlTest : public ::testing::Test {
, kTestGrammarId_(10)
, kHash_("saved_hash")
, kAppResumingTimeout_(30000u) // miliseconds
- , kTestTimeStamp_(1452074434u) {}
+ , kTestTimeStamp_(1452074434u)
+ , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , kDefaultDeferredTestLevel_(eType::INVALID_ENUM)
+ , kNaviLowbandwidthLevel_("LIMITED")
+ , kProjectionLowbandwidthLevel_("NONE")
+ , kMediaLowbandwidthLevel_("NONE") {
+ profile::Profile profile_;
+ profile_.set_config_file_name("smartDeviceLink.ini");
+ resumption_delay_before_ign_ = profile_.resumption_delay_before_ign();
+ }
virtual void SetUp() OVERRIDE {
- Mock::VerifyAndClearExpectations(&app_mngr_);
- ON_CALL(app_mngr_, event_dispatcher())
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
+ ON_CALL(mock_app_mngr_, event_dispatcher())
.WillByDefault(ReturnRef(mock_event_dispatcher_));
mock_storage_ =
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
- app_mngr_);
- app_mock_ = utils::MakeShared<NiceMock<MockApplication> >();
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
+ mock_app_mngr_);
+ mock_app_ = std::make_shared<NiceMock<MockApplication> >();
+ mock_help_prompt_manager_ =
+ std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
+ mock_app_extension_ = std::make_shared<
+ NiceMock<application_manager_test::MockAppExtension> >();
const_app_ =
- static_cast<application_manager::ApplicationConstSharedPtr>(app_mock_);
- res_ctrl_ = utils::MakeShared<ResumeCtrlImpl>(app_mngr_);
+ static_cast<application_manager::ApplicationConstSharedPtr>(mock_app_);
+ res_ctrl_ = std::make_shared<ResumeCtrlImpl>(mock_app_mngr_);
res_ctrl_->set_resumption_storage(mock_storage_);
- ON_CALL(app_mngr_, state_controller())
- .WillByDefault(ReturnRef(state_controller_));
- ON_CALL(app_mngr_, get_settings())
+ ON_CALL(mock_app_mngr_, state_controller())
+ .WillByDefault(ReturnRef(mock_state_controller_));
+ ON_CALL(mock_app_mngr_, get_settings())
.WillByDefault(ReturnRef(mock_application_manager_settings_));
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .Times(AtLeast(0))
+ .WillRepeatedly(Return(true));
ON_CALL(mock_application_manager_settings_, use_db_for_resumption())
.WillByDefault(Return(false));
ON_CALL(mock_application_manager_settings_, app_resuming_timeout())
.WillByDefault(ReturnRef(kAppResumingTimeout_));
+ // use EXPECTED_CALL().Times(AtLeast(0)) instead of ON_CALL to remove
+ // warning messages
+ EXPECT_CALL(mock_application_manager_settings_,
+ navigation_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kNaviLowbandwidthLevel_));
+ EXPECT_CALL(mock_application_manager_settings_,
+ projection_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kProjectionLowbandwidthLevel_));
+ EXPECT_CALL(mock_application_manager_settings_,
+ media_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kMediaLowbandwidthLevel_));
+
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(Return(kDefaultDeferredTestLevel_));
}
void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&app_mngr_);
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
}
void GetInfoFromApp() {
- ON_CALL(*app_mock_, policy_app_id())
+ ON_CALL(*mock_app_, policy_app_id())
.WillByDefault(Return(kTestPolicyAppId_));
- ON_CALL(*app_mock_, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
- ON_CALL(*app_mock_, device()).WillByDefault(Return(kTestDevId_));
- ON_CALL(*app_mock_, app_id()).WillByDefault(Return(kTestAppId_));
+ ON_CALL(*mock_app_, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
+ ON_CALL(*mock_app_, device()).WillByDefault(Return(kTestDevId_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kTestAppId_));
}
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
- application_manager_test::MockApplicationManager app_mngr_;
- MockStateController state_controller_;
- utils::SharedPtr<ResumeCtrl> res_ctrl_;
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
- utils::SharedPtr<NiceMock<MockApplication> > app_mock_;
+ NiceMock<application_manager_test::MockApplicationManager> mock_app_mngr_;
+ std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> >
+ mock_app_extension_;
+ MockStateController mock_state_controller_;
+ std::shared_ptr<ResumeCtrl> res_ctrl_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_;
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager_;
application_manager::ApplicationConstSharedPtr const_app_;
const uint32_t kTestAppId_;
const std::string kTestPolicyAppId_;
@@ -136,7 +177,13 @@ class ResumeCtrlTest : public ::testing::Test {
const std::string kHash_;
const uint32_t kAppResumingTimeout_;
const uint32_t kTestTimeStamp_;
+ uint32_t resumption_delay_before_ign_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
sync_primitives::Lock app_set_lock_;
+ const mobile_apis::HMILevel::eType kDefaultDeferredTestLevel_;
+ const std::string kNaviLowbandwidthLevel_;
+ const std::string kProjectionLowbandwidthLevel_;
+ const std::string kMediaLowbandwidthLevel_;
};
/**
@@ -151,15 +198,15 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGrammarId) {
// Check RestoreApplicationData
GetInfoFromApp();
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -175,16 +222,16 @@ TEST_F(ResumeCtrlTest, StartResumption_WithoutGrammarId) {
saved_app[application_manager::strings::hash_id] = kHash_;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_)).Times(0);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_)).Times(0);
- bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_FALSE(res);
}
@@ -223,15 +270,15 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
test_application_files;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_files; ++i) {
- EXPECT_CALL(*app_mock_,
+ EXPECT_CALL(*mock_app_,
AddFile(CheckAppFile(
true,
true,
@@ -239,7 +286,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
static_cast<mobile_apis::FileType::eType>(file_types[i]))));
}
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -261,27 +308,27 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
test_application_submenues;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_submenues; ++i) {
- EXPECT_CALL(*app_mock_, AddSubMenu(i, test_application_submenues[i]));
+ EXPECT_CALL(*mock_app_, AddSubMenu(i, test_application_submenues[i]));
}
smart_objects::SmartObjectList requests;
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ EXPECT_CALL(mock_app_mngr_, GetNextHMICorrelationID())
.WillRepeatedly(Return(kCorId_));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
CreateAddSubMenuRequestToHMI(_, kCorId_))
.WillRepeatedly(Return(requests));
- EXPECT_CALL(*app_mock_, UpdateHash());
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -302,17 +349,21 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
saved_app[application_manager::strings::application_commands] =
test_application_commands;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
+ ON_CALL(*mock_app_, help_prompt_manager())
+ .WillByDefault(ReturnRef(*mock_help_prompt_manager_));
for (uint32_t i = 0; i < count_of_commands; ++i) {
- EXPECT_CALL(*app_mock_, AddCommand(i, test_application_commands[i]));
+ EXPECT_CALL(*mock_app_, AddCommand(i, test_application_commands[i]));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(i, test_application_commands[i], true));
}
smart_objects::SmartObjectList requests;
@@ -320,7 +371,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
CreateAddCommandRequestToHMI(_, _))
.WillRepeatedly(Return(requests));
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -354,17 +405,17 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
application_choice_sets;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
- EXPECT_CALL(*app_mock_, AddChoiceSet(i, application_choice_sets[i]));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(i, application_choice_sets[i]));
}
smart_objects::SmartObjectList requests;
@@ -372,7 +423,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
CreateAddVRCommandRequestFromChoiceToHMI(_))
.WillRepeatedly(Return(requests));
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -386,22 +437,22 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGlobalProperties) {
test_global_properties;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
SendGlobalPropertiesToHMI(_));
- EXPECT_CALL(*app_mock_, load_global_properties(test_global_properties));
+ EXPECT_CALL(*mock_app_, load_global_properties(test_global_properties));
- EXPECT_CALL(*app_mock_, UpdateHash());
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -410,7 +461,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
smart_objects::SmartObject test_subscriptions;
smart_objects::SmartObject app_buttons;
- uint32_t count_of_buttons = 17;
+ const uint32_t count_of_buttons = 17;
for (uint32_t i = 0; i < count_of_buttons; ++i) {
app_buttons[i] = i;
}
@@ -421,30 +472,37 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
- saved_app[application_manager::strings::application_subscribtions] =
+ saved_app[application_manager::strings::application_subscriptions] =
test_subscriptions;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_buttons; ++i) {
EXPECT_CALL(
- *app_mock_,
+ *mock_app_,
SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(i)));
}
- EXPECT_CALL(*app_mock_, UpdateHash());
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ std::list<application_manager::AppExtensionPtr> extensions;
+ extensions.insert(extensions.begin(), mock_app_extension_);
+
+ EXPECT_CALL(*mock_app_, Extensions()).WillOnce(ReturnRef(extensions));
+
+ EXPECT_CALL(*mock_app_extension_, ProcessResumption(test_subscriptions));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
SendAllOnButtonSubscriptionNotificationsForApp(_, _)).Times(2);
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -466,31 +524,30 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
- saved_app[application_manager::strings::application_subscribtions] =
+ saved_app[application_manager::strings::application_subscriptions] =
test_subscriptions;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
-
- for (size_t i = 0; i < app_vi.length(); ++i) {
- EXPECT_CALL(
- *app_mock_,
- SubscribeToIVI(static_cast<mobile_apis::VehicleDataType::eType>(i)));
- }
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
smart_objects::SmartObjectList requests;
- EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- GetIVISubscriptionRequests(_)).WillRepeatedly(Return(requests));
- EXPECT_CALL(*app_mock_, UpdateHash());
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ std::list<application_manager::AppExtensionPtr> extensions;
+
+ extensions.insert(extensions.begin(), mock_app_extension_);
+
+ EXPECT_CALL(*mock_app_, Extensions()).WillOnce(ReturnRef(extensions));
+
+ EXPECT_CALL(*mock_app_extension_, ProcessResumption(test_subscriptions));
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -505,43 +562,80 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToWayPoints) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
EXPECT_CALL(
- app_mngr_,
+ mock_app_mngr_,
SubscribeAppForWayPoints(A<application_manager::ApplicationSharedPtr>()));
const mobile_apis::HMILevel::eType hmi_test_level =
mobile_apis::HMILevel::HMI_FULL;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(hmi_test_level));
- EXPECT_CALL(state_controller_, SetRegularState(_, hmi_test_level));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, hmi_test_level));
- const bool result = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool result = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(result);
}
TEST_F(ResumeCtrlTest, StartResumptionOnlyHMILevel) {
smart_objects::SmartObject saved_app;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- const bool res = res_ctrl_->StartResumptionOnlyHMILevel(app_mock_);
+ const bool res = res_ctrl_->StartResumptionOnlyHMILevel(mock_app_);
EXPECT_TRUE(res);
}
+TEST_F(ResumeCtrlTest, RetryResumption) {
+ const uint32_t app_id = 1;
+
+ EXPECT_CALL(mock_app_mngr_, application(app_id)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillOnce(Return(eType::HMI_FULL));
+
+ res_ctrl_->RetryResumption(app_id);
+
+ bool is_resumption_active = res_ctrl_->get_resumption_active();
+ EXPECT_TRUE(is_resumption_active);
+}
+
+TEST_F(ResumeCtrlTest, RetryResumption_NotDeferred) {
+ const uint32_t app_id = 1;
+
+ EXPECT_CALL(mock_app_mngr_, application(app_id)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillOnce(Return(eType::INVALID_ENUM));
+
+ res_ctrl_->RetryResumption(app_id);
+
+ bool is_resumption_active = res_ctrl_->get_resumption_active();
+ EXPECT_FALSE(is_resumption_active);
+}
+
TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
- EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
@@ -550,9 +644,9 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceAllowed));
- res_ctrl_->StartAppHmiStateResumption(app_mock_);
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
@@ -563,13 +657,145 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppHasDeferredResumption) {
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_NONE;
+ mobile_apis::HMILevel::eType deferred_level = eType::HMI_FULL;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ // resume into deferred level instead of restored level
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, deferred_level))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ mobile_apis::HMILevel::eType app_deferred_level = deferred_level;
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(ReturnPointee(&app_deferred_level));
+ EXPECT_CALL(*mock_app_,
+ set_deferred_resumption_hmi_level(eType::INVALID_ENUM))
+ .WillOnce(SaveArg<0>(&app_deferred_level));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest,
+ StartAppHmiStateResumption_HighBandwidthTransportNotAvailable) {
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
+ .Times(AtLeast(1));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- res_ctrl_->StartAppHmiStateResumption(app_mock_);
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(false));
+
+ // if resumption is deferred ...
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(Return(restored_test_type));
+
+ // ... then RemoveApplicationFromSaved() will not be called
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .Times(0);
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ StartAppHmiStateResumption_HighBandwidthTransportNotAvailable_NaviAndMedia) {
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ // in this test, it is expected that the app will resume into LIMITED, which
+ // is the higher level among NONE and LIMITED
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(true));
+
+ std::string navi_lowbandwidth_level("NONE");
+ std::string projection_lowbandwidth_level("BACKGROUND");
+ std::string media_lowbandwidth_level("LIMITED");
+ EXPECT_CALL(mock_application_manager_settings_,
+ navigation_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(navi_lowbandwidth_level));
+ EXPECT_CALL(mock_application_manager_settings_,
+ projection_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(projection_lowbandwidth_level));
+ EXPECT_CALL(mock_application_manager_settings_,
+ media_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(media_lowbandwidth_level));
+
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(Return(restored_test_type));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .Times(0);
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
/**
@@ -579,23 +805,30 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ ::application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
- EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
- const bool res = res_ctrl_->RestoreAppHMIState(app_mock_);
+ const bool res = res_ctrl_->RestoreAppHMIState(mock_app_);
EXPECT_TRUE(res);
}
@@ -604,35 +837,76 @@ TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) {
saved_app[application_manager::strings::hmi_level] = kDefaultTestLevel_;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
- EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
- res_ctrl_->SetupDefaultHMILevel(app_mock_);
+ res_ctrl_->SetupDefaultHMILevel(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest,
+ SetupDefaultHMILevel_HighBandwidthTransportNotAvailable) {
+ smart_objects::SmartObject saved_app;
+
+ saved_app[application_manager::strings::hmi_level] = kDefaultTestLevel_;
+
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(false));
+
+ // SetRegularState() should be called with kProjectionLowbandwidthLevel_
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_NONE))
+ .Times(AtLeast(1));
+
+ res_ctrl_->SetupDefaultHMILevel(mock_app_);
}
TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
- ON_CALL(app_mngr_, application(kTestAppId_)).WillByDefault(Return(app_mock_));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
+
+ ::application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
const uint32_t ign_off_count = 0u;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
MockStateController state_controller;
- EXPECT_CALL(app_mngr_, state_controller())
+ EXPECT_CALL(mock_app_mngr_, state_controller())
.WillOnce(ReturnRef(state_controller));
EXPECT_CALL(state_controller, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
@@ -641,37 +915,37 @@ TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- ON_CALL(app_mngr_, GetUserConsentForDevice(kMacAddress_))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice(kMacAddress_))
.WillByDefault(Return(policy::kDeviceAllowed));
- res_ctrl_->StartAppHmiStateResumption(app_mock_);
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
/**
* @brief group of tests which check correct SetAppHMIState
-*/
+ */
TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_WithoutCheckPolicy) {
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
const bool res =
- res_ctrl_->SetAppHMIState(app_mock_, kDefaultTestLevel_, false);
+ res_ctrl_->SetAppHMIState(mock_app_, kDefaultTestLevel_, false);
EXPECT_TRUE(res);
}
TEST_F(ResumeCtrlTest, SetAppHMIState_HMILimited_WithoutCheckPolicy) {
mobile_apis::HMILevel::eType test_type = eType::HMI_LIMITED;
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, false);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, false);
EXPECT_TRUE(res);
}
@@ -679,14 +953,14 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithoutCheckPolicy) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
// GetDefaultHmiLevel should not be called
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(const_app_)).Times(0);
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_)).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, false);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, false);
EXPECT_TRUE(res);
}
@@ -694,14 +968,14 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevAllowed) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, true);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, true);
EXPECT_TRUE(res);
}
@@ -709,51 +983,51 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceDisallowed));
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
- EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, true);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, true);
EXPECT_FALSE(res);
}
TEST_F(ResumeCtrlTest, SaveAllApplications) {
- utils::SharedPtr<application_manager_test::MockApplication> test_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> test_app =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*test_app, app_id()).WillRepeatedly(Return(kTestAppId_));
application_manager::ApplicationSet app_set;
app_set.insert(test_app);
DataAccessor<application_manager::ApplicationSet> accessor(app_set,
- app_set_lock_);
+ app_set_lock_ptr_);
- ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(accessor));
EXPECT_CALL(*mock_storage_, SaveApplication(Eq(test_app)));
res_ctrl_->SaveAllApplications();
}
TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) {
- utils::SharedPtr<application_manager::Application> mock_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
application_manager::ApplicationSet app_set;
DataAccessor<application_manager::ApplicationSet> accessor(app_set,
- app_set_lock_);
+ app_set_lock_ptr_);
- ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(accessor));
EXPECT_CALL(*mock_storage_, SaveApplication(mock_app)).Times(0);
res_ctrl_->SaveAllApplications();
}
TEST_F(ResumeCtrlTest, SaveApplication) {
- utils::SharedPtr<application_manager::Application> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*mock_storage_, SaveApplication(app_sh_mock));
res_ctrl_->SaveApplication(app_sh_mock);
@@ -763,26 +1037,26 @@ TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionHasStarted) {
smart_objects::SmartObject saved_app;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- ON_CALL(*app_mock_, app_id()).WillByDefault(Return(kTestAppId_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kTestAppId_));
- const bool res = res_ctrl_->StartResumptionOnlyHMILevel(app_mock_);
+ const bool res = res_ctrl_->StartResumptionOnlyHMILevel(mock_app_);
EXPECT_TRUE(res);
- utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(kTestAppId_));
res_ctrl_->OnAppActivated(app_sh_mock);
}
TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) {
- utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).Times(0);
res_ctrl_->OnAppActivated(app_sh_mock);
}
@@ -840,7 +1114,7 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFiles_WithoutCommandAndChoiceSets) {
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(mock_app_));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
@@ -861,7 +1135,7 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
VerifyImageFiles(_, _, _))
.WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
- EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(mock_app_));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
@@ -878,7 +1152,7 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(mock_app_));
}
// TODO (VVeremjova) APPLINK-16718
@@ -888,15 +1162,15 @@ TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) {
}
TEST_F(ResumeCtrlTest, OnSuspend_EmptyApplicationlist) {
- utils::SharedPtr<application_manager::Application> mock_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
application_manager::ApplicationSet app_set;
DataAccessor<application_manager::ApplicationSet> accessor(app_set,
- app_set_lock_);
+ app_set_lock_ptr_);
- ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(accessor));
EXPECT_CALL(*mock_storage_, SaveApplication(mock_app)).Times(0);
EXPECT_CALL(*mock_storage_, IncrementIgnOffCount()).Times(0);
@@ -918,7 +1192,7 @@ TEST_F(ResumeCtrlTest, RemoveApplicationFromSaved) {
EXPECT_CALL(*mock_storage_,
RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- EXPECT_TRUE(res_ctrl_->RemoveApplicationFromSaved(app_mock_));
+ EXPECT_TRUE(res_ctrl_->RemoveApplicationFromSaved(mock_app_));
}
TEST_F(ResumeCtrlTest, CheckApplicationkHash_) {
@@ -929,7 +1203,7 @@ TEST_F(ResumeCtrlTest, CheckApplicationkHash_) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl_->CheckApplicationHash(app_mock_, kHash_));
+ EXPECT_TRUE(res_ctrl_->CheckApplicationHash(mock_app_, kHash_));
}
TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_NoAskedApp_INVALID_ENUM) {
@@ -955,6 +1229,194 @@ TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_AskedAppFound_INVALID_ENUM) {
res_ctrl_->GetSavedAppHmiLevel(kTestPolicyAppId_, kMacAddress_));
}
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInFullUnregisteredWithinTimeFrame_HMILevelRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInFullUnregisteredBeyondTimeFrame_HMILevelNotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest, ResumptionLowVoltage_AppInBackground_NotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_BACKGROUND;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInLimitedlUnregisteredWithinTimeFrame_HMILevelRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_ + time_offset));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInLimitedlUnregisteredBeyondTimeFrame_HMILevelNotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
} // namespace resumption_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
index cf0ebb7fd2..8423520b9f 100644
--- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -38,7 +38,7 @@
#include "interfaces/MOBILE_API.h"
#include "utils/sqlite_wrapper/sql_database.h"
#include "utils/sqlite_wrapper/sql_query.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "application_manager/resumption_data_test.h"
#include "application_manager/test_resumption_data_db.h"
@@ -52,6 +52,7 @@ namespace resumption_test {
using ::testing::NiceMock;
using ::testing::ReturnRef;
+using ::testing::_;
using application_manager_test::MockApplication;
namespace am = application_manager;
@@ -67,7 +68,7 @@ const std::string kPath =
class ResumptionDataDBTest : public ResumptionDataTest {
protected:
void SetUp() OVERRIDE {
- app_mock = utils::MakeShared<NiceMock<MockApplication> >();
+ app_mock = std::make_shared<NiceMock<MockApplication> >();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
is_audio_ = true;
@@ -122,7 +123,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
void SetZeroIgnOffTime() {
utils::dbms::SQLQuery query(test_db());
- EXPECT_TRUE(query.Prepare(KUpdateLastIgnOffTime));
+ EXPECT_TRUE(query.Prepare(kUpdateLastIgnOffTime));
query.Bind(0, 0);
EXPECT_TRUE(query.Exec());
}
@@ -165,7 +166,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
"DELETE FROM `applicationCommandsArray`; "
"DELETE FROM `applicationFilesArray`; "
"DELETE FROM `applicationSubMenuArray`; "
- "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `applicationSubscriptionsArray`; "
"DELETE FROM `_internal_data`; ";
private:
@@ -271,6 +272,10 @@ void ResumptionDataDBTest::CheckGlobalProportiesData() {
select_image.GetInteger(0));
EXPECT_EQ((*menu_icon_)[am::strings::value].asString(),
select_image.GetString(1));
+ if ((*menu_icon_).keyExists(am::strings::is_template)) {
+ EXPECT_EQ((*menu_icon_)[am::strings::is_template].asBool(),
+ select_image.GetBoolean(2));
+ }
}
if (!select_globalproperties.IsNull(8)) {
utils::dbms::SQLQuery select_tts_chunk(test_db());
@@ -559,6 +564,7 @@ TEST_F(ResumptionDataDBTest, Init) {
TEST_F(ResumptionDataDBTest, SaveApplication) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
}
@@ -566,6 +572,7 @@ TEST_F(ResumptionDataDBTest, SaveApplication) {
TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_TRUE(
@@ -580,6 +587,7 @@ TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved) {
TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved_AppNotSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
sm::SmartObject saved_app;
@@ -591,6 +599,7 @@ TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved_AppNotSaved) {
TEST_F(ResumptionDataDBTest, SavedApplicationTwice) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_db()->SaveApplication(app_mock);
CheckSavedDB();
res_db()->SaveApplication(app_mock);
@@ -600,6 +609,7 @@ TEST_F(ResumptionDataDBTest, SavedApplicationTwice) {
TEST_F(ResumptionDataDBTest, SavedApplicationTwice_UpdateApp) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_db()->SaveApplication(app_mock);
CheckSavedDB();
(*vr_help_)[0][am::strings::position] = 2;
@@ -611,6 +621,7 @@ TEST_F(ResumptionDataDBTest, SavedApplicationTwice_UpdateApp) {
TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(0, result);
@@ -619,6 +630,7 @@ TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationSaved) {
TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationRemoved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
EXPECT_TRUE(
res_db()->RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
@@ -629,6 +641,7 @@ TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationRemoved) {
TEST_F(ResumptionDataDBTest, GetSavedApplication) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
@@ -650,6 +663,7 @@ TEST_F(ResumptionDataDBTest, GetSavedApplication_AppNotSaved) {
TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
sm::SmartObject saved_app;
@@ -668,6 +682,7 @@ TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData_AppRemove) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_TRUE(
@@ -679,6 +694,7 @@ TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData_AppRemove) {
TEST_F(ResumptionDataDBTest, UpdateHmiLevel) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
@@ -690,6 +706,7 @@ TEST_F(ResumptionDataDBTest, UpdateHmiLevel) {
TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppIsSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_TRUE(res_db()->IsHMIApplicationIdExist(hmi_app_id_));
@@ -698,6 +715,7 @@ TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppIsSaved) {
TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppNotSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
uint32_t new_hmi_app_id_ = hmi_app_id_ + 10;
@@ -707,6 +725,7 @@ TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppNotSaved) {
TEST_F(ResumptionDataDBTest, GetHMIApplicationID) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_EQ(hmi_app_id_,
@@ -716,6 +735,7 @@ TEST_F(ResumptionDataDBTest, GetHMIApplicationID) {
TEST_F(ResumptionDataDBTest, GetHMIApplicationID_AppNotSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_EQ(0u, res_db()->GetHMIApplicationID(policy_app_id_, "other_dev_id"));
@@ -725,6 +745,7 @@ TEST_F(ResumptionDataDBTest, OnSuspend) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
@@ -737,6 +758,7 @@ TEST_F(ResumptionDataDBTest, OnSuspendFourTimes) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
@@ -762,6 +784,7 @@ TEST_F(ResumptionDataDBTest, OnSuspendOnAwake) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
@@ -779,6 +802,7 @@ TEST_F(ResumptionDataDBTest, Awake_AppNotSuspended) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
@@ -792,6 +816,7 @@ TEST_F(ResumptionDataDBTest, TwiceAwake_AppNotSuspended) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
@@ -808,6 +833,7 @@ TEST_F(ResumptionDataDBTest, GetHashId) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
std::string test_hash;
@@ -821,6 +847,7 @@ TEST_F(ResumptionDataDBTest, GetIgnOffTime_AfterSuspendAndAwake) {
SetZeroIgnOffTime();
uint32_t last_ign_off_time;
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
last_ign_off_time = res_db()->GetIgnOffTime();
@@ -844,6 +871,7 @@ TEST_F(ResumptionDataDBTest, DropAppResumptionData) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
EXPECT_TRUE(res_db()->DropAppDataResumption(kMacAddress_, policy_app_id_));
@@ -863,8 +891,8 @@ TEST_F(ResumptionDataDBTest, DropAppResumptionData) {
EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
app[am::strings::application_global_properties].empty());
- EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
- app[am::strings::application_subscribtions].empty());
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscriptions) &&
+ app[am::strings::application_subscriptions].empty());
EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
app[am::strings::application_files].empty());
diff --git a/src/components/application_manager/test/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
index e017c39497..40e61a3c53 100644
--- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
@@ -52,6 +52,7 @@ namespace resumption_test {
using ::testing::_;
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::NiceMock;
namespace am = application_manager;
@@ -60,7 +61,7 @@ using namespace file_system;
using namespace resumption;
using namespace mobile_apis;
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
class ResumptionDataJsonTest : public ResumptionDataTest {
protected:
@@ -68,7 +69,8 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
: last_state_("app_storage_folder", "app_info_storage")
, res_json(last_state_, mock_application_manager_) {}
virtual void SetUp() {
- app_mock = new NiceMock<application_manager_test::MockApplication>();
+ app_mock = std::make_shared<
+ NiceMock<application_manager_test::MockApplication> >();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
@@ -90,7 +92,7 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
dictionary[am::strings::resumption][am::strings::resume_app_list];
sm::SmartObject res_app_list;
for (uint32_t i = 0; i < resume_app_list.size(); i++) {
- Formatters::CFormatterJsonBase::jsonValueToObj(resume_app_list[i],
+ formatters::CFormatterJsonBase::jsonValueToObj(resume_app_list[i],
res_app_list);
CheckSavedApp(res_app_list);
}
@@ -109,12 +111,14 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
TEST_F(ResumptionDataJsonTest, SaveApplication) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
}
TEST_F(ResumptionDataJsonTest, SavedApplicationTwice) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_json.SaveApplication(app_mock);
CheckSavedJson();
res_json.SaveApplication(app_mock);
@@ -123,6 +127,7 @@ TEST_F(ResumptionDataJsonTest, SavedApplicationTwice) {
TEST_F(ResumptionDataJsonTest, SavedApplicationTwice_UpdateApp) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_json.SaveApplication(app_mock);
CheckSavedJson();
(*vr_help_)[0][am::strings::position] = 2;
@@ -133,6 +138,7 @@ TEST_F(ResumptionDataJsonTest, SavedApplicationTwice_UpdateApp) {
TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
EXPECT_TRUE(
res_json.RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
@@ -150,6 +156,7 @@ TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
ssize_t result = res_json.IsApplicationSaved(policy_app_id_, kMacAddress_);
@@ -158,6 +165,7 @@ TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationSaved) {
TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationRemoved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_TRUE(
@@ -168,6 +176,7 @@ TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationRemoved) {
TEST_F(ResumptionDataJsonTest, GetSavedApplication) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
smart_objects::SmartObject saved_app;
EXPECT_TRUE(
@@ -184,6 +193,7 @@ TEST_F(ResumptionDataJsonTest, GetSavedApplication_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
smart_objects::SmartObject saved_app;
@@ -201,6 +211,7 @@ TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData_AppRemove) {
smart_objects::SmartObject saved_app;
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_TRUE(
@@ -211,6 +222,7 @@ TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData_AppRemove) {
TEST_F(ResumptionDataJsonTest, UpdateHmiLevel) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
@@ -222,6 +234,7 @@ TEST_F(ResumptionDataJsonTest, UpdateHmiLevel) {
TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppIsSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_TRUE(res_json.IsHMIApplicationIdExist(hmi_app_id_));
@@ -229,6 +242,7 @@ TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppIsSaved) {
TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppNotSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -238,6 +252,7 @@ TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, GetHMIApplicationID) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_EQ(hmi_app_id_,
@@ -246,6 +261,7 @@ TEST_F(ResumptionDataJsonTest, GetHMIApplicationID) {
TEST_F(ResumptionDataJsonTest, GetHMIApplicationID_AppNotSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
EXPECT_EQ(0u, res_json.GetHMIApplicationID(policy_app_id_, "other_dev_id"));
}
@@ -253,7 +269,7 @@ TEST_F(ResumptionDataJsonTest, GetHMIApplicationID_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, OnSuspend) {
SetZeroIgnOff();
PrepareData();
-
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -265,6 +281,7 @@ TEST_F(ResumptionDataJsonTest, OnSuspend) {
TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -282,6 +299,7 @@ TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -297,6 +315,7 @@ TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
SetZeroIgnOff();
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -308,6 +327,7 @@ TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
SetZeroIgnOff();
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -322,6 +342,7 @@ TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
TEST_F(ResumptionDataJsonTest, GetHashId) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -334,6 +355,7 @@ TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
uint32_t last_ign_off_time;
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
last_ign_off_time = res_json.GetIgnOffTime();
@@ -355,6 +377,7 @@ TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
TEST_F(ResumptionDataJsonTest, DropAppDataResumption) {
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -375,8 +398,8 @@ TEST_F(ResumptionDataJsonTest, DropAppDataResumption) {
EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
app[am::strings::application_global_properties].empty());
- EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
- app[am::strings::application_subscribtions].empty());
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscriptions) &&
+ app[am::strings::application_subscriptions].empty());
EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
app[am::strings::application_files].empty());
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index 1f13ff78f3..fe24ea39b6 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -50,6 +50,7 @@ namespace custom_str = utils::custom_string;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::ReturnPointee;
+using ::testing::_;
void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
EXPECT_EQ(policy_app_id_, resume_app_list[am::strings::app_id].asString());
@@ -72,7 +73,7 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
CheckGlobalProporties(
resume_app_list[am::strings::application_global_properties]);
- CheckSubscriptions(resume_app_list[am::strings::application_subscribtions]);
+ CheckSubscriptions(resume_app_list[am::strings::application_subscriptions]);
}
void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
@@ -137,8 +138,6 @@ void ResumptionDataTest::CheckSubscriptions(sm::SmartObject& res_list) {
res_list[am::strings::application_buttons][0].asUInt());
EXPECT_EQ(static_cast<uint32_t>(ButtonName::eType::CUSTOM_BUTTON),
res_list[am::strings::application_buttons][1].asUInt());
- EXPECT_EQ(0u, res_list[am::strings::application_vehicle_info][0].asUInt());
- EXPECT_EQ(5u, res_list[am::strings::application_vehicle_info][1].asUInt());
}
void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) {
@@ -292,7 +291,7 @@ void ResumptionDataTest::CheckHelpPrompt(sm::SmartObject& res_list) {
}
void ResumptionDataTest::CheckTimeoutPrompt(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list) {
for (uint i = 0; i < tts_chunks_count; ++i) {
std::string text = (*timeout_prompt_)[i][am::strings::text].asString();
SpeechCapabilities::eType speech = static_cast<SpeechCapabilities::eType>(
@@ -316,25 +315,28 @@ void ResumptionDataTest::CheckVRHelp(sm::SmartObject& res_list) {
}
void ResumptionDataTest::CheckVRTitle(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list) {
std::string vtitle = (*vr_help_title_)[am::strings::vr_help_title].asString();
EXPECT_EQ(vtitle, res_list[am::strings::vr_help_title].asString());
}
void ResumptionDataTest::PrepareData() {
+ mock_app_extension_ =
+ std::make_shared<NiceMock<application_manager_test::MockAppExtension> >();
+ extensions_.insert(extensions_.begin(), mock_app_extension_);
+ ON_CALL(*app_mock, Extensions()).WillByDefault(ReturnRef(extensions_));
SetGlobalProporties();
SetCommands();
SetSubmenues();
SetChoiceSet();
SetAppFiles();
- DataAccessor<am::SubMenuMap> sub_menu_m(test_submenu_map, sublock_);
- DataAccessor<am::CommandsMap> commands_m(test_commands_map, comlock_);
- DataAccessor<am::ChoiceSetMap> choice_set_m(test_choiceset_map, setlock_);
+ DataAccessor<am::SubMenuMap> sub_menu_m(test_submenu_map, sublock_ptr_);
+ DataAccessor<am::CommandsMap> commands_m(test_commands_map, comlock_ptr_);
+ DataAccessor<am::ChoiceSetMap> choice_set_m(test_choiceset_map, setlock_ptr_);
SetSubscriptions();
- DataAccessor<am::ButtonSubscriptions> btn_sub(btn_subscr, btnlock_);
- DataAccessor<am::VehicleInfoSubscriptions> ivi_access(ivi, ivilock_);
+ DataAccessor<am::ButtonSubscriptions> btn_sub(btn_subscr, btnlock_ptr_);
ON_CALL(*app_mock, is_application_data_changed()).WillByDefault(Return(true));
@@ -364,7 +366,6 @@ void ResumptionDataTest::PrepareData() {
ON_CALL(*app_mock, menu_icon()).WillByDefault(ReturnPointee(&menu_icon_));
ON_CALL(*app_mock, SubscribedButtons()).WillByDefault(Return(btn_sub));
- ON_CALL(*app_mock, SubscribedIVI()).WillByDefault(Return(ivi_access));
ON_CALL(*app_mock, getAppFiles()).WillByDefault(ReturnRef(app_files_map_));
}
@@ -381,6 +382,7 @@ void ResumptionDataTest::SetMenuTitleAndIcon() {
sm::SmartObject sm_icon;
sm_icon[am::strings::value] = "test icon";
sm_icon[am::strings::image_type] = ImageType::STATIC;
+ sm_icon[am::strings::is_template] = false;
sm::SmartObject sm_title;
sm_title = "test title";
@@ -539,8 +541,6 @@ void ResumptionDataTest::SetKeyboardProperties() {
void ResumptionDataTest::SetSubscriptions() {
btn_subscr.insert(ButtonName::eType::CUSTOM_BUTTON);
btn_subscr.insert(ButtonName::eType::OK);
- ivi.insert(static_cast<mobile_apis::VehicleDataType::eType>(0));
- ivi.insert(static_cast<mobile_apis::VehicleDataType::eType>(5));
}
} // namespace resumption_test
diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc
index 08fa0a3eb5..0ec902085f 100644
--- a/src/components/application_manager/test/resumption_sql_queries_test.cc
+++ b/src/components/application_manager/test/resumption_sql_queries_test.cc
@@ -79,7 +79,7 @@ const string kDeleteData =
"DELETE FROM `applicationCommandsArray`; "
"DELETE FROM `applicationFilesArray`; "
"DELETE FROM `applicationSubMenuArray`; "
- "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `applicationSubscriptionsArray`; "
"DELETE FROM `_internal_data`; "
"COMMIT; "
"VACUUM;";
@@ -197,8 +197,9 @@ class ResumptionSqlQueriesTest : public ::testing::Test {
const int64_t glob_prop_key);
SQLQuery& FillImageTable(SQLQuery& query,
- const int imageType,
- const string& value);
+ const int image_type,
+ const string& value,
+ const bool is_template);
SQLQuery& FillTableLimitedCharacterListTable(
SQLQuery& query, const string& limitedCharacterList);
@@ -326,7 +327,7 @@ class ResumptionSqlQueriesTest : public ::testing::Test {
db_schema.push_back("applicationCommandsArray");
db_schema.push_back("applicationFilesArray");
db_schema.push_back("applicationSubMenuArray");
- db_schema.push_back("applicationSubscribtionsArray");
+ db_schema.push_back("applicationSubscriptionsArray");
db_schema.push_back("_internal_data");
std::sort(db_schema.begin(), db_schema.end());
}
@@ -456,11 +457,13 @@ void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
}
SQLQuery& ResumptionSqlQueriesTest::FillImageTable(SQLQuery& query,
- const int imageType,
- const string& value) {
+ const int image_type,
+ const string& value,
+ const bool is_template) {
EXPECT_TRUE(query.Prepare(kInsertImage));
- query.Bind(0, imageType);
+ query.Bind(0, image_type);
query.Bind(1, value);
+ query.Bind(2, is_template);
EXPECT_TRUE(query.Exec());
return query;
}
@@ -802,7 +805,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksResumptionData_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -829,7 +835,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -854,7 +863,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -879,7 +891,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -904,7 +919,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -930,7 +948,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -956,7 +977,10 @@ TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -990,7 +1014,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectIgnOffTime_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1015,7 +1042,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1032,7 +1062,9 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) {
device_id,
key);
- key = FillImageTable(temp_query, 1, "tst_img2").LastInsertId();
+ key = FillImageTable(
+ temp_query, 1 /* image_type */, "tst_img2", true /* is_template */)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1056,7 +1088,10 @@ TEST_F(ResumptionSqlQueriesTest,
kSelectDataForLoadResumeData_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1084,7 +1119,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1117,7 +1155,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) {
TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1148,7 +1189,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) {
TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1189,7 +1233,10 @@ TEST_F(ResumptionSqlQueriesTest,
kSelectApplicationsIgnOffCount_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1229,7 +1276,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1258,7 +1308,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) {
TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1288,7 +1341,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteApplicationFilesArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1324,7 +1380,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1355,7 +1414,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteApplicationSubMenuArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1386,10 +1448,13 @@ TEST_F(ResumptionSqlQueriesTest,
}
TEST_F(ResumptionSqlQueriesTest,
- kDeleteApplicationSubscribtionsArray_ExpectDataDeleted) {
+ kDeleteApplicationSubscriptionsArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1410,12 +1475,12 @@ TEST_F(ResumptionSqlQueriesTest,
key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId();
FillAppSubscriptionsArrayTable(temp_query, 7, 2, key1);
// Check
- const std::string select_count_applicationSubscribtionsArray =
- "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
+ const std::string select_count_applicationSubscriptionsArray =
+ "SELECT COUNT(*) FROM applicationSubscriptionsArray;";
ValToPosPair p1(0, app_id2);
ValToPosPair p2(1, device_id);
- CheckDeleteQuery(select_count_applicationSubscribtionsArray,
- kDeleteApplicationSubscribtionsArray,
+ CheckDeleteQuery(select_count_applicationSubscriptionsArray,
+ kDeleteApplicationSubscriptionsArray,
p1,
p2,
1,
@@ -1426,7 +1491,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
key1 = FillGlobalPropertiesTable(
@@ -1456,7 +1524,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
key1 = FillGlobalPropertiesTable(
@@ -1490,7 +1561,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
@@ -1522,7 +1596,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteApplicationCommandsArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
@@ -1560,7 +1637,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillChoiceTable(temp_query,
2,
"tst_menu_name",
@@ -1595,7 +1675,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteVrCommandsFromChoiceSet_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 =
FillChoiceTable(
temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
@@ -1638,7 +1721,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 =
FillChoiceTable(
temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
@@ -1775,7 +1861,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteImageFromGlobalProperties_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1804,7 +1893,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1834,7 +1926,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -2051,7 +2146,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- FillImageTable(temp_query, 2, "tst_image");
+ FillImageTable(
+ temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true);
ValToPosPair p1(0, "tst_image");
ValToPosPair p2(1, "");
// Check
@@ -2061,7 +2157,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
ValToPosPair p1(0, "tst_image");
ValToPosPair p2(1, "");
// Check
@@ -2071,7 +2170,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kInsertImage_ExpectDataInserted) {
// Arrange
SQLQuery temp_query(db());
- FillImageTable(temp_query, 2, "tst_image");
+ FillImageTable(
+ temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true);
const std::string select_count_image = "SELECT COUNT(*) FROM image;";
// Check
CheckSelectQuery(select_count_image, 1, 0);
@@ -2211,17 +2311,17 @@ TEST_F(ResumptionSqlQueriesTest, kInsertSubscriptions_ExpectDataInserted) {
SQLQuery temp_query(db());
FillAppSubscriptionsArrayTable(temp_query, 2, 3, 4);
// Checks
- const std::string select_count_applicationSubscribtionsArray =
- "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
- CheckSelectQuery(select_count_applicationSubscribtionsArray, 1, 0);
+ const std::string select_count_applicationSubscriptionsArray =
+ "SELECT COUNT(*) FROM applicationSubscriptionsArray;";
+ CheckSelectQuery(select_count_applicationSubscriptionsArray, 1, 0);
const std::string select_idApplication =
- "SELECT idApplication FROM applicationSubscribtionsArray;";
+ "SELECT idApplication FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_idApplication, 4, 0);
const std::string select_vehicleValue =
- "SELECT vehicleValue FROM applicationSubscribtionsArray;";
+ "SELECT vehicleValue FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_vehicleValue, 2, 0);
const std::string select_ButtonNameValue =
- "SELECT ButtonNameValue FROM applicationSubscribtionsArray;";
+ "SELECT ButtonNameValue FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_ButtonNameValue, 3, 0);
}
@@ -2616,7 +2716,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) {
app_id1,
device_id,
9).LastInsertId();
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
FillChoiceTable(
temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
@@ -2656,7 +2759,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) {
app_id1,
device_id,
9).LastInsertId();
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t choice_key =
FillChoiceTable(
@@ -2776,7 +2882,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) {
app_id1,
device_id,
9).LastInsertId();
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t choice_key =
FillChoiceTable(
temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
@@ -2808,7 +2917,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectImage_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
// Check
ValToPosPair p1(0, IntToString(image_key));
ValToPosPair p2(1, "");
@@ -2846,7 +2958,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
@@ -2883,7 +2998,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
@@ -2900,7 +3018,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json
index d6f34c12fc..59e3f947c3 100644
--- a/src/components/application_manager/test/sdl_preloaded_pt.json
+++ b/src/components/application_manager/test/sdl_preloaded_pt.json
@@ -14,12 +14,13 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"COMMUNICATION": 6,
"NORMAL": 4,
"NONE": 0
@@ -296,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +354,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +374,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +394,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +413,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
index a332f92382..23c75e8475 100644
--- a/src/components/application_manager/test/sdl_pt_update.json
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1433,6 +1433,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1445,6 +1446,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1457,6 +1459,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1469,6 +1472,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1587,12 +1591,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1602,12 +1609,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1617,12 +1627,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1631,12 +1644,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1698,7 +1714,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
@@ -1708,6 +1724,7 @@
"COMMUNICATION" : 6,
"EMERGENCY" : 60,
"NAVIGATION" : 15,
+ "PROJECTION": 15,
"NONE" : 0,
"NORMAL" : 4,
"VOICECOMM" : 10
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 fe4d1d2ee8..1d4cead52b 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
@@ -41,7 +41,7 @@
#include "transport_manager/mock_transport_manager.h"
#include "utils/lock.h"
#include "utils/data_accessor.h"
-#include "utils/make_shared.h"
+
#include "application_manager/message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/smart_object_keys.h"
@@ -54,6 +54,7 @@
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_service.h"
namespace am = application_manager;
using am::HmiState;
@@ -63,6 +64,7 @@ using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::ReturnPointee;
+using ::testing::SaveArg;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::InSequence;
@@ -76,29 +78,34 @@ namespace state_controller_test {
namespace constants {
const uint32_t kCorrID = 314u;
const uint32_t kHMIAppID = 2718u;
-}
+} // namespace constants
struct HmiStatesComparator {
mobile_apis::HMILevel::eType hmi_level_;
mobile_apis::AudioStreamingState::eType audio_streaming_state_;
+ mobile_apis::VideoStreamingState::eType video_streaming_state_;
mobile_apis::SystemContext::eType system_context_;
HmiStatesComparator(
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_streaming_state,
+ mobile_apis::VideoStreamingState::eType video_streaming_state,
mobile_apis::SystemContext::eType system_context)
: hmi_level_(hmi_level)
, audio_streaming_state_(audio_streaming_state)
+ , video_streaming_state_(video_streaming_state)
, system_context_(system_context) {}
HmiStatesComparator(am::HmiStatePtr state_ptr)
: hmi_level_(state_ptr->hmi_level())
, audio_streaming_state_(state_ptr->audio_streaming_state())
+ , video_streaming_state_(state_ptr->video_streaming_state())
, system_context_(state_ptr->system_context()) {}
bool operator()(am::HmiStatePtr state_ptr) const {
return state_ptr->hmi_level() == hmi_level_ &&
state_ptr->audio_streaming_state() == audio_streaming_state_ &&
+ state_ptr->video_streaming_state() == video_streaming_state_ &&
state_ptr->system_context() == system_context_;
}
};
@@ -132,9 +139,10 @@ class StateControllerImplTest : public ::testing::Test {
StateControllerImplTest()
: ::testing::Test()
, usage_stat("0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
new usage_statistics_test::MockStatisticsManager))
- , applications_(application_set_, applications_lock_)
+ , applications_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , applications_(application_set_, applications_lock_ptr_)
, message_helper_mock_(
*application_manager::MockMessageHelper::message_helper_mock()) {
Mock::VerifyAndClearExpectations(&message_helper_mock_);
@@ -145,6 +153,7 @@ class StateControllerImplTest : public ::testing::Test {
}
NiceMock<application_manager_test::MockApplicationManager> app_manager_mock_;
+ NiceMock<application_manager_test::MockRPCService> mock_rpc_service_;
NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
NiceMock<connection_handler_test::MockConnectionHandler>
mock_connection_handler_;
@@ -154,9 +163,9 @@ class StateControllerImplTest : public ::testing::Test {
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
am::ApplicationSet application_set_;
- mutable sync_primitives::Lock applications_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> applications_lock_ptr_;
DataAccessor<am::ApplicationSet> applications_;
- utils::SharedPtr<am::StateControllerImpl> state_ctrl_;
+ std::shared_ptr<am::StateControllerImpl> state_ctrl_;
am::ApplicationSharedPtr simple_app_;
NiceMock<application_manager_test::MockApplication>* simple_app_ptr_;
@@ -206,16 +215,18 @@ class StateControllerImplTest : public ::testing::Test {
am::HmiStatePtr createHmiState(
mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType aidio_ss,
+ mobile_apis::AudioStreamingState::eType audio_ss,
+ mobile_apis::VideoStreamingState::eType video_ss,
mobile_apis::SystemContext::eType system_context) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::HmiStatePtr state =
- utils::MakeShared<am::HmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::HmiState>(simple_app_, app_manager_mock_);
state->set_hmi_level(hmi_level);
- state->set_audio_streaming_state(aidio_ss);
+ state->set_audio_streaming_state(audio_ss);
+ state->set_video_streaming_state(video_ss);
state->set_system_context(system_context);
return state;
}
@@ -228,13 +239,15 @@ class StateControllerImplTest : public ::testing::Test {
am::HmiStatePtr CreateHmiStateByHmiStateType(
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_ss,
+ const mobile_apis::VideoStreamingState::eType video_ss,
const mobile_apis::SystemContext::eType system_context,
const am::ApplicationSharedPtr app) {
am::HmiStatePtr new_state =
- utils::MakeShared<HmiStateType>(app, app_manager_mock_);
+ std::make_shared<HmiStateType>(app, app_manager_mock_);
new_state->set_hmi_level(hmi_level);
new_state->set_audio_streaming_state(audio_ss);
+ new_state->set_video_streaming_state(video_ss);
new_state->set_system_context(system_context);
return new_state;
@@ -248,27 +261,38 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_VRSESSION));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MENU));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MENU));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_ALERT));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_BACKGROUND,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_ALERT));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
}
/**
@@ -280,20 +304,29 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
PrepareCommonStateResults(result_hmi_state);
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_LIMITED,
- AudioStreamingState::ATTENUATED,
- SystemContext::SYSCTXT_MAIN));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_LIMITED,
- AudioStreamingState::ATTENUATED,
- SystemContext::SYSCTXT_MAIN));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_FULL,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_FULL,
- AudioStreamingState::ATTENUATED,
- SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
}
/**
@@ -305,6 +338,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
@@ -313,6 +347,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -321,18 +356,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -341,18 +380,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -369,6 +412,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
case APP_TYPE_NON_MEDIA: {
@@ -376,6 +420,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -385,18 +430,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -417,6 +466,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
case APP_TYPE_NON_MEDIA: {
@@ -424,6 +474,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -432,18 +483,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -465,6 +520,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
case APP_TYPE_NON_MEDIA: {
@@ -472,6 +528,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -590,10 +647,9 @@ class StateControllerImplTest : public ::testing::Test {
app_id = (*it_begin)->app_id();
app_type = AppType(app_id);
app = (*it_begin);
- am::HmiStatePtr state_first =
- utils::MakeShared<T>(app, app_manager_mock_);
+ am::HmiStatePtr state_first = std::make_shared<T>(app, app_manager_mock_);
am::HmiStatePtr state_second =
- utils::MakeShared<Q>(app, app_manager_mock_);
+ std::make_shared<Q>(app, app_manager_mock_);
TestSetSeveralState(
app, state_first, state_second, app_type, call_back_result);
TestSetSeveralState(
@@ -630,146 +686,180 @@ class StateControllerImplTest : public ::testing::Test {
void FillStatesLists() {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
// Valid states for not audio app
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_VRSESSION));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MENU));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_ALERT));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Valid states audio app
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_VRSESSION));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MENU));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_ALERT));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Common Invalid States
common_invalid_states_.push_back(
createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::INVALID_ENUM));
common_invalid_states_.push_back(
createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::INVALID_ENUM));
common_invalid_states_.push_back(
createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::INVALID_ENUM));
// Invalid States for audio apps
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Invalid States for not audio apps
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Valid state ids
@@ -864,7 +954,7 @@ class StateControllerImplTest : public ::testing::Test {
virtual void SetUp() OVERRIDE {
ON_CALL(app_manager_mock_, event_dispatcher())
.WillByDefault(ReturnRef(mock_event_dispatcher_));
- state_ctrl_ = utils::MakeShared<am::StateControllerImpl>(app_manager_mock_);
+ state_ctrl_ = std::make_shared<am::StateControllerImpl>(app_manager_mock_);
ON_CALL(app_manager_mock_, applications())
.WillByDefault(Return(applications_));
@@ -894,14 +984,15 @@ class StateControllerImplTest : public ::testing::Test {
ON_CALL(app_manager_mock_, GetPolicyHandler())
.WillByDefault(ReturnRef(policy_interface_));
smart_objects::SmartObjectSPtr bc_activate_app_request =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
(*bc_activate_app_request)[am::strings::params]
[am::strings::correlation_id] = corr_id;
ON_CALL(message_helper_mock_,
GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _))
.WillByDefault(Return(bc_activate_app_request));
-
- ON_CALL(app_manager_mock_, ManageHMICommand(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))
.WillByDefault(Return(true));
}
@@ -939,7 +1030,7 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr app,
NiceMock<application_manager_test::MockApplication>* app_mock,
am::HmiStatePtr state) {
- EXPECT_CALL(*app_mock, RegularHmiState()).WillOnce(Return(state));
+ ON_CALL(*app_mock, RegularHmiState()).WillByDefault(Return(state));
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app)).Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(app->app_id(), _, _))
.Times(0);
@@ -954,46 +1045,52 @@ class StateControllerImplTest : public ::testing::Test {
am::HmiStatePtr NoneNotAudibleState() {
return createHmiState(mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr FullAudibleState() {
return createHmiState(mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr FullNotAudibleState() {
return createHmiState(mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr LimitedState() {
return createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr BackgroundState() {
return createHmiState(mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
void ApplyTempStatesForApplication(
- NiceMock<application_manager_test::MockApplication>& application,
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>& app_mock,
std::vector<am::HmiState::StateID>& state_ids) {
- using smart_objects::SmartObject;
using am::event_engine::Event;
+ using smart_objects::SmartObject;
namespace FunctionID = hmi_apis::FunctionID;
- EXPECT_CALL(application, CurrentHmiState())
+ EXPECT_CALL(app_mock, CurrentHmiState())
.WillRepeatedly(Return(NoneNotAudibleState()));
for (size_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(application,
+ EXPECT_CALL(app_mock,
AddHMIState(Truly(HmiStatesIDComparator(state_id))));
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
@@ -1029,30 +1126,31 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_->OnNaviStreamingStarted();
+ state_ctrl_->OnVideoStreamingStarted(app);
break;
}
default:
break;
}
- EXPECT_CALL(application, AddHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, AddHMIState(_)).Times(0);
}
}
void CheckStateApplyingForApplication(
- NiceMock<application_manager_test::MockApplication>& application,
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>& app_mock,
std::vector<am::HmiState::StateID>& state_ids) {
- using smart_objects::SmartObject;
using am::event_engine::Event;
+ using smart_objects::SmartObject;
namespace FunctionID = hmi_apis::FunctionID;
- EXPECT_CALL(application, CurrentHmiState())
+ EXPECT_CALL(app_mock, CurrentHmiState())
.WillRepeatedly(Return(NoneNotAudibleState()));
for (uint32_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(application,
- AddHMIState(Truly(HmiStatesIDComparator(state_id)))).Times(1);
+ EXPECT_CALL(app_mock, AddHMIState(Truly(HmiStatesIDComparator(state_id))))
+ .Times(1);
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
@@ -1088,23 +1186,23 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_->OnNaviStreamingStarted();
+ state_ctrl_->OnVideoStreamingStarted(app);
break;
}
default:
break;
}
- EXPECT_CALL(application, AddHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, AddHMIState(_)).Times(0);
}
for (uint32_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(application, RemoveHMIState(state_id)).Times(1);
+ EXPECT_CALL(app_mock, RemoveHMIState(state_id)).Times(1);
- EXPECT_CALL(application, PostponedHmiState())
+ EXPECT_CALL(app_mock, PostponedHmiState())
.WillOnce(Return(NoneNotAudibleState()));
- EXPECT_CALL(application, RemovePostponedState());
+ EXPECT_CALL(app_mock, RemovePostponedState());
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
@@ -1140,14 +1238,14 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_->OnNaviStreamingStopped();
+ state_ctrl_->OnVideoStreamingStopped(app);
break;
}
default:
break;
}
- EXPECT_CALL(application, RemoveHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, RemoveHMIState(_)).Times(0);
}
}
};
@@ -1199,10 +1297,13 @@ TEST_F(StateControllerImplTest, OnStateChangedToNone) {
HmiStatePtr none_state = createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN);
- HmiStatePtr not_none_state = createHmiState(HMILevel::HMI_FULL,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN);
+ HmiStatePtr not_none_state =
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
state_ctrl_->OnStateChanged(simple_app_, none_state, not_none_state);
@@ -1214,9 +1315,11 @@ TEST_F(StateControllerImplTest, OnStateChangedToNone) {
TEST_F(StateControllerImplTest, MoveSimpleAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM);
for (std::vector<HmiStatePtr>::iterator it =
@@ -1243,6 +1346,7 @@ TEST_F(StateControllerImplTest, MoveSimpleAppToValidStates) {
TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
@@ -1251,6 +1355,7 @@ TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM);
for (std::vector<HmiStatePtr>::iterator it =
@@ -1277,6 +1382,7 @@ TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
@@ -1285,6 +1391,7 @@ TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM);
// Set all valid states for audio app
@@ -1360,7 +1467,6 @@ TEST_F(StateControllerImplTest, MoveAppFromValidStateToInvalid) {
TEST_F(StateControllerImplTest,
SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
@@ -1389,7 +1495,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full = media_navi_vc_app_;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock =
@@ -1415,7 +1520,6 @@ TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileAnotherTypeAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full = media_app_;
@@ -1442,7 +1546,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
am::ApplicationSharedPtr app_in_full =
@@ -1468,7 +1571,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
@@ -1495,7 +1597,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetLimitedToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
@@ -1523,7 +1624,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInLimited) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_limited = navi_app_;
@@ -1542,11 +1642,12 @@ TEST_F(StateControllerImplTest,
LimitedState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState());
+
state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
}
TEST_F(StateControllerImplTest,
- SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInFull) {
+ DISABLED_SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
@@ -1765,8 +1866,10 @@ TEST_F(StateControllerImplTest,
media_navi_vc_app_ptr_,
BackgroundState(),
FullAudibleState());
- ExpectAppChangeHmiStateDueToConflictResolving(
- media_app_, media_app_ptr_, LimitedState(), BackgroundState());
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState())
+ .WillOnce(Return(LimitedState()));
+
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
@@ -1788,8 +1891,10 @@ TEST_F(StateControllerImplTest,
media_navi_vc_app_ptr_,
BackgroundState(),
FullAudibleState());
- ExpectAppChangeHmiStateDueToConflictResolving(
- media_app_, media_app_ptr_, LimitedState(), BackgroundState());
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState())
+ .WillOnce(Return(LimitedState()));
+
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
@@ -1817,13 +1922,14 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
hmi_states.push_back(
StateLevelPair(createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN),
Common_HMILevel::NONE));
std::vector<StateLevelPair> initial_hmi_states = hmi_states;
std::vector<StateLevelPair>::iterator it = hmi_states.begin();
std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin();
smart_objects::SmartObjectSPtr bc_activate_app_request =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
(*bc_activate_app_request)[am::strings::params][am::strings::correlation_id] =
corr_id;
@@ -1833,7 +1939,9 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
Common_HMILevel::eType hmi_level = it->second;
SetBCActivateAppRequestToHMI(hmi_level, corr_id);
- ON_CALL(app_manager_mock_, ManageHMICommand(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))
.WillByDefault(Return(true));
EXPECT_CALL(app_manager_mock_, application_id(corr_id))
@@ -1940,49 +2048,55 @@ TEST_F(StateControllerImplTest, ActivateAppInvalidCorrelationId) {
state_ctrl_->on_event(event);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForSimpleApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForSimpleApp) {
InsertApplication(simple_app_);
- CheckStateApplyingForApplication(*simple_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ simple_app_, *simple_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForMediaApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForMediaApp) {
InsertApplication(media_app_);
- CheckStateApplyingForApplication(*media_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_app_, *media_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForNaviApp) {
InsertApplication(navi_app_);
- CheckStateApplyingForApplication(*navi_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(navi_app_, *navi_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForVCApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForVCApp) {
InsertApplication(vc_app_);
- CheckStateApplyingForApplication(*vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(vc_app_, *vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviApp) {
InsertApplication(media_navi_app_);
- CheckStateApplyingForApplication(*media_navi_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_navi_app_, *media_navi_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForMediaVCApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForMediaVCApp) {
InsertApplication(media_vc_app_);
- CheckStateApplyingForApplication(*media_vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_vc_app_, *media_vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForNaviVCApp) {
InsertApplication(navi_vc_app_);
- CheckStateApplyingForApplication(*navi_vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ navi_vc_app_, *navi_vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviVCApp) {
InsertApplication(media_navi_vc_app_);
- CheckStateApplyingForApplication(*media_navi_vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_navi_vc_app_, *media_navi_vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
am::HmiStatePtr state_phone_call =
- utils::MakeShared<am::PhoneCallHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::PhoneCallHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_phone_call,
APP_TYPE_NON_MEDIA,
@@ -1991,7 +2105,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
am::HmiStatePtr state_phone_call =
- utils::MakeShared<am::PhoneCallHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::PhoneCallHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_phone_call,
APP_TYPE_MEDIA,
@@ -1999,7 +2113,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
- am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
+ am::HmiStatePtr state_phone_call = std::make_shared<am::PhoneCallHmiState>(
media_navi_app_, app_manager_mock_);
TestSetState(media_navi_app_,
state_phone_call,
@@ -2009,7 +2123,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_vr,
APP_TYPE_NON_MEDIA,
@@ -2018,7 +2132,7 @@ TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -2027,7 +2141,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -2037,7 +2151,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(simple_app_,
@@ -2049,7 +2163,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(simple_app_,
@@ -2061,7 +2175,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_app_,
@@ -2073,7 +2187,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_app_,
@@ -2085,7 +2199,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_navi_vc_app_,
@@ -2097,7 +2211,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_navi_vc_app_,
@@ -2108,7 +2222,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(simple_app_,
+ std::make_shared<am::VideoStreamingHmiState>(simple_app_,
app_manager_mock_);
TestSetState(simple_app_,
state_navi_streming,
@@ -2117,9 +2231,9 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) {
+ DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_app_,
+ std::make_shared<am::VideoStreamingHmiState>(media_app_,
app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
@@ -2130,9 +2244,9 @@ TEST_F(StateControllerImplTest,
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateMediaApplicationAttenuatedSupported) {
+ DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_app_,
+ std::make_shared<am::VideoStreamingHmiState>(media_app_,
app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
@@ -2143,9 +2257,9 @@ TEST_F(StateControllerImplTest,
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateVCApplicationAttenuatedNotSupported) {
+ DISABLED_SetNaviStreamingStateVCApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(vc_app_, app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(vc_app_,
@@ -2155,9 +2269,9 @@ TEST_F(StateControllerImplTest,
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateVCApplicationAttenuatedSupported) {
+ DISABLED_SetNaviStreamingStateVCApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(vc_app_, app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(vc_app_,
@@ -2166,9 +2280,9 @@ TEST_F(StateControllerImplTest,
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
-TEST_F(StateControllerImplTest, SetNaviStreamingStateNaviApplication) {
+TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(navi_app_,
+ std::make_shared<am::VideoStreamingHmiState>(navi_app_,
app_manager_mock_);
TestSetState(navi_app_,
state_navi_streming,
@@ -2176,9 +2290,10 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateNaviApplication) {
&StateControllerImplTest::PrepareNaviStreamingHMIStateResults);
}
-TEST_F(StateControllerImplTest, SetNaviStreamingStateMediaNaviApplication) {
+TEST_F(StateControllerImplTest,
+ DISABLED_SetNaviStreamingStateMediaNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_navi_app_,
+ std::make_shared<am::VideoStreamingHmiState>(media_navi_app_,
app_manager_mock_);
TestSetState(media_navi_app_,
state_navi_streming,
@@ -2188,7 +2303,7 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateMediaNaviApplication) {
TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::SafetyModeHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::SafetyModeHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_safety_mode,
APP_TYPE_NON_MEDIA,
@@ -2197,7 +2312,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::VRHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2207,7 +2322,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
TEST_F(StateControllerImplTest,
SetSafetyModeStateForMediaNaviVoiceApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2240,7 +2355,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::PhoneCallHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::PhoneCallHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PreparePhoneCallHMIStateResults);
}
@@ -2249,7 +2364,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::PhoneCallHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::PhoneCallHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PreparePhoneCallHMIStateResults);
}
@@ -2278,7 +2393,7 @@ TEST_F(StateControllerImplTest, MixNaviStreamingWithVRAttenuatedNotSupported) {
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::VRHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::VRHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2286,7 +2401,7 @@ TEST_F(StateControllerImplTest, MixNaviStreamingWithVRAttenuatedSupported) {
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::VRHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::VRHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2300,7 +2415,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::TTSHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::TTSHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2308,7 +2423,7 @@ TEST_F(StateControllerImplTest, MixNaviStreamingWithTTSAttenueatedSupported) {
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::TTSHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::TTSHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareNaviStreamTTSStateResult);
}
@@ -2333,7 +2448,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::SafetyModeHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::SafetyModeHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2342,7 +2457,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::SafetyModeHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::SafetyModeHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2394,6 +2509,7 @@ TEST_F(StateControllerImplTest, SetRegularStateWithAudioStateAudible) {
HmiStatePtr check_state = createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::STREAMABLE,
SystemContext::SYSCTXT_MAIN);
EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
.WillRepeatedly(Return(BackgroundState()));
@@ -2404,7 +2520,9 @@ TEST_F(StateControllerImplTest, SetRegularStateWithAudioStateAudible) {
EXPECT_CALL(*simple_app_ptr_,
SetRegularState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(simple_app_, AudioStreamingState::AUDIBLE);
+ state_ctrl_->SetRegularState(simple_app_,
+ AudioStreamingState::AUDIBLE,
+ VideoStreamingState::STREAMABLE);
}
TEST_F(StateControllerImplTest,
@@ -2712,6 +2830,82 @@ TEST_F(StateControllerImplTest,
state_ctrl_->SetRegularState(navi_app_, hmi_state, true);
}
+TEST_F(StateControllerImplTest,
+ OnEventChangedAudioSource_KeepContext_AppRemainInFull) {
+ const uint32_t app_id = simple_app_->app_id();
+ InsertApplication(simple_app_);
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+
+ EXPECT_CALL(*simple_app_ptr_, keep_context()).WillOnce(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(FullAudibleState()));
+ EXPECT_CALL(*simple_app_ptr_, set_keep_context(false));
+
+ HmiStatePtr new_state;
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
+ .WillOnce(SaveArg<0>(&new_state));
+
+ state_ctrl_->on_event(event);
+
+ EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_EQ(new_state->audio_streaming_state(),
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+}
+
+TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) {
+ const uint32_t app_id = simple_app_->app_id();
+ InsertApplication(simple_app_);
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(LimitedState()));
+
+ HmiStatePtr new_state;
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
+ .WillOnce(SaveArg<0>(&new_state));
+
+ state_ctrl_->on_event(event);
+
+ EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_BACKGROUND);
+ EXPECT_EQ(new_state->audio_streaming_state(),
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+}
+
TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectHmiLevel) {
smart_objects::SmartObject msg;
const uint32_t app_id = simple_app_->app_id();
@@ -2753,6 +2947,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedAudioApplication) {
const HmiStatePtr state =
createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
// OnAppDeactivated
EXPECT_CALL(app_manager_mock_, application(app_id))
@@ -2781,6 +2976,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedNotAudioApplication) {
const HmiStatePtr state =
createHmiState(mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
// OnAppDeactivated
EXPECT_CALL(app_manager_mock_, application(app_id))
@@ -2836,7 +3032,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
.WillRepeatedly(Return(true));
smart_objects::SmartObjectSPtr activate_app =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*activate_app)[am::strings::params][am::strings::correlation_id] = kCorrID;
SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID);
state_ctrl_->on_event(event);
@@ -2844,9 +3040,11 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
}
TEST_F(StateControllerImplTest, IsStateActive) {
- HmiStatePtr state = createHmiState(mobile_apis::HMILevel::HMI_FULL,
- mobile_apis::AudioStreamingState::AUDIBLE,
- mobile_apis::SystemContext::SYSCTXT_MAIN);
+ HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
state->set_state_id(HmiState::STATE_ID_CURRENT);
EXPECT_TRUE(state_ctrl_->IsStateActive(state->state_id()));
state->set_state_id(HmiState::STATE_ID_REGULAR);
@@ -2855,9 +3053,10 @@ TEST_F(StateControllerImplTest, IsStateActive) {
EXPECT_FALSE(state_ctrl_->IsStateActive(state->state_id()));
}
-TEST_F(StateControllerImplTest, IsStateActiveApplyCorrectTempStates) {
+TEST_F(StateControllerImplTest, DISABLED_IsStateActiveApplyCorrectTempStates) {
InsertApplication(simple_app_);
- ApplyTempStatesForApplication(*simple_app_ptr_, valid_state_ids_);
+ ApplyTempStatesForApplication(
+ simple_app_, *simple_app_ptr_, valid_state_ids_);
std::vector<am::HmiState::StateID>::const_iterator it =
valid_state_ids_.begin();
for (; it != valid_state_ids_.end(); ++it) {
@@ -2906,6 +3105,7 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
simple_app_);
@@ -2918,6 +3118,7 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
simple_app_);
@@ -2955,6 +3156,7 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
simple_app_);
@@ -2967,6 +3169,7 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
simple_app_);
EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc
index 6efef83052..dfc694f3c5 100644
--- a/src/components/application_manager/test/usage_statistics_test.cc
+++ b/src/components/application_manager/test/usage_statistics_test.cc
@@ -36,16 +36,14 @@
#include "smart_objects/enum_schema_item.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/mock_app_stopwatch.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
namespace test {
namespace components {
namespace usage_statistics_test {
-using namespace mobile_apis; // For Language enums
-using namespace NsSmartDeviceLink::NsSmartObjects; // For EnumToCString &
- // EnumConversionHelper
+using namespace mobile_apis; // For Language enums
+using namespace ns_smart_device_link::ns_smart_objects; // For EnumToCString &
+ // EnumConversionHelper
using namespace usage_statistics;
using testing::_;
@@ -69,23 +67,22 @@ const std::string kAppId = "SPT";
class UsageStatisticsTest : public testing::Test {
public:
UsageStatisticsTest()
- : mock_statistics_manager_sptr_(
- utils::MakeShared<MockStatisticsManager>())
+ : mock_statistics_manager_sptr_(std::make_shared<MockStatisticsManager>())
, usage_statistics_test_object1_sptr_(
new application_manager::UsageStatistics(
kAppId, mock_statistics_manager_sptr_))
, language_(LanguageIdToString(kTestLanguageId)) {}
protected:
- utils::SharedPtr<MockStatisticsManager> mock_statistics_manager_sptr_;
- std::auto_ptr<application_manager::UsageStatistics>
+ std::shared_ptr<MockStatisticsManager> mock_statistics_manager_sptr_;
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object1_sptr_;
const std::string language_;
};
TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
// Arrange
- std::auto_ptr<MockAppStopwatch> mock_app_stopwatch_object(
+ std::unique_ptr<MockAppStopwatch> mock_app_stopwatch_object(
new MockAppStopwatch);
// Checks
@@ -93,7 +90,7 @@ TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
EXPECT_CALL(*mock_app_stopwatch_object, Switch(kTestAppStopwatchId));
// Act
- std::auto_ptr<application_manager::UsageStatistics>
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object2_sptr_(
new application_manager::UsageStatistics(
kAppId,
diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc
index cce0b2abf2..640a186e2b 100644
--- a/src/components/application_manager/test/zero_request_amount_test.cc
+++ b/src/components/application_manager/test/zero_request_amount_test.cc
@@ -51,7 +51,7 @@ using namespace ::profile;
using namespace application_manager::request_controller;
using namespace application_manager;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
commands::Command* RegisterApplication() {
SmartObjectSPtr resultsmart =
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 61dddf55b0..57e925cd43 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -37,6 +37,7 @@
#include <string>
#include <vector>
#include <list>
+#include <map>
#include "utils/macro.h"
#include "protocol_handler/protocol_handler_settings.h"
#include "connection_handler/connection_handler_settings.h"
@@ -109,10 +110,25 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::string& app_resource_folder() const;
/**
- * @brief Returns true, if SDL 4.0 is enabled
- * @deprecated use max_supported_protocol_version instead
- */
- DEPRECATED bool enable_protocol_4() const OVERRIDE;
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGLOWVOLTAGE
+ * which is used for handling LOW Voltage functionality
+ */
+ int low_voltage_signal_offset() const;
+
+ /**
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGWAKEUP
+ * which is used for handling LOW Voltage functionality
+ */
+ int wake_up_signal_offset() const;
+
+ /**
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGIGNITIONOFF
+ * which is used for handling LOW Voltage functionality
+ */
+ int ignition_off_signal_offset() const;
/**
* @brief Returns application icons folder path
@@ -368,6 +384,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
bool enable_policy() const;
+ /**
+ * @brief Should core use fullAppID internally instead of appID (Default true)
+ * @return Flag
+ */
+ bool use_full_app_id() const;
+
// TransportManageSettings interface
/*
@@ -385,6 +407,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
uint16_t transport_manager_tcp_adapter_port() const OVERRIDE;
+ /**
+ * @brief Returns the network interface name for TCP transport adapter
+ */
+ const std::string& transport_manager_tcp_adapter_network_interface()
+ const OVERRIDE;
+
// TransportManageMMESettings interface
const std::string& event_mq_name() const OVERRIDE;
@@ -466,17 +494,39 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
size_t update_before_hours() const;
#endif // ENABLE_SECURITY
- /**
- * @brief Reads a string value from the profile
- *
- * @param value Result value
- * @param default_value Value to use key wasn't found
- * @param pSection The section to read the value in
- * @param pKey The key whose value needs to be read out
- *
- * @return FALSE if could not read the value out of the profile
- * (then the value is equal \c default_value)
- */
+
+ /**
+ * @brief Returns true multiple transports is enabled
+ */
+ const bool multiple_transports_enabled() const OVERRIDE;
+
+ /**
+ * @brief Returns list of secondary transports available
+ * for the named primary transport
+ */
+ const std::vector<std::string>& secondary_transports_for_bluetooth()
+ const OVERRIDE;
+ const std::vector<std::string>& secondary_transports_for_usb() const OVERRIDE;
+ const std::vector<std::string>& secondary_transports_for_wifi()
+ const OVERRIDE;
+
+ /**
+ * @brief Returns list of allowed transports for the named service
+ */
+ const std::vector<std::string>& audio_service_transports() const OVERRIDE;
+ const std::vector<std::string>& video_service_transports() const OVERRIDE;
+
+ /**
+ * @brief Reads a string value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is equal \c default_value)
+ */
bool ReadStringValue(std::string* value,
const char* default_value,
const char* const pSection,
@@ -520,13 +570,17 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @param pKey The key whose value needs to be read out
* @param out_result Pointer to bool value for result reading Section
* (could be NULL)
+ * @param allow_empty If true, then out_result will be true when the value
+ * contains an empty string.
+ * If false, then out_result will be false in such case.
*
* @return container of values or empty continer
* if could not read the value out of the profile
*/
std::vector<std::string> ReadStringContainer(const char* const pSection,
const char* const pKey,
- bool* out_result) const;
+ bool* out_result,
+ bool allow_empty = false) const;
/**
* @brief Reads an container of hex int values from the profile,
* which handle as "0x01, 0xA0, 0XFF"
@@ -618,6 +672,33 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint16_t open_attempt_timeout_ms_resumption_db() const;
/**
+ * @brief Returns "transport required for resumption" map
+ *
+ * Keys of the map are AppHMIType strings, i.e. "DEFAULT", "COMMUNICATION",
+ * "MEDIA", and so on. The map may contain a special key "EMPTY_APP" for apps
+ * that does not specify any AppHMIType.
+ */
+ const std::map<std::string, std::vector<std::string> >&
+ transport_required_for_resumption_map() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a NAVIGATION app
+ */
+ const std::string& navigation_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a PROJECTION app
+ */
+ const std::string& projection_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a media app
+ *
+ * Note: this is *not* for AppHMIType = MEDIA.
+ */
+ const std::string& media_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
* @brief Returns wait time after device connection
* before app launch request
*/
@@ -687,6 +768,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency()
const OVERRIDE;
+ const std::pair<uint32_t, int32_t>& get_interior_vehicle_data_frequency()
+ const OVERRIDE;
const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const OVERRIDE;
@@ -714,13 +797,29 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @param pKey The key whose value needs to be read out
*
* @return FALSE if could not read the value out of the profile
- * (then the value is not changed)
+ * (then the value is not changed) or the value was empty
*/
bool ReadValue(std::string* value,
const char* const pSection,
const char* const pKey) const;
/**
+ * @brief Reads a string value from the profile
+ *
+ * This is same as ReadValue(), except that this method will accept an empty
+ * string.
+ *
+ * @param value The value to return
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return TRUE if the value is read, FALSE if the value is not found
+ */
+ bool ReadValueEmpty(std::string* value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
* @brief Reads a boolean value from the profile
*
* @param value The value to return
@@ -854,11 +953,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string preloaded_pt_file_;
std::string policy_snapshot_file_name_;
bool enable_policy_;
+ bool use_full_app_id_;
uint32_t transport_manager_disconnect_timeout_;
bool use_last_state_;
std::vector<uint32_t> supported_diag_modes_;
std::string system_files_path_;
uint16_t transport_manager_tcp_adapter_port_;
+ std::string transport_manager_tcp_adapter_network_interface_;
std::string tts_delimiter_;
uint32_t audio_data_stopped_timeout_;
uint32_t video_data_stopped_timeout_;
@@ -895,6 +996,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
std::pair<uint32_t, int32_t> get_vehicle_data_frequency_;
+ /*
+ * first value is count of request
+ * second is time scale
+ */
+ std::pair<uint32_t, int32_t> get_interior_vehicle_data_frequency_;
+
/**
* first value is count of retries for start stream
* second for timer
@@ -919,6 +1026,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool use_db_for_resumption_;
uint16_t attempts_to_open_resumption_db_;
uint16_t open_attempt_timeout_ms_resumption_db_;
+ std::map<std::string, std::vector<std::string> >
+ transport_required_for_resumption_map_;
+ std::string navigation_lowbandwidth_resumption_level_;
+ std::string projection_lowbandwidth_resumption_level_;
+ std::string media_lowbandwidth_resumption_level_;
uint16_t app_launch_wait_time_;
uint16_t app_launch_max_retry_attempt_;
uint16_t app_launch_retry_wait_time_;
@@ -928,8 +1040,17 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool enable_app_launch_ios_;
uint32_t app_tranport_change_timer_;
uint32_t app_tranport_change_timer_addition_;
+ bool multiple_transports_enabled_;
+ std::vector<std::string> secondary_transports_for_bluetooth_;
+ std::vector<std::string> secondary_transports_for_usb_;
+ std::vector<std::string> secondary_transports_for_wifi_;
+ std::vector<std::string> audio_service_transports_;
+ std::vector<std::string> video_service_transports_;
bool error_occured_;
std::string error_description_;
+ int low_voltage_signal_offset_;
+ int wake_up_signal_offset_;
+ int ignition_off_signal_offset_;
DISALLOW_COPY_AND_ASSIGN(Profile);
};
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 4137476d63..57984324aa 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -33,6 +33,7 @@
#include "config_profile/profile.h"
#include <errno.h>
+#include <numeric>
#include <string.h>
#include <stdlib.h>
#include <sstream>
@@ -88,6 +89,12 @@ const char* kSDL4Section = "SDL4";
const char* kSDL5Section = "SDL5";
const char* kResumptionSection = "Resumption";
const char* kAppLaunchSection = "AppLaunch";
+const char* kMultipleTransportsSection = "MultipleTransports";
+const char* kServicesMapSection = "ServicesMap";
+const char* kTransportRequiredForResumptionSection =
+ "TransportRequiredForResumption";
+const char* kLowBandwidthTransportResumptionLevelSection =
+ "LowBandwidthTransportResumptionLevel";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -146,6 +153,7 @@ const char* kHeartBeatTimeoutKey = "HeartBeatTimeout";
const char* kMaxSupportedProtocolVersionKey = "MaxSupportedProtocolVersion";
const char* kUseLastStateKey = "UseLastState";
const char* kTCPAdapterPortKey = "TCPAdapterPort";
+const char* kTCPAdapterNetworkInterfaceKey = "TCPAdapterNetworkInterface";
const char* kServerPortKey = "ServerPort";
const char* kVideoStreamingPortKey = "VideoStreamingPort";
const char* kAudioStreamingPortKey = "AudioStreamingPort";
@@ -176,11 +184,14 @@ const char* kTTSDelimiterKey = "TTSDelimiter";
const char* kRecordingFileNameKey = "RecordingFileName";
const char* kRecordingFileSourceKey = "RecordingFileSource";
const char* kEnablePolicy = "EnablePolicy";
+const char* kUseFullAppID = "UseFullAppID";
const char* kEventMQKey = "EventMQ";
const char* kAckMQKey = "AckMQ";
const char* kApplicationListUpdateTimeoutKey = "ApplicationListUpdateTimeout";
const char* kReadDIDFrequencykey = "ReadDIDRequest";
const char* kGetVehicleDataFrequencyKey = "GetVehicleDataRequest";
+const char* kGetInteriorVehicleDataFrequencyKey =
+ "GetInteriorVehicleDataRequest";
const char* kLegacyProtocolMaskKey = "LegacyProtocol";
const char* kHubProtocolMaskKey = "HubProtocol";
const char* kPoolProtocolMaskKey = "PoolProtocol";
@@ -214,6 +225,63 @@ const char* kEnableAppLaunchIOSKey = "EnableAppLaunchIOS";
const char* kAppTransportChangeTimerKey = "AppTransportChangeTimer";
const char* kAppTransportChangeTimerAdditionKey =
"AppTransportChangeTimerAddition";
+const char* kLowVoltageSignalOffsetKey = "LowVoltageSignal";
+const char* kWakeUpSignalOffsetKey = "WakeUpSignal";
+const char* kIgnitionOffSignalOffsetKey = "IgnitionOffSignal";
+const char* kMultipleTransportsEnabledKey = "MultipleTransportsEnabled";
+const char* kSecondaryTransportForBluetoothKey =
+ "SecondaryTransportForBluetooth";
+const char* kSecondaryTransportForUSBKey = "SecondaryTransportForUSB";
+const char* kSecondaryTransportForWiFiKey = "SecondaryTransportForWiFi";
+const char* kAudioServiceTransportsKey = "AudioServiceTransports";
+const char* kVideoServiceTransportsKey = "VideoServiceTransports";
+
+const char* kDefaultTransportRequiredForResumptionKey =
+ "DefaultTransportRequiredForResumption";
+const char* kAppHMITypeDefault = "DEFAULT";
+const char* kCommunicationTransportRequiredForResumptionKey =
+ "CommunicationTransportRequiredForResumption";
+const char* kAppHMITypeCommunication = "COMMUNICATION";
+const char* kMediaTransportRequiredForResumptionKey =
+ "MediaTransportRequiredForResumption";
+const char* kAppHMITypeMedia = "MEDIA";
+const char* kMessagingTransportRequiredForResumptionKey =
+ "MessagingTransportRequiredForResumption";
+const char* kAppHMITypeMessaging = "MESSAGING";
+const char* kNavigationTransportRequiredForResumptionKey =
+ "NavigationTransportRequiredForResumption";
+const char* kAppHMITypeNavigation = "NAVIGATION";
+const char* kInformationTransportRequiredForResumptionKey =
+ "InformationTransportRequiredForResumption";
+const char* kAppHMITypeInformation = "INFORMATION";
+const char* kSocialTransportRequiredForResumptionKey =
+ "SocialTransportRequiredForResumption";
+const char* kAppHMITypeSocial = "SOCIAL";
+const char* kBackgroundProcessTransportRequiredForResumptionKey =
+ "BackgroundProcessTransportRequiredForResumption";
+const char* kAppHMITypeBackgroundProcess = "BACKGROUND_PROCESS";
+const char* kTestingTransportRequiredForResumptionKey =
+ "TestingTransportRequiredForResumption";
+const char* kAppHMITypeTesting = "TESTING";
+const char* kSystemTransportRequiredForResumptionKey =
+ "SystemTransportRequiredForResumption";
+const char* kAppHMITypeSystem = "SYSTEM";
+const char* kProjectionTransportRequiredForResumptionKey =
+ "ProjectionTransportRequiredForResumption";
+const char* kAppHMITypeProjection = "PROJECTION";
+const char* kRemoteControlTransportRequiredForResumptionKey =
+ "RemoteControlTransportRequiredForResumption";
+const char* kAppHMITypeRemoteControl = "REMOTE_CONTROL";
+const char* kEmptyAppTransportRequiredForResumptionKey =
+ "EmptyAppTransportRequiredForResumption";
+const char* kAppHMITypeEmptyApp = "EMPTY_APP";
+const char* kNavigationLowBandwidthResumptionLevelKey =
+ "NavigationLowBandwidthResumptionLevel";
+const char* kProjectionLowBandwidthResumptionLevelKey =
+ "ProjectionLowBandwidthResumptionLevel";
+const char* kMediaLowBandwidthResumptionLevelKey =
+ "MediaLowBandwidthResumptionLevel";
+
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
#endif // WEB_HMI
@@ -237,6 +305,7 @@ const char* kDefaultHubProtocolMask = "com.smartdevicelink.prot";
const char* kDefaultPoolProtocolMask = "com.smartdevicelink.prot";
const char* kDefaultIAPSystemConfig = "/fs/mp/etc/mm/ipod.cfg";
const char* kDefaultIAP2SystemConfig = "/fs/mp/etc/mm/iap2.cfg";
+const char* kDefaultTransportManagerTCPAdapterNetworkInterface = "";
#ifdef ENABLE_SECURITY
const char* kDefaultSecurityProtocol = "TLSv1.2";
@@ -276,6 +345,7 @@ const uint32_t kDefaultTransportManagerDisconnectTimeout = 0;
const uint32_t kDefaultApplicationListUpdateTimeout = 1;
const std::pair<uint32_t, uint32_t> kReadDIDFrequency = {5, 1};
const std::pair<uint32_t, uint32_t> kGetVehicleDataFrequency = {5, 1};
+const std::pair<uint32_t, uint32_t> kGetInteriorVehicleDataFrequency = {20, 1};
const std::pair<uint32_t, uint32_t> kStartStreamRetryAmount = {3, 1};
const uint32_t kDefaultMaxThreadPoolSize = 2;
const int kDefaultIAP2HubConnectAttempts = 0;
@@ -309,8 +379,13 @@ const uint16_t kDefaultWaitTimeBetweenApps = 4000;
const bool kDefaultEnableAppLaunchIOS = true;
const uint32_t kDefaultAppTransportChangeTimer = 500u;
const uint32_t kDefaultAppTransportChangeTimerAddition = 0u;
+const int32_t kDefaultLowVoltageSignalOffset = 1;
+const int32_t kDefaultWakeUpSignalOffset = 2;
+const int32_t kDefaultIgnitionOffSignalOffset = 3;
const std::string kAllowedSymbols =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
+const bool kDefaultMultipleTransportsEnabled = false;
+const char* kDefaultLowBandwidthResumptionLevel = "NONE";
} // namespace
namespace profile {
@@ -370,6 +445,7 @@ Profile::Profile()
, max_supported_protocol_version_(kDefaultMaxSupportedProtocolVersion)
, policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName)
, enable_policy_(false)
+ , use_full_app_id_(true)
, transport_manager_disconnect_timeout_(
kDefaultTransportManagerDisconnectTimeout)
, use_last_state_(false)
@@ -403,6 +479,11 @@ Profile::Profile()
, attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB)
, open_attempt_timeout_ms_resumption_db_(
kDefaultOpenAttemptTimeoutMsResumptionDB)
+ , navigation_lowbandwidth_resumption_level_(
+ kDefaultLowBandwidthResumptionLevel)
+ , projection_lowbandwidth_resumption_level_(
+ kDefaultLowBandwidthResumptionLevel)
+ , media_lowbandwidth_resumption_level_(kDefaultLowBandwidthResumptionLevel)
, app_launch_wait_time_(kDefaultAppLaunchWaitTime)
, app_launch_max_retry_attempt_(kDefaultAppLaunchMaxRetryAttempt)
, app_launch_retry_wait_time_(kDefaultAppLaunchRetryWaitTime)
@@ -413,8 +494,12 @@ Profile::Profile()
, app_tranport_change_timer_(kDefaultAppTransportChangeTimer)
, app_tranport_change_timer_addition_(
kDefaultAppTransportChangeTimerAddition)
+ , multiple_transports_enabled_(kDefaultMultipleTransportsEnabled)
, error_occured_(false)
- , error_description_() {
+ , error_description_()
+ , low_voltage_signal_offset_(kDefaultLowVoltageSignalOffset)
+ , wake_up_signal_offset_(kDefaultWakeUpSignalOffset)
+ , ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset) {
// SDL version
ReadStringValue(
&sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
@@ -459,8 +544,16 @@ const std::string& Profile::app_resource_folder() const {
return app_resource_folder_;
}
-bool Profile::enable_protocol_4() const {
- return max_supported_protocol_version_ >= 4;
+int Profile::low_voltage_signal_offset() const {
+ return low_voltage_signal_offset_;
+}
+
+int Profile::wake_up_signal_offset() const {
+ return wake_up_signal_offset_;
+}
+
+int Profile::ignition_off_signal_offset() const {
+ return ignition_off_signal_offset_;
}
const std::string& Profile::app_icons_folder() const {
@@ -659,6 +752,10 @@ bool Profile::enable_policy() const {
return enable_policy_;
}
+bool Profile::use_full_app_id() const {
+ return use_full_app_id_;
+}
+
uint32_t Profile::transport_manager_disconnect_timeout() const {
return transport_manager_disconnect_timeout_;
}
@@ -682,6 +779,11 @@ uint16_t Profile::transport_manager_tcp_adapter_port() const {
return transport_manager_tcp_adapter_port_;
}
+const std::string& Profile::transport_manager_tcp_adapter_network_interface()
+ const {
+ return transport_manager_tcp_adapter_network_interface_;
+}
+
const std::string& Profile::tts_delimiter() const {
return tts_delimiter_;
}
@@ -714,6 +816,11 @@ const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency()
return get_vehicle_data_frequency_;
}
+const std::pair<uint32_t, int32_t>&
+Profile::get_interior_vehicle_data_frequency() const {
+ return get_interior_vehicle_data_frequency_;
+}
+
const std::pair<uint32_t, int32_t>& Profile::start_stream_retry_amount() const {
return start_stream_retry_amount_;
}
@@ -899,6 +1006,23 @@ uint16_t Profile::open_attempt_timeout_ms_resumption_db() const {
return open_attempt_timeout_ms_resumption_db_;
}
+const std::map<std::string, std::vector<std::string> >&
+Profile::transport_required_for_resumption_map() const {
+ return transport_required_for_resumption_map_;
+}
+
+const std::string& Profile::navigation_lowbandwidth_resumption_level() const {
+ return navigation_lowbandwidth_resumption_level_;
+}
+
+const std::string& Profile::projection_lowbandwidth_resumption_level() const {
+ return projection_lowbandwidth_resumption_level_;
+}
+
+const std::string& Profile::media_lowbandwidth_resumption_level() const {
+ return media_lowbandwidth_resumption_level_;
+}
+
const uint16_t Profile::app_launch_max_retry_attempt() const {
return app_launch_max_retry_attempt_;
}
@@ -935,6 +1059,31 @@ const uint16_t Profile::wait_time_between_apps() const {
return wait_time_between_apps_;
}
+const bool Profile::multiple_transports_enabled() const {
+ return multiple_transports_enabled_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_bluetooth()
+ const {
+ return secondary_transports_for_bluetooth_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_usb() const {
+ return secondary_transports_for_usb_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_wifi() const {
+ return secondary_transports_for_wifi_;
+}
+
+const std::vector<std::string>& Profile::audio_service_transports() const {
+ return audio_service_transports_;
+}
+
+const std::vector<std::string>& Profile::video_service_transports() const {
+ return video_service_transports_;
+}
+
const bool Profile::ErrorOccured() const {
return error_occured_;
}
@@ -1610,6 +1759,16 @@ void Profile::UpdateValues() {
kTCPAdapterPortKey,
kTransportManagerSection);
+ // Transport manager TCP network interface
+ ReadStringValue(&transport_manager_tcp_adapter_network_interface_,
+ kDefaultTransportManagerTCPAdapterNetworkInterface,
+ kTransportManagerSection,
+ kTCPAdapterNetworkInterfaceKey);
+
+ LOG_UPDATED_VALUE(transport_manager_tcp_adapter_network_interface_,
+ kTCPAdapterNetworkInterfaceKey,
+ kTransportManagerSection);
+
// Event MQ
ReadStringValue(
&event_mq_name_, kDefaultEventMQ, kTransportManagerSection, kEventMQKey);
@@ -1701,6 +1860,15 @@ void Profile::UpdateValues() {
enable_policy_ = false;
}
+ // Use full app ID internally?
+ std::string use_full_id_string;
+ if (ReadValue(&use_full_id_string, kPolicySection, kUseFullAppID) &&
+ 0 == strcmp("true", use_full_id_string.c_str())) {
+ use_full_app_id_ = true;
+ } else {
+ use_full_app_id_ = false;
+ }
+
// Max protocol version
ReadUIntValue(&max_supported_protocol_version_,
kDefaultMaxSupportedProtocolVersion,
@@ -1735,6 +1903,11 @@ void Profile::UpdateValues() {
kMainSection,
kGetVehicleDataFrequencyKey);
+ ReadUintIntPairValue(&get_interior_vehicle_data_frequency_,
+ kGetInteriorVehicleDataFrequency,
+ kMainSection,
+ kGetInteriorVehicleDataFrequencyKey);
+
ReadUIntValue(&max_thread_pool_size_,
kDefaultMaxThreadPoolSize,
kApplicationManagerSection,
@@ -1841,6 +2014,84 @@ void Profile::UpdateValues() {
kOpenAttemptTimeoutMsResumptionDBKey,
kResumptionSection);
+ { // read parameters from TransportRequiredForResumption section
+ struct KeyPair {
+ const char* ini_key_name;
+ const char* map_key_name;
+ } keys[] = {
+ {kDefaultTransportRequiredForResumptionKey, kAppHMITypeDefault},
+ {kCommunicationTransportRequiredForResumptionKey,
+ kAppHMITypeCommunication},
+ {kMediaTransportRequiredForResumptionKey, kAppHMITypeMedia},
+ {kMessagingTransportRequiredForResumptionKey, kAppHMITypeMessaging},
+ {kNavigationTransportRequiredForResumptionKey, kAppHMITypeNavigation},
+ {kInformationTransportRequiredForResumptionKey, kAppHMITypeInformation},
+ {kSocialTransportRequiredForResumptionKey, kAppHMITypeSocial},
+ {kBackgroundProcessTransportRequiredForResumptionKey,
+ kAppHMITypeBackgroundProcess},
+ {kTestingTransportRequiredForResumptionKey, kAppHMITypeTesting},
+ {kSystemTransportRequiredForResumptionKey, kAppHMITypeSystem},
+ {kProjectionTransportRequiredForResumptionKey, kAppHMITypeProjection},
+ {kRemoteControlTransportRequiredForResumptionKey,
+ kAppHMITypeRemoteControl},
+ {kEmptyAppTransportRequiredForResumptionKey, kAppHMITypeEmptyApp},
+ {NULL, NULL}};
+ struct KeyPair* entry = keys;
+
+ while (entry->ini_key_name != NULL) {
+ bool exist = false;
+ std::vector<std::string> transport_list =
+ ReadStringContainer(kTransportRequiredForResumptionSection,
+ entry->ini_key_name,
+ &exist,
+ true);
+ if (exist) {
+ transport_required_for_resumption_map_[entry->map_key_name] =
+ transport_list;
+
+ const std::string list_with_comma = std::accumulate(
+ transport_list.begin(),
+ transport_list.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,
+ kTransportRequiredForResumptionSection);
+ }
+ entry++;
+ }
+ }
+
+ // Read parameters from LowBandwidthTransportResumptionLevel section
+ ReadStringValue(&navigation_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kNavigationLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(navigation_lowbandwidth_resumption_level_,
+ kNavigationLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
+ ReadStringValue(&projection_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kProjectionLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(projection_lowbandwidth_resumption_level_,
+ kProjectionLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
+ ReadStringValue(&media_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kMediaLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(media_lowbandwidth_resumption_level_,
+ kMediaLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
// Read parameters from App Launch section
ReadUIntValue(&app_launch_wait_time_,
kDefaultAppLaunchWaitTime,
@@ -1917,6 +2168,83 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(app_tranport_change_timer_addition_,
kAppTransportChangeTimerAdditionKey,
kMainSection);
+
+ ReadIntValue(&low_voltage_signal_offset_,
+ kDefaultLowVoltageSignalOffset,
+ kMainSection,
+ kLowVoltageSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ low_voltage_signal_offset_, kLowVoltageSignalOffsetKey, kMainSection);
+
+ ReadIntValue(&wake_up_signal_offset_,
+ kDefaultWakeUpSignalOffset,
+ kMainSection,
+ kWakeUpSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ wake_up_signal_offset_, kWakeUpSignalOffsetKey, kMainSection);
+
+ ReadIntValue(&ignition_off_signal_offset_,
+ kDefaultIgnitionOffSignalOffset,
+ kMainSection,
+ kIgnitionOffSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ ignition_off_signal_offset_, kIgnitionOffSignalOffsetKey, kMainSection);
+
+ ReadBoolValue(&multiple_transports_enabled_,
+ kDefaultMultipleTransportsEnabled,
+ kMultipleTransportsSection,
+ kMultipleTransportsEnabledKey);
+
+ LOG_UPDATED_BOOL_VALUE(multiple_transports_enabled_,
+ kMultipleTransportsEnabledKey,
+ kMultipleTransportsSection);
+
+ { // Secondary Transports and ServicesMap
+ struct KeyPair {
+ std::vector<std::string>* ini_vector;
+ const char* ini_section_name;
+ const char* ini_key_name;
+ } keys[] = {{&secondary_transports_for_bluetooth_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForBluetoothKey},
+ {&secondary_transports_for_usb_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForUSBKey},
+ {&secondary_transports_for_wifi_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForWiFiKey},
+ {&audio_service_transports_,
+ kServicesMapSection,
+ kAudioServiceTransportsKey},
+ {&video_service_transports_,
+ kServicesMapSection,
+ kVideoServiceTransportsKey},
+ {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,
@@ -1944,15 +2272,22 @@ bool Profile::ReadValue(std::string* value,
const char* const pSection,
const char* const pKey) const {
DCHECK(value);
+ return ReadValueEmpty(value, pSection, pKey) && "\0" != *value;
+}
+
+bool Profile::ReadValueEmpty(std::string* value,
+ const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
bool ret = false;
char buf[INI_LINE_LEN + 1];
*buf = '\0';
- if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) &&
- ('\0' != *buf)) {
+ if (0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) {
*value = buf;
ret = true;
}
+
return ret;
}
@@ -2014,6 +2349,18 @@ namespace {
int32_t hex_to_int(const std::string& value) {
return static_cast<int32_t>(strtol(value.c_str(), NULL, 16));
}
+
+std::string trim_string(const std::string& str) {
+ const char* delims = " \t";
+
+ size_t start = str.find_first_not_of(delims);
+ if (std::string::npos == start) {
+ return std::string();
+ }
+ size_t end = str.find_last_not_of(delims);
+
+ return str.substr(start, end - start + 1);
+}
}
std::vector<int> Profile::ReadIntContainer(const char* const pSection,
@@ -2031,9 +2378,15 @@ std::vector<int> Profile::ReadIntContainer(const char* const pSection,
std::vector<std::string> Profile::ReadStringContainer(
const char* const pSection,
const char* const pKey,
- bool* out_result) const {
+ bool* out_result,
+ bool allow_empty) const {
std::string string;
- const bool result = ReadValue(&string, pSection, pKey);
+ bool result;
+ if (allow_empty) {
+ result = ReadValueEmpty(&string, pSection, pKey);
+ } else {
+ result = ReadValue(&string, pSection, pKey);
+ }
if (out_result)
*out_result = result;
std::vector<std::string> value_container;
@@ -2043,7 +2396,7 @@ std::vector<std::string> Profile::ReadStringContainer(
while (iss) {
if (!getline(iss, temp_str, ','))
break;
- value_container.push_back(temp_str);
+ value_container.push_back(trim_string(temp_str));
}
}
return value_container;
diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc
index e7d62f4740..64bafdd6bf 100644
--- a/src/components/config_profile/test/profile_test.cc
+++ b/src/components/config_profile/test/profile_test.cc
@@ -690,10 +690,34 @@ TEST_F(ProfileTest, CheckStringContainer) {
std::vector<std::string>::iterator element_mode = diagmodes_list.begin();
element_mode++;
element_mode++;
- diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), " 0x03");
+ diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), "0x03");
EXPECT_EQ(diag_mode, element_mode);
}
+TEST_F(ProfileTest, CheckStringContainerEmpty) {
+ // Set new config file
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
+
+ bool isread = false;
+ std::vector<std::string> output_list =
+ profile_.ReadStringContainer("MAIN", "AppConfigFolder", &isread);
+ EXPECT_FALSE(isread);
+ EXPECT_TRUE(output_list.empty());
+
+ isread = false;
+ std::vector<std::string> output_list2 =
+ profile_.ReadStringContainer("MAIN", "AppConfigFolder", &isread, true);
+ EXPECT_TRUE(isread);
+ EXPECT_TRUE(output_list2.empty());
+
+ isread = false;
+ std::vector<std::string> output_list3 =
+ profile_.ReadStringContainer("MAIN", "DoesNotExistKey", &isread, true);
+ EXPECT_FALSE(isread);
+ EXPECT_TRUE(output_list2.empty());
+}
+
#ifdef ENABLE_SECURITY
TEST_F(ProfileTest, CheckIntContainerInSecurityData) {
// Set new config file
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index 9b72d60776..4f900bb65e 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -72,13 +72,18 @@ typedef std::map<int32_t, Connection*> ConnectionList;
*/
struct Service {
protocol_handler::ServiceType service_type;
+ transport_manager::ConnectionUID connection_id;
bool is_protected_;
Service()
: service_type(protocol_handler::kInvalidServiceType)
+ , connection_id(0)
, is_protected_(false) {}
- explicit Service(protocol_handler::ServiceType service_type)
- : service_type(service_type), is_protected_(false) {}
+ explicit Service(protocol_handler::ServiceType service_type,
+ transport_manager::ConnectionUID connection_id)
+ : service_type(service_type)
+ , connection_id(connection_id)
+ , is_protected_(false) {}
bool operator==(const protocol_handler::ServiceType service_type) const {
return this->service_type == service_type;
@@ -154,9 +159,11 @@ class Connection {
/**
* @brief Adds session to connection
+ * @param connection_handle Connection Handle for the session
* @return new session id or 0 in case of issues
*/
- uint32_t AddNewSession();
+ uint32_t AddNewSession(
+ const transport_manager::ConnectionUID connection_handle);
/**
* @brief Removes session from connection
@@ -171,11 +178,13 @@ class Connection {
* @param session_id session ID
* @param service_type Type of service
* @param is_protected protection state
+ * @param connection_id Connection ID associated with the service
* @return TRUE on success, otherwise FALSE
*/
bool AddNewService(uint8_t session_id,
protocol_handler::ServiceType service_type,
- const bool is_protected);
+ const bool is_protected,
+ transport_manager::ConnectionUID connection_id);
/**
* @brief Removes service from session
* @param session_id session ID
@@ -184,6 +193,18 @@ class Connection {
*/
bool RemoveService(uint8_t session_id,
protocol_handler::ServiceType service_type);
+
+ /**
+ * @brief Removes secondary service from session
+ * @param secondary_connection_handle connection identifying services to be
+ * removed
+ * @param removed_services_list Returned: List of service types removed
+ * @return the session ID associated with the services removed
+ */
+ uint8_t RemoveSecondaryServices(
+ transport_manager::ConnectionUID secondary_connection_handle,
+ std::list<protocol_handler::ServiceType>& removed_services_list);
+
#ifdef ENABLE_SECURITY
/**
* @brief Sets crypto context of service
@@ -213,10 +234,11 @@ class Connection {
const protocol_handler::ServiceType& service_type);
#endif // ENABLE_SECURITY
- /**
- * @brief Returns map of sessions which have been opened in
- * current connection.
- */
+
+ /**
+ * @brief Returns map of sessions which have been opened in
+ * current connection.
+ */
const SessionMap session_map() const;
/**
@@ -283,6 +305,20 @@ class Connection {
*/
bool ProtocolVersion(uint8_t session_id, uint8_t& protocol_version);
+ /**
+ * @brief Returns the primary connection handle associated with this
+ * connection
+ * @return ConnectionHandle
+ */
+ ConnectionHandle primary_connection_handle() const;
+
+ /**
+ * @brief Sets the primary connection handle
+ * @param primary_connection_handle the primary connection handle to
+ * associate with this connection
+ */
+ void SetPrimaryConnectionHandle(ConnectionHandle primary_connection_handle);
+
private:
/**
* @brief Current connection handler.
@@ -304,7 +340,12 @@ class Connection {
*/
SessionMap session_map_;
- mutable sync_primitives::Lock session_map_lock_;
+ mutable sync_primitives::RecursiveLock session_map_lock_;
+
+ /**
+ * @brief primary connection handle for secondary connections
+ */
+ ConnectionHandle primary_connection_handle_;
/**
* @brief monitor that closes connection if there is no traffic over it
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
index 66b2d7cf16..1ab70ce702 100644
--- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
@@ -54,11 +54,14 @@
#include "utils/stl_utils.h"
#include "utils/rwlock.h"
+const transport_manager::ConnectionUID kDisabledSecondary = 0xFFFFFFFF;
+
/**
* \namespace connection_handler
* \brief SmartDeviceLink connection_handler namespace.
*/
namespace connection_handler {
+
/**
* \class ConnectionHandlerImpl
* \brief SmartDeviceLink connection_handler main class
@@ -193,25 +196,6 @@ class ConnectionHandlerImpl
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates start of new session.
- * \param connection_handle Connection identifier within which session has to
- * be started.
- * \param session_id Identifier of the session to be started
- * \param service_type Type of service
- * \param is_protected would be service protected
- * \param hash_id pointer for session hash identifier
- * \return uint32_t Id (number) of new session if successful, otherwise 0.
- * \deprecated
- */
- virtual uint32_t OnSessionStartedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id);
-
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates start of new session.
* Result must be notified through NotifySessionStartedContext().
* \param connection_handle Connection identifier within which session
* has to be started.
@@ -227,22 +211,7 @@ class ConnectionHandlerImpl
const protocol_handler::ServiceType& service_type,
const bool is_protected,
const BsonObject* params);
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates session ending.
- * \param connection_handle Connection identifier within which session exists
- * \param sessionId Identifier of the session to be ended
- * \param hashCode Hash used only in second version of SmartDeviceLink
- * protocol.
- * If not equal to hash assigned to session on start then operation fails.
- * \return uint32_t 0 if operation fails, session key otherwise
- * \deprecated
- */
- uint32_t OnSessionEndedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
- const uint32_t& hashCode,
- const protocol_handler::ServiceType& service_type) OVERRIDE;
+
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates session ending.
@@ -274,6 +243,24 @@ class ConnectionHandlerImpl
void OnMalformedMessageCallback(const uint32_t& connection_key) OVERRIDE;
/**
+ * @brief Converts connection handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param connection_handle A connection identifier
+ * @return string representation of the transport of the device
+ */
+ const std::string TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const;
+
+ /**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ const std::string TransportTypeProfileStringFromDeviceHandle(
+ DeviceHandle device_handle) const;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
@@ -503,26 +490,49 @@ class ConnectionHandlerImpl
std::list<int32_t>* sessions_list,
connection_handler::DeviceHandle* device_id) const OVERRIDE;
- /**
- * DEPRECATED
- * \brief information about given Connection Key.
- * \param key Unique key used by other components as session identifier
- * \param app_id Returned: ApplicationID
- * \param sessions_list Returned: List of session keys
- * \param device_id Returned: DeviceID
- * \return int32_t -1 in case of error or 0 in case of success
- */
- int32_t GetDataOnSessionKey(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id) const OVERRIDE;
-
const ConnectionHandlerSettings& get_settings() const OVERRIDE;
const protocol_handler::SessionObserver& get_session_observer();
DevicesDiscoveryStarter& get_device_discovery_starter();
/**
+ * \brief Add a session. This is meant to be called from Connection class.
+ * \param primary_transport_id the primary connection ID to associate with the
+ * newly created session
+ * \return new session id, or 0 if failed
+ **/
+ uint32_t AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) OVERRIDE;
+
+ /**
+ * \brief Remove a session. This is meant to be called from Connection class.
+ * \param session_id ID of the session to remove
+ * \return true if successful, false otherwise
+ **/
+ bool RemoveSession(uint8_t session_id) OVERRIDE;
+
+ DataAccessor<SessionConnectionMap> session_connection_map() OVERRIDE;
+
+ /**
+ * \brief Associate a secondary transport ID with a session
+ * \param session_id the session ID
+ * \param connection_id the new secondary connection ID to associate with the
+ * session
+ * \return the SessionTransports (newly) associated with the session
+ **/
+ SessionTransports SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) OVERRIDE;
+
+ /**
+ * \brief Retrieve the session transports associated with a session
+ * \param session_id the session ID
+ * \return the SessionTransports associated with the session
+ **/
+ const SessionTransports GetSessionTransports(
+ uint8_t session_id) const OVERRIDE;
+
+ /**
* \brief Invoked when observer's OnServiceStartedCallback is completed
* \param session_key the key of started session passed to
* OnServiceStartedCallback().
@@ -538,6 +548,28 @@ class ConnectionHandlerImpl
bool result,
std::vector<std::string>& rejected_params);
+ /**
+ * \brief Called when secondary transport with given session ID is established
+ * \param primary_connection_handle Set to identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * \param sessionid session ID taken from Register Secondary Transport frame
+ **/
+ bool OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) OVERRIDE;
+
+ /**
+ * \brief Called when secondary transport shuts down
+ * \param primary_connection_handle Identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * transport
+ **/
+ void OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle)
+ OVERRIDE;
+
private:
/**
* \brief Disconnect application.
@@ -549,6 +581,9 @@ class ConnectionHandlerImpl
void OnConnectionEnded(const transport_manager::ConnectionUID connection_id);
+ const uint8_t GetSessionIdFromSecondaryTransport(
+ transport_manager::ConnectionUID secondary_transport_id) const;
+
const ConnectionHandlerSettings& settings_;
/**
* \brief Pointer to observer
@@ -568,6 +603,13 @@ class ConnectionHandlerImpl
DeviceMap device_list_;
/**
+ * @brief session/connection map
+ */
+ SessionConnectionMap session_connection_map_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ session_connection_map_lock_ptr_;
+
+ /**
* \brief List of connections
*/
ConnectionList connection_list_;
@@ -587,6 +629,11 @@ class ConnectionHandlerImpl
std::map<uint32_t, protocol_handler::SessionContext>
start_service_context_map_;
+ /**
+ * @brief connection object as it's being closed
+ */
+ Connection* ending_connection_;
+
#ifdef BUILD_TESTS
// Methods for test usage
public:
@@ -595,6 +642,9 @@ class ConnectionHandlerImpl
void addDeviceConnection(
const transport_manager::DeviceInfo& device_info,
const transport_manager::ConnectionUID connection_id);
+ SessionConnectionMap& getSessionConnectionMap() {
+ return session_connection_map_;
+ }
#endif
private:
DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl);
diff --git a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
index 4d1d07112c..cf956353dd 100644
--- a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
+++ b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
@@ -102,7 +102,7 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
void RefreshExpiration();
uint32_t heartbeat_timeout_mseconds_;
- TimevalStruct heartbeat_expiration_;
+ date_time::TimeDuration heartbeat_expiration_;
bool is_heartbeat_sent_;
};
@@ -111,7 +111,7 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
typedef std::map<uint8_t, SessionState> SessionMap;
SessionMap sessions_;
- sync_primitives::Lock sessions_list_lock_; // recurcive
+ sync_primitives::RecursiveLock sessions_list_lock_; // recurcive
sync_primitives::Lock main_thread_lock_;
mutable sync_primitives::Lock heartbeat_timeout_seconds_lock_;
sync_primitives::ConditionalVariable heartbeat_monitor_;
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 16b88c4164..3f5b0e1901 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -81,7 +81,7 @@ Connection::Connection(ConnectionHandle connection_handle,
: connection_handler_(connection_handler)
, connection_handle_(connection_handle)
, connection_device_handle_(connection_device_handle)
- , session_map_lock_(true)
+ , primary_connection_handle_(0)
, heartbeat_timeout_(heartbeat_timeout) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK(connection_handler_);
@@ -97,39 +97,62 @@ Connection::~Connection() {
heart_beat_monitor_thread_->join();
delete heartbeat_monitor_;
threads::DeleteThread(heart_beat_monitor_thread_);
- sync_primitives::AutoLock lock(session_map_lock_);
- session_map_.clear();
-}
-// Finds a key not presented in std::map<unsigned char, T>
-// Returns 0 if that key not found
-namespace {
-template <class T>
-uint32_t findGap(const std::map<unsigned char, T>& map) {
- for (uint32_t i = 1; i <= UCHAR_MAX; ++i) {
- if (map.find(i) == map.end()) {
- return i;
- }
+ // Before clearing out the session_map_, we must remove all sessions
+ // associated with this Connection from the SessionConnectionMap.
+
+ // NESTED LOCK: make sure to lock session_map_lock_ then ConnectionHandler's
+ // session_connection_map_lock_ptr_ (which will be taken in RemoveSession).
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.begin();
+ while (session_it != session_map_.end()) {
+ LOG4CXX_INFO(
+ logger_,
+ "Removed Session ID "
+ << static_cast<int>(session_it->first)
+ << " from Session/Connection Map in Connection Destructor");
+ connection_handler_->RemoveSession(session_it->first);
+ session_it++;
}
- return 0;
+
+ session_map_.clear();
}
-} // namespace
-uint32_t Connection::AddNewSession() {
+uint32_t Connection::AddNewSession(
+ const transport_manager::ConnectionUID connection_handle) {
LOG4CXX_AUTO_TRACE(logger_);
+
+ // NESTED LOCK: make sure to lock session_map_lock_ then ConnectionHandler's
+ // session_connection_map_lock_ptr_ (which will be taken in AddSession)
sync_primitives::AutoLock lock(session_map_lock_);
- const uint32_t session_id = findGap(session_map_);
+
+ // Even though we have our own SessionMap, we use the Connection Handler's
+ // SessionConnectionMap to generate a session ID. We want to make sure that
+ // session IDs are globally unique, and not only unique within a Connection.
+ const uint32_t session_id =
+ connection_handler_->AddSession(connection_handle);
if (session_id > 0) {
Session& new_session = session_map_[session_id];
new_session.protocol_version = ::protocol_handler::PROTOCOL_VERSION_2;
- new_session.service_list.push_back(Service(protocol_handler::kRpc));
- new_session.service_list.push_back(Service(protocol_handler::kBulk));
+ new_session.service_list.push_back(
+ Service(protocol_handler::kRpc, connection_handle));
+ new_session.service_list.push_back(
+ Service(protocol_handler::kBulk, connection_handle));
}
+
return session_id;
}
uint32_t Connection::RemoveSession(uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Again, a NESTED lock, but it follows the rules.
sync_primitives::AutoLock lock(session_map_lock_);
+
+ if (!connection_handler_->RemoveSession(session_id)) {
+ return 0;
+ }
+
SessionMap::iterator it = session_map_.find(session_id);
if (session_map_.end() == it) {
LOG4CXX_WARN(logger_, "Session not found in this connection!");
@@ -137,12 +160,14 @@ uint32_t Connection::RemoveSession(uint8_t session_id) {
}
heartbeat_monitor_->RemoveSession(session_id);
session_map_.erase(session_id);
+
return session_id;
}
bool Connection::AddNewService(uint8_t session_id,
protocol_handler::ServiceType service_type,
- const bool request_protection) {
+ const bool request_protection,
+ transport_manager::ConnectionUID connection_id) {
// Ignore wrong services
if (protocol_handler::kControl == service_type ||
protocol_handler::kInvalidServiceType == service_type) {
@@ -152,7 +177,9 @@ bool Connection::AddNewService(uint8_t session_id,
LOG4CXX_DEBUG(logger_,
"Add service " << service_type << " for session "
- << static_cast<uint32_t>(session_id));
+ << static_cast<uint32_t>(session_id)
+ << " using connection ID "
+ << static_cast<uint32_t>(connection_id));
sync_primitives::AutoLock lock(session_map_lock_);
SessionMap::iterator session_it = session_map_.find(session_id);
@@ -201,7 +228,7 @@ bool Connection::AddNewService(uint8_t session_id,
#endif // ENABLE_SECURITY
}
// id service is not exists
- session.service_list.push_back(Service(service_type));
+ session.service_list.push_back(Service(service_type, connection_id));
return true;
}
@@ -246,6 +273,63 @@ bool Connection::RemoveService(uint8_t session_id,
return true;
}
+uint8_t Connection::RemoveSecondaryServices(
+ transport_manager::ConnectionUID secondary_connection_handle,
+ std::list<protocol_handler::ServiceType>& removed_services_list) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint8_t found_session_id = 0;
+ sync_primitives::AutoLock lock(session_map_lock_);
+
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices looking for services on Connection ID "
+ << static_cast<int>(secondary_connection_handle));
+
+ // Walk the SessionMap in the primary connection, and for each
+ // Session, we walk its ServiceList, looking for all the services
+ // that were running on the now-closed Secondary Connection.
+ for (SessionMap::iterator session_it = session_map_.begin();
+ session_map_.end() != session_it;
+ ++session_it) {
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices found session ID "
+ << static_cast<int>(session_it->first));
+
+ // Now, for each session, walk the its ServiceList, looking for services
+ // that were using secondary)_connection_handle. If we find such a service,
+ // set session_found and break out of the outer loop.
+ ServiceList& service_list = session_it->second.service_list;
+ ServiceList::iterator service_it = service_list.begin();
+ for (; service_it != service_list.end();) {
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices found service ID "
+ << static_cast<int>(service_it->service_type));
+ if (service_it->connection_id == secondary_connection_handle) {
+ found_session_id = session_it->first;
+
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices removing Service "
+ << static_cast<int>(service_it->service_type)
+ << " in session "
+ << static_cast<int>(found_session_id));
+
+ removed_services_list.push_back(service_it->service_type);
+ service_it = service_list.erase(service_it);
+ } else {
+ service_it++;
+ }
+ }
+
+ // If we found a session that had services running on the secondary
+ // connection, we're done.
+ if (found_session_id != 0) {
+ break;
+ }
+ }
+
+ return found_session_id;
+}
+
#ifdef ENABLE_SECURITY
int Connection::SetSSLContext(uint8_t session_id,
security_manager::SSLContext* context) {
@@ -346,7 +430,6 @@ const SessionMap Connection::session_map() const {
}
void Connection::CloseSession(uint8_t session_id) {
- size_t size;
{
sync_primitives::AutoLock lock(session_map_lock_);
@@ -354,16 +437,10 @@ void Connection::CloseSession(uint8_t session_id) {
if (session_it == session_map_.end()) {
return;
}
- size = session_map_.size();
}
connection_handler_->CloseSession(
connection_handle_, session_id, connection_handler::kCommon);
-
- // Close connection if it is last session
- if (1 == size) {
- connection_handler_->CloseConnection(connection_handle_);
- }
}
void Connection::UpdateProtocolVersionSession(uint8_t session_id,
@@ -405,6 +482,15 @@ bool Connection::ProtocolVersion(uint8_t session_id,
return true;
}
+ConnectionHandle Connection::primary_connection_handle() const {
+ return primary_connection_handle_;
+}
+
+void Connection::SetPrimaryConnectionHandle(
+ ConnectionHandle primary_connection_handle) {
+ primary_connection_handle_ = primary_connection_handle;
+}
+
void Connection::StartHeartBeat(uint8_t session_id) {
heartbeat_monitor_->AddSession(session_id);
}
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 5b26304302..478127c42a 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -68,11 +68,14 @@ ConnectionHandlerImpl::ConnectionHandlerImpl(
, connection_handler_observer_(NULL)
, transport_manager_(tm)
, protocol_handler_(NULL)
+ , session_connection_map_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, connection_list_lock_()
, connection_handler_observer_lock_()
, connection_list_deleter_(&connection_list_)
, start_service_context_map_lock_()
- , start_service_context_map_() {}
+ , start_service_context_map_()
+ , ending_connection_(NULL) {}
ConnectionHandlerImpl::~ConnectionHandlerImpl() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -316,6 +319,7 @@ void ConnectionHandlerImpl::RemoveConnection(
bool AllowProtection(const ConnectionHandlerSettings& settings,
const protocol_handler::ServiceType& service_type,
const bool is_protected) {
+ LOG4CXX_AUTO_TRACE(logger_);
const std::vector<int>& force_unprotected_list =
is_protected ? settings.force_unprotected_service()
: settings.force_protected_service();
@@ -334,86 +338,42 @@ bool AllowProtection(const ConnectionHandlerSettings& settings,
}
#endif // ENABLE_SECURITY
-uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
+void ConnectionHandlerImpl::OnSessionStartedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
const protocol_handler::ServiceType& service_type,
const bool is_protected,
- uint32_t* hash_id) {
+ const BsonObject* params) {
LOG4CXX_AUTO_TRACE(logger_);
- if (hash_id) {
- *hash_id = protocol_handler::HASH_ID_WRONG;
- }
-
-#ifdef ENABLE_SECURITY
- if (!AllowProtection(get_settings(), service_type, is_protected)) {
- return 0;
- }
-#endif // ENABLE_SECURITY
- sync_primitives::AutoReadLock lock(connection_list_lock_);
- ConnectionList::iterator it = connection_list_.find(connection_handle);
- if (connection_list_.end() == it) {
- LOG4CXX_ERROR(logger_, "Unknown connection!");
- return 0;
- }
- uint32_t new_session_id = 0;
+ std::vector<std::string> rejected_params;
- Connection* connection = it->second;
- if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
- new_session_id = connection->AddNewSession();
- if (0 == new_session_id) {
- LOG4CXX_ERROR(logger_, "Couldn't start new session!");
- return 0;
- }
- if (hash_id) {
- *hash_id = KeyFromPair(connection_handle, new_session_id);
- }
- } else { // Could be create new service or protected exists one
- if (!connection->AddNewService(session_id, service_type, is_protected)) {
- LOG4CXX_ERROR(logger_,
- "Couldn't establish "
-#ifdef ENABLE_SECURITY
- << (is_protected ? "protected" : "non-protected")
-#endif // ENABLE_SECURITY
- << " service " << static_cast<int>(service_type)
- << " for session " << static_cast<int>(session_id));
- return 0;
- }
- new_session_id = session_id;
- if (hash_id) {
- *hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED;
- }
- }
- sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
- if (connection_handler_observer_) {
- const uint32_t session_key = KeyFromPair(connection_handle, new_session_id);
- const bool success = connection_handler_observer_->OnServiceStartedCallback(
- connection->connection_device_handle(), session_key, service_type);
- if (!success) {
+ // In case this is a Session running on a Secondary Transport, we need to
+ // find the Sessions's primary transport. In this case, "connection_handle"
+ // reflects the secondary transport, which we need for the various callbacks,
+ // so they can send appropriate Ack or NAK messages on the correct transport.
+ transport_manager::ConnectionUID primary_connection_handle =
+ connection_handle;
+ SessionTransports st = GetSessionTransports(session_id);
+ if (session_id != 0) {
+ if (st.primary_transport == 0) {
LOG4CXX_WARN(logger_,
- "Service starting forbidden by connection_handler_observer");
- if (protocol_handler::kRpc == service_type) {
- connection->RemoveSession(new_session_id);
- } else {
- connection->RemoveService(session_id, service_type);
- }
- return 0;
+ "OnSessionStartedCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnSessionStartedCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ primary_connection_handle = st.primary_transport;
}
}
- return new_session_id;
-}
-void ConnectionHandlerImpl::OnSessionStartedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- const BsonObject* params) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- std::vector<std::string> rejected_params;
- protocol_handler::SessionContext context(connection_handle,
+ protocol_handler::SessionContext context(primary_connection_handle,
+ connection_handle,
session_id,
0,
service_type,
@@ -427,7 +387,8 @@ void ConnectionHandlerImpl::OnSessionStartedCallback(
}
#endif // ENABLE_SECURITY
sync_primitives::AutoReadLock lock(connection_list_lock_);
- ConnectionList::iterator it = connection_list_.find(connection_handle);
+ ConnectionList::iterator it =
+ connection_list_.find(primary_connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_ERROR(logger_, "Unknown connection!");
protocol_handler_->NotifySessionStarted(context, rejected_params);
@@ -439,15 +400,18 @@ void ConnectionHandlerImpl::OnSessionStartedCallback(
!connection->SessionServiceExists(session_id, service_type);
if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
- context.new_session_id_ = connection->AddNewSession();
+ context.new_session_id_ =
+ connection->AddNewSession(primary_connection_handle);
if (0 == context.new_session_id_) {
LOG4CXX_ERROR(logger_, "Couldn't start new session!");
protocol_handler_->NotifySessionStarted(context, rejected_params);
return;
}
- context.hash_id_ = KeyFromPair(connection_handle, context.new_session_id_);
+ context.hash_id_ =
+ KeyFromPair(primary_connection_handle, context.new_session_id_);
} else { // Could be create new service or protected exists one
- if (!connection->AddNewService(session_id, service_type, is_protected)) {
+ if (!connection->AddNewService(
+ session_id, service_type, is_protected, connection_handle)) {
LOG4CXX_ERROR(logger_,
"Couldn't establish "
#ifdef ENABLE_SECURITY
@@ -460,19 +424,16 @@ void ConnectionHandlerImpl::OnSessionStartedCallback(
}
context.new_session_id_ = session_id;
context.hash_id_ = protocol_handler::HASH_ID_NOT_SUPPORTED;
+
+ if (st.secondary_transport == connection_handle) {
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ st.secondary_transport_services.push_back(service_type);
+ }
}
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
const uint32_t session_key =
- KeyFromPair(connection_handle, context.new_session_id_);
-
- uint32_t app_id = 0;
- GetDataOnSessionKey(
- session_key, &app_id, NULL, static_cast<DeviceHandle*>(NULL));
- if (app_id > 0) {
- context.is_ptu_required_ =
- !connection_handler_observer_->CheckAppIsNavi(app_id);
- }
+ KeyFromPair(primary_connection_handle, context.new_session_id_);
{
sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
@@ -509,10 +470,12 @@ void ConnectionHandlerImpl::NotifyServiceStartedResult(
start_service_context_map_.erase(it);
}
+ // We need the context's primary connection so we can manage its services list
Connection* connection = NULL;
{
sync_primitives::AutoReadLock lock(connection_list_lock_);
- ConnectionList::iterator it = connection_list_.find(context.connection_id_);
+ ConnectionList::iterator it =
+ connection_list_.find(context.primary_connection_id_);
if (connection_list_.end() == it) {
LOG4CXX_ERROR(logger_, "connection not found");
return;
@@ -545,6 +508,28 @@ void ConnectionHandlerImpl::OnApplicationFloodCallBack(
uint8_t session_id = 0;
PairFromKey(connection_key, &connection_handle, &session_id);
+ // In case this is a Session running on a Secondary Transport,
+ // "connection_handle" will reflect the active (secondary) transport.
+ // To close the conneciton and its sessions properly, we need to find
+ // the Sessions's primary transport/connection.
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnApplicationFloodCallBack could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnApplicationFloodCallBack found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ connection_handle = st.primary_transport;
+ }
+ }
+
LOG4CXX_INFO(logger_, "Disconnect flooding application");
if (session_id != 0) {
CloseSession(connection_handle, session_id, kFlood);
@@ -562,6 +547,28 @@ void ConnectionHandlerImpl::OnMalformedMessageCallback(
uint8_t session_id = 0;
PairFromKey(connection_key, &connection_handle, &session_id);
+ // In case this is a Session running on a Secondary Transport,
+ // "connection_handle" will reflect the active (secondary) transport.
+ // To close the conneciton and its sessions properly, we need to find
+ // the Sessions's primary transport/connection.
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnMalformedMessageCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnMalformedMessageCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ connection_handle = st.primary_transport;
+ }
+ }
+
LOG4CXX_INFO(logger_, "Disconnect malformed messaging application");
CloseConnectionSessions(connection_handle, kMalformed);
CloseConnection(connection_handle);
@@ -570,22 +577,37 @@ void ConnectionHandlerImpl::OnMalformedMessageCallback(
uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
- const uint32_t& hashCode,
- const protocol_handler::ServiceType& service_type) {
- uint32_t hashValue = hashCode;
- return OnSessionEndedCallback(
- connection_handle, session_id, &hashValue, service_type);
-}
-
-uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
uint32_t* hashCode,
const protocol_handler::ServiceType& service_type) {
LOG4CXX_AUTO_TRACE(logger_);
+ // In case this is a Session running on a Secondary Transport, we need to
+ // find the Sessions's primary transport. In this case, "connection_handle"
+ // reflects the secondary transport, which we need for the various callbacks,
+ // so they can send appropriate Ack or NAK messages on the correct transport.
+ transport_manager::ConnectionUID primary_connection_handle =
+ connection_handle;
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnSessionEndedCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnSessionEndedCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ primary_connection_handle = st.primary_transport;
+ }
+ }
+
connection_list_lock_.AcquireForReading();
- ConnectionList::iterator it = connection_list_.find(connection_handle);
+ ConnectionList::iterator it =
+ connection_list_.find(primary_connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_WARN(logger_, "Unknown connection!");
connection_list_lock_.Release();
@@ -595,7 +617,8 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
connection_list_lock_.Release();
Connection* connection = connection_item.second;
- const uint32_t session_key = KeyFromPair(connection_handle, session_id);
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
if (protocol_handler::kRpc == service_type) {
LOG4CXX_INFO(logger_,
@@ -638,6 +661,178 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
return session_key;
}
+bool ConnectionHandlerImpl::OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (session_id == 0) {
+ LOG4CXX_WARN(logger_, "Session id for secondary transport is invalid");
+ return false;
+ }
+
+ DeviceHandle device_handle;
+ Connection* connection;
+ {
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::iterator it =
+ connection_list_.find(secondary_connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Unknown connection " << secondary_connection_handle);
+ return false;
+ }
+
+ connection = it->second;
+ device_handle = connection->connection_device_handle();
+ }
+
+ // Add the secondary transport connection ID to the SessionConnectionMap
+ SessionTransports st =
+ SetSecondaryTransportID(session_id, secondary_connection_handle);
+ primary_connection_handle = st.primary_transport;
+ if (st.secondary_transport != secondary_connection_handle) {
+ LOG4CXX_WARN(logger_,
+ "Failed setting the session's secondary transport ID");
+ return false;
+ }
+
+ connection->SetPrimaryConnectionHandle(primary_connection_handle);
+
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
+
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ LOG4CXX_TRACE(logger_,
+ "Calling Connection Handler Observer's "
+ "OnSecondaryTransportStartedCallback");
+ connection_handler_observer_->OnSecondaryTransportStartedCallback(
+ device_handle, session_key);
+ }
+
+ return true;
+}
+
+void ConnectionHandlerImpl::OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ LOG4CXX_INFO(logger_,
+ "Secondary Transport: "
+ << static_cast<int32_t>(secondary_connection_handle)
+ << " ended. Cleaning up services from primary connection ID "
+ << static_cast<int32_t>(primary_connection_handle));
+ connection_list_lock_.AcquireForReading();
+ ConnectionList::iterator itr =
+ connection_list_.find(primary_connection_handle);
+ if (connection_list_.end() == itr) {
+ LOG4CXX_ERROR(logger_, "Primary Connection not found!");
+ connection_list_lock_.Release();
+ return;
+ }
+ Connection* connection = itr->second;
+ connection_list_lock_.Release();
+
+ if (connection != NULL) {
+ std::list<protocol_handler::ServiceType> removed_services_list;
+ uint8_t session_id = connection->RemoveSecondaryServices(
+ secondary_connection_handle, removed_services_list);
+
+ if (session_id == 0) {
+ // The secondary services have already been removed from the primary
+ // connection, so we find the session associated with this secondary
+ // transport in the SessionConnectionMap
+ session_id =
+ GetSessionIdFromSecondaryTransport(secondary_connection_handle);
+ }
+
+ if (session_id != 0) {
+ {
+ sync_primitives::AutoReadLock read_lock(
+ connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
+
+ // Walk the returned list of services and call the ServiceEnded
+ // callback for each
+ std::list<protocol_handler::ServiceType>::const_iterator it =
+ removed_services_list.begin();
+ for (; removed_services_list.end() != it; ++it) {
+ connection_handler_observer_->OnServiceEndedCallback(
+ session_key, *it, CloseSessionReason::kCommon);
+ }
+
+ connection_handler_observer_->OnSecondaryTransportEndedCallback(
+ session_key);
+ }
+ }
+
+ // Clear the secondary connection from the Session/Connection map entry
+ // associated with this session
+ SetSecondaryTransportID(session_id, 0);
+ }
+ }
+}
+
+const std::string
+ConnectionHandlerImpl::TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::const_iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_, "Unknown connection " << connection_handle);
+ return std::string();
+ } else {
+ DeviceHandle device_handle = it->second->connection_device_handle();
+ return TransportTypeProfileStringFromDeviceHandle(device_handle);
+ }
+}
+
+const std::string
+ConnectionHandlerImpl::TransportTypeProfileStringFromDeviceHandle(
+ DeviceHandle device_handle) const {
+ std::string connection_type;
+ DeviceMap::const_iterator it = device_list_.find(device_handle);
+ if (device_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Device not found!");
+ } else {
+ connection_type = it->second.connection_type();
+ }
+
+ // Caution: this should be in sync with devicesType map in
+ // transport_adapter_impl.cc
+ if (connection_type == "USB_AOA") {
+ return std::string("AOA_USB");
+ } else if (connection_type == "BLUETOOTH") {
+ return std::string("SPP_BLUETOOTH");
+ } else if (connection_type == "USB_IOS") {
+ return std::string("IAP_USB");
+ } else if (connection_type == "BLUETOOTH_IOS") {
+ return std::string("IAP_BLUETOOTH");
+ } else if (connection_type == "WIFI") {
+ return std::string("TCP_WIFI");
+ } else if (connection_type == "USB_IOS_HOST_MODE") {
+ return std::string("IAP_USB_HOST_MODE");
+ } else if (connection_type == "USB_IOS_DEVICE_MODE") {
+ return std::string("IAP_USB_DEVICE_MODE");
+ } else if (connection_type == "CARPLAY_WIRELESS_IOS") {
+ return std::string("IAP_CARPLAY");
+#ifdef BUILD_TESTS
+ } else if (connection_type == "BTMAC") {
+ return std::string("BTMAC");
+#endif
+ } else {
+ LOG4CXX_WARN(logger_, "Unknown transport type string: " << connection_type);
+ return std::string();
+ }
+}
+
uint32_t ConnectionHandlerImpl::KeyFromPair(
transport_manager::ConnectionUID connection_handle,
uint8_t session_id) const {
@@ -646,7 +841,7 @@ uint32_t ConnectionHandlerImpl::KeyFromPair(
"Key for ConnectionHandle:"
<< static_cast<uint32_t>(connection_handle)
<< " Session:" << static_cast<uint32_t>(session_id)
- << " is: " << static_cast<uint32_t>(key));
+ << " is: 0x" << std::hex << static_cast<uint32_t>(key));
if (protocol_handler::HASH_ID_WRONG == key) {
LOG4CXX_ERROR(logger_,
"Connection key is WRONG_HASH_ID "
@@ -716,18 +911,6 @@ int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
return 0;
}
-int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
- uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- DeviceHandle handle;
- int32_t result = GetDataOnSessionKey(key, app_id, sessions_list, &handle);
- *device_id = static_cast<uint32_t>(handle);
- return result;
-}
-
const ConnectionHandlerSettings& ConnectionHandlerImpl::get_settings() const {
return settings_;
}
@@ -741,6 +924,139 @@ DevicesDiscoveryStarter& ConnectionHandlerImpl::get_device_discovery_starter() {
return *this;
}
+// Finds a key not presented in std::map<unsigned char, T>
+// Returns 0 if that key not found
+namespace {
+template <class T>
+uint32_t findGap(const std::map<unsigned char, T>& map) {
+ for (uint32_t i = 1; i <= UCHAR_MAX; ++i) {
+ if (map.find(i) == map.end()) {
+ return i;
+ }
+ }
+ return 0;
+}
+} // namespace
+
+uint32_t ConnectionHandlerImpl::AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ const uint32_t session_id = findGap(session_connection_map_);
+ if (session_id > 0) {
+ LOG4CXX_INFO(logger_,
+ "New session ID " << session_id << " and Connection Id "
+ << static_cast<int>(primary_transport_id)
+ << " added to Session/Connection Map");
+ SessionTransports st;
+ st.primary_transport = primary_transport_id;
+ st.secondary_transport = 0;
+ session_connection_map_[session_id] = st;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Session/Connection Map could not create a new session ID!!!");
+ }
+
+ return session_id;
+}
+
+bool ConnectionHandlerImpl::RemoveSession(uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::iterator itr = session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == itr) {
+ LOG4CXX_WARN(logger_, "Session not found in Session/Connection Map!");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "Removed Session ID " << static_cast<int>(session_id)
+ << " from Session/Connection Map");
+ session_connection_map_.erase(session_id);
+ return true;
+}
+
+DataAccessor<SessionConnectionMap>
+ConnectionHandlerImpl::session_connection_map() {
+ return DataAccessor<SessionConnectionMap>(session_connection_map_,
+ session_connection_map_lock_ptr_);
+}
+
+SessionTransports ConnectionHandlerImpl::SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) {
+ SessionTransports st;
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::iterator it = session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "SetSecondaryTransportID: session ID "
+ << static_cast<int>(session_id)
+ << " not found in Session/Connection map");
+ st.primary_transport = 0;
+ st.secondary_transport = 0;
+ } else {
+ st = it->second;
+
+ // The only time we overwrite an existing entry in the map is if the new
+ // secondary transport ID is kDisabledSecondary, which effectively DISABLES
+ // the secondary transport feature for the session, or if the new secondary
+ // transport ID is 0, which means a secondary transport has shut down
+ if (st.secondary_transport != 0 &&
+ secondary_transport_id != kDisabledSecondary &&
+ secondary_transport_id != 0) {
+ LOG4CXX_WARN(logger_,
+ "SetSecondaryTransportID: session ID "
+ << static_cast<int>(session_id)
+ << " already has a secondary connection "
+ << static_cast<int>(st.secondary_transport)
+ << " in the Session/Connection map");
+ } else {
+ st.secondary_transport = secondary_transport_id;
+ session_connection_map_[session_id] = st;
+ }
+ }
+
+ return st;
+}
+
+const SessionTransports ConnectionHandlerImpl::GetSessionTransports(
+ uint8_t session_id) const {
+ SessionTransports st;
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::const_iterator it =
+ session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == it) {
+ st.primary_transport = 0;
+ st.secondary_transport = 0;
+ } else {
+ st = it->second;
+ }
+
+ return st;
+}
+
+const uint8_t ConnectionHandlerImpl::GetSessionIdFromSecondaryTransport(
+ transport_manager::ConnectionUID secondary_transport_id) const {
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::const_iterator it = session_connection_map_.begin();
+ for (; session_connection_map_.end() != it; it++) {
+ SessionTransports st = it->second;
+ if (st.secondary_transport == secondary_transport_id) {
+ return it->first;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_,
+ "Could not find secondary transport ID "
+ << static_cast<int>(secondary_transport_id)
+ << " in the Session/Connection map");
+ return 0;
+}
+
struct CompareMAC {
explicit CompareMAC(const std::string& mac) : mac_(mac) {}
bool operator()(const DeviceMap::value_type& device) {
@@ -1117,8 +1433,33 @@ void ConnectionHandlerImpl::SendEndService(uint32_t key, uint8_t service_type) {
uint32_t connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(key, &connection_handle, &session_id);
- protocol_handler_->SendEndService(
- connection_handle, session_id, service_type);
+
+ // If the service is running on a secondary transport, we need to retrieve
+ // that transport from the SessionConnection Map
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "SendEndService could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "SendEndService found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ auto it = std::find(st.secondary_transport_services.begin(),
+ st.secondary_transport_services.end(),
+ service_type);
+ if (it != st.secondary_transport_services.end()) {
+ connection_handle = st.secondary_transport;
+ st.secondary_transport_services.erase(it);
+ }
+ protocol_handler_->SendEndService(
+ st.primary_transport, connection_handle, session_id, service_type);
+ }
}
}
@@ -1179,12 +1520,16 @@ void ConnectionHandlerImpl::OnConnectionEnded(
connection_list_lock_.Release();
return;
}
- std::auto_ptr<Connection> connection(itr->second);
+ std::unique_ptr<Connection> connection(itr->second);
connection_list_.erase(itr);
connection_list_lock_.Release();
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_ && connection.get() != NULL) {
+ // We have to remember the Connection object we just removed from
+ // connection_list_, because we will need to retrieve the protocol
+ // version from it inside of OnServiceEndedCallback
+ ending_connection_ = connection.get();
const SessionMap session_map = connection->session_map();
for (SessionMap::const_iterator session_it = session_map.begin();
@@ -1201,6 +1546,13 @@ void ConnectionHandlerImpl::OnConnectionEnded(
session_key, service_it->service_type, CloseSessionReason::kCommon);
}
}
+ ending_connection_ = NULL;
+ }
+
+ ConnectionHandle primary_connection_handle =
+ connection->primary_connection_handle();
+ if (primary_connection_handle != 0) {
+ OnSecondaryTransportEnded(primary_connection_handle, connection_id);
}
}
@@ -1241,6 +1593,10 @@ bool ConnectionHandlerImpl::ProtocolVersionUsed(
ConnectionList::const_iterator it = connection_list_.find(connection_id);
if (connection_list_.end() != it) {
return it->second->ProtocolVersion(session_id, protocol_version);
+ } else if (ending_connection_ &&
+ static_cast<uint32_t>(ending_connection_->connection_handle()) ==
+ connection_id) {
+ return ending_connection_->ProtocolVersion(session_id, protocol_version);
}
LOG4CXX_WARN(logger_, "Connection not found !");
return false;
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
index f3a2322810..4c2d5899af 100644
--- a/src/components/connection_handler/src/heartbeat_monitor.cc
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -47,7 +47,6 @@ HeartBeatMonitor::HeartBeatMonitor(uint32_t heartbeat_timeout_mseconds,
Connection* connection)
: default_heartbeat_timeout_(heartbeat_timeout_mseconds)
, connection_(connection)
- , sessions_list_lock_(true)
, run_(true) {}
void HeartBeatMonitor::Process() {
@@ -90,18 +89,20 @@ void HeartBeatMonitor::threadMain() {
}
void HeartBeatMonitor::AddSession(uint8_t session_id) {
- LOG4CXX_DEBUG(logger_,
- "Add session with id " << static_cast<int32_t>(session_id));
+ const uint32_t converted_session_id = static_cast<int32_t>(session_id);
+ UNUSED(converted_session_id);
+ LOG4CXX_DEBUG(logger_, "Add session with id " << converted_session_id);
AutoLock auto_lock(sessions_list_lock_);
if (sessions_.end() != sessions_.find(session_id)) {
LOG4CXX_WARN(logger_,
- "Session with id " << static_cast<int32_t>(session_id)
- << " already exists");
+ "Session with id: " << converted_session_id
+ << " already exists");
return;
}
sessions_.insert(
std::make_pair(session_id, SessionState(default_heartbeat_timeout_)));
- LOG4CXX_INFO(logger_, "Start heartbeat for session " << session_id);
+ LOG4CXX_INFO(logger_,
+ "Start heartbeat for session: " << converted_session_id);
}
void HeartBeatMonitor::RemoveSession(uint8_t session_id) {
@@ -164,8 +165,8 @@ HeartBeatMonitor::SessionState::SessionState(
void HeartBeatMonitor::SessionState::RefreshExpiration() {
LOG4CXX_DEBUG(logger_, "Refresh expiration: " << heartbeat_timeout_mseconds_);
using namespace date_time;
- TimevalStruct time = DateTime::getCurrentTime();
- DateTime::AddMilliseconds(time, heartbeat_timeout_mseconds_);
+ date_time::TimeDuration time = getCurrentTime();
+ AddMilliseconds(time, heartbeat_timeout_mseconds_);
heartbeat_expiration_ = time;
}
@@ -194,8 +195,8 @@ void HeartBeatMonitor::SessionState::KeepAlive() {
}
bool HeartBeatMonitor::SessionState::HasTimeoutElapsed() {
- TimevalStruct now = date_time::DateTime::getCurrentTime();
- return date_time::DateTime::Greater(now, heartbeat_expiration_);
+ date_time::TimeDuration now = date_time::getCurrentTime();
+ return date_time::Greater(now, heartbeat_expiration_);
}
} // namespace connection_handler
diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc
index d0b9ce4ae4..64de24b103 100644
--- a/src/components/connection_handler/test/connection_handler_impl_test.cc
+++ b/src/components/connection_handler/test/connection_handler_impl_test.cc
@@ -88,7 +88,7 @@ class ConnectionHandlerTest : public ::testing::Test {
mac_address_ = "test_address";
connection_handler_ = new ConnectionHandlerImpl(
- mock_connection_handler_settings, mock_transport_manager_);
+ mock_connection_handler_settings_, mock_transport_manager_);
uid_ = 1u;
connection_key_ = connection_handler_->KeyFromPair(0, 0u);
protected_services_.clear();
@@ -101,23 +101,29 @@ class ConnectionHandlerTest : public ::testing::Test {
void SetSpecificServices() {
#ifdef ENABLE_SECURITY
- ON_CALL(mock_connection_handler_settings, force_protected_service())
+ ON_CALL(mock_connection_handler_settings_, force_protected_service())
.WillByDefault(ReturnRefOfCopy(protected_services_));
- ON_CALL(mock_connection_handler_settings, force_unprotected_service())
+ ON_CALL(mock_connection_handler_settings_, force_unprotected_service())
.WillByDefault(ReturnRefOfCopy(unprotected_services_));
#endif // ENABLE_SECURITY
}
+
// Additional SetUp
void AddTestDeviceConnection() {
const transport_manager::DeviceInfo device_info(
device_handle_, mac_address_, device_name_, connection_type_);
// Add Device and connection
- ON_CALL(mock_connection_handler_settings, heart_beat_timeout())
+ ON_CALL(mock_connection_handler_settings_, heart_beat_timeout())
.WillByDefault(Return(1000u));
connection_handler_->addDeviceConnection(device_info, uid_);
connection_key_ = connection_handler_->KeyFromPair(uid_, 0u);
// Remove all specific services
}
+
+ /**
+ * @brief Adds test session
+ * @return session_id
+ */
void AddTestSession() {
protocol_handler_test::MockProtocolHandler temp_protocol_handler;
connection_handler_->set_protocol_handler(&temp_protocol_handler);
@@ -134,9 +140,11 @@ class ConnectionHandlerTest : public ::testing::Test {
connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
CheckSessionExists(uid_, out_context_.new_session_id_);
}
+
uint32_t SessionHash(const uint32_t connection, const uint32_t session) {
return connection_handler_->KeyFromPair(connection, session);
}
+
void AddTestService(ServiceType service_type) {
EXPECT_NE(0u, out_context_.new_session_id_);
EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
@@ -198,10 +206,12 @@ class ConnectionHandlerTest : public ::testing::Test {
}
// Check Service Wrapper
- void CheckServiceExists(const int connectionId,
- const int session_id,
- const ::protocol_handler::ServiceType serviceId,
- const bool exists) {
+ void CheckServiceExists(
+ const int connectionId,
+ const int session_id,
+ const ::protocol_handler::ServiceType serviceId,
+ const ::transport_manager::ConnectionUID serviceConnectionId,
+ const bool exists) {
// Check all trees to find Service and check own protected value
const ConnectionList& connection_list =
connection_handler_->getConnectionList();
@@ -221,6 +231,7 @@ class ConnectionHandlerTest : public ::testing::Test {
std::find(service_list.begin(), service_list.end(), serviceId);
if (exists) {
ASSERT_NE(serv_it, service_list.end());
+ ASSERT_EQ(serv_it->connection_id, serviceConnectionId);
} else {
ASSERT_EQ(serv_it, service_list.end());
}
@@ -306,12 +317,37 @@ class ConnectionHandlerTest : public ::testing::Test {
connection->ProtocolVersion(session_id, check_protocol_version));
EXPECT_EQ(check_protocol_version, protocol_version);
}
+ void AddSecondaryTestService(ServiceType service_type) {
+ EXPECT_NE(0u, out_context_.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
+ out_context_.hash_id_);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
+
+ // Set protocol version to 5
+ ChangeProtocol(uid_,
+ out_context_.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_5);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ temp_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &temp_connection_handler_observer);
+ EXPECT_CALL(temp_connection_handler_observer,
+ OnServiceStartedCallback(_, _, service_type, _)).Times(1);
+
+ connection_handler_->OnSessionStartedCallback(2u,
+ out_context_.new_session_id_,
+ service_type,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(0));
+ connection_handler_->set_connection_handler_observer(NULL);
+ }
ConnectionHandlerImpl* connection_handler_;
testing::NiceMock<transport_manager_test::MockTransportManager>
mock_transport_manager_;
testing::NiceMock<MockConnectionHandlerSettings>
- mock_connection_handler_settings;
+ mock_connection_handler_settings_;
protocol_handler_test::MockProtocolHandler mock_protocol_handler_;
transport_manager::DeviceHandle device_handle_;
transport_manager::ConnectionUID uid_;
@@ -376,23 +412,23 @@ TEST_F(ConnectionHandlerTest, GetAppIdOnSessionKey) {
AddTestSession();
uint32_t app_id = 0;
- const uint32_t testid = SessionHash(uid_, out_context_.new_session_id_);
+ const uint32_t test_id = SessionHash(uid_, out_context_.new_session_id_);
- connection_handler::DeviceHandle null_handle = 0;
+ connection_handler::DeviceHandle* device_id = NULL;
EXPECT_EQ(0,
connection_handler_->GetDataOnSessionKey(
- connection_key_, &app_id, NULL, &null_handle));
- EXPECT_EQ(testid, app_id);
+ connection_key_, &app_id, NULL, device_id));
+ EXPECT_EQ(test_id, app_id);
}
TEST_F(ConnectionHandlerTest, GetAppIdOnSessionKey_SessionNotStarted) {
AddTestDeviceConnection();
uint32_t app_id = 0;
- connection_handler::DeviceHandle null_handle = 0;
+ connection_handler::DeviceHandle* device_id = NULL;
EXPECT_EQ(-1,
connection_handler_->GetDataOnSessionKey(
- connection_key_, &app_id, NULL, &null_handle));
+ connection_key_, &app_id, NULL, device_id));
}
TEST_F(ConnectionHandlerTest, GetDeviceID) {
@@ -500,6 +536,13 @@ TEST_F(ConnectionHandlerTest, GetPairFromKey) {
EXPECT_EQ(out_context_.new_session_id_, session_id);
}
+MATCHER_P(SameDevice, device, "") {
+ return arg.device_handle() == device.device_handle() &&
+ arg.user_friendly_name() == device.user_friendly_name() &&
+ arg.mac_address() == device.mac_address() &&
+ arg.connection_type() == device.connection_type();
+}
+
TEST_F(ConnectionHandlerTest, IsHeartBeatSupported) {
AddTestDeviceConnection();
AddTestSession();
@@ -508,17 +551,10 @@ TEST_F(ConnectionHandlerTest, IsHeartBeatSupported) {
uid_, out_context_.new_session_id_));
}
-MATCHER_P(SameDevice, device, "") {
- return arg.device_handle() == device.device_handle() &&
- arg.user_friendly_name() == device.user_friendly_name() &&
- arg.mac_address() == device.mac_address() &&
- arg.connection_type() == device.connection_type();
-}
-
TEST_F(ConnectionHandlerTest, SendEndServiceWithoutSetProtocolHandler) {
AddTestDeviceConnection();
AddTestSession();
- EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, kRpc)).Times(0);
+ EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, _, kRpc)).Times(0);
connection_handler_->SendEndService(connection_key_, kRpc);
}
@@ -526,7 +562,7 @@ TEST_F(ConnectionHandlerTest, SendEndService) {
AddTestDeviceConnection();
AddTestSession();
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, kRpc));
+ EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, _, kRpc));
connection_handler_->SendEndService(connection_key_, kRpc);
}
@@ -1112,7 +1148,7 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) {
PROTECTION_OFF,
static_cast<BsonObject*>(NULL));
EXPECT_NE(0u, audio_context.new_session_id_);
- CheckServiceExists(uid_, audio_context.new_session_id_, kAudio, true);
+ CheckServiceExists(uid_, audio_context.new_session_id_, kAudio, uid_, true);
EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, audio_context.hash_id_);
// Start Audio service
@@ -1122,7 +1158,8 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) {
PROTECTION_OFF,
static_cast<BsonObject*>(NULL));
EXPECT_NE(0u, video_context.new_session_id_);
- CheckServiceExists(uid_, video_context.new_session_id_, kMobileNav, true);
+ CheckServiceExists(
+ uid_, video_context.new_session_id_, kMobileNav, uid_, true);
EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
connection_handler_->set_protocol_handler(NULL);
@@ -1150,7 +1187,8 @@ TEST_F(ConnectionHandlerTest, StartService_withServices_withParams) {
PROTECTION_OFF,
dummy_param);
EXPECT_EQ(out_context_.new_session_id_, video_context.new_session_id_);
- CheckServiceExists(uid_, out_context_.new_session_id_, kMobileNav, true);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, uid_, true);
EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
connection_handler_->set_protocol_handler(NULL);
@@ -1174,7 +1212,7 @@ TEST_F(ConnectionHandlerTest, ServiceStop_UnExistService) {
connection_handler_->OnSessionEndedCallback(
uid_, out_context_.new_session_id_, &dummy_hash, kAudio);
EXPECT_EQ(0u, end_session_result);
- CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, uid_, false);
}
TEST_F(ConnectionHandlerTest, ServiceStop) {
@@ -1204,7 +1242,7 @@ TEST_F(ConnectionHandlerTest, ServiceStop) {
connection_handler_->OnSessionEndedCallback(
uid_, out_context_.new_session_id_, &some_hash_id, kAudio);
EXPECT_EQ(connection_key_, end_session_result);
- CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, uid_, false);
}
}
@@ -1235,8 +1273,8 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckSpecificHash) {
for (uint32_t session = 0; session < 0xFF; ++session) {
AddTestSession();
- uint32_t wrong_hash = protocol_handler::HASH_ID_WRONG;
- uint32_t hash = protocol_handler::HASH_ID_NOT_SUPPORTED;
+ uint32_t hash = connection_key_;
+ uint32_t wrong_hash = hash + 1;
const uint32_t end_audio_wrong_hash =
connection_handler_->OnSessionEndedCallback(
@@ -1273,9 +1311,6 @@ TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) {
true,
ByRef(empty)));
- EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
- .WillOnce(Return(true));
-
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
.WillOnce(SaveArg<0>(&out_context_));
@@ -1312,8 +1347,6 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_SUCCESS) {
session_key,
true,
ByRef(empty)));
- EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
- .WillOnce(Return(true));
// confirm that NotifySessionStarted() is called
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
@@ -1354,8 +1387,6 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_FAILURE) {
session_key,
false,
ByRef(empty)));
- EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
- .WillOnce(Return(true));
// confirm that NotifySessionStarted() is called
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
@@ -1446,9 +1477,6 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_Multiple) {
session_key1,
true,
ByRef(empty))));
- EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
- .Times(2)
- .WillRepeatedly(Return(true));
// verify that connection handler will not mix up the two results
SessionContext new_context_first, new_context_second;
@@ -1474,7 +1502,7 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_Multiple) {
TEST_F(ConnectionHandlerTest,
SessionStarted_StartSession_SecureSpecific_Unprotect) {
- EXPECT_CALL(mock_connection_handler_settings, heart_beat_timeout())
+ EXPECT_CALL(mock_connection_handler_settings_, heart_beat_timeout())
.WillOnce(Return(heartbeat_timeout));
// Add virtual device and connection
AddTestDeviceConnection();
@@ -2013,6 +2041,193 @@ TEST_F(ConnectionHandlerTest, OnDeviceConnectionSwitching) {
connection_handler_->OnDeviceSwitchingStart(mac_address_, second_mac_address);
}
+TEST_F(ConnectionHandlerTest, StartStopSecondarySession) {
+ // Add virtual device and connection
+ AddTestDeviceConnection();
+ // Start new session with RPC service
+ AddTestSession();
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ // Start a session on a secondary transport
+ const transport_manager::DeviceInfo secondary_device_info(
+ device_handle_, mac_address_, device_name_, std::string("WIFI"));
+ const transport_manager::ConnectionUID secondary_uid = 2u;
+ // Add Device and connection
+ ON_CALL(mock_connection_handler_settings_, heart_beat_timeout())
+ .WillByDefault(Return(1000u));
+ connection_handler_->addDeviceConnection(secondary_device_info,
+ secondary_uid);
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+
+ connection_handler_->OnSecondaryTransportStarted(
+ uid_, secondary_uid, out_context_.new_session_id_);
+
+ SessionTransports st =
+ connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, secondary_uid);
+
+ AddSecondaryTestService(kAudio);
+ AddSecondaryTestService(kMobileNav);
+
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kAudio, secondary_uid, true);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, secondary_uid, true);
+
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportEndedCallback(_)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(_, kAudio, _)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(_, kMobileNav, _)).Times(1);
+
+ connection_handler_->OnSecondaryTransportEnded(uid_, secondary_uid);
+
+ st = connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, 0u);
+
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kAudio, secondary_uid, false);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, secondary_uid, false);
+}
+
+TEST_F(ConnectionHandlerTest, StopSecondarySession_NoService) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ const transport_manager::DeviceInfo secondary_device_info(
+ device_handle_, mac_address_, device_name_, std::string("WIFI"));
+ const transport_manager::ConnectionUID secondary_uid = 123u;
+ ON_CALL(mock_connection_handler_settings_, heart_beat_timeout())
+ .WillByDefault(Return(1000u));
+ connection_handler_->addDeviceConnection(secondary_device_info,
+ secondary_uid);
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+ connection_handler_->OnSecondaryTransportStarted(
+ uid_, secondary_uid, out_context_.new_session_id_);
+
+ // check if OnSecondaryTransportEndedCallback is triggered with correct
+ // session ID even if we don't have any services
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportEndedCallback(_));
+ EXPECT_CALL(mock_connection_handler_observer, OnServiceEndedCallback(_, _, _))
+ .Times(0);
+
+ connection_handler_->OnSecondaryTransportEnded(uid_, secondary_uid);
+
+ SessionTransports st =
+ connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, 0u);
+}
+
+TEST_F(ConnectionHandlerTest, ConnectionType_valid) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ std::string ret =
+ connection_handler_->TransportTypeProfileStringFromConnHandle(uid_);
+ EXPECT_EQ(connection_type_, ret);
+}
+
+TEST_F(ConnectionHandlerTest, ConnectionType_invalid) {
+ AddTestDeviceConnection();
+
+ transport_manager::ConnectionUID invalid_uid = 12345;
+ ASSERT_TRUE(invalid_uid != uid_);
+ std::string ret =
+ connection_handler_->TransportTypeProfileStringFromConnHandle(
+ invalid_uid);
+ EXPECT_EQ(std::string(), ret);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_UpdateSuccess) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 0;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ // secondary transport's ID is 0
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ secondary_uid = 200;
+ st = connection_handler_->SetSecondaryTransportID(session_id, secondary_uid);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_UpdateFailure) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 300;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ // secondary transport's ID is already assigned
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ st = connection_handler_->SetSecondaryTransportID(session_id, 500);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ // secondary transport's ID is NOT updated
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_OverwirteSecondaryUID) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 200;
+ transport_manager::ConnectionUID secondary_uid = 500;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ secondary_uid = kDisabledSecondary;
+ st = connection_handler_->SetSecondaryTransportID(session_id, secondary_uid);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ // secondary transport's ID is updated
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_Failure) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 0;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ uint8_t invalid_session_id = 10;
+ secondary_uid = 300;
+ st = connection_handler_->SetSecondaryTransportID(invalid_session_id,
+ secondary_uid);
+ EXPECT_EQ(0u, st.primary_transport);
+ EXPECT_EQ(0u, st.secondary_transport);
+}
+
} // namespace connection_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc
index de21dd1e97..98b83f5fc4 100644
--- a/src/components/connection_handler/test/connection_test.cc
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -36,6 +36,7 @@
#include "protocol/common.h"
#include "connection_handler/connection.h"
+#include "connection_handler/mock_connection_handler.h"
#include "connection_handler/connection_handler_impl.h"
#include "protocol/service_type.h"
#include "connection_handler/mock_connection_handler_settings.h"
@@ -56,6 +57,8 @@ namespace connection_handler_test {
using namespace ::connection_handler;
using namespace ::protocol_handler;
+using ::testing::Return;
+
class ConnectionTest : public ::testing::Test {
protected:
void SetUp() OVERRIDE {
@@ -78,7 +81,7 @@ class ConnectionTest : public ::testing::Test {
session_id, protocol_handler::PROTOCOL_VERSION_3);
}
void StartDefaultSession() {
- session_id = connection_->AddNewSession();
+ session_id = connection_->AddNewSession(kDefaultConnectionHandle);
EXPECT_NE(session_id, 0u);
const SessionMap sessionMap = connection_->session_map();
EXPECT_FALSE(sessionMap.empty());
@@ -88,13 +91,14 @@ class ConnectionTest : public ::testing::Test {
std::find(serviceList.begin(), serviceList.end(), kRpc);
const bool found_result = (it != serviceList.end());
EXPECT_TRUE(found_result);
+ EXPECT_EQ(connection_->primary_connection_handle(), 0);
}
void AddNewService(const ServiceType service_type,
const bool protection,
const bool expect_add_new_service_call_result,
const bool expect_exist_service) {
- const bool result =
- connection_->AddNewService(session_id, service_type, protection);
+ const bool result = connection_->AddNewService(
+ session_id, service_type, protection, kDefaultConnectionHandle);
EXPECT_EQ(result, expect_add_new_service_call_result);
#ifdef ENABLE_SECURITY
@@ -110,12 +114,35 @@ class ConnectionTest : public ::testing::Test {
std::find(newServiceList.begin(), newServiceList.end(), service_type);
const bool found_result = it != newServiceList.end();
EXPECT_EQ(expect_exist_service, found_result);
-#ifdef ENABLE_SECURITY
if (found_result) {
const Service& service = *it;
+ transport_manager::ConnectionUID expected_connection_handle =
+ kDefaultConnectionHandle;
+ EXPECT_EQ(service.connection_id, expected_connection_handle);
+#ifdef ENABLE_SECURITY
EXPECT_EQ(service.is_protected_, protection);
- }
#endif // ENABLE_SECURITY
+ }
+ }
+ void AddNewSecondaryService(const ServiceType service_type) {
+ const bool result = connection_->AddNewService(
+ session_id, service_type, false, kSecondaryConnectionHandle);
+ EXPECT_EQ(result, true);
+
+ const SessionMap session_map = connection_->session_map();
+ EXPECT_FALSE(session_map.empty());
+ const ServiceList newServiceList = session_map.begin()->second.service_list;
+ EXPECT_FALSE(newServiceList.empty());
+ const ServiceList::const_iterator it =
+ std::find(newServiceList.begin(), newServiceList.end(), service_type);
+ const bool found_result = it != newServiceList.end();
+ EXPECT_TRUE(found_result);
+ if (found_result) {
+ const Service& service = *it;
+ transport_manager::ConnectionUID expected_secondary_connection_handle =
+ kSecondaryConnectionHandle;
+ EXPECT_EQ(service.connection_id, expected_secondary_connection_handle);
+ }
}
void RemoveService(const ServiceType service_type,
@@ -141,6 +168,8 @@ class ConnectionTest : public ::testing::Test {
transport_manager_mock;
ConnectionHandlerImpl* connection_handler_;
uint32_t session_id;
+ static const transport_manager::ConnectionUID kDefaultConnectionHandle = 1;
+ static const transport_manager::ConnectionUID kSecondaryConnectionHandle = 2;
};
TEST_F(ConnectionTest, Session_TryGetProtocolVersionWithoutSession) {
@@ -236,13 +265,17 @@ TEST_F(ConnectionTest, HeartBeat_Protocol5_ZeroHeartBeat_NotSupported) {
// Try to add service without session
TEST_F(ConnectionTest, Session_AddNewServiceWithoutSession) {
- EXPECT_EQ(connection_->AddNewService(session_id, kAudio, true),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kAudio, true, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kAudio, false),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kAudio, false, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kMobileNav, true),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kMobileNav, true, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kMobileNav, false),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kMobileNav, false, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
}
@@ -409,6 +442,133 @@ TEST_F(ConnectionTest, RemoveSession) {
EXPECT_EQ(0u, connection_->RemoveSession(session_id));
}
+TEST_F(ConnectionTest, AddNewSession_VerifyAddSessionCalled) {
+ MockConnectionHandler mock_connection_handler;
+
+ ConnectionHandle connection_handle = 123;
+ DeviceHandle device_handle = 0u;
+ uint32_t heart_beat = 10000u;
+ Connection* connection = new Connection(
+ connection_handle, device_handle, &mock_connection_handler, heart_beat);
+
+ transport_manager::ConnectionUID connection_handle_uid = 1;
+ uint32_t mock_session_id = 2;
+ EXPECT_CALL(mock_connection_handler, AddSession(connection_handle_uid))
+ .WillOnce(Return(mock_session_id));
+
+ uint32_t sid = connection->AddNewSession(connection_handle_uid);
+ EXPECT_EQ(mock_session_id, sid);
+
+ EXPECT_CALL(mock_connection_handler, RemoveSession(mock_session_id))
+ .WillOnce(Return(true)); // invoked by destructor of connection
+ delete connection;
+}
+
+TEST_F(ConnectionTest, RemoveSession_VerifyRemoveSessionCalled) {
+ MockConnectionHandler mock_connection_handler;
+
+ ConnectionHandle connection_handle = 123;
+ DeviceHandle device_handle = 0u;
+ uint32_t heart_beat = 10000u;
+ Connection* connection = new Connection(
+ connection_handle, device_handle, &mock_connection_handler, heart_beat);
+
+ transport_manager::ConnectionUID connection_handle_uid = 1;
+ uint32_t mock_session_id = 10;
+ EXPECT_CALL(mock_connection_handler, AddSession(connection_handle_uid))
+ .WillOnce(Return(mock_session_id));
+ EXPECT_CALL(mock_connection_handler,
+ RemoveSession(static_cast<uint8_t>(mock_session_id)))
+ .WillOnce(Return(true));
+
+ uint32_t sid = connection->AddNewSession(connection_handle_uid);
+
+ uint32_t ret = connection->RemoveSession(sid);
+ EXPECT_EQ(sid, ret);
+
+ delete connection;
+}
+
+TEST_F(ConnectionTest, SecondarySessionTest) {
+ StartSession();
+ AddNewService(
+ kRpc, PROTECTION_OFF, EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+
+ const ConnectionHandle connectionHandle = 0;
+ const DeviceHandle device_handle = 0u;
+ const uint32_t heart_beat = 0u;
+ Connection* secondary_connection = new Connection(
+ connectionHandle, device_handle, connection_handler_, heart_beat);
+
+ secondary_connection->SetPrimaryConnectionHandle(kDefaultConnectionHandle);
+ connection_handler::ConnectionHandle expected_primary_connection_handle =
+ kDefaultConnectionHandle;
+ EXPECT_EQ(secondary_connection->primary_connection_handle(),
+ expected_primary_connection_handle);
+
+ AddNewSecondaryService(kAudio);
+ AddNewSecondaryService(kMobileNav);
+
+ delete secondary_connection;
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_SUCCESS) {
+ StartSession();
+
+ ServiceType services[2] = {kMobileNav, kAudio};
+ AddNewSecondaryService(services[0]);
+ AddNewSecondaryService(services[1]);
+ size_t services_count = sizeof(services) / sizeof(services[0]);
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ kSecondaryConnectionHandle, removed_services);
+
+ // check return value
+ EXPECT_EQ(session_id, ret_session_id);
+ // check returned list
+ EXPECT_EQ(services_count, removed_services.size());
+ std::list<protocol_handler::ServiceType>::iterator it;
+ it = std::find(removed_services.begin(), removed_services.end(), services[0]);
+ EXPECT_TRUE(it != removed_services.end());
+ it = std::find(removed_services.begin(), removed_services.end(), services[1]);
+ EXPECT_TRUE(it != removed_services.end());
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_NoService) {
+ StartSession();
+ /* do not call AddNewSecondaryService() */
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ kSecondaryConnectionHandle, removed_services);
+
+ // check return value
+ EXPECT_EQ(0, ret_session_id);
+ // check returned list
+ EXPECT_EQ(0u, removed_services.size());
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_InvalidConnectionHandle) {
+ StartSession();
+
+ ServiceType services[2] = {kMobileNav, kAudio};
+ AddNewSecondaryService(services[0]);
+ AddNewSecondaryService(services[1]);
+
+ transport_manager::ConnectionUID invalid_connection_handle = 123;
+ ASSERT_TRUE(kSecondaryConnectionHandle != invalid_connection_handle);
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ invalid_connection_handle, removed_services);
+
+ // check return value
+ EXPECT_EQ(0, ret_session_id);
+ // check returned list
+ EXPECT_EQ(0u, removed_services.size());
+}
+
#ifdef ENABLE_SECURITY
TEST_F(ConnectionTest, SetSSLContextWithoutSession) {
diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc
index 4c67c97191..ccfff34116 100644
--- a/src/components/connection_handler/test/heart_beat_monitor_test.cc
+++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc
@@ -43,6 +43,7 @@ namespace {
const int32_t MILLISECONDS_IN_SECOND = 1000;
const int32_t MICROSECONDS_IN_MILLISECONDS = 1000;
const int32_t MICROSECONDS_IN_SECOND = 1000 * 1000;
+const uint32_t kTime_offset = 20u;
}
namespace test {
@@ -51,27 +52,34 @@ namespace connection_handler_test {
using ::testing::DoAll;
using ::testing::_;
+using ::testing::Return;
class HeartBeatMonitorTest : public testing::Test {
public:
- HeartBeatMonitorTest() : conn(NULL) {
- kTimeout = 5000u;
- }
+ HeartBeatMonitorTest()
+ : connection_(NULL)
+ , timeout_(100u)
+ , time_allowance_multiplier_(1.5)
+ , expiration_timeout_(timeout_ * 2u) {}
protected:
- testing::NiceMock<MockConnectionHandler> connection_handler_mock;
- connection_handler::Connection* conn;
- uint32_t kTimeout;
- static const connection_handler::ConnectionHandle kConnectionHandle =
+ testing::NiceMock<MockConnectionHandler> connection_handler_mock_;
+ connection_handler::Connection* connection_;
+ const uint32_t timeout_;
+ const float_t time_allowance_multiplier_;
+ const uint32_t expiration_timeout_;
+ static const connection_handler::ConnectionHandle connection_handle_ =
0xABCDEF;
+ static const transport_manager::ConnectionUID kDefaultConnectionHandle = 1;
+ static const uint32_t kDefaultSessionId = 1;
- virtual void SetUp() {
- conn = new connection_handler::Connection(
- kConnectionHandle, 0, &connection_handler_mock, kTimeout);
+ void SetUp() OVERRIDE {
+ connection_ = new connection_handler::Connection(
+ connection_handle_, 0, &connection_handler_mock_, timeout_);
}
void TearDown() OVERRIDE {
- delete conn;
+ delete connection_;
}
};
@@ -80,159 +88,191 @@ ACTION_P2(RemoveSession, conn, session_id) {
}
TEST_F(HeartBeatMonitorTest, TimerNotStarted) {
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true)); // called by destructor of Connection
+
// Whithout StartHeartBeat nothing to be call
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
- conn->AddNewSession();
+ connection_->AddNewSession(kDefaultConnectionHandle);
}
TEST_F(HeartBeatMonitorTest, TimerNotElapsed) {
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
- const uint32_t session = conn->AddNewSession();
- conn->StartHeartBeat(session);
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
+ connection_->StartHeartBeat(session);
}
TEST_F(HeartBeatMonitorTest, TimerElapsed) {
- const uint32_t session = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true)); // invoked by RemoveSession action
+
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, session, _))
- .WillOnce(
- DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, session)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, session, _))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(connection_, session)));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, session))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- conn->StartHeartBeat(session);
+ connection_->StartHeartBeat(session);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, KeptAlive) {
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
-
- const uint32_t session = conn->AddNewSession();
- conn->StartHeartBeat(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
+
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
+ connection_->StartHeartBeat(session);
+ usleep(timeout_);
+ connection_->KeepAlive(session);
+ usleep(timeout_);
+ connection_->KeepAlive(session);
}
TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
- const uint32_t session = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, session))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, session, _))
- .WillOnce(
- DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, session)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, session, _))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(connection_, session)));
times++;
- conn->StartHeartBeat(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
+ connection_->StartHeartBeat(session);
+ usleep(timeout_);
+ connection_->KeepAlive(session);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
- const uint32_t kSession1 = conn->AddNewSession();
- const uint32_t kSession2 = conn->AddNewSession();
+ const uint32_t kMockSessionId1 = 1;
+ const uint32_t kMockSessionId2 = 2;
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kMockSessionId1))
+ .WillOnce(Return(kMockSessionId2));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kMockSessionId1))
+ .WillOnce(Return(true));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kMockSessionId2))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession1 =
+ connection_->AddNewSession(kDefaultConnectionHandle);
+
+ const transport_manager::ConnectionUID kAnotherConnectionHandle = 2;
+ const uint32_t kSession2 =
+ connection_->AddNewSession(kAnotherConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession1, _))
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, kSession1, _))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
- RemoveSession(conn, kSession1)));
+ RemoveSession(connection_, kSession1)));
times++;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession2, _))
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, kSession2, _))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
- RemoveSession(conn, kSession2)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ RemoveSession(connection_, kSession2)));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession1))
+
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, kSession1))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession2))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, kSession2))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- conn->StartHeartBeat(kSession1);
- conn->StartHeartBeat(kSession2);
+ connection_->StartHeartBeat(kSession1);
+ connection_->StartHeartBeat(kSession2);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
- const uint32_t kSession = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession =
+ connection_->AddNewSession(kDefaultConnectionHandle);
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
- const uint32_t kNewTimeout = kTimeout + MICROSECONDS_IN_MILLISECONDS;
- conn->StartHeartBeat(kSession);
- conn->SetHeartBeatTimeout(kNewTimeout, kSession);
+ const uint32_t kNewTimeout = timeout_ + MICROSECONDS_IN_MILLISECONDS;
+ connection_->StartHeartBeat(kSession);
+ connection_->SetHeartBeatTimeout(kNewTimeout, kSession);
}
TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) {
- const uint32_t kSession = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession =
+ connection_->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession, _))
- .WillOnce(
- DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, kSession)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, kSession, _))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(connection_, kSession)));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, kSession))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- const uint32_t kNewTimeout = kTimeout - MICROSECONDS_IN_MILLISECONDS;
- conn->StartHeartBeat(kSession);
- conn->SetHeartBeatTimeout(kNewTimeout, kSession);
+ const uint32_t new_timeout = timeout_ - kTime_offset;
+ connection_->StartHeartBeat(kSession);
+ connection_->SetHeartBeatTimeout(new_timeout, kSession);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
} // namespace connection_handler_test
diff --git a/src/components/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt
deleted file mode 100644
index 26ff9373bf..0000000000
--- a/src/components/dbus/CMakeLists.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright (c) 2016, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
-include_directories (
- ${DBUS_INCLUDE_DIRS}
- ${CMAKE_CURRENT_SOURCE_DIR}/include/
- ${CMAKE_SOURCE_DIR}/
- ${COMPONENTS_DIR}
- ${COMPONENTS_DIR}/formatters/include/
- ${COMPONENTS_DIR}/smart_objects/include/
- ${COMPONENTS_DIR}/utils/include/
- ${CMAKE_BINARY_DIR}/src/components/
-)
-
-set(PATHS
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}/src/introspection_xml.cc
- ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
-)
-collect_sources(SOURCES "${PATHS}")
-
-set(LIBRARIES
- HMI_API
- Utils
- dbus-1
-)
-
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
- COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
- --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
-)
-
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
- COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
- --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
-)
-
-add_library("DBus" ${SOURCES})
-
-target_link_libraries("DBus" "${LIBRARIES}")
-
-if(BUILD_TESTS)
- add_subdirectory(test)
-endif()
diff --git a/src/components/dbus/codegen/code_formatter.py b/src/components/dbus/codegen/code_formatter.py
deleted file mode 100644
index c3eb1b7815..0000000000
--- a/src/components/dbus/codegen/code_formatter.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file code_formatter.py
-# @brief Utility that helps to manage indents in generated code
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-class CodeBlock:
- indent = 0
- def __init__(self, out):
- self.out = out
- if type(out) == file:
- self.indent = 0
- elif type(out) == CodeBlock:
- self.indent = out.indent
- def __enter__(self):
- self.indent += 1
- return self
- def __exit__(self, exc_type, exc_value, traceback):
- if self.indent >= 1:
- self.indent -= 1
- def write(self, s):
- for string in s.splitlines(True):
- self.out.write(' ' * self.indent + string)
-
-# vim: set ts=4 sw=4 et:
-
diff --git a/src/components/dbus/codegen/ford_xml_parser.py b/src/components/dbus/codegen/ford_xml_parser.py
deleted file mode 100644
index 4f9f222d24..0000000000
--- a/src/components/dbus/codegen/ford_xml_parser.py
+++ /dev/null
@@ -1,231 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file ford_xml_parser.py
-# @brief Parser for HMI_API.xml
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from xml.etree import ElementTree
-from collections import OrderedDict
-
-node_name = '/com/ford/hmi'
-
-class ParamDesc:
- pass
-
-class FordXmlParser:
- def __init__(self, in_el_tree, interface_path=None):
- self.interface_path = interface_path
- self.el_tree = in_el_tree
- self.find_enums()
- self.find_structs()
-
- def find_enums(self):
- self.enums = dict()
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for enum_el in interface_el.findall('enum'):
- enum_name = enum_el.get('name')
- self.enums[(interface_name,enum_name)] = enum_el
-
-
- def make_param_desc(self, param_el, iface=None):
- param_desc = ParamDesc()
- param_desc.name = param_el.get('name')
- param_desc.type = param_el.get('type')
- param_desc.enum = False
- param_desc.struct = False
- param_desc.fulltype = param_desc.type
- if param_el.get('mandatory') == 'false':
- param_desc.mandatory = False
- else:
- param_desc.mandatory = True
- if param_el.get('array') == 'true':
- param_desc.array = True
- else:
- param_desc.array = False
- param_desc.minValue = param_el.get('minvalue') if param_el.get('minvalue') else 0
- param_desc.maxValue = param_el.get('maxvalue')
- param_desc.minLength = param_el.get('minlength') if param_el.get('minlength') else 0
- param_desc.maxLength = param_el.get('maxlength')
- param_desc.minSize = param_el.get('minsize')
- param_desc.maxSize = param_el.get('maxsize')
-
- param_desc.restricted = param_desc.minValue != None or \
- param_desc.maxValue != None or \
- param_desc.minLength > 0 or \
- param_desc.maxLength > 0
- param_desc.restrictedArray = param_desc.array and (param_desc.minSize > 0 or param_desc.maxSize > 0)
- if iface is None:
- return param_desc
- if param_desc.type not in ['Integer', 'String', 'Boolean', 'Float']:
- param_type = param_desc.type.split('.')
- if len(param_type) > 1:
- param_type = (param_type[0], param_type[1])
- else:
- param_type = (iface, param_type[0])
- param_desc.fulltype = param_type
- if param_type in self.enums: param_desc.enum = True
- elif param_type in self.structs: param_desc.struct = True
- return param_desc
-
-
- def find_structs(self):
- self.structs = OrderedDict()
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for struct_el in interface_el.findall('struct'):
- struct_name = struct_el.get('name')
- self.structs[(interface_name, struct_name)] = []
-
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for struct_el in interface_el.findall('struct'):
- struct_name = struct_el.get('name')
- for param_el in struct_el.findall('param'):
- param_desc = self.make_param_desc(param_el, interface_name)
- self.structs[(interface_name, struct_name)].append(param_desc)
-
-
- def convert_struct_to_dbus(self, param_type):
- ret = '('
- struct = self.structs[param_type]
- for param in struct:
- ret = ret + self.convert_to_dbus_type(param)
- ret = ret + ')'
- return ret
-
-
- def convert_to_dbus_type(self, param):
- if param.type == 'Integer': restype = 'i'
- elif param.type == 'String': restype = 's'
- elif param.type == 'Boolean': restype = 'b'
- elif param.type == 'Float': restype = 'd' # D-Bus double
- elif param.enum: restype = 'i' # D-Bus 32-bit signed int
- elif param.struct: restype = self.convert_struct_to_dbus(param.fulltype)
- else: raise RuntimeError('Unknown type: ' + param.type)
- if param.array: restype = 'a' + restype
- if not param.mandatory: restype = '(b' + restype + ')'
- return restype
-
-
- def find_notifications(self, interface_el):
- notifications = list()
- for function_el in interface_el.findall('function[@messagetype="notification"]'):
- notifications.append(function_el)
- return notifications
-
-
- def find_notifications_by_provider(self, interface_el, provider):
- notifications = list()
- condition = 'function[@messagetype="notification"][@provider="%s"]' % provider
- for function_el in interface_el.findall(condition):
- notifications.append(function_el)
- return notifications
-
-
- def find_request_response_pairs(self, interface_el):
- result = list()
- request_els = interface_el.findall('function[@messagetype="request"]')
- response_els = interface_el.findall('function[@messagetype="response"]')
- for request_el in request_els:
- name = request_el.get('name')
- response_el = next(r for r in response_els if r.get('name') == name)
- result.append((request_el, response_el))
- return result
-
-
- def find_request_response_pairs_by_provider(self, interface_el, provider):
- result = list()
- condition = 'function[@messagetype="request"][@provider="%s"]' % provider
- request_els = interface_el.findall(condition)
- response_els = interface_el.findall('function[@messagetype="response"]')
- for request_el in request_els:
- name = request_el.get('name')
- response_el = next(r for r in response_els if r.get('name') == name)
- result.append((request_el, response_el))
- return result
-
-
- def convert_to_signal(self, notification_el, interface):
- result = ElementTree.Element('signal')
- result.set('name', notification_el.get('name'))
- for param_el in notification_el.findall('param'):
- self.create_arg_element(result, param_el, interface)
- return result
-
-
- def convert_to_method(self, (request_el, response_el), interface):
- result = ElementTree.Element('method')
- result.set('name', request_el.get('name'))
- for param_el in request_el.findall('param'):
- arg_el = self.create_arg_element(result, param_el, interface)
- arg_el.set('direction', 'in')
-
- arg_el = ElementTree.SubElement(result, 'arg')
- arg_el.set('name', 'retCode')
- arg_el.set('type', 'i')
- arg_el.set('direction', 'out')
-
- for param_el in response_el.findall('param'):
- arg_el = self.create_arg_element(result, param_el, interface)
- arg_el.set('direction', 'out')
- return result
-
-
- def create_arg_element(self, parent, param_el, interface):
- arg_el = ElementTree.SubElement(parent, 'arg')
- arg_el.set('name', param_el.get('name'))
- arg_el.set('type', self.convert_to_dbus_type(self.make_param_desc(param_el, interface)))
- return arg_el
-
-
- def create_introspection_iface_el(self, interface_el, provider):
- interface = interface_el.get('name')
- interface_name = self.interface_path + '.' + interface
-
- notifications = self.find_notifications_by_provider(interface_el, provider)
- signals = [self.convert_to_signal(n, interface) for n in notifications]
-
- request_responses = self.find_request_response_pairs_by_provider(interface_el, provider)
- methods = [self.convert_to_method(r, interface) for r in request_responses]
-
- if signals or methods:
- el = ElementTree.Element('interface', attrib={'name':interface_name})
- for m in methods: el.append(m)
- for s in signals: el.append(s)
- return el
-
-
-
diff --git a/src/components/dbus/codegen/introspection_xml.cc b/src/components/dbus/codegen/introspection_xml.cc
deleted file mode 100644
index 210c232a4d..0000000000
--- a/src/components/dbus/codegen/introspection_xml.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-// Warning! This file is generated by 'make_introspection_c.py'. Edit at your
-// own risk.
-/**
- * @file instrospections_xml.cc
- * @brief D-Bus introspection XML as C-string
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-char introspection_xml[] = {
- 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x6e, 0x6f,
- 0x64, 0x65, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d,
- 0x2f, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f,
- 0x70, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x44, 0x2d, 0x42, 0x55, 0x53,
- 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x72,
- 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e,
- 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70,
- 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64,
- 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x73,
- 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x64, 0x62, 0x75,
- 0x73, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73,
- 0x70, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c,
- 0x6e, 0x6f, 0x64, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x2f,
- 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6f, 0x72, 0x64, 0x2f, 0x68, 0x6d, 0x69,
- 0x22, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x66,
- 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64, 0x6c, 0x2e,
- 0x42, 0x61, 0x73, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53,
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x53, 0x44, 0x4c, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x52,
- 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x4e,
- 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61,
- 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x67,
- 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x6c,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x73, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x28, 0x62,
- 0x61, 0x73, 0x29, 0x69, 0x69, 0x62, 0x28, 0x62, 0x61, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x28, 0x62, 0x61, 0x69, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x74, 0x74, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x76, 0x72, 0x53, 0x79, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x73,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x73,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x56, 0x72,
- 0x47, 0x72, 0x61, 0x6d, 0x6d, 0x61, 0x72, 0x73, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x70,
- 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c,
- 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x41, 0x70, 0x70, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
- 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
- 0x65, 0x64, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6e,
- 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x74, 0x68, 0x6f,
- 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6c,
- 0x6f, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x50,
- 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6f, 0x66, 0x66, 0x73, 0x65,
- 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x20,
- 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x79, 0x6e, 0x63,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65,
- 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f,
- 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74,
- 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65,
- 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69,
- 0x2e, 0x73, 0x64, 0x6c, 0x2e, 0x55, 0x49, 0x22, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74,
- 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,
- 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
- 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d,
- 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64,
- 0x6c, 0x2e, 0x53, 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x41, 0x63, 0x74,
- 0x69, 0x76, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x53, 0x44,
- 0x4c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x69, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64,
- 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50,
- 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
- 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69,
- 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41,
- 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x69, 0x65, 0x6e,
- 0x64, 0x6c, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64,
- 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
- 0x67, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x28, 0x62, 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74,
- 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73,
- 0x74, 0x4f, 0x66, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,
- 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
- 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f,
- 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43,
- 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c,
- 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x47, 0x65, 0x74, 0x55, 0x52, 0x4c, 0x53, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22,
- 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72,
- 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f,
- 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x72,
- 0x6c, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x73,
- 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
- 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72,
- 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x76, 0x6f,
- 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76,
- 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
- 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74,
- 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6f,
- 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e,
- 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e,
- 0x3c, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3e, 0x00}; \ No newline at end of file
diff --git a/src/components/dbus/codegen/make_hmi_requests.py b/src/components/dbus/codegen/make_hmi_requests.py
deleted file mode 100755
index 4716d40439..0000000000
--- a/src/components/dbus/codegen/make_hmi_requests.py
+++ /dev/null
@@ -1,343 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
- def make_requests_classes_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- request_full_name = interface_el.get('name') + '_' +request.get('name')
- out.write('class ' + request_full_name + ': public HMIRequest {\n')
- with CodeBlock(out) as output:
- output.write('Q_OBJECT\n')
- out.write(' public:\n')
- with CodeBlock(out) as output:
- output.write(request_full_name + '(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name):\n')
- output.write(' HMIRequest(hmi_callback, interface, args, name) {}\n')
- out.write(' private:\n')
- with CodeBlock(out) as output:
- output.write('QJSValueList fillArgsList();\n};\n\n')
-
-
- def make_header_file(self, out):
- out.write("namespace requests {\n")
- out.write("class HMIRequest: public QObject {\n")
- with CodeBlock(out) as output:
- output.write('Q_OBJECT\n')
- out.write('public:\n')
- with CodeBlock(out) as output:
- output.write('HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name );\n')
- out.write('protected:\n')
- with CodeBlock(out) as output:
- output.write('virtual QJSValueList fillArgsList() = 0;\n')
- output.write('QDBusPendingCallWatcher *watcher_;\n')
- output.write('QJSValue hmi_callback_;\n\n')
- output.write('template<typename T>\n')
- output.write('QJSValue CreateQJSValue(T value) {\n')
- output.write(' return QJSValue(value);\n')
- output.write('}\n\n')
- output.write('template<typename T>\n')
- output.write('QJSValue CreateQJSValue(QList<T> value) {\n')
- with CodeBlock(output) as output:
- output.write('QJSValue array = hmi_callback_.engine()->newArray();\n')
- output.write('int i = 0;\n')
- output.write('foreach (T item, value) {\n')
- output.write(' QJSValue value = CreateQJSValue(item);\n')
- output.write(' array.setProperty(i, value);\n')
- output.write(' ++i;\n')
- output.write('}\n')
- output.write('return array;\n')
- output.write('}\n')
- out.write('private:\n')
- with CodeBlock(out) as output:
- output.write('QDBusInterface *interface_;\n')
- output.write('QList<QVariant> args_;\n')
- out.write('public slots:\n')
- with CodeBlock(out) as output:
- output.write('void invokeCallback();\n')
- out.write('};\n\n')
- output.write('template<>\n')
- output.write('QJSValue HMIRequest::CreateQJSValue(QStringList value);\n')
- for (interface_name, struct_name) in self.structs:
- out.write('template<>\n')
- out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_name + ' value);\n\n')
- impl.make_requests_classes_header(out)
- out.write("} // namespace requests\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- return "xxx"
-
-
- def make_requests_methods_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- iface_name = interface_el.get('name')
- request_full_name = iface_name + '_' +request.get('name')
- out.write('QJSValueList ' + request_full_name + '::fillArgsList() {\n')
- out.write(' QDBusPendingReply< ')
- count = 0
- for param_el in response.findall('param'):
- param = self.make_param_desc(param_el, iface_name)
- out.write(self.qt_param_type(param))
- count += 1
- if count < len(response.findall('param')):
- out.write(',')
- out.write(' > reply = *watcher_;\n')
-
- with CodeBlock(out) as out:
- out.write('QJSValueList qjsValueList;\n\n')
- out.write('QJSValue param;\n\n')
- count = 0
- for param_el in response.findall('param'):
- if param_el.get('mandatory') == 'false':
- out.write('if (reply.argumentAt<' + str(count) + '>().presence) {\n')
- out.write(' param = CreateQJSValue(reply.argumentAt<' + str(count) + '>().val);\n')
- out.write('} else {\n')
- out.write(' param = QJSValue();\n')
- out.write('}\n')
- out.write('qjsValueList.append(param);\n')
- else:
- out.write('param = CreateQJSValue(reply.argumentAt<' + str(count) + '>());\n')
- out.write('qjsValueList.append(param);\n')
- count += 1
- out.write('return qjsValueList;\n')
- out.write('}\n\n')
-
-
- def make_source_file(self, out):
- out.write("namespace requests {\n")
- for interface_el in self.el_tree.findall('interface'):
- for struct_el in interface_el.findall('struct'):
- out.write('template<>\n')
- out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_el.get('name') + ' value){\n')
- with CodeBlock(out) as output:
- output.write('QJSValue object = hmi_callback_.engine()->newObject();\n')
- for param_el in struct_el.findall('param'):
- param_name = param_el.get('name')
- if param_el.get('mandatory') == 'true':
- with CodeBlock(out) as output:
- output.write('object.setProperty("' + param_name + '", CreateQJSValue(value.' + param_name + '));\n')
- elif param_el.get('mandatory') == 'false':
- with CodeBlock(out) as output:
- output.write('object.setProperty("' + param_name + '", value.' + param_name + '.presence ? CreateQJSValue(value.' + param_name + '.val) : QJSValue());\n')
- out.write('return object;\n')
- out.write('}\n\n')
-
-
- out.write('HMIRequest::HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name) :\n')
- out.write(' hmi_callback_(hmi_callback), interface_(interface), args_(args) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusPendingCall pcall = interface->asyncCallWithArgumentList(name, args);\n')
- output.write('watcher_ = new QDBusPendingCallWatcher(pcall);\n')
- output.write('QObject::connect(watcher_, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(invokeCallback()));\n}\n\n')
- out.write('void HMIRequest::invokeCallback() {\n')
- with CodeBlock(out) as output:
- output.write('if (!hmi_callback_.isUndefined()) {\n')
- with CodeBlock(output) as output:
- output.write('QJSValueList qjsValueList;\n')
- output.write('qjsValueList = this->fillArgsList();\n')
- output.write('hmi_callback_.call(qjsValueList);\n')
- output.write('}\n')
- output.write('watcher_->deleteLater();\n')
- output.write('this->deleteLater();\n}\n\n')
- impl.make_requests_methods_source(out)
- out.write("} // namespace requests\n")
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'hmi_requests.h'
-source_name = 'hmi_requests.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file hmi_requests.h
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
-header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n\n");
-header_out.write("#include <QObject>\n");
-header_out.write("#include <QJSValue>\n");
-header_out.write("#include <QDBusPendingCall>\n");
-header_out.write("#include <QDBusPendingCallWatcher>\n");
-header_out.write('#include <QDBusPendingReply>\n');
-header_out.write("#include <QDBusAbstractInterface>\n");
-header_out.write("#include <QDBusInterface>\n");
-header_out.write("#include <QJSEngine>\n");
-
-header_out.write('#include "qml_dbus.h"\n\n');
-
-impl.make_header_file(header_out)
-
-header_out.write("#endif // SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file hmi_requests.cc
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-source_out.write('#include "hmi_requests.h"\n\n')
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_introspection_c.py b/src/components/dbus/codegen/make_introspection_c.py
deleted file mode 100755
index 22a53f308d..0000000000
--- a/src/components/dbus/codegen/make_introspection_c.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_introspection_c.py
-# @brief Converts introspection.xml to C-string
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from argparse import ArgumentParser
-from ford_xml_parser import FordXmlParser
-from ford_xml_parser import node_name
-from xml.etree import ElementTree
-from os import path
-from sys import argv
-
-class Impl(FordXmlParser):
- def convert_to_introspection(self, out_el_tree):
- for interface_el in self.el_tree.findall('interface'):
- el = self.create_introspection_iface_el(interface_el, 'sdl')
- if el is not None:
- out_el_tree.append(el)
-
-arg_parser = ArgumentParser(description='Converts introspection.xml to C-string')
-arg_parser.add_argument('--infile', required=True, help="Full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--outdir', required=True, help="Path to directory where output file introspection_xml.cc will be saved")
-args = arg_parser.parse_args()
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-out_file = open(args.outdir + '/' + 'introspection_xml.cc', "w")
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-out_tree_root = ElementTree.Element('node', attrib={'name':node_name})
-
-impl = Impl(in_tree_root, 'com.ford.hmi.sdl')
-impl.convert_to_introspection(out_tree_root)
-
-introspection_string = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">'
-introspection_string += "\n"
-introspection_string += ElementTree.tostring(out_tree_root)
-
-out_file.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-out_file.write("""/**
- * @file instrospections_xml.cc
- * @brief D-Bus introspection XML as C-string
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-
-out_file.write("char introspection_xml[] = {")
-
-cnt = 0
-for char in introspection_string:
- if cnt % 12 == 0:
- out_file.write("\n ")
- else:
- out_file.write(" ")
- out_file.write("0x%02x," % ord(char))
- cnt = cnt + 1
-
-out_file.write(" 0x00\n")
-out_file.write("};")
-
diff --git a/src/components/dbus/codegen/make_message_descriptions.py b/src/components/dbus/codegen/make_message_descriptions.py
deleted file mode 100755
index 0079666392..0000000000
--- a/src/components/dbus/codegen/make_message_descriptions.py
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_message_descriptions.py
-# @brief Generates HMI API message descriptions for D-Bus
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from argparse import ArgumentParser
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser
-from os import path
-from sys import argv
-
-namespace_name = 'ford_message_descriptions'
-namespace = namespace_name + '::'
-
-
-class Impl(FordXmlParser):
- def write_param_definition(self, param_var_name, param, out):
- if param.array:
- tmp_param = copy(param)
- tmp_param.array = False
- tmp_param.mandatory = True
- dbus_sig = self.convert_to_dbus_type(tmp_param)
- self.write_param_definition(param_var_name + '_array', tmp_param, out)
-
- if param.array: out.write('const ' + namespace + 'ArrayDescription ')
- elif param.struct: out.write('const ' + namespace + 'StructDescription ')
- else: out.write('const ' + namespace + 'ParameterDescription ')
-
- out.write(param_var_name + " = {\n")
-
- if param.struct or param.array:
- out.write(" {\n")
- shift = ' ' * 4
- else:
- shift = ' ' * 2
-
- out.write(shift + "\"" + param.name + "\",\n")
-
- if param.array:
- out.write(shift + namespace + "Array,\n")
- elif param.struct:
- out.write(shift + namespace + "Struct,\n")
- elif param.enum:
- out.write(shift + namespace + "Enum,\n")
- else:
- out.write(shift + namespace + param.type + ",\n")
-
- if param.mandatory:
- out.write(shift + "true\n")
- else:
- out.write(shift + "false\n")
-
- if param.struct or param.array:
- out.write(" },\n")
- if param.array:
- out.write(" (const " + namespace + "ParameterDescription*)&" + param_var_name + "_array,\n")
- out.write(" \"" + dbus_sig + "\"\n")
- elif param.struct:
- out.write(" Structs::" + param.fulltype[0] + "__" + param.fulltype[1] + "__parameters\n")
- out.write("};\n")
-
-
- def write_struct_params_declarations(self, out):
- out.write("struct Structs {\n");
- for (interface, name), params in self.structs.iteritems():
- params_var_name = interface + '__' + name + '__parameters'
- out.write(" static const " + namespace + "ParameterDescription* " + params_var_name + "[];\n")
- out.write("};\n\n")
-
-
- def write_enum_entries_declarations(self, out):
- out.write("struct Enums {\n");
- for interface, name in self.enums:
- entries_var_name = interface + '__' + name + '__entries'
- out.write(" static const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[];\n")
- out.write("};\n\n")
-
-
- def write_parameters(self, params, out, name):
- n = 1
- for param in params:
- param_var_name = name + str(n)
- n = n + 1
- self.write_param_definition(param_var_name, param, out)
-
-
- def write_struct_params_definitions(self, out):
- for (interface, name), params in self.structs.iteritems():
- param_var_name = interface + '__' + name + '__parameter'
- self.write_parameters(params, out, param_var_name)
- params_var_name = 'Structs::' + interface + '__' + name + '__parameters'
- out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
- for n in range(1, len(params) + 1):
- name = param_var_name + str(n)
- out.write(" (const " + namespace + "ParameterDescription*)&" + name + ",\n")
- out.write( " NULL };\n\n")
-
-
- def write_enum_entries_definitions(self, out):
- for (interface, name), enum_el in self.enums.iteritems():
- n = 1
- for element_el in enum_el.findall('element'):
- entry_var_name = interface + '__' + name + '__entry' + str(n)
- value = element_el.get("value")
- if value is None:
- value = str(n)
- out.write(namespace + "EnumDescription::Entry " + entry_var_name + " = {\"" + element_el.get("name") + "\", " + value + "};\n")
- n = n + 1
-
- entries_var_name = "Enums::" + interface + '__' + name + '__entries'
- out.write("const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[] = {\n")
- for n in range(1, len(enum_el.findall('element')) + 1):
- entry_var_name = interface + '__' + name + '__entry' + str(n)
- out.write(" &" + entry_var_name + ",\n")
- out.write(" NULL };\n\n")
-
-
- def write_message_definition(self, message_el, interface, out):
- name = message_el.get('name')
- messagetype = message_el.get('messagetype')
- params = list()
- for param_el in message_el.findall('param'):
- param_desc = self.make_param_desc(param_el, interface)
- params.append(param_desc)
- param_var_name = interface + '__' + name + '__' + messagetype + '__parameter'
- self.write_parameters(params, out, param_var_name)
-
- params_var_name = param_var_name + 's'
- out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
- for n in range(1, len(params) + 1):
- param_name = param_var_name + str(n)
- out.write(" (const " + namespace + "ParameterDescription*)&" + param_name + ",\n")
- out.write(" NULL };\n")
-
- message_desc_name = interface + '__' + name + '__' + messagetype
- out.write("const " + namespace + "MessageDescription " + message_desc_name + " = {\n")
- out.write(" \"" + interface + "\",\n")
- out.write(" \"" + name + "\",\n")
- out.write(" hmi_apis::messageType::" + messagetype + ",\n")
- out.write(" hmi_apis::FunctionID::" + interface + "_" + name + ",\n")
- out.write(" " + params_var_name + "\n")
- out.write("};\n\n")
-
-
- def write_message_definitions(self, out):
- for interface_el in self.el_tree.findall('interface'):
- interface = interface_el.get('name')
- message_els = interface_el.findall('function')
- for message_el in message_els:
- self.write_message_definition(message_el, interface, out)
-
-
- def make_message_descriptions(self, out):
- self.write_struct_params_declarations(out)
- #self.write_enum_entries_declarations(out)
- self.write_struct_params_definitions(out)
- #self.write_enum_entries_definitions(out)
- self.write_message_definitions(out)
-
-
- def make_message_array(self, out):
- out.write("const MessageDescription* message_descriptions[] = {\n")
- for interface_el in self.el_tree.findall('interface'):
- interface = interface_el.get('name')
- message_els = interface_el.findall('function')
- for message_el in message_els:
- name = message_el.get('name')
- messagetype = message_el.get('messagetype')
- message_desc_name = interface + '__' + name + '__' + messagetype
- out.write(" &" + message_desc_name + ",\n")
- out.write(" NULL\n")
- out.write("};\n")
-
-
-arg_parser = ArgumentParser(description="Generates HMI API message descriptions for D-Bus on SDL core side")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output file message_descriptions.cc will be saved")
-args = arg_parser.parse_args()
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-outfile = 'message_descriptions.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root)
-
-out = open(args.outdir + "/" + outfile, "w")
-
-out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-out.write("""/**
- * @file message_descriptions.cc
- * @brief Generated HMI API message descriptions for D-Bus
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-
-out.write("#include \"dbus/message_descriptions.h\"\n\n");
-out.write("namespace {\n\n");
-impl.make_message_descriptions(out)
-out.write("}\n\n");
-
-out.write("namespace " + namespace_name + " {\n\n");
-impl.make_message_array(out)
-out.write("}\n\n");
-
diff --git a/src/components/dbus/codegen/make_notifications_qml.py b/src/components/dbus/codegen/make_notifications_qml.py
deleted file mode 100755
index 3c173e8b4f..0000000000
--- a/src/components/dbus/codegen/make_notifications_qml.py
+++ /dev/null
@@ -1,387 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-class Notifications_qml(FordXmlParser):
- #Used for qt signal names, because qt signals cannot begin with a capital letter
- def first_letter_to_lower_case(self, s):
- if len(s) == 0:
- return s
- else:
- return s[0].lower() + s[1:]
-
- def make_header(self, out):
- out.write("class SdlProxy: public Item {\n")
- with CodeBlock(out) as out:
- out.write("Q_OBJECT\n")
- out.write("Q_DISABLE_COPY(SdlProxy)\n")
- out.write("public:\n")
- out.write("explicit SdlProxy(Item* parent = 0);\n")
- out.write("private:\n")
- out.write("QDBusInterface *sdlBasicCommunicationInterface;\n")
- out.write("signals:\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- with CodeBlock(out) as out:
- out.write("void %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("QVariant %s" % param_el.get("name"))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- with CodeBlock(out) as out:
- out.write("private slots:\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- with CodeBlock(out) as out:
- out.write("void slot_%s(" % notification_el.get("name"))
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- out.write("};\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def qml_param_type(self, param):
- if not param.mandatory:
- return "QVariant"
- if param.array:
- return "QVariant"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "QVariant"
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def make_source(self, out):
- def qml_args(variable_name_needed):
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- if variable_name_needed:
- out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
- else:
- out.write("%s" % self.qt_param_type(param))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write("SdlProxy::SdlProxy(Item *parent): Item(parent) {\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- notification_name = notification_el.get('name')
- with CodeBlock(out) as out:
- out.write("QDBusConnection::sessionBus().connect(\n")
- with CodeBlock(out) as out:
- out.write("\"com.ford.sdl.core\", \"/\", \"com.ford.sdl.core.%s\",\n" % iface_name)
- out.write("\"%s\", this, SLOT(slot_%s(" % (notification_name, notification_el.get("name")))
- qml_args(variable_name_needed = False)
- out.write(")));\n")
- out.write("}\n\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- notific_full_name = interface_el.get("name") + "_" + notification_el.get("name")
- out.write("void SdlProxy::slot_%s(" % notification_el.get("name"))
- qml_args(variable_name_needed = True)
- out.write(") {\n")
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"ENTER\");\n\n")
- for param_el in notification_el.findall("param"):
- param = self.make_param_desc(param_el, iface_name)
- tmp_param_name = param.name + "_qvariant"
- out.write("QVariant %s;\n" % tmp_param_name)
- out.write("%s = ValueToVariant(%s);\n" % (tmp_param_name, param.name))
- self.write_param_validation(param, param.name, "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\")" % (param.name, notific_full_name), out)
- out.write("\n")
- out.write("emit %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("%s" % param.name + "_qvariant")
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"EXIT\");\n")
- out.write("}\n\n")
-
-
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % fail_statement)
- out.write("}\n")
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % (fail_statement))
- out.write("}\n")
-
-
-#QVarian name;
-#if (ttsName.presence) {
-
-
-
-arg_parser = ArgumentParser(description="Generator of classes which Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-
-if args.version == "4.8.5":
- prefix_class_item = 'Script'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-else:
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'sdl_proxy.h'
-source_name = 'sdl_proxy.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Notifications_qml(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""
-/*
- 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.
-*/
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n")
-header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n\n")
-header_out.write("#include \"qml_dbus.h\"\n")
-header_out.write("#include \"qt_version.h\"\n\n")
-header_out.write("#include <QtCore/QVariant>\n")
-header_out.write("#include <QtDBus/QDBusInterface>\n")
-header_out.write("#if QT_4\n")
-header_out.write("#include <QtDeclarative/QDeclarativeItem>\n")
-header_out.write("typedef QDeclarativeItem Item;\n")
-header_out.write("#elif QT_5\n")
-header_out.write("#include <QtQuick/QQuickItem>\n")
-header_out.write("typedef QQuickItem Item;\n")
-header_out.write("#endif // QT_VERSION\n")
-
-impl.make_header(header_out)
-
-header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""
-/*
- 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.
-*/
-
-""")
-
-source_out.write("#include \"sdl_proxy.h\"\n")
-source_out.write("#include \"utils/logger.h\"\n")
-source_out.write("CREATE_LOGGERPTR_GLOBAL(logger_, \"DBusPlugin\")\n\n")
-
-impl.make_source(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_cpp.py b/src/components/dbus/codegen/make_qml_dbus_cpp.py
deleted file mode 100755
index f40bc74df8..0000000000
--- a/src/components/dbus/codegen/make_qml_dbus_cpp.py
+++ /dev/null
@@ -1,736 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
- def make_dbus_type_declarations(self, out):
- for struct in self.structs.items():
- self.write_struct_declaration(struct, out)
-
- def make_dbus_metatype_declarations(self, out):
- for struct in self.structs.items():
- self.write_struct_metatype_declaration(struct, out)
-
-
- def write_struct_declaration(self, ((iface, name), params), out):
- struct_name = "{0}_{1}".format(iface, name)
- out.write("struct {0} {{\n".format(struct_name))
- with CodeBlock(out) as out:
- for param in params:
- out.write("{0} {1};\n".format(self.qt_param_type(param), param.name))
- out.write("{0}()\n".format(struct_name))
- initializersList = map(lambda x: "{0}({1})".format(x.name, defaultValue(x)), [p for p in params if p.type != "String" and not p.struct and not p.array])
- if initializersList:
- out.write(": " + ",\n ".join(initializersList))
-
- out.write("{ }\n")
-
- out.write("};\n")
- out.write('QDBusArgument& operator << (QDBusArgument&, const ' + struct_name + "&);\n")
- out.write('const QDBusArgument& operator >> (const QDBusArgument&, ' + struct_name + "&);\n")
- out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v);\n")
- out.write('QVariant ValueToVariant(const ' + struct_name + "& v);\n")
- out.write('QVariant ValueToVariant(const QList<' + struct_name + " >& v);\n")
- out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v);\n")
- out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v);\n")
- out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + " >& v);\n")
-
-
- def write_struct_metatype_declaration(self, ((iface, name), params), out):
- struct_name = iface + '_' + name
- out.write('Q_DECLARE_METATYPE(' + struct_name + ")\n")
- out.write('Q_DECLARE_METATYPE(OptionalArgument<' + struct_name + ">)\n")
- out.write('Q_DECLARE_METATYPE(QList<' + struct_name + ">)\n")
- out.write('Q_DECLARE_METATYPE(OptionalArgument<QList<' + struct_name + "> >)\n\n")
-
-
- def make_dbus_type_definitions(self, out):
- for struct in self.structs.items():
- self.write_struct_definition(struct, out)
-
- def write_struct_definition(self, ((iface, name), params), out):
- struct_name = iface + '_' + name
-
- out.write('QDBusArgument& operator << (QDBusArgument& arg, const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("arg.beginStructure();\n")
- for param in params:
- out.write("arg << v.{0};\n".format(param.name))
- out.write("arg.endStructure();\n")
- out.write("return arg;\n")
- out.write("}\n\n")
-
- out.write('const QDBusArgument& operator >> (const QDBusArgument& arg, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("arg.beginStructure();\n")
- for param in params:
- out.write("arg >> v.{0};\n".format(param.name))
- out.write("arg.endStructure();\n")
- out.write("return arg;\n")
- out.write("}\n\n")
-
- out.write('QVariant ValueToVariant(const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("QVariantMap map;\n")
- for param in params:
- out.write("""PutArgToMap(map, "{0}", v.{0});\n""".format(param.name))
- out.write("return QVariant::fromValue(map);\n")
- out.write("}\n\n")
-
- out.write('QVariant ValueToVariant(const QList<' + struct_name + ">& v) {\n")
- with CodeBlock(out) as out:
- out.write("QList<QVariant> ret;\n")
- out.write("for (QList<{0}>::const_iterator i = v.begin(); i != v.end(); ++i)\n".format(struct_name))
- with CodeBlock(out) as out:
- out.write("ret.append(ValueToVariant(*i));\n")
- out.write("return QVariant::fromValue(ret);\n")
- out.write("}\n\n")
-
- out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("map.insert(name, ValueToVariant(v));\n")
- out.write("}\n\n")
-
- out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("if (variant.type() != QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a map");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("QVariantMap map = variant.toMap();\n")
- for param in params:
- out.write("if (!GetArgFromMap(map, \"" + param.name + "\", v." + param.name + ")) return false;\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + ">& v) {\n")
- with CodeBlock(out) as out:
- out.write("if (variant.type() != QVariant::List) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a list");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("QList<QVariant> list = variant.toList();\n")
- out.write("for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {\n");
- with CodeBlock(out) as out:
- out.write(struct_name + " s;\n");
- out.write("if (!VariantToValue(*i, s)) return false;\n");
- out.write("v.append(s);\n");
- out.write("}\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("QVariantMap::const_iterator it = map.find(name);\n")
- out.write("if (map.end() == it) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_WARN(logger_, "Argument '" << name << "' not found");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("if (it->type() != QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Argument '" << name << "' isn't a map");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("const QVariantMap& inmap = it->toMap();\n")
- for param in params:
- out.write("if (!GetArgFromMap(inmap, \"" + param.name + "\", v." + param.name + ")) return false;\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{ {2}; }}\n".format(param_name, param.minSize, fail_statement))
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{ {2}; }}\n".format(param_name, param.maxSize, fail_statement))
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) { %s; }\n' % (' || '.join(conditions), fail_statement))
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- with CodeBlock(out) as out:
- out.write('if (%s) { %s;\n }\n' % (' || '.join(conditions), fail_statement))
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- return "xxx"
-
-
- def from_variant_func_name(self, param, interface):
- prefix = ''
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return 'opt_' + self.from_variant_func_name(param_copy, interface)
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- return 'arr_' + self.from_variant_func_name(param_copy, interface)
-
- if param.type in ['Integer', 'String', 'Boolean', 'Float']:
- param_type = param.type
- else:
- param_type = param.type.split('.')
- if len(param_type) > 1:
- param_type = (param_type[0], param_type[1])
- else:
- param_type = (interface, param_type[0])
- if param_type in self.structs:
- param_type = param_type[0] + '_' + param_type[1]
- elif param_type in self.enums:
- param_type = 'Integer'
- return param_type + '_from_variant'
-
-
- def make_method_signature(self, request, response, interface, add_classname):
- in_params = [self.make_param_desc(x, interface) for x in request.findall('param')]
- out_params = [self.make_param_desc(x, interface) for x in response.findall('param')]
-
- signature_len = len(''.join(map(lambda x: self.convert_to_dbus_type(x), in_params + out_params)))
- if signature_len > 255:
- raise RuntimeError("Too long signature of {0} method. Maximum valid length is 255, actual is {1}", request.get('name'), signature_len)
-
- return "int {0}{1} ({2}{3}const QDBusMessage& message, QString& userMessage_out{4}{5})".format(
- interface + "Adaptor::" if add_classname else "",
- request.get('name'),
- ", ".join(map(lambda x: "const {0}& {1}_in".format(self.qt_param_type(x), x.name), in_params)),
- ", " if in_params else "",
- ", " if out_params else "",
- ", ".join(map(lambda x: "{0}& {1}_out".format(self.qt_param_type(x), x.name), out_params)))
-
-
- def make_signal_signature(self, signal, interface, add_void):
- params = signal.findall('param')
- if add_void:
- retstr = 'void '
- else:
- retstr = ''
- retstr = retstr + signal.get('name') + '('
- params_num = len(params)
- for i in range(0, params_num):
- param_desc = self.make_param_desc(params[i], interface)
- param_type = self.qt_param_type(param_desc)
- retstr = retstr + param_type + ' ' + param_desc.name
- if i <> params_num - 1: retstr = retstr + ", "
- retstr = retstr + ')'
- return retstr
-
-
- def make_qml_signal_signature(self, signal, interface, name, short=False, add_classname=False):
- params = signal.findall('param')
- if short:
- retstr = ''
- else:
- retstr = 'void '
- if add_classname:
- retstr = retstr + interface + 'Adaptor::'
- retstr = retstr + name + '('
- params_num = len(params)
- for i in range(0, params_num):
- param_desc = self.make_param_desc(params[i], interface)
- if param_desc.struct or param_desc.array or not param_desc.mandatory: typ = 'QVariant'
- elif param_desc.type == 'Integer' or param_desc.enum: typ = 'int'
- elif param_desc.type == 'Boolean': typ = 'bool'
- elif param_desc.type == 'Float': typ = 'double'
- elif param_desc.type == 'String': typ = 'QString'
- else: typ = 'QVariant'
- retstr = retstr + typ
- if not short: retstr = retstr + ' ' + param_desc.name
- if i <> params_num - 1: retstr = retstr + ", "
- retstr = retstr + ')'
- return retstr
-
-
- def write_adaptor_declaration(self, interface_el, notifications, request_responses, out):
- global prefix_class_item
- def glue_strings(strings):
- ret = list()
- curstr = ''
- for str in strings:
- curstr = curstr + str
- if(str[-1] == '>'):
- ret.append(curstr)
- curstr = ''
- return ret
- ifacename = interface_el.get('name')
- out.write("class " + ifacename + "Adaptor : public QDBusAbstractAdaptor {\n");
- out.write(" Q_OBJECT\n");
- out.write(" Q_CLASSINFO(\"D-Bus Interface\", \"" + self.interface_path + '.' + ifacename + "\")\n");
- out.write(" Q_CLASSINFO(\"D-Bus Introspection\",\n");
- introspection_el = self.create_introspection_iface_el(interface_el, 'hmi')
- introspection = glue_strings(ElementTree.tostringlist(introspection_el))
- for str in introspection:
- str = str.replace('"', '\\"')
- out.write('"' + str + '"' + "\n")
- out.write(" )\n")
- out.write(" public:\n")
- out.write(" explicit " + ifacename + "Adaptor(QObject *parent = 0);\n")
- out.write(" void SetApi(Q%sItem*);\n" % prefix_class_item)
- out.write(" DBusController *dbusController;\n")
- out.write(" public slots:\n")
- for (request, response) in request_responses:
- signature = self.make_method_signature(request, response, ifacename, False)
- out.write(" " + signature + ";\n")
- out.write(" signals:\n")
- for n in notifications:
- signature = self.make_signal_signature(n, ifacename, True)
- out.write(" " + signature + ";\n")
- out.write(" private slots:\n")
- for n in notifications:
- signature = self.make_qml_signal_signature(n, ifacename, n.get('name') + '_qml', False)
- out.write(" " + signature + ";\n")
- out.write(" private:\n")
- out.write(" Q%sItem* api_;\n" % prefix_class_item)
- out.write("};\n\n");
-
- def write_adaptor_definition(self, interface_el, notifications, request_responses, out):
- global prefix_class_item
- iface_name = interface_el.get('name')
- classname = iface_name + 'Adaptor'
- out.write("{0}::{0}(QObject* parent) : QDBusAbstractAdaptor(parent) {{}}\n".format(classname))
-
- out.write("void {0}::SetApi(Q{1}Item* api) {{\n".format(classname, prefix_class_item))
- with CodeBlock(out) as out:
- out.write("api_ = api;\n")
- for n in notifications:
- signame = n.get('name')
- signame = signame[:1].lower() + signame[1:]
- slotname = n.get('name') + '_qml'
- sig_signature = self.make_qml_signal_signature(n, iface_name, signame, True)
- slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, True)
- out.write("connect(api_, SIGNAL(" + sig_signature + "), this, SLOT(" + slot_signature + "));\n")
- out.write("LOG4CXX_TRACE(logger_, \"CONNECT SIGNALS: \" << __PRETTY_FUNCTION__ );\n")
- out.write("}\n\n")
-
- for (request,response) in request_responses:
- in_params = [ self.make_param_desc(x, iface_name) for x in request.findall('param') ]
- out_params = [ self.make_param_desc(x, iface_name) for x in response.findall('param') ]
-
- out.write("bool fill{0}{1}Reply(QDBusMessage& message, const QVariantMap& map) {{\n".format(classname, request.get('name')))
- with CodeBlock(out) as out:
- out.write("int retCode_out = 0;\n")
- out.write("GetArgFromMap(map, \"__retCode\", retCode_out);\n")
- out.write("QVariant retCode_arg = QVariant::fromValue(retCode_out);\n")
- out.write("message << retCode_arg;\n")
- out.write("QString userMessage_out;\n")
- out.write("GetArgFromMap(map, \"__message\", userMessage_out);\n")
- out.write("QVariant userMessage_arg = QVariant::fromValue(userMessage_out);\n")
- out.write("message << userMessage_arg;\n")
- for p in out_params:
- param_name = p.name
- param_type = self.qt_param_type(p)
- out.write("%s %s_out;\n" % (param_type, p.name))
- out.write("if (!GetArgFromMap(map, \"{0}\", {0}_out)) {{ return false; }}\n".format(p.name))
- self.write_param_validation(p, p.name + "_out", "return false", out)
- out.write("QVariant {0}_arg;\n".format(p.name))
- out.write("{0}_arg.setValue({0}_out);\n".format(p.name))
- out.write("message << {0}_arg;\n".format(p.name))
- out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(map));\n")
- out.write("LOG4CXX_TRACE(logger_, \"REPLY ASYNC: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write("{0} {{\n".format(self.make_method_signature(request, response, iface_name, True)))
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"ENTER: \" << __PRETTY_FUNCTION__ );\n")
- out.write("int ret = 0;\n")
- return_statement = "return ret;\n"
- out.write("QVariantMap in_arg;\n");
- out.write("QVariant out_arg_v;\n");
- for param in in_params:
- self.write_param_validation(param, param.name + "_in", "RaiseDbusError(this, InvalidData); return ret", out)
- out.write("PutArgToMap(in_arg, \"" + param.name + "\", " + param.name + "_in);\n")
- out.write("LOG4CXX_DEBUG(logger_, \"Input arguments:\\n\" << in_arg);\n")
- method_name = request.get('name')[:1].lower() + request.get('name')[1:]
-
- out.write("dbusController->message = &message;\n")
- out.write("dbusController->fill = &fill{0}{1}Reply;\n".format(classname, request.get("name")))
-
- out.write("""if (!QMetaObject::invokeMethod(api_, "{0}", Qt::{1}Connection, Q_RETURN_ARG(QVariant, out_arg_v), Q_ARG(QVariant, QVariant(in_arg)))) {{\n""".format(method_name, invoke_type_connection))
- with CodeBlock(out) as out:
- out.write("RaiseDbusError(this, InvalidData);\n")
- out.write("LOG4CXX_ERROR(logger_, \"Can't invoke method " + method_name +"\");\n ")
- out.write("return ret;\n")
- out.write("}\n")
-
- out.write("dbusController->message = NULL;\n")
- out.write("dbusController->fill = NULL;\n")
- out.write("if (message.isDelayedReply()) {\n")
- with CodeBlock(out) as out:
- out.write("return ret;\n")
- out.write("}\n")
-
- out.write("QVariantMap out_arg;\n")
- out.write("if (out_arg_v.type() == QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("out_arg = out_arg_v.toMap();\n")
- out.write("};\n")
-
- out.write("int err;\n")
- out.write("""if (GetArgFromMap(out_arg, "__errno", err)) { RaiseDbusError(this, err); return ret; }\n""")
-
- out.write("int async_uid;\n")
- out.write("if (GetArgFromMap(out_arg, \"__async_uid\", async_uid)) {\n")
- with CodeBlock(out) as out:
- out.write("message.setDelayedReply(true);\n")
- out.write("dbusController->addMessage(message, &fill%s%sReply, async_uid);\n" % (classname, request.get('name')))
- out.write("LOG4CXX_TRACE(logger_, \"EXIT ASYNC: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return ret;\n");
- out.write("}\n\n")
-
- for param in out_params:
- out.write("if (!GetArgFromMap(out_arg, \"{0}\", {0}_out)) {{ RaiseDbusError(this, InvalidData); return ret; }}\n".format(param.name))
- self.write_param_validation(param, param.name + "_out", "RaiseDbusError(this, InvalidData); return ret", out)
-
- out.write("GetArgFromMap(out_arg, \"__retCode\", ret);\n")
- out.write("GetArgFromMap(out_arg, \"__message\", userMessage_out);\n")
- out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(out_arg));\n")
- out.write("LOG4CXX_TRACE(logger_, \"EXIT: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return ret;\n")
- out.write("}\n\n")
-
- for n in notifications:
- slotname = n.get('name') + '_qml'
- slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, False, True)
- out.write(slot_signature + " {\n")
- params = n.findall('param')
- out.write(" LOG4CXX_TRACE(logger_, \"EMIT SIGNAL: \" << __PRETTY_FUNCTION__ );\n")
- out.write(" LOG4CXX_DEBUG(logger_, \"Arguments:\\n{\"")
- for p in params[0:-1]:
- param = self.make_param_desc(p, iface_name)
- out.write(" << \" " + param.name + ":\" << " + param.name + " << \",\"")
- for p in params[-1:]: # last param without comma in end line
- p = params[-1]
- param = self.make_param_desc(p, iface_name)
- out.write(" << \" " + param.name + ":\" << " + param.name)
- out.write(" << \" }\");\n")
- for p in params:
- param = self.make_param_desc(p, iface_name)
- param_type = self.qt_param_type(param)
- param_name = 'p_' + param.name
- if param.mandatory:
- if param.array or (param.type not in ['Integer', 'String', 'Float', 'Boolean'] and not param.enum):
- out.write(' ' + param_type + ' ' + param_name + ";\n")
- out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ")) {\n")
- out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
- out.write(" return;}\n")
- else:
- out.write(' ' + param_type + ' ' + param_name + ";\n")
- out.write(' ' + param_name + '.presence = !' + param.name + ".isNull();\n")
- out.write(' if (' + param_name + ".presence) {\n")
- out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ".val)) {\n")
- out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
- out.write(" return;\n }\n")
- out.write(" }\n")
- out.write(' emit ' + n.get('name') + '(')
- for i in range(len(params)):
- param = self.make_param_desc(params[i], iface_name)
- basic_type = (param.type in ['Integer', 'String', 'Float', 'Boolean']) or param.enum
- if param.array or (not param.mandatory) or (not basic_type):
- param_name = 'p_' + param.name
- else:
- param_name = param.name
- out.write(param_name)
- if i != len(params) - 1: out.write(', ')
- out.write(");\n")
- out.write("}\n\n")
-
-
- def make_dbus_adaptor_declarations(self, out):
- for interface_el in self.el_tree.findall('interface'):
- notifications = self.find_notifications_by_provider(interface_el, "hmi")
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
- if len(notifications) > 0 or len(request_responses) > 0:
- self.write_adaptor_declaration(interface_el, notifications, request_responses, out)
-
-
- def make_dbus_adaptor_definitions(self, out):
- for interface_el in self.el_tree.findall('interface'):
- notifications = self.find_notifications_by_provider(interface_el, "hmi")
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
- if len(notifications) > 0 or len(request_responses) > 0:
- self.write_adaptor_definition(interface_el, notifications, request_responses, out)
-
-
- def make_dbus_register_metatypes_declaraion(self, out):
- out.write("void RegisterDbusMetatypes();\n")
-
-
- def make_dbus_register_metatypes_definition(self, out):
- out.write("void RegisterDbusMetatypes() {\n")
- for (iface, name) in self.structs:
- struct_name = iface + '_' + name
- out.write('qDBusRegisterMetaType<' + struct_name + ">();\n")
- out.write('qDBusRegisterMetaType<OptionalArgument<' + struct_name + "> >();\n")
- out.write('qDBusRegisterMetaType<QList<' + struct_name + "> >();\n")
- out.write('qDBusRegisterMetaType<OptionalArgument<QList<' + struct_name + "> > >();\n")
- out.write("}\n")
-
-
- def make_api_adaptors_class(self, out):
- global prefix_class_item
- out.write("struct ApiAdaptors {\n")
- interfaces = self.el_tree.findall('interface')
- def filt(iface):
- return self.find_notifications_by_provider(iface, "hmi") or self.find_request_response_pairs_by_provider(iface, "hmi")
- interfaces = filter(filt, interfaces)
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- out.write(" " + name + "* " + name + "_;\n")
- out.write(" ApiAdaptors() :\n")
- for i in range(len(interfaces)):
- name = interfaces[i].get('name') + 'Adaptor'
- out.write(" " + name + "_(NULL)")
- if i <> len(interfaces) - 1: out.write(',')
- out.write("\n")
- out.write(" {}\n")
- out.write(" void Init(QObject* p) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- out.write(" " + name + "_ = new " + name + "(p);\n")
- out.write(" }\n")
- out.write(" void SetApi(QObject* p) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- chname = interface_el.get('name')
- out.write(" " + name + ("_->SetApi(p->findChild<Q%sItem*>(\"" % prefix_class_item) + chname + "\"));\n")
- out.write(" }\n")
- out.write(" void SetDBusController(DBusController* dc) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- chname = interface_el.get('name')
- out.write(" " + name + "_->dbusController = dc;\n")
- out.write(" }\n")
- out.write("};\n\n")
-
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files qml_dbus.cc, qml_dbus.h will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'qml_dbus.h'
-source_name = 'qml_dbus.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file qml_dbus.h
- * @brief Generated QDbus adaptors header file
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
-header_out.write("#define SRC_COMPONENTS_DBUS_QML_DBUS_H_\n\n");
-header_out.write("#include <QtDBus/QDBusArgument>\n");
-header_out.write("#include <QtDBus/QDBusMessage>\n");
-header_out.write("#include <QtDBus/QDBusConnection>\n");
-header_out.write("#include <QtDBus/QDBusAbstractAdaptor>\n");
-header_out.write("#include <QtDBus/QDBusMetaType>\n");
-header_out.write("#include <Qt%s/Q%sItem>\n" % (prefix_class_item, prefix_class_item));
-header_out.write("#include \"qml_dbus_common.h\"\n\n");
-header_out.write("#include \"dbus_controller.h\"\n\n");
-impl.make_dbus_type_declarations(header_out)
-impl.make_dbus_adaptor_declarations(header_out)
-impl.make_dbus_register_metatypes_declaraion(header_out)
-impl.make_api_adaptors_class(header_out)
-impl.make_dbus_metatype_declarations(header_out)
-header_out.write("#endif // #ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file qml_dbus.cc
- * @brief Generated QDbus adaptors source file
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-source_out.write("#include \"" + header_name + "\"\n\n");
-source_out.write("#include \"utils/logger.h\"\n")
-source_out.write("#ifdef ENABLE_LOG\n")
-source_out.write("extern log4cxx::LoggerPtr logger_;\n")
-source_out.write("#endif // ENABLE_LOG\n\n")
-impl.make_dbus_type_definitions(source_out)
-impl.make_dbus_adaptor_definitions(source_out)
-impl.make_dbus_register_metatypes_definition(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_qml.py b/src/components/dbus/codegen/make_qml_dbus_qml.py
deleted file mode 100755
index 8d057dcda1..0000000000
--- a/src/components/dbus/codegen/make_qml_dbus_qml.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_qml.py
-# @brief Generator of QML to QDbus QML part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from os import path
-from os import makedirs
-from sys import argv
-from argparse import ArgumentParser
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser
-
-namespace = 'dbus_qml'
-qt_quick_version = '1.1'
-type_variant_name = 'variant'
-
-class Impl(FordXmlParser):
- def write_function(self, ifacename, request, response, out):
- name = request.get('name')
- name = name[:1].lower() + name[1:]
- out.write(" function " + name + "(params) {\n")
- out.write(""" console.debug("{0}Proxy::{1}")\n""".format(ifacename, name))
- out.write(" try {\n")
- out.write(" if(\"{0}\" in sdl{1})\n".format(name, ifacename))
- out.write(" return sdl{0}.{1}(" .format(ifacename, name))
- params = request.findall('param')
- for i in range(len(params)):
- out.write('params.' + params[i].get('name'))
- if i <> len(params) - 1:
- out.write(', ')
- out.write(")\n")
- out.write(" else\n")
- out.write(""" return { "__errno": Common.Result.UNSUPPORTED_REQUEST }\n""")
- out.write(" } catch(err) {\n")
- out.write(""" return { "__errno": err }\n""")
- out.write(" }\n")
- out.write(" }\n\n")
-
-
- def write_signal_param(self, param, out):
- if param.array or param.struct or not param.mandatory: typ = type_variant_name
- elif param.type == 'Integer' or param.enum: typ = 'int'
- elif param.type == 'String': typ = 'string'
- elif param.type == 'Boolean': typ = 'bool'
- elif param.type == 'Float': typ = 'double'
- else: typ = type_variant_name
- out.write(typ + ' ' + param.name)
-
-
- def write_signal(self, ifacename, notification, out):
- name = notification.get('name')
- name = name[:1].lower() + name[1:]
- out.write(" signal " + name + "(")
- params = notification.findall('param')
- for i in range(len(params)):
- self.write_signal_param(self.make_param_desc(params[i], ifacename), out)
- if i <> len(params) - 1:
- out.write(', ')
- out.write(")\n")
- name = notification.get('name')
- out.write(""" on{1}: console.debug("emitted {0}:{1}")\n""".format(ifacename, name))
-
-
- def write_qml(self, iface, out):
- global qt_quick_version
- name = iface.get('name')
- out.write("import QtQuick %s\n" % qt_quick_version)
- out.write("""import "Common.js" as Common\n""")
- out.write("import \"..\"\n\n")
- out.write("Item {\n")
- out.write(" " + name + " {\n")
- out.write(" id: sdl" + name + "\n")
- out.write(" }\n")
-
- notifications = impl.find_notifications_by_provider(interface_el, "hmi")
- request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
- for request, response in request_responses:
- self.write_function(name, request, response, out)
- for n in notifications:
- self.write_signal(name, n, out)
- out.write("}\n")
-
-
- def write_js_enum(self, enum, out):
- out.write("var " + enum.get('name') + " = {\n")
- lastval = -1
- elements = enum.findall('element')
- for i in range(len(elements)):
- element = elements[i]
- value = element.get('value')
- if value is None:
- value = lastval + 1
- else:
- value = int(value)
- lastval = value
- name = element.get('internal_name')
- if name is None:
- name = element.get('name')
- out.write(" " + name + ': ' + str(value))
- if len(elements) - 1 != i: out.write(',')
- out.write("\n")
- out.write("}\n\n")
-
-
-def write_header(out):
- out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
- out.write("""/**
- * 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.
- */
-
-""")
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus QML part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files with pattern name <intarface name>Proxy.qml will be saved, e.g. BasicCommunicationProxy.qml, ButtonsProxy.qml VRProxy.qml")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- qt_quick_version = "1.1"
- type_variant_name = "variant"
-elif args.version == "5.1.0":
- qt_quick_version = "2.0"
- type_variant_name = "var"
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root)
-
-for interface_el in in_tree_root.findall('interface'):
- notifications = impl.find_notifications_by_provider(interface_el, "hmi")
- request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
- if notifications or request_responses:
- filename = interface_el.get('name')+'Proxy.qml'
- outfile = open(args.outdir + '/' + filename, 'w')
- write_header(outfile)
- impl.write_qml(interface_el, outfile)
-
-enum_files = dict()
-for (iface, name), enum in impl.enums.items():
- if iface in enum_files:
- outfile = enum_files[iface]
- else:
- filename = iface+'.js'
- outfile = open(args.outdir + '/' + filename, 'w')
- write_header(outfile)
- outfile.write(".pragma library\n")
- enum_files[iface] = outfile
- impl.write_js_enum(enum, outfile)
-
-
diff --git a/src/components/dbus/codegen/make_qml_requests_cpp.py b/src/components/dbus/codegen/make_qml_requests_cpp.py
deleted file mode 100644
index 6674b8f5e2..0000000000
--- a/src/components/dbus/codegen/make_qml_requests_cpp.py
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
-
-
- def args_for_function_definition(self, params, out):
- if len(params) == 0:
- out.write('QJSValue hmi_callback')
- return
- for param in params:
- out.write('QVariant ' + param.get('name') + ', ')
- out.write('QJSValue hmi_callback')
-
-
- def make_requests_for_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- all_params = list()
- for param_el in request.findall('param'):
- all_params.append(param_el)
- with CodeBlock(out) as output:
- output.write("Q_INVOLABKE void " + interface_el.get('name') + "_" +request.get('name') + "(")
- impl.args_for_function_definition(all_params, out)
- output.write(");\n")
-
-
- def make_header_file(self, out):
- out.write("class RequestToSDL : public QObject\n")
- out.write("{\n")
- out.write(" public:\n")
- with CodeBlock(out) as output:
- output.write("explicit RequestToSDL(QObject *parent = 0);\n")
- output.write("~RequestToSDL();\n")
- impl.make_requests_for_header(out)
- out.write(" private:\n")
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- output.write('QDBusInterface *' + interface_el.get('name') + ';\n')
- out.write("};\n")
-
-
- def make_requests_for_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- out.write('void RequestToSDL::' + request.get('name') + '(QString name, ')
- for param_el in request.findall('param'):
- out.write('QVariant ' + param_el.get('name') + ', ')
- out.write('QJSValue hmi_callback) {\n')
- with CodeBlock(out) as output:
- output.write('QList<QVariant> args;\n')
- for param_el in request.findall('param'):
- output.write('args << ' + param_el.get('name') + ';\n')
- output.write('new ' + interface_el.get('name') + '_' + request.get('name') + '(' + interface_el.get('name') + ', name, args, hmi_callback);\n}\n')
-
-
-
- def make_source_file(self, out):
- out.write('#include "request_to_sdl.h"\n')
- out.write('\n')
- out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
- out.write('}\n\n')
- out.write('RequestToSDL::~RequestToSDL() {\n')
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + '->deleteLater();\n')
- output.write('this->deleteLater();\n')
- out.write('}\n\n')
- impl.make_requests_for_source(out)
-
-
-
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'request_to_sdl.h'
-source_name = 'request_to_sdl.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file request_to_sdl.h
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
-header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n\n");
-header_out.write("#include <QDBusConnection>\n");
-header_out.write("#include <QJSValue>\n");
-header_out.write("#include <QObject>\n");
-header_out.write("#include <QDBusInterface>\n");
-header_out.write('#include "hmi_requests.h"\n');
-
-impl.make_header_file(header_out)
-
-header_out.write("#endif SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file request_to_sdl.cc
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-""")
-
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_request_to_sdl.py b/src/components/dbus/codegen/make_request_to_sdl.py
deleted file mode 100755
index c8940f3eb7..0000000000
--- a/src/components/dbus/codegen/make_request_to_sdl.py
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-class Impl(FordXmlParser):
-
- def args_for_function_definition(self, params, iface_name, out):
- for param_el in params:
- param = self.make_param_desc(param_el, iface_name)
- out.write('QVariant %s,' % (param.name))
- out.write('Q%sValue hmi_callback' % prefix_class_item)
-
- def make_requests_for_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- all_params = list()
- for param_el in request.findall('param'):
- all_params.append(param_el)
- with CodeBlock(out) as output:
- output.write("Q_INVOKABLE bool %s_%s(" % (interface_el.get('name'), request.get('name')))
- impl.args_for_function_definition(all_params, interface_el.get('name'), out)
- output.write(");\n")
-
-
- def make_header_file(self, out):
- out.write("class QDBusInterface;\n")
- out.write("class RequestToSDL : public QObject\n")
- out.write("{\n")
- out.write(' Q_OBJECT\n')
- out.write(" public:\n")
- with CodeBlock(out) as output:
- output.write("explicit RequestToSDL(QObject *parent = 0);\n")
- output.write("~RequestToSDL();\n")
- impl.make_requests_for_header(out)
- out.write(" private:\n")
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- output.write('QDBusInterface *%s;\n' % interface_el.get('name'))
- out.write("};\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def make_requests_for_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- request_name = request.get('name')
- iface_name = interface_el.get('name')
- request_full_name = iface_name + '_' + request_name
- out.write('bool RequestToSDL::' + request_full_name + '(')
- for param_el in request.findall('param'):
- out.write('QVariant %s, ' % (param_el.get('name')))
- out.write('Q%sValue hmi_callback) {\n' % prefix_class_item)
- with CodeBlock(out) as output:
- output.write('LOG4CXX_TRACE(logger_, "ENTER");\n')
- output.write('QList<QVariant> args;\n')
- for param_el in request.findall('param'):
- param = self.make_param_desc(param_el, iface_name)
- output.write('%s %s;\n' % (impl.qt_param_type(param), param.name + "_tmp"))
- output.write('if (VariantToValue(%s, %s)) {\n' % (param.name, param.name + '_tmp'))
- with CodeBlock(output) as out:
- self.write_param_validation(param, param.name + "_tmp",
- "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\");\nreturn false" % (param.name, request_full_name),
- out)
- out.write('args << QVariant::fromValue(%s);\n' % (param.name + '_tmp'))
- output.write('} else {\n')
- with CodeBlock(output) as out:
- out.write('LOG4CXX_ERROR(logger_, "%s in %s is NOT valid");\n' % (param.name, request_full_name))
- out.write('return false;\n')
- out.write('}\n')
- output.write('new requests::' + request_full_name + '(hmi_callback, ' + interface_el.get('name') + ' , args, '
- + '"' + request_name + '");\n')
- output.write('LOG4CXX_TRACE(logger_, "EXIT");\n')
- output.write('return true;\n')
- out.write('}\n\n')
-
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % fail_statement)
- out.write("}\n")
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % (fail_statement))
- out.write("}\n")
-
- def make_source_file(self, out):
- out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
- out.write('}\n\n')
- out.write('RequestToSDL::~RequestToSDL() {\n')
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + '->deleteLater();\n')
- output.write('this->deleteLater();\n')
- out.write('}\n\n')
- impl.make_requests_for_source(out)
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-
-if args.version == "4.8.5":
- prefix_class_item = 'Script'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-else:
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'request_to_sdl.h'
-source_name = 'request_to_sdl.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""
-/*
- 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.
-*/
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n")
-header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n\n")
-
-header_out.write("#include <QtCore/QObject>\n")
-header_out.write("#include <QtCore/QVariant>\n")
-header_out.write("#include <QtCore/QStringList>\n\n")
-header_out.write('#include "qml_dbus.h"\n\n')
-if args.version == "4.8.5":
- header_out.write("#include <QtScript/QScriptValue>\n")
-elif args.version == "5.1.0":
- header_out.write("#include <QtQml/QJSValue>\n")
-
-impl.make_header_file(header_out)
-header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""
-/*
- 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.
-*/
-
-""")
-
-source_out.write('#include "request_to_sdl.h"\n')
-source_out.write("#include <QtDBus/QDBusConnection>\n")
-source_out.write("#include <QtDBus/QDBusInterface>\n")
-source_out.write('#include "hmi_requests.h"\n')
-source_out.write('#include "utils/logger.h"\n\n')
-source_out.write('CREATE_LOGGERPTR_GLOBAL(logger_, "DBusPlugin")\n\n')
-
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/include/dbus/dbus_adapter.h b/src/components/dbus/include/dbus/dbus_adapter.h
deleted file mode 100644
index 42a2ac1140..0000000000
--- a/src/components/dbus/include/dbus/dbus_adapter.h
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * Copyright (c) 2013-2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
-
-#include <string>
-#include "smart_objects/smart_object.h"
-#include "dbus/schema.h"
-#include "dbus/message_descriptions.h"
-
-struct DBusConnection;
-struct DBusMessage;
-struct DBusMessageIter;
-
-namespace dbus {
-
-/**
- * \brief class for work with DBus
- */
-class DBusAdapter {
- public:
- /**
- * \brief constructs DBus adapter
- * \param sdlServiceName core service name
- * \param sdlObjectPath core object path
- * \param hmiServiceName hmi service name
- */
- DBusAdapter(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath);
-
- /**
- * \brief destructs DBus adapter
- */
- virtual ~DBusAdapter();
-
- /**
- * \brief inits service
- * \return true if success
- */
- bool Init();
-
- /**
- * \brief return schema messages for DBus
- * \return schema
- */
- const DBusSchema& get_schema() const;
-
- protected:
- /**
- * \brief calls method on HMI
- * \param id id message
- * \param func_id id function in Ford protocol
- * \param name pair interface and name of method for call
- * \param obj params for call
- */
- void MethodCall(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends signal
- * \param id id message
- * \param func_id id function in Ford protocol
- * \param name pair interface and name of signal for call
- * \param obj params for signal
- */
- void Signal(const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief returns result of call method to HMI
- * \param id id message
- * \param obj params for return
- */
- void MethodReturn(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends error on message from HMI
- * \param id id message
- * \param msg message from HMI
- * \param name name of error
- * \param description description of error
- */
- void Error(uint id, const std::string& name, const std::string& description);
-
- /**
- * \brief adds a match rule
- * \param rule string rule in the DBus specification
- */
- void AddMatch(const std::string& rule);
-
- /**
- * \brief processes incoming message from DBus if queue isn't empty
- * and fill obj
- * \param obj object for send to core
- * \return true if message processed
- */
- bool Process(smart_objects::SmartObject& obj);
-
- /**
- * \brief saves link D-Bus serial to Ford message id
- * \param serial D-Bus message serial
- * \param ids pair correlation id and Ford message id
- */
- inline void SaveRequestToHMI(uint32_t serial,
- const std::pair<uint, MessageId>& ids);
-
- /**
- * \brief gets Ford message id by serial
- * \param serial D-Bus message serial
- * \return pair correlation id and Ford message id
- */
- inline std::pair<uint, MessageId> GetRequestToHMI(uint32_t serial);
-
- /**
- * \brief saves link D-Bus serial to Ford message id
- * \param serial D-Bus message serial
- * \param request D-Bus message from HMI
- */
- inline void SaveRequestFromHMI(uint32_t serial, DBusMessage* request);
-
- /**
- * \brief gets D-Bus message id by serial
- * \param serial DBus message serial
- * \return D-Bus message from HMI
- */
- inline DBusMessage* GetRequestFromHMI(uint32_t serial);
-
- std::string sdl_service_name_;
- std::string sdl_object_path_;
- std::string hmi_service_name_;
- std::string hmi_object_path_;
- DBusConnection* conn_;
-
- private:
- /**
- * \brief schema messages and arguments for DBus
- */
- const DBusSchema* schema_;
-
- /**
- * \brief mapping serial message DBus on message id Ford protocol
- */
- std::map<uint32_t, std::pair<uint, MessageId> > requests_to_hmi_;
-
- /**
- * \brief mapping message id Ford protocol on message DBus
- */
- std::map<uint32_t, DBusMessage*> requests_from_hmi_;
-
- /**
- * \brief processes incoming call of method and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessMethodCall(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming return of method and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessMethodReturn(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming error and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessError(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming signal and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessSignal(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief sets arguments to message
- * \param msg DBus message
- * \param rules list of rules for arguments
- * \param args map of arguments
- * \return true if success
- */
- bool SetArguments(DBusMessage* msg,
- const ListArgs& rules,
- const smart_objects::SmartObject& args);
-
- /**
- * \brief Sets one argument to message
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool SetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool SetValue(DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets value for every element of argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param array values of argument
- * \return true if success
- */
- bool SetArrayValue(DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets struct value for argument
- * \param iter DBus message iter
- * \param rules description for argument
- * \param param structure
- * \return true if success
- */
- bool SetStructValue(DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets optional value for argument.
- * Optional param is struct bool, value
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of optional argument
- * \return true if success
- */
- bool SetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief gets arguments from message
- * \param iter DBus message iterator
- * \param code response code (output)
- * \param message response message (output)
- * \return true if success
- */
- bool GetHeader(DBusMessageIter* iter, int* code, std::string* message);
-
- /**
- * \brief gets arguments from message with header
- * \param iter DBus message iterator
- * \param rules list of rules for arguments
- * \param args map of arguments
- * \return true if success
- */
- bool GetArguments(DBusMessageIter* iter,
- const ListArgs& rules,
- smart_objects::SmartObject& args);
-
- /**
- * \brief gets one argument from message
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param args map of arguments
- * \return true if success
- */
- bool GetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& args);
-
- /**
- * \brief gets value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool GetValue(DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets value for every element of argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param array values of argument
- * \return true if success
- */
- bool GetArrayValue(DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets struct value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param structure
- * \return true if success
- */
- bool GetStructValue(DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets optional value for argument.
- * Optional param is struct bool, value
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of optional argument
- * \return true if success
- */
- bool GetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief processes request on introspect
- * \param msg DBus message
- */
- void Introspect(DBusMessage* msg);
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
diff --git a/src/components/dbus/include/dbus/dbus_message.h b/src/components/dbus/include/dbus/dbus_message.h
deleted file mode 100644
index 23e672d0fc..0000000000
--- a/src/components/dbus/include/dbus/dbus_message.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
-
-#include <stdint.h>
-#include <string>
-
-#include <dbus/dbus.h>
-
-namespace dbus {
-
-enum ContainerType {
- kArray = DBUS_TYPE_ARRAY,
- kStruct = DBUS_TYPE_STRUCT,
- kDictEntry = DBUS_TYPE_DICT_ENTRY
-};
-
-class MessageRefKeeper {
- public:
- MessageRefKeeper();
- MessageRefKeeper(DBusMessage* message);
- ~MessageRefKeeper();
- MessageRefKeeper(const MessageRefKeeper& other);
- MessageRefKeeper& operator=(MessageRefKeeper other);
- DBusMessage* get() const;
- DBusMessage* Pass();
- void swap(MessageRefKeeper& other);
-
- private:
- DBusMessage* raw_message_;
-};
-
-class MessageRef {
- public:
- MessageRef(DBusMessage* message);
- ~MessageRef();
- std::string GetInterface() const;
- std::string GetMember() const;
-
- protected:
- MessageRefKeeper raw_message_ref_;
- friend class MessageReader;
- friend class MessageWriter;
-};
-
-class MessageReader {
- public:
- // Main constructor
- MessageReader(const MessageRef& message);
- bool has_failed() const;
- bool IsAtLastElement() const;
- bool HasNext() const;
-
- // Type checkers
- bool NextIsInvalid() const;
- bool NextIsBool() const;
- bool NextIsByte() const;
- bool NextIsInt16() const;
- bool NextIsUint16() const;
- bool NextIsInt32() const;
- bool NextIsUint32() const;
- bool NextIsInt64() const;
- bool NextIsUint64() const;
- bool NextIsDouble() const;
- bool NextIsString() const;
- bool NextIsArray() const;
- bool NextIsStruct() const;
- bool NextIsDictEntry() const;
-
- // Readers
- bool TakeBool();
- uint8_t TakeByte();
- int16_t TakeInt16();
- uint16_t TakeUint16();
- int32_t TakeInt32();
- uint32_t TakeUint32();
- int64_t TakeInt64();
- uint64_t TakeUint64();
- double TakeDouble();
- std::string TakeString();
-
- MessageReader TakeArrayReader();
- MessageReader TakeStructReader();
- MessageReader TakeDictEntryReader();
-
- private:
- typedef int DataType;
- // Container reader constructor
- MessageReader(MessageReader* reader, DataType container_data_type);
- void MoveToNext();
- void MarkFailed();
- DataType NextValueType() const;
- void ReadNextValue(DataType type, void* value);
-
- private:
- // Fields
- MessageReader* parent_reader_;
- bool failed_;
- DBusMessageIter iterator_;
-};
-
-class MessageWriter {
- public:
- // Methods
- // Main appending constructor
- MessageWriter(const MessageRef& message);
- // Container writer constructor
- MessageWriter(MessageWriter* parent,
- ContainerType type,
- const char* array_signature);
- ~MessageWriter();
- void PutBool(bool value);
- void PutByte(uint8_t value);
- void PutInt16(int16_t value);
- void PutUint16(uint16_t value);
- void PutInt32(int32_t value);
- void PutUint32(uint32_t value);
- void PutInt64(int64_t value);
- void PutUint64(uint64_t value);
- void PutDouble(double value);
- void PutString(const std::string& value);
-
- private:
- typedef int DataType;
- // Main constructor
- void WriteAndCheck(DataType value_type, const void* value);
- void CloseWriter();
-
- private:
- // Fields
- bool has_opened_subcontainer_;
- MessageWriter* parent_writer_;
- DBusMessageIter iterator_;
-
- // Disallow copy and assign
- MessageWriter(const MessageWriter& other);
- MessageWriter& operator=(const MessageWriter& other);
-};
-
-MessageRef MethodCall(const char* bus_name,
- const char* path,
- const char* interface,
- const char* method);
-MessageRef Signal(const char* path, const char* interface, const char* name);
-} // namespace dbus
-
-#include "dbus/dbus_message_inl.h"
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
diff --git a/src/components/dbus/include/dbus/dbus_message_controller.h b/src/components/dbus/include/dbus/dbus_message_controller.h
deleted file mode 100644
index a4a3718ce3..0000000000
--- a/src/components/dbus/include/dbus/dbus_message_controller.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
-
-#include <string>
-#include <map>
-#include "dbus/dbus_adapter.h"
-#include "smart_objects/smart_object.h"
-
-namespace dbus {
-
-class DBusMessageController : public DBusAdapter {
- public:
- /**
- * @brief constructs DBus message controller
- * @param sdlServiceName name of service SDL
- * @param sdlObjectPath path of object SDL
- * @param hmiServiceName name of service HMI
- * @param hmiObjectPath path of object HMI
- */
- DBusMessageController(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath);
-
- /**
- * @brief destructs DBus message controller
- */
- virtual ~DBusMessageController();
-
- /**
- * @brief subscribes to the DBus signal.
- * @param interface name of interface in HMI
- * @param signal name of signal
- */
- void SubscribeTo(const std::string& interface, const std::string& signal);
-
- /**
- * @brief Method for receiving thread.
- */
- void* MethodForReceiverThread(void*);
-
- /**
- * @brief Main thread loop.
- */
- bool Run();
-
- /**
- * @brief Signal shutdown for thread loop.
- */
- void Shutdown();
-
- protected:
- /**
- * @brief sends message to core
- * @param obj
- */
- virtual void SendMessageToCore(const smart_objects::SmartObject& obj) = 0;
-
- private:
- bool shutdown_;
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
diff --git a/src/components/dbus/include/dbus/dbus_message_inl.h b/src/components/dbus/include/dbus/dbus_message_inl.h
deleted file mode 100644
index ba9bfaa78d..0000000000
--- a/src/components/dbus/include/dbus/dbus_message_inl.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
-
-#include "dbus/dbus_message.h"
-
-namespace dbus {
-// MessageReader
-inline bool MessageReader::has_failed() const {
- return failed_;
-}
-
-inline bool MessageReader::IsAtLastElement() const {
- DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
- return dbus_message_iter_has_next(iter) == 0;
-}
-
-inline bool MessageReader::HasNext() const {
- return !failed_ && NextValueType() != DBUS_TYPE_INVALID;
-}
-
-inline bool MessageReader::NextIsInvalid() const {
- return NextValueType() == DBUS_TYPE_INVALID;
-}
-
-inline bool MessageReader::NextIsBool() const {
- return NextValueType() == DBUS_TYPE_BOOLEAN;
-}
-
-inline bool MessageReader::NextIsByte() const {
- return NextValueType() == DBUS_TYPE_BYTE;
-}
-
-inline bool MessageReader::NextIsInt16() const {
- return NextValueType() == DBUS_TYPE_INT16;
-}
-
-inline bool MessageReader::NextIsUint16() const {
- return NextValueType() == DBUS_TYPE_UINT16;
-}
-
-inline bool MessageReader::NextIsInt32() const {
- return NextValueType() == DBUS_TYPE_INT32;
-}
-
-inline bool MessageReader::NextIsUint32() const {
- return NextValueType() == DBUS_TYPE_UINT32;
-}
-
-inline bool MessageReader::NextIsInt64() const {
- return NextValueType() == DBUS_TYPE_INT64;
-}
-
-inline bool MessageReader::NextIsUint64() const {
- return NextValueType() == DBUS_TYPE_UINT64;
-}
-
-inline bool MessageReader::NextIsDouble() const {
- return NextValueType() == DBUS_TYPE_DOUBLE;
-}
-
-inline bool MessageReader::NextIsString() const {
- return NextValueType() == DBUS_TYPE_STRING;
-}
-
-inline bool MessageReader::NextIsArray() const {
- return NextValueType() == DBUS_TYPE_ARRAY;
-}
-
-inline bool MessageReader::NextIsStruct() const {
- return NextValueType() == DBUS_TYPE_STRUCT;
-}
-
-inline bool MessageReader::TakeBool() {
- dbus_bool_t value = 0;
- ReadNextValue(DBUS_TYPE_BOOLEAN, &value);
- return value != 0;
-}
-
-inline uint8_t MessageReader::TakeByte() {
- uint8_t value = 0;
- ReadNextValue(DBUS_TYPE_BYTE, &value);
- return value;
-}
-
-inline int16_t MessageReader::TakeInt16() {
- int16_t value = 0;
- ReadNextValue(DBUS_TYPE_INT16, &value);
- return value;
-}
-
-inline uint16_t MessageReader::TakeUint16() {
- uint16_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT16, &value);
- return value;
-}
-
-inline int32_t MessageReader::TakeInt32() {
- int32_t value = 0;
- ReadNextValue(DBUS_TYPE_INT32, &value);
- return value;
-}
-
-inline uint32_t MessageReader::TakeUint32() {
- uint32_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT32, &value);
- return value;
-}
-
-inline int64_t MessageReader::TakeInt64() {
- int64_t value = 0;
- ReadNextValue(DBUS_TYPE_INT64, &value);
- return value;
-}
-
-inline uint64_t MessageReader::TakeUint64() {
- uint64_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT64, &value);
- return value;
-}
-
-inline double MessageReader::TakeDouble() {
- double value = 0.;
- ReadNextValue(DBUS_TYPE_DOUBLE, &value);
- return value;
-}
-
-inline std::string MessageReader::TakeString() {
- const char* value = "";
- ReadNextValue(DBUS_TYPE_STRING, &value);
- return value;
-}
-
-inline MessageReader::DataType MessageReader::NextValueType() const {
- DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
- return failed_ ? DBUS_TYPE_INVALID : dbus_message_iter_get_arg_type(iter);
-}
-
-// Message writer methods
-inline void MessageWriter::PutBool(bool value) {
- dbus_bool_t dbus_value = value;
- WriteAndCheck(DBUS_TYPE_BOOLEAN, &dbus_value);
-}
-
-inline void MessageWriter::PutByte(uint8_t value) {
- WriteAndCheck(DBUS_TYPE_BYTE, &value);
-}
-
-inline void MessageWriter::PutInt16(int16_t value) {
- WriteAndCheck(DBUS_TYPE_INT16, &value);
-}
-
-inline void MessageWriter::PutUint16(uint16_t value) {
- WriteAndCheck(DBUS_TYPE_UINT16, &value);
-}
-
-inline void MessageWriter::PutInt32(int32_t value) {
- WriteAndCheck(DBUS_TYPE_INT32, &value);
-}
-
-inline void MessageWriter::PutUint32(uint32_t value) {
- WriteAndCheck(DBUS_TYPE_UINT32, &value);
-}
-
-inline void MessageWriter::PutInt64(int64_t value) {
- WriteAndCheck(DBUS_TYPE_INT64, &value);
-}
-
-inline void MessageWriter::PutUint64(uint64_t value) {
- WriteAndCheck(DBUS_TYPE_UINT64, &value);
-}
-
-inline void MessageWriter::PutDouble(double value) {
- WriteAndCheck(DBUS_TYPE_DOUBLE, &value);
-}
-
-inline void MessageWriter::PutString(const std::string& value) {
- const char* pointer = value.c_str();
- WriteAndCheck(DBUS_TYPE_STRING, &pointer);
-}
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
diff --git a/src/components/dbus/include/dbus/message_descriptions.h b/src/components/dbus/include/dbus/message_descriptions.h
deleted file mode 100644
index a9e7a5e141..0000000000
--- a/src/components/dbus/include/dbus/message_descriptions.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
-
-#include <stdint.h>
-#include <stdlib.h>
-#include "interfaces/HMI_API.h"
-
-namespace ford_message_descriptions {
-
-enum ParameterType { Integer, Boolean, Float, String, Struct, Enum, Array };
-
-struct ParameterDescription {
- const char* name;
- const ParameterType type;
- const bool obligatory; // TODO (dchmerev@luxoft.com): rename to 'mandatory'
- // as in HMI API description
-};
-
-struct ArrayDescription {
- const ParameterDescription base;
- const ParameterDescription* element;
- const char* element_dbus_signature;
-};
-
-struct StructDescription {
- const ParameterDescription base;
- const ParameterDescription** parameters;
-};
-
-struct MessageDescription {
- const char* interface;
- const char* name;
- const hmi_apis::messageType::eType message_type;
- const hmi_apis::FunctionID::eType function_id;
- const ParameterDescription** parameters;
-};
-
-extern const MessageDescription* message_descriptions[];
-
-} // namespace ford_message_descriptions
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
diff --git a/src/components/dbus/include/dbus/schema.h b/src/components/dbus/include/dbus/schema.h
deleted file mode 100644
index 3dfe49cc95..0000000000
--- a/src/components/dbus/include/dbus/schema.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
-
-#include <string>
-#include <vector>
-#include <utility>
-
-#include "dbus/message_descriptions.h"
-#include "interfaces/HMI_API.h"
-
-namespace dbus {
-
-using ford_message_descriptions::ParameterDescription;
-using ford_message_descriptions::MessageDescription;
-
-struct Description;
-
-typedef hmi_apis::FunctionID::eType MessageId;
-typedef hmi_apis::messageType::eType MessageType;
-typedef std::pair<std::string, std::string> MessageName; // interface, message
-typedef std::vector<const ParameterDescription*> ListArgs;
-typedef std::vector<const Description*> Messages;
-
-/**
- * \brief Wrapper class for message description
- */
-class DBusSchema {
- public:
- explicit DBusSchema(const MessageDescription** array);
-
- /**
- * \brief gets message name by message id
- * \param id id message
- * \return name message
- */
- MessageName getMessageName(MessageId id) const;
-
- /**
- * \brief gets message id by message name
- * \param name name message
- * \return id message
- */
- MessageId getMessageId(const MessageName& name) const;
-
- /**
- * \brief gets list rules for arguments
- * \param id id message
- * \param type type message
- * \return list rules
- */
- ListArgs getListArgs(MessageId id, MessageType type) const;
-
- /**
- * \brief gets list rules for arguments
- * @param name name message
- * @param type type message
- * @return list rules
- */
- ListArgs getListArgs(const MessageName& name, MessageType type) const;
-
- private:
- Messages msgs_;
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
diff --git a/src/components/dbus/src/dbus_adapter.cc b/src/components/dbus/src/dbus_adapter.cc
deleted file mode 100644
index a46e8e8167..0000000000
--- a/src/components/dbus/src/dbus_adapter.cc
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * Copyright (c) 2013-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 "dbus/dbus_adapter.h"
-#include <dbus/dbus.h>
-#include <sstream>
-#include "formatters/CSmartFactory.h"
-#include "utils/logger.h"
-#include "smart_objects/smart_object.h"
-#include "introspection_xml.cc"
-#include "message_descriptions.cc"
-
-using ford_message_descriptions::ParameterDescription;
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-extern char introspection_xml[];
-
-namespace dbus {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-
-std::vector<std::string>& split(const std::string& s,
- char delim,
- std::vector<std::string>& elems) {
- std::stringstream ss(s);
- std::string item;
- while (std::getline(ss, item, delim)) {
- elems.push_back(item);
- }
- return elems;
-}
-
-DBusAdapter::DBusAdapter(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath)
- : sdl_service_name_(sdlServiceName)
- , sdl_object_path_(sdlObjectPath)
- , hmi_service_name_(hmiServiceName)
- , hmi_object_path_(hmiObjectPath)
- , conn_(NULL)
- , schema_(new DBusSchema(ford_message_descriptions::message_descriptions)) {
-}
-
-DBusAdapter::~DBusAdapter() {
- dbus_shutdown();
- delete schema_;
-}
-
-bool DBusAdapter::Init() {
- DBusError err;
- int ret;
- dbus_error_init(&err);
- if (!dbus_threads_init_default()) {
- LOG4CXX_ERROR(logger_, "DBus: Can't initializes threads");
- return false;
- }
- conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
- if (dbus_error_is_set(&err)) {
- LOG4CXX_ERROR(logger_, "DBus: Connection Error " << err.message);
- dbus_error_free(&err);
- return false;
- }
- ret = dbus_bus_request_name(
- conn_, sdl_service_name_.c_str(), DBUS_NAME_FLAG_DO_NOT_QUEUE, &err);
- if (ret == -1 || dbus_error_is_set(&err)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't request name " << err.name);
- dbus_error_free(&err);
- return false;
- }
- if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) {
- LOG4CXX_ERROR(logger_,
- "DBus: Service '" << sdl_service_name_
- << "' is already running");
- return false;
- }
-
- LOG4CXX_INFO(logger_, "DBus: Success init dbus adaptor");
- return true;
-}
-
-bool DBusAdapter::Process(smart_objects::SmartObject& obj) {
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't initialized");
- return false;
- }
- DBusMessage* msg = dbus_connection_pop_message(conn_);
- if (msg != NULL) {
- switch (dbus_message_get_type(msg)) {
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- return ProcessMethodCall(msg, obj);
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- return ProcessMethodReturn(msg, obj);
- case DBUS_MESSAGE_TYPE_ERROR:
- return ProcessError(msg, obj);
- case DBUS_MESSAGE_TYPE_SIGNAL:
- return ProcessSignal(msg, obj);
- default:
- return false;
- }
- } else {
- dbus_connection_read_write(conn_, 50);
- }
- return false;
-}
-
-void DBusAdapter::MethodReturn(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Method return " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg = GetRequestFromHMI(id);
- if (!msg) {
- LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
- return;
- }
-
- DBusMessage* reply;
- reply = dbus_message_new_method_return(msg);
- if (NULL == reply) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::response);
- if (!SetArguments(reply, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, reply, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- return;
- }
- dbus_connection_flush(conn_);
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success return method");
-}
-
-void DBusAdapter::Error(uint id,
- const std::string& name,
- const std::string& description) {
- LOG4CXX_DEBUG(logger_, "Error " << name << ": " << description);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- DBusMessage* msg = GetRequestFromHMI(id);
- if (!msg) {
- LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
- return;
- }
-
- DBusMessage* error;
- error = dbus_message_new_error(msg, name.c_str(), description.c_str());
- if (NULL == error) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, error, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(error);
- dbus_message_unref(msg);
- return;
- }
- dbus_connection_flush(conn_);
- dbus_message_unref(error);
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success error");
-}
-
-void DBusAdapter::MethodCall(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Method call " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg;
- msg = dbus_message_new_method_call(
- hmi_service_name_.c_str(),
- hmi_object_path_.c_str(),
- (hmi_service_name_ + "." + name.first).c_str(),
- name.second.c_str());
- if (NULL == msg) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::request);
- if (!SetArguments(msg, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(msg);
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, msg, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(msg);
- return;
- }
- SaveRequestToHMI(serial, std::make_pair(id, func_id));
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success call method");
-}
-
-void DBusAdapter::Signal(const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Signal " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg;
- msg = dbus_message_new_signal(sdl_object_path_.c_str(),
- (sdl_service_name_ + "." + name.first).c_str(),
- name.second.c_str());
- if (NULL == msg) {
- LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::notification);
- if (!SetArguments(msg, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(msg);
- return;
- }
-
- if (!dbus_connection_send(conn_, msg, NULL)) { // serial isn't required
- LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Out Of Memory)");
- dbus_message_unref(msg);
- return;
- }
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success emit signal");
-}
-
-void DBusAdapter::AddMatch(const std::string& rule) {
- LOG4CXX_INFO(logger_, "Subscription: " << rule);
- dbus_bus_add_match(conn_, rule.c_str(), NULL);
-}
-
-bool DBusAdapter::ProcessMethodCall(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- std::string method = dbus_message_get_member(msg);
- std::string interface = dbus_message_get_interface(msg);
- LOG4CXX_INFO(logger_, "DBus: name of method " << interface << " " << method);
-
- if (interface == "org.freedesktop.DBus.Introspectable" &&
- method == "Introspect") {
- LOG4CXX_INFO(logger_, "DBus: INTROSPECT");
- Introspect(msg);
- return false;
- }
-
- std::vector<std::string> elems;
- split(interface, '.', elems);
- MessageName name(elems.back(), method);
- MessageId m_id = schema_->getMessageId(name);
- if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method call from hmi");
- return false;
- }
-
- uint32_t serial = dbus_message_get_serial(msg);
- if (!serial) {
- LOG4CXX_ERROR(logger_, "DBus: Serial of request from HMI isn't defined");
- return false;
- }
-
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = serial;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::request;
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- const ListArgs args =
- schema_->getListArgs(name, hmi_apis::messageType::request);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- if (GetArguments(&iter, args, obj[sos::S_MSG_PARAMS])) {
- SaveRequestFromHMI(serial, msg);
- return true;
- }
- return false;
-}
-
-bool DBusAdapter::ProcessMethodReturn(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
- std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
- if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return false;
- }
-
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- ListArgs args =
- schema_->getListArgs(ids.second, hmi_apis::messageType::response);
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- int code = 0;
- std::string message;
- smart_objects::SmartObject description(smart_objects::SmartType_Map);
- bool ret = GetHeader(&iter, &code, &message) &&
- GetArguments(&iter, args, description);
-
- if (ret) {
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::response;
- obj[sos::S_PARAMS][sos::kCode] = code;
- obj[sos::S_PARAMS][sos::kMessage] = message;
- if (code != hmi_apis::Common_Result::SUCCESS) {
- MessageName name = schema_->getMessageName(ids.second);
- description["method"] = name.first + "." + name.second;
- obj[sos::S_PARAMS]["data"] = description;
- } else {
- obj[sos::S_MSG_PARAMS] = description;
- }
- }
-
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::ProcessError(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
- std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
- if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return false;
- }
-
- const char* error_name;
- bool ret = false;
- if ((error_name = dbus_message_get_error_name(msg)) != NULL) {
- smart_objects::SmartObject name(smart_objects::SmartType_String);
- name = error_name;
- ford_message_descriptions::ParameterDescription rule = {
- "description", ford_message_descriptions::String, true};
- ListArgs args;
- args.push_back(&rule);
- smart_objects::SmartObject description(smart_objects::SmartType_Map);
- description[rule.name] =
- smart_objects::SmartObject(smart_objects::SmartType_String);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- ret = GetArguments(&iter, args, description);
- MessageName method = schema_->getMessageName(ids.second);
-
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] =
- hmi_apis::messageType::error_response;
- obj[sos::S_PARAMS][sos::kCode] = name.asInt();
- obj[sos::S_PARAMS][sos::kMessage] = description[rule.name].asString();
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- obj[sos::S_PARAMS]["data"]["method"] = method.first + "." + method.second;
-
- LOG4CXX_WARN(logger_,
- "DBus: Call of method " << method.first << "." << method.second
- << " returned error " << name.asInt()
- << ": "
- << description[rule.name].asString());
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Type message isn't error");
- }
-
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::ProcessSignal(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- std::string method = dbus_message_get_member(msg);
- std::string interface = dbus_message_get_interface(msg);
- LOG4CXX_INFO(logger_, "DBus: name of signal " << method);
-
- std::vector<std::string> elems;
- split(interface, '.', elems);
- MessageName name(elems.back(), method);
- MessageId m_id = schema_->getMessageId(name);
- if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name signal");
- return false;
- }
-
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::notification;
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- const ListArgs args =
- schema_->getListArgs(name, hmi_apis::messageType::notification);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- bool ret = GetArguments(&iter, args, obj[sos::S_MSG_PARAMS]);
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::SetArguments(DBusMessage* msg,
- const ListArgs& rules,
- const smart_objects::SmartObject& args) {
- DBusMessageIter iter;
- dbus_message_iter_init_append(msg, &iter);
- size_t size = rules.size();
- for (size_t i = 0; i < size; ++i) {
- const smart_objects::SmartObject& param = args.getElement(rules[i]->name);
- if (!SetOneArgument(&iter, rules[i], param)) {
- return false;
- }
- }
- return true;
-}
-
-bool DBusAdapter::SetOneArgument(DBusMessageIter* iter,
- const ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- if (rules->obligatory) {
- if (param.isValid()) {
- return SetValue(iter, rules, param);
- } else {
- LOG4CXX_WARN(logger_,
- "DBus: Argument '" << rules->name << "' is obligatory!");
- return false;
- }
- } else {
- return SetOptionalValue(iter, rules, param);
- }
-}
-
-bool DBusAdapter::SetValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- // LOG4CXX_DEBUG(logger_, "DBus: Set param " << rules->name << " = " <<
- // param.asString());
- int type = 0;
- void* value = 0;
- dbus_int32_t integerValue = 0;
- double floatValue = 0;
- dbus_bool_t booleanValue = false;
- const char* stringValue;
- switch (rules->type) {
- case ford_message_descriptions::ParameterType::Array:
- return SetArrayValue(
- iter,
- reinterpret_cast<const ford_message_descriptions::ArrayDescription*>(
- rules),
- param);
- break;
- case ford_message_descriptions::ParameterType::Struct:
- return SetStructValue(
- iter,
- reinterpret_cast<const ford_message_descriptions::StructDescription*>(
- rules),
- param);
- break;
- case ford_message_descriptions::ParameterType::Enum:
- case ford_message_descriptions::ParameterType::Integer:
- type = DBUS_TYPE_INT32;
- integerValue = param.asInt();
- value = &integerValue;
- break;
- case ford_message_descriptions::ParameterType::Float:
- type = DBUS_TYPE_DOUBLE;
- floatValue = param.asDouble();
- value = &floatValue;
- break;
- case ford_message_descriptions::ParameterType::Boolean:
- type = DBUS_TYPE_BOOLEAN;
- booleanValue = param.asBool();
- value = &booleanValue;
- break;
- case ford_message_descriptions::ParameterType::String:
- type = DBUS_TYPE_STRING;
- stringValue = param.asString().c_str();
- value = &stringValue;
- break;
- default:
- LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument");
- return false;
- }
- return dbus_message_iter_append_basic(iter, type, value);
-}
-
-bool DBusAdapter::SetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_STRUCT, NULL, &sub_iter)) {
- LOG4CXX_ERROR(
- logger_,
- "DBus: Can't open container type (STRUCT) for optional parameter");
- return false;
- }
-
- ford_message_descriptions::ParameterDescription flagRules = {
- "flag", ford_message_descriptions::Boolean, true};
- smart_objects::SmartObject flag(param.getType() !=
- smart_objects::SmartType_Invalid);
- if (!SetValue(&sub_iter, &flagRules, flag) ||
- !SetValue(&sub_iter, rules, param)) {
- return false;
- }
-
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(
- logger_,
- "DBus: Can't close container type (STRUCT) for optional parameter");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::SetArrayValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- const smart_objects::SmartObject& param) {
- smart_objects::SmartType type = param.getType();
- if (type != smart_objects::SmartType_Array &&
- type != smart_objects::SmartType_Invalid) {
- LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
- return false;
- }
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_ARRAY, rules->element_dbus_signature, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't open container type (ARRAY)");
- return false;
- }
- size_t size = param.length();
- for (size_t i = 0; i < size; ++i) {
- if (!SetValue(&sub_iter, rules->element, param[i])) {
- return false;
- }
- }
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't close container type (ARRAY)");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::SetStructValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- const smart_objects::SmartObject& structure) {
- smart_objects::SmartType type = structure.getType();
- if (type != smart_objects::SmartType_Map &&
- type != smart_objects::SmartType_Invalid) {
- LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
- return false;
- }
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_STRUCT, NULL, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't open container type (STRUCT)");
- return false;
- }
- const ParameterDescription** entry;
- entry = rules->parameters;
- while (*entry != NULL) {
- const smart_objects::SmartObject& param =
- structure.getElement((*entry)->name);
- if (!SetOneArgument(&sub_iter, *entry, param)) {
- return false;
- }
- entry++;
- }
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't close container type (STRUCT)");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::GetHeader(DBusMessageIter* iter,
- int* code,
- std::string* message) {
- // Get code of response
- dbus_int32_t intValue;
- int type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_INT32) {
- LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
- return false;
- }
- dbus_message_iter_get_basic(iter, &intValue);
- *code = intValue;
- LOG4CXX_DEBUG(logger_, "DBus: Code of response " << *code);
-
- dbus_message_iter_next(iter);
-
- // Get message of response
- type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_STRING) {
- LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
- return false;
- }
- const char* stringValue;
- dbus_message_iter_get_basic(iter, &stringValue);
- *message = stringValue;
- LOG4CXX_DEBUG(logger_, "DBus: message of response " << *message);
-
- dbus_message_iter_next(iter);
- return true;
-}
-
-bool DBusAdapter::GetArguments(DBusMessageIter* iter,
- const ListArgs& rules,
- smart_objects::SmartObject& args) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- size_t size = rules.size();
- for (size_t i = 0; i < size; ++i) {
- if (!GetOneArgument(iter, rules[i], args)) {
- return false;
- }
- dbus_message_iter_next(iter);
- }
- return true;
-}
-
-const DBusSchema& DBusAdapter::get_schema() const {
- return *schema_;
-}
-
-bool DBusAdapter::GetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& args) {
- if (rules->obligatory) {
- return GetValue(iter, rules, args[rules->name]);
- } else {
- return GetOptionalValue(iter, rules, args);
- }
-}
-
-bool DBusAdapter::GetValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param) {
- LOG4CXX_DEBUG(logger_, "DBus: Get param " << rules->name);
- int type = dbus_message_iter_get_arg_type(iter);
- switch (rules->type) {
- case ford_message_descriptions::ParameterType::Array:
- if (type == DBUS_TYPE_ARRAY) {
- return GetArrayValue(
- iter,
- // FIXME (dchmerev@luxoft.com): not portable, danger cast.
- reinterpret_cast<
- const ford_message_descriptions::ArrayDescription*>(rules),
- param);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Struct:
- if (type == DBUS_TYPE_STRUCT) {
- return GetStructValue(
- iter,
- reinterpret_cast<
- const ford_message_descriptions::StructDescription*>(rules),
- param);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Enum:
- case ford_message_descriptions::ParameterType::Integer:
- if (type == DBUS_TYPE_INT32) {
- dbus_int32_t integerValue;
- dbus_message_iter_get_basic(iter, &integerValue);
- smart_objects::SmartObject value(integerValue);
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = " << integerValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Float:
- if (type == DBUS_TYPE_DOUBLE) {
- double floatValue;
- dbus_message_iter_get_basic(iter, &floatValue);
- smart_objects::SmartObject value(floatValue);
- param = value;
- LOG4CXX_DEBUG(logger_, "DBus: " << rules->name << " = " << floatValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Boolean:
- if (type == DBUS_TYPE_BOOLEAN) {
- dbus_bool_t booleanValue;
- dbus_message_iter_get_basic(iter, &booleanValue);
- smart_objects::SmartObject value(static_cast<bool>(booleanValue));
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = " << std::boolalpha
- << booleanValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::String:
- if (type == DBUS_TYPE_STRING) {
- const char* stringValue;
- dbus_message_iter_get_basic(iter, &stringValue);
- std::string strValue = stringValue;
- smart_objects::SmartObject value(strValue);
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = \"" << strValue << "\"");
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- default:
- LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::GetArrayValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- smart_objects::SmartObject& param) {
- smart_objects::SmartObject array(smart_objects::SmartType_Array);
-
- int i = 0;
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- while (dbus_message_iter_get_arg_type(&sub_iter) != DBUS_TYPE_INVALID) {
- if (!GetValue(&sub_iter, rules->element, array[i])) {
- return false;
- }
- dbus_message_iter_next(&sub_iter);
- i++;
- }
- param = array;
- return true;
-}
-
-bool DBusAdapter::GetStructValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- smart_objects::SmartObject& param) {
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- const ParameterDescription** entry;
- entry = rules->parameters;
- smart_objects::SmartObject structure(smart_objects::SmartType_Map);
- while (*entry != NULL) {
- if (!GetOneArgument(&sub_iter, *entry, structure)) {
- return false;
- }
- dbus_message_iter_next(&sub_iter);
- entry++;
- }
- param = structure;
- return true;
-}
-
-bool DBusAdapter::GetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param) {
- int type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_STRUCT) {
- LOG4CXX_WARN(
- logger_,
- "DBus: Not expected type of argument. It is not optional parameter.");
- return false;
- }
-
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- ford_message_descriptions::ParameterDescription flagRules = {
- "flag", ford_message_descriptions::Boolean, true};
- smart_objects::SmartObject flag;
- if (!GetValue(&sub_iter, &flagRules, flag)) {
- return false;
- }
- if (flag.asBool()) {
- dbus_message_iter_next(&sub_iter);
- return GetValue(&sub_iter, rules, param[rules->name]);
- } else {
- return true;
- }
-}
-
-std::pair<uint, MessageId> DBusAdapter::GetRequestToHMI(uint32_t serial) {
- std::map<uint32_t, std::pair<uint, MessageId> >::iterator it;
- it = requests_to_hmi_.find(serial);
- if (it != requests_to_hmi_.end()) {
- std::pair<uint, MessageId> ids = it->second;
- requests_to_hmi_.erase(it);
- return ids;
- }
- return std::make_pair(0, hmi_apis::FunctionID::INVALID_ENUM);
-}
-
-void DBusAdapter::SaveRequestToHMI(uint32_t serial,
- const std::pair<uint, MessageId>& ids) {
- requests_to_hmi_.insert(std::make_pair(serial, ids));
-}
-
-void DBusAdapter::Introspect(DBusMessage* msg) {
- DBusMessage* reply;
-
- dbus_uint32_t serial = dbus_message_get_serial(msg);
- reply = dbus_message_new_method_return(msg);
- if (!reply) {
- LOG4CXX_WARN(logger_, "DBus: Failed return method for introspection");
- return;
- }
-
- DBusMessageIter iter;
- dbus_message_iter_init_append(reply, &iter);
- char* value = introspection_xml;
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &value);
- dbus_connection_send(conn_, reply, &serial);
- dbus_connection_flush(conn_);
- dbus_message_unref(reply);
- dbus_message_unref(msg);
-}
-
-void DBusAdapter::SaveRequestFromHMI(uint32_t serial, DBusMessage* request) {
- LOG4CXX_DEBUG(logger_, "Save correlation id (serial id) : " << serial);
- LOG4CXX_DEBUG(logger_, "D-Bus message: " << request);
- requests_from_hmi_.insert(std::make_pair(serial, request));
-}
-
-DBusMessage* DBusAdapter::GetRequestFromHMI(uint32_t serial) {
- LOG4CXX_DEBUG(logger_, "Get correlation id (serial id) : " << serial);
- std::map<uint32_t, DBusMessage*>::iterator it;
- it = requests_from_hmi_.find(serial);
- if (it != requests_from_hmi_.end()) {
- DBusMessage* msg = it->second;
- requests_from_hmi_.erase(it);
- LOG4CXX_DEBUG(logger_, "D-Bus message: " << msg);
- return msg;
- }
- return 0;
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message.cc b/src/components/dbus/src/dbus_message.cc
deleted file mode 100644
index b8a55896ce..0000000000
--- a/src/components/dbus/src/dbus_message.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dbus/dbus_message.h"
-
-#include <algorithm>
-#include <cassert>
-
-#include <dbus/dbus.h>
-
-namespace dbus {
-
-MessageRefKeeper::MessageRefKeeper() : raw_message_(NULL) {}
-
-MessageRefKeeper::MessageRefKeeper(DBusMessage* message)
- : raw_message_(message) {
- assert(raw_message_);
- dbus_message_ref(raw_message_);
-}
-
-MessageRefKeeper::~MessageRefKeeper() {
- if (raw_message_) {
- dbus_message_unref(raw_message_);
- }
-}
-
-MessageRefKeeper::MessageRefKeeper(const MessageRefKeeper& other)
- : raw_message_(other.raw_message_) {
- assert(raw_message_);
- dbus_message_ref(raw_message_);
-}
-
-MessageRefKeeper& MessageRefKeeper::operator=(MessageRefKeeper other) {
- other.swap(*this);
- return *this;
-}
-
-DBusMessage* MessageRefKeeper::get() const {
- return raw_message_;
-}
-
-DBusMessage* MessageRefKeeper::Pass() {
- DBusMessage* message = raw_message_;
- raw_message_ = NULL;
- return message;
-}
-
-void MessageRefKeeper::swap(MessageRefKeeper& other) {
- std::swap(raw_message_, other.raw_message_);
-}
-
-MessageRef::MessageRef(DBusMessage* message) : raw_message_ref_(message) {}
-
-MessageRef::~MessageRef() {}
-
-std::string MessageRef::GetInterface() const {
- return dbus_message_get_interface(raw_message_ref_.get());
-}
-
-std::string MessageRef::GetMember() const {
- return dbus_message_get_member(raw_message_ref_.get());
-}
-
-// Message writer
-MessageReader::MessageReader(const MessageRef& message)
- : parent_reader_(NULL), failed_(false) {
- dbus_bool_t success =
- dbus_message_iter_init(message.raw_message_ref_.get(), &iterator_);
- if (!success) {
- MarkFailed();
- }
-}
-
-MessageReader::MessageReader(MessageReader* reader,
- DataType container_data_type)
- : parent_reader_(reader), failed_(reader->has_failed()) {
- assert(parent_reader_);
- if (!failed_) {
- if (reader->NextValueType() != container_data_type) {
- MarkFailed();
- } else {
- dbus_message_iter_recurse(&reader->iterator_, &iterator_);
- reader->MoveToNext();
- }
- }
-}
-
-bool MessageReader::NextIsDictEntry() const {
- return NextValueType() == DBUS_TYPE_DICT_ENTRY;
-}
-
-MessageReader MessageReader::TakeArrayReader() {
- return MessageReader(this, DBUS_TYPE_ARRAY);
-}
-
-MessageReader MessageReader::TakeStructReader() {
- return MessageReader(this, DBUS_TYPE_STRUCT);
-}
-
-MessageReader MessageReader::TakeDictEntryReader() {
- return MessageReader(this, DBUS_TYPE_DICT_ENTRY);
-}
-
-void MessageReader::MoveToNext() {
- if (!HasNext()) {
- MarkFailed();
- }
- dbus_message_iter_next(&iterator_);
-}
-
-void MessageReader::MarkFailed() {
- if (!failed_) {
- failed_ = true;
- if (parent_reader_) {
- parent_reader_->MarkFailed();
- }
- }
-}
-
-void MessageReader::ReadNextValue(MessageReader::DataType type, void* value) {
- assert(value);
- if (NextValueType() != type) {
- MarkFailed();
- } else if (!failed_) {
- dbus_message_iter_get_basic(&iterator_, value);
- MoveToNext();
- }
-}
-
-// DbusMessageWriter
-MessageWriter::MessageWriter(const MessageRef& message)
- : has_opened_subcontainer_(false), parent_writer_(NULL) {
- dbus_message_iter_init_append(message.raw_message_ref_.get(), &iterator_);
-}
-
-MessageWriter::MessageWriter(MessageWriter* parent,
- ContainerType container_type,
- const char* array_signature)
- : has_opened_subcontainer_(false), parent_writer_(parent) {
- assert(parent_writer_);
- // Only array writers require array_signature
- assert((container_type == kArray && array_signature != NULL) ||
- (container_type != kArray && array_signature == NULL));
- assert(!parent_writer_->has_opened_subcontainer_);
- bool enough_memory = dbus_message_iter_open_container(
- &parent_writer_->iterator_, container_type, array_signature, &iterator_);
- assert(enough_memory);
- parent_writer_->has_opened_subcontainer_ = true;
-}
-
-MessageWriter::~MessageWriter() {
- assert(!has_opened_subcontainer_);
- if (parent_writer_ != NULL) {
- CloseWriter();
- }
-}
-
-void MessageWriter::WriteAndCheck(MessageWriter::DataType value_type,
- const void* value) {
- assert(!has_opened_subcontainer_);
- dbus_bool_t enough_memory =
- dbus_message_iter_append_basic(&iterator_, value_type, value);
- assert(enough_memory);
-}
-
-void MessageWriter::CloseWriter() {
- assert(parent_writer_);
- assert(parent_writer_->has_opened_subcontainer_);
- dbus_bool_t enough_memory =
- dbus_message_iter_close_container(&parent_writer_->iterator_, &iterator_);
- assert(enough_memory);
- parent_writer_->has_opened_subcontainer_ = false;
-}
-
-// Construction functions
-
-MessageRef MethodCall(const char* bus_name,
- const char* path,
- const char* interface,
- const char* method) {
- return MessageRef(
- dbus_message_new_method_call(bus_name, path, interface, method));
-}
-
-MessageRef Signal(const char* path, const char* interface, const char* name) {
- return MessageRef(dbus_message_new_signal(path, interface, name));
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message_controller.cc b/src/components/dbus/src/dbus_message_controller.cc
deleted file mode 100644
index 59f08d6695..0000000000
--- a/src/components/dbus/src/dbus_message_controller.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dbus/dbus_message_controller.h"
-#include "formatters/CSmartFactory.h"
-
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-namespace dbus {
-
-DBusMessageController::DBusMessageController(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath)
- : DBusAdapter(sdlServiceName, sdlObjectPath, hmiServiceName, hmiObjectPath)
- , shutdown_(false) {}
-
-void DBusMessageController::SubscribeTo(const std::string& interface,
- const std::string& signal) {
- std::string rule = "type='signal'";
- rule.append(", sender='")
- .append(hmi_service_name_)
- .append("'")
- .append(", path='")
- .append(hmi_object_path_)
- .append("'")
- .append(", interface='")
- .append(hmi_service_name_)
- .append(".")
- .append(interface)
- .append("'")
- .append(", member='")
- .append(signal)
- .append("'");
- DBusAdapter::AddMatch(rule);
-}
-
-DBusMessageController::~DBusMessageController() {}
-
-void* DBusMessageController::MethodForReceiverThread(void*) {
- Run();
- return NULL;
-}
-
-bool DBusMessageController::Run() {
- while (!shutdown_) {
- smart_objects::SmartObject obj(smart_objects::SmartType_Map);
- obj[sos::S_PARAMS][sos::S_PROTOCOL_VERSION] = 2;
- obj[sos::S_PARAMS][sos::S_PROTOCOL_TYPE] = 1;
- if (DBusAdapter::Process(obj)) {
- SendMessageToCore(obj);
- }
- }
- return true;
-}
-
-void DBusMessageController::Shutdown() {
- shutdown_ = true;
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/introspection_xml.cc b/src/components/dbus/src/introspection_xml.cc
deleted file mode 100644
index 210c232a4d..0000000000
--- a/src/components/dbus/src/introspection_xml.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-// Warning! This file is generated by 'make_introspection_c.py'. Edit at your
-// own risk.
-/**
- * @file instrospections_xml.cc
- * @brief D-Bus introspection XML as C-string
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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.
-
-char introspection_xml[] = {
- 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x6e, 0x6f,
- 0x64, 0x65, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d,
- 0x2f, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f,
- 0x70, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x44, 0x2d, 0x42, 0x55, 0x53,
- 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x72,
- 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e,
- 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70,
- 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64,
- 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x73,
- 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x64, 0x62, 0x75,
- 0x73, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73,
- 0x70, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c,
- 0x6e, 0x6f, 0x64, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x2f,
- 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6f, 0x72, 0x64, 0x2f, 0x68, 0x6d, 0x69,
- 0x22, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x66,
- 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64, 0x6c, 0x2e,
- 0x42, 0x61, 0x73, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53,
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x53, 0x44, 0x4c, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x52,
- 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x4e,
- 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61,
- 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x67,
- 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x6c,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x73, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x28, 0x62,
- 0x61, 0x73, 0x29, 0x69, 0x69, 0x62, 0x28, 0x62, 0x61, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x28, 0x62, 0x61, 0x69, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x74, 0x74, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x76, 0x72, 0x53, 0x79, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x73,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x73,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x56, 0x72,
- 0x47, 0x72, 0x61, 0x6d, 0x6d, 0x61, 0x72, 0x73, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x70,
- 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c,
- 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x41, 0x70, 0x70, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
- 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
- 0x65, 0x64, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6e,
- 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x74, 0x68, 0x6f,
- 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6c,
- 0x6f, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x50,
- 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6f, 0x66, 0x66, 0x73, 0x65,
- 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x20,
- 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x79, 0x6e, 0x63,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65,
- 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f,
- 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74,
- 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65,
- 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69,
- 0x2e, 0x73, 0x64, 0x6c, 0x2e, 0x55, 0x49, 0x22, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74,
- 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,
- 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
- 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d,
- 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64,
- 0x6c, 0x2e, 0x53, 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x41, 0x63, 0x74,
- 0x69, 0x76, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x53, 0x44,
- 0x4c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x69, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64,
- 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50,
- 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
- 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69,
- 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41,
- 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x69, 0x65, 0x6e,
- 0x64, 0x6c, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64,
- 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
- 0x67, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x28, 0x62, 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74,
- 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73,
- 0x74, 0x4f, 0x66, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,
- 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
- 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f,
- 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43,
- 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c,
- 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x47, 0x65, 0x74, 0x55, 0x52, 0x4c, 0x53, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22,
- 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72,
- 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f,
- 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x72,
- 0x6c, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x73,
- 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
- 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72,
- 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x76, 0x6f,
- 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76,
- 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
- 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74,
- 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6f,
- 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e,
- 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e,
- 0x3c, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3e, 0x00}; \ No newline at end of file
diff --git a/src/components/dbus/src/message_descriptions.cc b/src/components/dbus/src/message_descriptions.cc
deleted file mode 100644
index 1a5e499a7f..0000000000
--- a/src/components/dbus/src/message_descriptions.cc
+++ /dev/null
@@ -1,10424 +0,0 @@
-// Warning! This file is generated by 'make_message_descriptions.py'. Edit at
-// your own risk.
-/**
- * @file message_descriptions.cc
- * @brief Generated HMI API message descriptions for D-Bus
- *
- * This file is a part of HMI D-Bus layer.
- */
-// 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 "dbus/message_descriptions.h"
-
-namespace {
-
-struct Structs {
- static const ford_message_descriptions::ParameterDescription*
- Common__Coordinate__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DeviceInfo__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__UserFriendlyMessage__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__PermissionItem__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ServiceInfo__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TextField__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ButtonCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VehicleDataResult__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TouchCoord__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TouchEvent__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__PresetBankCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Image__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SoftButton__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TTSChunk__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HMIApplication__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__MenuParams__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Choice__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VrHelpItem__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TimeFormat__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TouchEventCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ImageResolution__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ScreenParams__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ImageField__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VideoStreamingFormat__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VideoConfig__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DisplayCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SoftButtonCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HMICapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__AudioPassThruCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TextFieldStruct__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__KeyboardProperties__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Turn__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VehicleType__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__GPSData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SingleTireStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DIDResult__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HeadLampStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TireStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__BeltStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__BodyInformation__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DeviceStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ECallInfo__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__AirbagStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__EmergencyEvent__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ClusterModeStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__MyKey__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RdsData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RadioControlData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RadioControlCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Temperature__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ClimateControlData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ClimateControlCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ModuleData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DateTime__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__OASISAddress__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__LocationDetails__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__NavigationCapability__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__PhoneCapability__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VideoStreamingCapability__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SystemCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RemoteControlCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Rectangle__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HapticRect__parameters[];
-};
-
-const ford_message_descriptions::ParameterDescription
- Common__Coordinate__parameter1 = {
- "latitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Coordinate__parameter2 = {
- "longitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Coordinate__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Coordinate__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Coordinate__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter1 = {
- "name", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter2 = {
- "id", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter3 = {
- "transportType", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter4 = {
- "isSDLAllowed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DeviceInfo__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter1 = {
- "messageCode", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter2 = {
- "ttsString", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter3 = {
- "label", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter4 = {
- "line1", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter5 = {
- "line2", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter6 = {
- "textBody", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__UserFriendlyMessage__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter6,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__PermissionItem__parameter1 = {
- "name", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__PermissionItem__parameter2 = {
- "id", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__PermissionItem__parameter3 = {
- "allowed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__PermissionItem__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PermissionItem__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PermissionItem__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PermissionItem__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ServiceInfo__parameter1 = {
- "url", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__ServiceInfo__parameter2 = {
- "policyAppId", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ServiceInfo__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ServiceInfo__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ServiceInfo__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter2 = {
- "characterSet", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter3 = {
- "width", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter4 = {
- "rows", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TextField__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter2 = {
- "shortPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter3 = {
- "longPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter4 = {
- "upDownAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ButtonCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VehicleDataResult__parameter1 = {
- "dataType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleDataResult__parameter2 = {
- "resultCode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VehicleDataResult__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleDataResult__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleDataResult__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TouchCoord__parameter1 = {
- "x", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchCoord__parameter2 = {
- "y", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TouchCoord__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchCoord__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchCoord__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TouchEvent__parameter1 = {
- "id", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchEvent__parameter2_array = {
- "ts", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- Common__TouchEvent__parameter2 = {
- {"ts", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter2_array,
- "i"};
-const ford_message_descriptions::StructDescription
- Common__TouchEvent__parameter3_array = {
- {"c", ford_message_descriptions::Struct, true},
- Structs::Common__TouchCoord__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__TouchEvent__parameter3 = {
- {"c", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter3_array,
- "(ii)"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TouchEvent__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__PresetBankCapabilities__parameter1 = {
- "onScreenPresetsAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__PresetBankCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PresetBankCapabilities__parameter1,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Image__parameter1 = {
- "value", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__Image__parameter2 = {
- "imageType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Image__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Image__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Image__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter1 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter2 = {
- "text", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Common__SoftButton__parameter3 = {
- {"image", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter4 = {
- "isHighlighted", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter5 = {
- "softButtonID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter6 = {
- "systemAction", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__SoftButton__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter6,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TTSChunk__parameter1 = {
- "text", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__TTSChunk__parameter2 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TTSChunk__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TTSChunk__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TTSChunk__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter1 = {
- "appName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter2 = {
- "ngnMediaScreenAppName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter3 = {
- "icon", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Common__HMIApplication__parameter4 = {
- {"deviceInfo", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter5 = {
- "policyAppID", ford_message_descriptions::String, true};
-const ford_message_descriptions::StructDescription
- Common__HMIApplication__parameter6_array = {
- {"ttsName", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter6 = {
- {"ttsName", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter6_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter7_array = {
- "vrSynonyms", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter7 = {
- {"vrSynonyms", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter7_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter8 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter9 = {
- "hmiDisplayLanguageDesired", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter10 = {
- "isMediaApplication", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter11_array = {
- "appType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter11 = {
- {"appType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter11_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter12 = {
- "greyOut", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter13_array = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter13 = {
- {"requestType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter13_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HMIApplication__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter13,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__MenuParams__parameter1 = {
- "parentID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__MenuParams__parameter2 = {
- "position", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__MenuParams__parameter3 = {
- "menuName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__MenuParams__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MenuParams__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MenuParams__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MenuParams__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter1 = {
- "choiceID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter2 = {
- "menuName", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription Common__Choice__parameter3 =
- {{"image", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter4 = {
- "secondaryText", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter5 = {
- "tertiaryText", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription Common__Choice__parameter6 =
- {{"secondaryImage", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Choice__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter6,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VrHelpItem__parameter1 = {
- "text", ford_message_descriptions::String, true};
-const ford_message_descriptions::StructDescription
- Common__VrHelpItem__parameter2 = {
- {"image", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__VrHelpItem__parameter3 = {
- "position", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VrHelpItem__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VrHelpItem__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VrHelpItem__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VrHelpItem__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TimeFormat__parameter1 = {
- "hours", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TimeFormat__parameter2 = {
- "minutes", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TimeFormat__parameter3 = {
- "seconds", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TimeFormat__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TimeFormat__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TimeFormat__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TimeFormat__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TouchEventCapabilities__parameter1 = {
- "pressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchEventCapabilities__parameter2 = {
- "multiTouchAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchEventCapabilities__parameter3 = {
- "doublePressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TouchEventCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEventCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEventCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEventCapabilities__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ImageResolution__parameter1 = {
- "resolutionWidth", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__ImageResolution__parameter2 = {
- "resolutionHeight", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ImageResolution__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageResolution__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageResolution__parameter2,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__ScreenParams__parameter1 = {
- {"resolution", ford_message_descriptions::Struct, true},
- Structs::Common__ImageResolution__parameters};
-const ford_message_descriptions::StructDescription
- Common__ScreenParams__parameter2 = {
- {"touchEventAvailable", ford_message_descriptions::Struct, false},
- Structs::Common__TouchEventCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ScreenParams__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ScreenParams__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ScreenParams__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ImageField__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ImageField__parameter2_array = {
- "imageTypeSupported", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__ImageField__parameter2 = {
- {"imageTypeSupported", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter2_array,
- "i"};
-const ford_message_descriptions::StructDescription
- Common__ImageField__parameter3 = {
- {"imageResolution", ford_message_descriptions::Struct, false},
- Structs::Common__ImageResolution__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ImageField__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingFormat__parameter1 = {
- "protocol", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingFormat__parameter2 = {
- "codec", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VideoStreamingFormat__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingFormat__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingFormat__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter1 = {
- "protocol", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter2 = {
- "codec", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter3 = {
- "width", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter4 = {
- "height", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VideoConfig__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter1 = {
- "displayType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- Common__DisplayCapabilities__parameter2_array = {
- {"textFields", ford_message_descriptions::Struct, true},
- Structs::Common__TextField__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter2 = {
- {"textFields", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter2_array,
- "(iiii)"};
-const ford_message_descriptions::StructDescription
- Common__DisplayCapabilities__parameter3_array = {
- {"imageFields", ford_message_descriptions::Struct, true},
- Structs::Common__ImageField__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter3 = {
- {"imageFields", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter3_array,
- "(i(bai)(b(ii)))"};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter4_array = {
- "mediaClockFormats", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter4 = {
- {"mediaClockFormats", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter4_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter5_array = {
- "imageCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter5 = {
- {"imageCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter5_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter6 = {
- "graphicSupported", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter7_array = {
- "templatesAvailable", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter7 = {
- {"templatesAvailable", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter7_array,
- "s"};
-const ford_message_descriptions::StructDescription
- Common__DisplayCapabilities__parameter8 = {
- {"screenParams", ford_message_descriptions::Struct, false},
- Structs::Common__ScreenParams__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter9 = {
- "numCustomPresetsAvailable", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DisplayCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter9,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter1 = {
- "shortPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter2 = {
- "longPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter3 = {
- "upDownAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter4 = {
- "imageSupported", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__SoftButtonCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HMICapabilities__parameter1 = {
- "navigation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__HMICapabilities__parameter2 = {
- "phoneCall", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HMICapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMICapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMICapabilities__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__AudioPassThruCapabilities__parameter1 = {
- "samplingRate", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AudioPassThruCapabilities__parameter2 = {
- "bitsPerSample", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AudioPassThruCapabilities__parameter3 = {
- "audioType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__AudioPassThruCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AudioPassThruCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AudioPassThruCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AudioPassThruCapabilities__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TextFieldStruct__parameter1 = {
- "fieldName", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextFieldStruct__parameter2 = {
- "fieldText", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TextFieldStruct__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextFieldStruct__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextFieldStruct__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter1 = {
- "language", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter2 = {
- "keyboardLayout", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter3 = {
- "keypressMode", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter4_array = {
- "limitedCharacterList", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__KeyboardProperties__parameter4 = {
- {"limitedCharacterList", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter4_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter5 = {
- "autoCompleteText", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__KeyboardProperties__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter5,
- NULL};
-
-const ford_message_descriptions::StructDescription Common__Turn__parameter1 = {
- {"navigationText", ford_message_descriptions::Struct, false},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::StructDescription Common__Turn__parameter2 = {
- {"turnIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Turn__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Turn__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Turn__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter1 = {
- "make", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter2 = {
- "model", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter3 = {
- "modelYear", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter4 = {
- "trim", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VehicleType__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter1 = {
- "longitudeDegrees", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter2 = {
- "latitudeDegrees", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter3 = {
- "utcYear", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter4 = {
- "utcMonth", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter5 = {
- "utcDay", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter6 = {
- "utcHours", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter7 = {
- "utcMinutes", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter8 = {
- "utcSeconds", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter9 = {
- "compassDirection", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter10 = {
- "pdop", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter11 = {
- "hdop", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter12 = {
- "vdop", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter13 = {
- "actual", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter14 = {
- "satellites", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter15 = {
- "dimension", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter16 = {
- "altitude", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter17 = {
- "heading", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter18 = {
- "speed", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__GPSData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter18,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__SingleTireStatus__parameter1 = {
- "status", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__SingleTireStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SingleTireStatus__parameter1,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DIDResult__parameter1 = {
- "resultCode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__DIDResult__parameter2 = {
- "didLocation", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__DIDResult__parameter3 = {
- "data", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DIDResult__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DIDResult__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DIDResult__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DIDResult__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HeadLampStatus__parameter1 = {
- "lowBeamsOn", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__HeadLampStatus__parameter2 = {
- "highBeamsOn", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__HeadLampStatus__parameter3 = {
- "ambientLightSensorStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HeadLampStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HeadLampStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HeadLampStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HeadLampStatus__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TireStatus__parameter1 = {
- "pressureTelltale", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter2 = {
- {"leftFront", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter3 = {
- {"rightFront", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter4 = {
- {"leftRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter5 = {
- {"rightRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter6 = {
- {"innerLeftRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter7 = {
- {"innerRightRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TireStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter7,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter1 = {
- "driverBeltDeployed", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter2 = {
- "passengerBeltDeployed", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter3 = {
- "passengerBuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter4 = {
- "driverBuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter5 = {
- "leftRow2BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter6 = {
- "passengerChildDetected", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter7 = {
- "rightRow2BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter8 = {
- "middleRow2BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter9 = {
- "middleRow3BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter10 = {
- "leftRow3BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter11 = {
- "rightRow3BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter12 = {
- "leftRearInflatableBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter13 = {
- "rightRearInflatableBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter14 = {
- "middleRow1BeltDeployed", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter15 = {
- "middleRow1BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__BeltStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter15,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter1 = {
- "parkBrakeActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter2 = {
- "ignitionStableStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter3 = {
- "ignitionStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter4 = {
- "driverDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter5 = {
- "passengerDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter6 = {
- "rearLeftDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter7 = {
- "rearRightDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__BodyInformation__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter7,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter1 = {
- "voiceRecOn", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter2 = {
- "btIconOn", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter3 = {
- "callActive", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter4 = {
- "phoneRoaming", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter5 = {
- "textMsgAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter6 = {
- "battLevelStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter7 = {
- "stereoAudioOutputMuted", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter8 = {
- "monoAudioOutputMuted", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter9 = {
- "signalLevelStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter10 = {
- "primaryAudioSource", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter11 = {
- "eCallEventActive", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DeviceStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter11,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ECallInfo__parameter1 = {
- "eCallNotificationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ECallInfo__parameter2 = {
- "auxECallNotificationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ECallInfo__parameter3 = {
- "eCallConfirmationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ECallInfo__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ECallInfo__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ECallInfo__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ECallInfo__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter1 = {
- "driverAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter2 = {
- "driverSideAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter3 = {
- "driverCurtainAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter4 = {
- "passengerAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter5 = {"passengerCurtainAirbagDeployed",
- ford_message_descriptions::Enum,
- true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter6 = {
- "driverKneeAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter7 = {
- "passengerSideAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter8 = {
- "passengerKneeAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__AirbagStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter8,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter1 = {
- "emergencyEventType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter2 = {
- "fuelCutoffStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter3 = {
- "rolloverEvent", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter4 = {
- "maximumChangeVelocity", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter5 = {
- "multipleEvents", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__EmergencyEvent__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter5,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter1 = {
- "powerModeActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter2 = {
- "powerModeQualificationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter3 = {
- "carModeStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter4 = {
- "powerModeStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ClusterModeStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__MyKey__parameter1 = {
- "e911Override", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__MyKey__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MyKey__parameter1,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter1 = {
- "PS", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter2 = {
- "RT", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter3 = {
- "CT", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter4 = {
- "PI", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter5 = {
- "PTY", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter6 = {
- "TP", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter7 = {
- "TA", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter8 = {
- "REG", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RdsData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter8,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter1 = {
- "frequencyInteger", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter2 = {
- "frequencyFraction", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter3 = {
- "band", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- Common__RadioControlData__parameter4 = {
- {"rdsData", ford_message_descriptions::Struct, false},
- Structs::Common__RdsData__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter5 = {
- "availableHDs", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter6 = {
- "hdChannel", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter7 = {
- "signalStrength", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter8 = {
- "signalChangeThreshold", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter9 = {
- "radioEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter10 = {
- "state", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RadioControlData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter10,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter1 = {
- "moduleName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter2 = {
- "radioEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter3 = {
- "radioBandAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter4 = {
- "radioFrequencyAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter5 = {
- "hdChannelAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter6 = {
- "rdsDataAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter7 = {
- "availableHDsAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter8 = {
- "stateAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter9 = {
- "signalStrengthAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter10 = {
- "signalChangeThresholdAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RadioControlCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter10,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Temperature__parameter1 = {
- "unit", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__Temperature__parameter2 = {
- "value", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Temperature__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Temperature__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Temperature__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter1 = {
- "fanSpeed", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- Common__ClimateControlData__parameter2 = {
- {"currentTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__Temperature__parameters};
-const ford_message_descriptions::StructDescription
- Common__ClimateControlData__parameter3 = {
- {"desiredTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__Temperature__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter4 = {
- "acEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter5 = {
- "circulateAirEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter6 = {
- "autoModeEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter7 = {
- "defrostZone", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter8 = {
- "dualModeEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter9 = {
- "acMaxEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter10 = {
- "ventilationMode", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ClimateControlData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter10,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter1 = {
- "moduleName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter2 = {
- "currentTemperatureAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter3 = {
- "fanSpeedAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter4 = {
- "desiredTemperatureAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter5 = {
- "acEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter6 = {
- "acMaxEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter7 = {
- "circulateAirEnableAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter8 = {
- "autoModeEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter9 = {
- "dualModeEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter10 = {
- "defrostZoneAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter11_array = {
- "defrostZone", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__ClimateControlCapabilities__parameter11 = {
- {"defrostZone", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter11_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter12 = {
- "ventilationModeAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter13_array = {
- "ventilationMode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__ClimateControlCapabilities__parameter13 = {
- {"ventilationMode", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter13_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ClimateControlCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter13,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ModuleData__parameter1 = {
- "moduleType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- Common__ModuleData__parameter2 = {
- {"radioControlData", ford_message_descriptions::Struct, false},
- Structs::Common__RadioControlData__parameters};
-const ford_message_descriptions::StructDescription
- Common__ModuleData__parameter3 = {
- {"climateControlData", ford_message_descriptions::Struct, false},
- Structs::Common__ClimateControlData__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ModuleData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ModuleData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ModuleData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ModuleData__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter1 = {
- "millisecond", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter2 = {
- "second", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter3 = {
- "minute", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter4 = {
- "hour", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter5 = {
- "day", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter6 = {
- "month", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter7 = {
- "year", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter8 = {
- "tz_hour", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter9 = {
- "tz_minute", ford_message_descriptions::Integer, false};
-/*const ford_message_descriptions::ParameterDescription*
- Structs::Common__DateTime__parameters[] = {
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter1,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter2,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter3,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter4,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter5,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter6,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter7,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter8,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter9,
- NULL };*/
-
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter1 = {
- "countryName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter2 = {
- "countryCode", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter3 = {
- "postalCode", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter4 = {
- "administrativeArea", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter5 = {
- "subAdministrativeArea", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter6 = {
- "locality", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter7 = {
- "subLocality", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter8 = {
- "thoroughfare", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter9 = {
- "subThoroughfare", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__OASISAddress__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter9,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__LocationDetails__parameter1 = {
- {"coordinate", ford_message_descriptions::Struct, false},
- Structs::Common__Coordinate__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter2 = {
- "locationName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter3_array = {
- "addressLines", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__LocationDetails__parameter3 = {
- {"addressLines", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter3_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter4 = {
- "locationDescription", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter5 = {
- "phoneNumber", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Common__LocationDetails__parameter6 = {
- {"locationImage", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- Common__LocationDetails__parameter7 = {
- {"searchAddress", ford_message_descriptions::Struct, false},
- Structs::Common__OASISAddress__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__LocationDetails__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter7,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__NavigationCapability__parameter1 = {
- "sendLocationEnabled", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__NavigationCapability__parameter2 = {
- "getWayPointsEnabled", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__NavigationCapability__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__NavigationCapability__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__NavigationCapability__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__PhoneCapability__parameter1 = {
- "dialNumberEnabled", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__PhoneCapability__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PhoneCapability__parameter1,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__VideoStreamingCapability__parameter1 = {
- {"preferredResolution", ford_message_descriptions::Struct, false},
- Structs::Common__ImageResolution__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingCapability__parameter2 = {
- "maxBitrate", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- Common__VideoStreamingCapability__parameter3_array = {
- {"supportedFormats", ford_message_descriptions::Struct, true},
- Structs::Common__VideoStreamingFormat__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__VideoStreamingCapability__parameter3 = {
- {"supportedFormats", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter3_array,
- "(ii)"};
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingCapability__parameter4 = {
- "hapticSpatialDataSupported",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VideoStreamingCapability__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter4,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__SystemCapabilities__parameter1 = {
- {"navigationCapability", ford_message_descriptions::Struct, false},
- Structs::Common__NavigationCapability__parameters};
-const ford_message_descriptions::StructDescription
- Common__SystemCapabilities__parameter2 = {
- {"phoneCapability", ford_message_descriptions::Struct, false},
- Structs::Common__PhoneCapability__parameters};
-const ford_message_descriptions::StructDescription
- Common__SystemCapabilities__parameter3 = {
- {"videoStreamingCapability", ford_message_descriptions::Struct, false},
- Structs::Common__VideoStreamingCapability__parameters};
-/*const ford_message_descriptions::ParameterDescription*
- Structs::Common__SystemCapabilities__parameters[] = {
- (const
- ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter1,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter2,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter3,
- NULL };*/
-
-const ford_message_descriptions::StructDescription
- Common__RemoteControlCapabilities__parameter1_array = {
- {"climateControlCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ClimateControlCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__RemoteControlCapabilities__parameter1 = {
- {"climateControlCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter1_array,
- "(s(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bai)(bb)(bai))"};
-const ford_message_descriptions::StructDescription
- Common__RemoteControlCapabilities__parameter2_array = {
- {"radioControlCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__RadioControlCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__RemoteControlCapabilities__parameter2 = {
- {"radioControlCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter2_array,
- "(s(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb))"};
-const ford_message_descriptions::StructDescription
- Common__RemoteControlCapabilities__parameter3_array = {
- {"buttonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__RemoteControlCapabilities__parameter3 = {
- {"buttonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter3_array,
- "(ibbb)"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RemoteControlCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter1 = {
- "x", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter2 = {
- "y", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter3 = {
- "width", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter4 = {
- "height", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Rectangle__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HapticRect__parameter1 = {
- "id", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- Common__HapticRect__parameter2 = {
- {"rect", ford_message_descriptions::Struct, true},
- Structs::Common__Rectangle__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HapticRect__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HapticRect__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HapticRect__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription*
- Buttons__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__GetCapabilities__request = {
- "Buttons",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Buttons_GetCapabilities,
- Buttons__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::StructDescription
- Buttons__GetCapabilities__response__parameter1_array = {
- {"capabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Buttons__GetCapabilities__response__parameter1 = {
- {"capabilities", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__GetCapabilities__response__parameter1_array,
- "(ibbb)"};
-const ford_message_descriptions::StructDescription
- Buttons__GetCapabilities__response__parameter2 = {
- {"presetBankCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__PresetBankCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- Buttons__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__GetCapabilities__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__GetCapabilities__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__GetCapabilities__response = {
- "Buttons",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Buttons_GetCapabilities,
- Buttons__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter2 = {
- "mode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter3 = {
- "customButtonID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter4 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Buttons__OnButtonEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__OnButtonEvent__notification = {
- "Buttons",
- "OnButtonEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Buttons_OnButtonEvent,
- Buttons__OnButtonEvent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter2 = {
- "mode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter3 = {
- "customButtonID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter4 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Buttons__OnButtonPress__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__OnButtonPress__notification = {
- "Buttons",
- "OnButtonPress",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Buttons_OnButtonPress,
- Buttons__OnButtonPress__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonSubscription__notification__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonSubscription__notification__parameter2 = {
- "isSubscribed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonSubscription__notification__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Buttons__OnButtonSubscription__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__OnButtonSubscription__notification = {
- "Buttons",
- "OnButtonSubscription",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Buttons_OnButtonSubscription,
- Buttons__OnButtonSubscription__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnReady__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnReady__notification = {
- "BasicCommunication",
- "OnReady",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnReady,
- BasicCommunication__OnReady__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnStartDeviceDiscovery__notification__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnStartDeviceDiscovery__notification = {
- "BasicCommunication",
- "OnStartDeviceDiscovery",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery,
- BasicCommunication__OnStartDeviceDiscovery__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnUpdateDeviceList__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnUpdateDeviceList__notification = {
- "BasicCommunication",
- "OnUpdateDeviceList",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList,
- BasicCommunication__OnUpdateDeviceList__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPhoneCall__notification__parameter1 = {
- "isActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnPhoneCall__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPhoneCall__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnPhoneCall__notification = {
- "BasicCommunication",
- "OnPhoneCall",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnPhoneCall,
- BasicCommunication__OnPhoneCall__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnEmergencyEvent__notification__parameter1 = {
- "enabled", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnEmergencyEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnEmergencyEvent__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnEmergencyEvent__notification = {
- "BasicCommunication",
- "OnEmergencyEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnEmergencyEvent,
- BasicCommunication__OnEmergencyEvent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnResumeAudioSource__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnResumeAudioSource__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnResumeAudioSource__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnResumeAudioSource__notification = {
- "BasicCommunication",
- "OnResumeAudioSource",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource,
- BasicCommunication__OnResumeAudioSource__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSDLPersistenceComplete__notification__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSDLPersistenceComplete__notification = {
- "BasicCommunication",
- "OnSDLPersistenceComplete",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete,
- BasicCommunication__OnSDLPersistenceComplete__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__UpdateAppList__request__parameter1_array = {
- {"applications", ford_message_descriptions::Struct, true},
- Structs::Common__HMIApplication__parameters};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__UpdateAppList__request__parameter1 = {
- {"applications", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateAppList__request__parameter1_array,
- "(s(bs)(bs)(ss(bi)(bb))s(ba(si))(bas)iib(bai)(bb)(bai))"};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateAppList__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateAppList__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateAppList__request = {
- "BasicCommunication",
- "UpdateAppList",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_UpdateAppList,
- BasicCommunication__UpdateAppList__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateAppList__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateAppList__response = {
- "BasicCommunication",
- "UpdateAppList",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_UpdateAppList,
- BasicCommunication__UpdateAppList__response__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__UpdateDeviceList__request__parameter1_array = {
- {"deviceList", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__UpdateDeviceList__request__parameter1 = {
- {"deviceList", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateDeviceList__request__parameter1_array,
- "(ss(bi)(bb))"};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateDeviceList__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateDeviceList__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateDeviceList__request = {
- "BasicCommunication",
- "UpdateDeviceList",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList,
- BasicCommunication__UpdateDeviceList__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateDeviceList__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateDeviceList__response = {
- "BasicCommunication",
- "UpdateDeviceList",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList,
- BasicCommunication__UpdateDeviceList__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnFileRemoved__notification__parameter1 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnFileRemoved__notification__parameter2 = {
- "fileType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnFileRemoved__notification__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnFileRemoved__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnFileRemoved__notification = {
- "BasicCommunication",
- "OnFileRemoved",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnFileRemoved,
- BasicCommunication__OnFileRemoved__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__AllowDeviceToConnect__request__parameter1 = {
- {"device", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__AllowDeviceToConnect__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__AllowDeviceToConnect__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__AllowDeviceToConnect__request = {
- "BasicCommunication",
- "AllowDeviceToConnect",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_AllowDeviceToConnect,
- BasicCommunication__AllowDeviceToConnect__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__AllowDeviceToConnect__response__parameter1 = {
- "allow", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__AllowDeviceToConnect__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__AllowDeviceToConnect__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__AllowDeviceToConnect__response = {
- "BasicCommunication",
- "AllowDeviceToConnect",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_AllowDeviceToConnect,
- BasicCommunication__AllowDeviceToConnect__response__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnDeviceChosen__notification__parameter1 = {
- {"deviceInfo", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnDeviceChosen__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnDeviceChosen__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnDeviceChosen__notification = {
- "BasicCommunication",
- "OnDeviceChosen",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen,
- BasicCommunication__OnDeviceChosen__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnFindApplications__notification__parameter1 = {
- {"deviceInfo", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnFindApplications__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFindApplications__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnFindApplications__notification = {
- "BasicCommunication",
- "OnFindApplications",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnFindApplications,
- BasicCommunication__OnFindApplications__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__ActivateApp__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__ActivateApp__request__parameter2 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__ActivateApp__request__parameter3 = {
- "level", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__ActivateApp__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__ActivateApp__request = {
- "BasicCommunication",
- "ActivateApp",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- BasicCommunication__ActivateApp__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__ActivateApp__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__ActivateApp__response = {
- "BasicCommunication",
- "ActivateApp",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- BasicCommunication__ActivateApp__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppActivated__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppActivated__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppActivated__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppActivated__notification = {
- "BasicCommunication",
- "OnAppActivated",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppActivated,
- BasicCommunication__OnAppActivated__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppDeactivated__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppDeactivated__notification__parameter2 = {
- "reason", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppDeactivated__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppDeactivated__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppDeactivated__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppDeactivated__notification = {
- "BasicCommunication",
- "OnAppDeactivated",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated,
- BasicCommunication__OnAppDeactivated__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnAppRegistered__notification__parameter1 = {
- {"application", ford_message_descriptions::Struct, true},
- Structs::Common__HMIApplication__parameters};
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnAppRegistered__notification__parameter2_array = {
- {"ttsName", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__OnAppRegistered__notification__parameter2 = {
- {"ttsName", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter2_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppRegistered__notification__parameter3_array = {
- "vrSynonyms", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__OnAppRegistered__notification__parameter3 = {
- {"vrSynonyms", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter3_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppRegistered__notification__parameter4 = {
- "resumeVrGrammars", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppRegistered__notification__parameter5 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppRegistered__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppRegistered__notification = {
- "BasicCommunication",
- "OnAppRegistered",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered,
- BasicCommunication__OnAppRegistered__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppUnregistered__notification__parameter1 = {
- "unexpectedDisconnect", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppUnregistered__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppUnregistered__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppUnregistered__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppUnregistered__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppUnregistered__notification = {
- "BasicCommunication",
- "OnAppUnregistered",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered,
- BasicCommunication__OnAppUnregistered__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnExitApplication__notification__parameter1 = {
- "reason", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnExitApplication__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnExitApplication__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnExitApplication__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnExitApplication__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnExitApplication__notification = {
- "BasicCommunication",
- "OnExitApplication",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnExitApplication,
- BasicCommunication__OnExitApplication__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnExitAllApplications__notification__parameter1 = {
- "reason", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnExitAllApplications__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnExitAllApplications__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnExitAllApplications__notification = {
- "BasicCommunication",
- "OnExitAllApplications",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications,
- BasicCommunication__OnExitAllApplications__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAwakeSDL__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAwakeSDL__notification = {
- "BasicCommunication",
- "OnAwakeSDL",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL,
- BasicCommunication__OnAwakeSDL__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__MixingAudioSupported__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__MixingAudioSupported__request = {
- "BasicCommunication",
- "MixingAudioSupported",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
- BasicCommunication__MixingAudioSupported__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__MixingAudioSupported__response__parameter1 = {
- "attenuatedSupported", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__MixingAudioSupported__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__MixingAudioSupported__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__MixingAudioSupported__response = {
- "BasicCommunication",
- "MixingAudioSupported",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
- BasicCommunication__MixingAudioSupported__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PlayTone__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PlayTone__notification__parameter2 = {
- "methodName", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__PlayTone__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PlayTone__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PlayTone__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__PlayTone__notification = {
- "BasicCommunication",
- "PlayTone",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_PlayTone,
- BasicCommunication__PlayTone__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__DialNumber__request__parameter1 = {
- "number", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__DialNumber__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DialNumber__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__DialNumber__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__DialNumber__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DialNumber__request = {
- "BasicCommunication",
- "DialNumber",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_DialNumber,
- BasicCommunication__DialNumber__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DialNumber__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DialNumber__response = {
- "BasicCommunication",
- "DialNumber",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_DialNumber,
- BasicCommunication__DialNumber__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter1 = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter2 = {
- "url", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter3 = {
- "fileType", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter4 = {
- "offset", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter5 = {
- "length", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter6 = {
- "timeout", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter7 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter8 = {
- "appID", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSystemRequest__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSystemRequest__notification = {
- "BasicCommunication",
- "OnSystemRequest",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSystemRequest,
- BasicCommunication__OnSystemRequest__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__SystemRequest__request__parameter1 = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__SystemRequest__request__parameter2 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__SystemRequest__request__parameter3 = {
- "appID", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__SystemRequest__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__SystemRequest__request = {
- "BasicCommunication",
- "SystemRequest",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_SystemRequest,
- BasicCommunication__SystemRequest__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__SystemRequest__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__SystemRequest__response = {
- "BasicCommunication",
- "SystemRequest",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_SystemRequest,
- BasicCommunication__SystemRequest__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PolicyUpdate__request__parameter1 = {
- "file", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PolicyUpdate__request__parameter2 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PolicyUpdate__request__parameter3_array = {
- "retry", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__PolicyUpdate__request__parameter3 = {
- {"retry", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter3_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__PolicyUpdate__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__PolicyUpdate__request = {
- "BasicCommunication",
- "PolicyUpdate",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_PolicyUpdate,
- BasicCommunication__PolicyUpdate__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__PolicyUpdate__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__PolicyUpdate__response = {
- "BasicCommunication",
- "PolicyUpdate",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_PolicyUpdate,
- BasicCommunication__PolicyUpdate__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSDLClose__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSDLClose__notification = {
- "BasicCommunication",
- "OnSDLClose",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSDLClose,
- BasicCommunication__OnSDLClose__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter1 = {
- "offset", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter2 = {
- "length", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter3 = {
- "fileSize", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter4 = {
- "FileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter5 = {
- "syncFileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter6 = {
- "fileType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter7 = {
- "persistentFile", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnPutFile__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnPutFile__notification = {
- "BasicCommunication",
- "OnPutFile",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnPutFile,
- BasicCommunication__OnPutFile__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__GetSystemInfo__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__GetSystemInfo__request = {
- "BasicCommunication",
- "GetSystemInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_GetSystemInfo,
- BasicCommunication__GetSystemInfo__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__GetSystemInfo__response__parameter1 = {
- "ccpu_version", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__GetSystemInfo__response__parameter2 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__GetSystemInfo__response__parameter3 = {
- "wersCountryCode", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__GetSystemInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__GetSystemInfo__response = {
- "BasicCommunication",
- "GetSystemInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_GetSystemInfo,
- BasicCommunication__GetSystemInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemInfoChanged__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSystemInfoChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemInfoChanged__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSystemInfoChanged__notification = {
- "BasicCommunication",
- "OnSystemInfoChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged,
- BasicCommunication__OnSystemInfoChanged__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnIgnitionCycleOver__notification__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnIgnitionCycleOver__notification = {
- "BasicCommunication",
- "OnIgnitionCycleOver",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver,
- BasicCommunication__OnIgnitionCycleOver__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__DecryptCertificate__request__parameter1 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DecryptCertificate__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__DecryptCertificate__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DecryptCertificate__request = {
- "BasicCommunication",
- "DecryptCertificate",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_DecryptCertificate,
- BasicCommunication__DecryptCertificate__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DecryptCertificate__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DecryptCertificate__response = {
- "BasicCommunication",
- "DecryptCertificate",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_DecryptCertificate,
- BasicCommunication__DecryptCertificate__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnEventChanged__notification__parameter1 = {
- "eventName", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnEventChanged__notification__parameter2 = {
- "isActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnEventChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnEventChanged__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnEventChanged__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnEventChanged__notification = {
- "BasicCommunication",
- "OnEventChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnEventChanged,
- BasicCommunication__OnEventChanged__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__IsReady__request = {
- "VR",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_IsReady,
- VR__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- VR__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription VR__IsReady__response = {
- "VR",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_IsReady,
- VR__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__Started__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__Started__notification =
- {"VR",
- "Started",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_Started,
- VR__Started__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__Stopped__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__Stopped__notification =
- {"VR",
- "Stopped",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_Stopped,
- VR__Stopped__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter2_array = {
- "vrCommands", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- VR__AddCommand__request__parameter2 = {
- {"vrCommands", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter2_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter3 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter4 = {
- "grammarID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter5 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- VR__AddCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription VR__AddCommand__request = {
- "VR",
- "AddCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_AddCommand,
- VR__AddCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__AddCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__AddCommand__response = {
- "VR",
- "AddCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_AddCommand,
- VR__AddCommand__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter2 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter3 = {
- "grammarID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VR__DeleteCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription VR__DeleteCommand__request =
- {"VR",
- "DeleteCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_DeleteCommand,
- VR__DeleteCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__DeleteCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__DeleteCommand__response = {"VR",
- "DeleteCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_DeleteCommand,
- VR__DeleteCommand__response__parameters};
-
-const ford_message_descriptions::StructDescription
- VR__PerformInteraction__request__parameter1_array = {
- {"helpPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter1 = {
- {"helpPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::StructDescription
- VR__PerformInteraction__request__parameter2_array = {
- {"initialPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter2 = {
- {"initialPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter2_array,
- "(si)"};
-const ford_message_descriptions::StructDescription
- VR__PerformInteraction__request__parameter3_array = {
- {"timeoutPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter3 = {
- {"timeoutPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter3_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- VR__PerformInteraction__request__parameter4 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__PerformInteraction__request__parameter5_array = {
- "grammarID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter5 = {
- {"grammarID", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter5_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VR__PerformInteraction__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__PerformInteraction__request = {
- "VR",
- "PerformInteraction",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_PerformInteraction,
- VR__PerformInteraction__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__PerformInteraction__response__parameter1 = {
- "choiceID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- VR__PerformInteraction__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__PerformInteraction__response = {
- "VR",
- "PerformInteraction",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_PerformInteraction,
- VR__PerformInteraction__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__OnCommand__notification__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__OnCommand__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VR__OnCommand__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__OnCommand__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__OnCommand__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__OnCommand__notification = {"VR",
- "OnCommand",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_OnCommand,
- VR__OnCommand__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__ChangeRegistration__request__parameter1_array = {
- "vrSynonyms", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- VR__ChangeRegistration__request__parameter1 = {
- {"vrSynonyms", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter1_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- VR__ChangeRegistration__request__parameter2 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- VR__ChangeRegistration__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VR__ChangeRegistration__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__ChangeRegistration__request = {
- "VR",
- "ChangeRegistration",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_ChangeRegistration,
- VR__ChangeRegistration__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__ChangeRegistration__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__ChangeRegistration__response = {
- "VR",
- "ChangeRegistration",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_ChangeRegistration,
- VR__ChangeRegistration__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__OnLanguageChange__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VR__OnLanguageChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__OnLanguageChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__OnLanguageChange__notification = {
- "VR",
- "OnLanguageChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_OnLanguageChange,
- VR__OnLanguageChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__GetSupportedLanguages__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetSupportedLanguages__request = {
- "VR",
- "GetSupportedLanguages",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_GetSupportedLanguages,
- VR__GetSupportedLanguages__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__GetSupportedLanguages__response__parameter1_array = {
- "languages", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- VR__GetSupportedLanguages__response__parameter1 = {
- {"languages", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetSupportedLanguages__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VR__GetSupportedLanguages__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetSupportedLanguages__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetSupportedLanguages__response = {
- "VR",
- "GetSupportedLanguages",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_GetSupportedLanguages,
- VR__GetSupportedLanguages__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__GetLanguage__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__GetLanguage__request = {
- "VR",
- "GetLanguage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_GetLanguage,
- VR__GetLanguage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__GetLanguage__response__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VR__GetLanguage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetLanguage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription VR__GetLanguage__response =
- {"VR",
- "GetLanguage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_GetLanguage,
- VR__GetLanguage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetCapabilities__request = {"VR",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_GetCapabilities,
- VR__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__GetCapabilities__response__parameter1_array = {
- "vrCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- VR__GetCapabilities__response__parameter1 = {
- {"vrCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetCapabilities__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VR__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetCapabilities__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetCapabilities__response = {"VR",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_GetCapabilities,
- VR__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetCapabilities__request = {"TTS",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_GetCapabilities,
- TTS__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__GetCapabilities__response__parameter1_array = {
- "speechCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- TTS__GetCapabilities__response__parameter1 = {
- {"speechCapabilities", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- TTS__GetCapabilities__response__parameter2_array = {
- "prerecordedSpeechCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- TTS__GetCapabilities__response__parameter2 = {
- {"prerecordedSpeechCapabilities",
- ford_message_descriptions::Array,
- true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter2_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- TTS__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetCapabilities__response = {
- "TTS",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_GetCapabilities,
- TTS__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__Started__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__Started__notification =
- {"TTS",
- "Started",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_Started,
- TTS__Started__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__Stopped__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__Stopped__notification =
- {"TTS",
- "Stopped",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_Stopped,
- TTS__Stopped__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__IsReady__request = {
- "TTS",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_IsReady,
- TTS__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription TTS__IsReady__response = {
- "TTS",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_IsReady,
- TTS__IsReady__response__parameters};
-
-const ford_message_descriptions::StructDescription
- TTS__Speak__request__parameter1_array = {
- {"ttsChunks", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__Speak__request__parameter1 = {
- {"ttsChunks", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- TTS__Speak__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- TTS__Speak__request__parameter3 = {
- "speakType", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- TTS__Speak__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription TTS__Speak__request = {
- "TTS",
- "Speak",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_Speak,
- TTS__Speak__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__Speak__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__Speak__response = {
- "TTS",
- "Speak",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_Speak,
- TTS__Speak__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__StopSpeaking__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__StopSpeaking__request =
- {"TTS",
- "StopSpeaking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_StopSpeaking,
- TTS__StopSpeaking__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__StopSpeaking__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__StopSpeaking__response = {"TTS",
- "StopSpeaking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_StopSpeaking,
- TTS__StopSpeaking__response__parameters};
-
-const ford_message_descriptions::StructDescription
- TTS__ChangeRegistration__request__parameter1_array = {
- {"ttsName", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__ChangeRegistration__request__parameter1 = {
- {"ttsName", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- TTS__ChangeRegistration__request__parameter2 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- TTS__ChangeRegistration__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__ChangeRegistration__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__ChangeRegistration__request = {
- "TTS",
- "ChangeRegistration",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_ChangeRegistration,
- TTS__ChangeRegistration__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__ChangeRegistration__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__ChangeRegistration__response = {
- "TTS",
- "ChangeRegistration",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_ChangeRegistration,
- TTS__ChangeRegistration__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__OnLanguageChange__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__OnLanguageChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__OnLanguageChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__OnLanguageChange__notification = {
- "TTS",
- "OnLanguageChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_OnLanguageChange,
- TTS__OnLanguageChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__GetSupportedLanguages__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetSupportedLanguages__request = {
- "TTS",
- "GetSupportedLanguages",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_GetSupportedLanguages,
- TTS__GetSupportedLanguages__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__GetSupportedLanguages__response__parameter1_array = {
- "languages", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- TTS__GetSupportedLanguages__response__parameter1 = {
- {"languages", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetSupportedLanguages__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- TTS__GetSupportedLanguages__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetSupportedLanguages__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetSupportedLanguages__response = {
- "TTS",
- "GetSupportedLanguages",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_GetSupportedLanguages,
- TTS__GetSupportedLanguages__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__GetLanguage__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__GetLanguage__request =
- {"TTS",
- "GetLanguage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_GetLanguage,
- TTS__GetLanguage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__GetLanguage__response__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__GetLanguage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetLanguage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription TTS__GetLanguage__response =
- {"TTS",
- "GetLanguage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_GetLanguage,
- TTS__GetLanguage__response__parameters};
-
-const ford_message_descriptions::StructDescription
- TTS__SetGlobalProperties__request__parameter1_array = {
- {"helpPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__SetGlobalProperties__request__parameter1 = {
- {"helpPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::StructDescription
- TTS__SetGlobalProperties__request__parameter2_array = {
- {"timeoutPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__SetGlobalProperties__request__parameter2 = {
- {"timeoutPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter2_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- TTS__SetGlobalProperties__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__SetGlobalProperties__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__SetGlobalProperties__request = {
- "TTS",
- "SetGlobalProperties",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_SetGlobalProperties,
- TTS__SetGlobalProperties__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__SetGlobalProperties__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__SetGlobalProperties__response = {
- "TTS",
- "SetGlobalProperties",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_SetGlobalProperties,
- TTS__SetGlobalProperties__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__OnResetTimeout__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- TTS__OnResetTimeout__notification__parameter2 = {
- "methodName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__OnResetTimeout__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__OnResetTimeout__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__OnResetTimeout__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__OnResetTimeout__notification = {
- "TTS",
- "OnResetTimeout",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_OnResetTimeout,
- TTS__OnResetTimeout__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__Alert__request__parameter1_array = {
- {"alertStrings", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Alert__request__parameter1 = {
- {"alertStrings", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter1_array,
- "(is)"};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter2 = {
- "duration", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__Alert__request__parameter3_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Alert__request__parameter3 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter3_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter4 = {
- "progressIndicator", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter5 = {
- "alertType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter6 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__Alert__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter6,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Alert__request = {
- "UI",
- "Alert",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_Alert,
- UI__Alert__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__Alert__response__parameter1 = {
- "tryAgainTime", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- UI__Alert__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Alert__response = {
- "UI",
- "Alert",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_Alert,
- UI__Alert__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter1_array = {
- {"showStrings", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Show__request__parameter1 = {
- {"showStrings", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter1_array,
- "(is)"};
-const ford_message_descriptions::ParameterDescription
- UI__Show__request__parameter2 = {
- "alignment", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter3 = {
- {"graphic", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter4 = {
- {"secondaryGraphic", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter5_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Show__request__parameter5 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter5_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- UI__Show__request__parameter6_array = {
- "customPresets", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- UI__Show__request__parameter6 = {
- {"customPresets", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter6_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- UI__Show__request__parameter7 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__Show__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Show__request = {
- "UI",
- "Show",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_Show,
- UI__Show__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__Show__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__Show__response = {
- "UI",
- "Show",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_Show,
- UI__Show__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__AddCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__AddCommand__request__parameter2 = {
- {"menuParams", ford_message_descriptions::Struct, false},
- Structs::Common__MenuParams__parameters};
-const ford_message_descriptions::StructDescription
- UI__AddCommand__request__parameter3 = {
- {"cmdIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__AddCommand__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__AddCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription UI__AddCommand__request = {
- "UI",
- "AddCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_AddCommand,
- UI__AddCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__AddCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__AddCommand__response = {
- "UI",
- "AddCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_AddCommand,
- UI__AddCommand__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__DeleteCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__DeleteCommand__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteCommand__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription UI__DeleteCommand__request =
- {"UI",
- "DeleteCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_DeleteCommand,
- UI__DeleteCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__DeleteCommand__response = {"UI",
- "DeleteCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_DeleteCommand,
- UI__DeleteCommand__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__AddSubMenu__request__parameter1 = {
- "menuID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__AddSubMenu__request__parameter2 = {
- {"menuParams", ford_message_descriptions::Struct, true},
- Structs::Common__MenuParams__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__AddSubMenu__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__AddSubMenu__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddSubMenu__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddSubMenu__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddSubMenu__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription UI__AddSubMenu__request = {
- "UI",
- "AddSubMenu",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_AddSubMenu,
- UI__AddSubMenu__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__AddSubMenu__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__AddSubMenu__response = {
- "UI",
- "AddSubMenu",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_AddSubMenu,
- UI__AddSubMenu__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__DeleteSubMenu__request__parameter1 = {
- "menuID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__DeleteSubMenu__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteSubMenu__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteSubMenu__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteSubMenu__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription UI__DeleteSubMenu__request =
- {"UI",
- "DeleteSubMenu",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_DeleteSubMenu,
- UI__DeleteSubMenu__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteSubMenu__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__DeleteSubMenu__response = {"UI",
- "DeleteSubMenu",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_DeleteSubMenu,
- UI__DeleteSubMenu__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__PerformInteraction__request__parameter1 = {
- {"initialText", ford_message_descriptions::Struct, false},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::StructDescription
- UI__PerformInteraction__request__parameter2_array = {
- {"choiceSet", ford_message_descriptions::Struct, true},
- Structs::Common__Choice__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__PerformInteraction__request__parameter2 = {
- {"choiceSet", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter2_array,
- "(i(bs)(b(si))(bs)(bs)(b(si)))"};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter3 = {
- "vrHelpTitle", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- UI__PerformInteraction__request__parameter4_array = {
- {"vrHelp", ford_message_descriptions::Struct, true},
- Structs::Common__VrHelpItem__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__PerformInteraction__request__parameter4 = {
- {"vrHelp", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter4_array,
- "(s(b(si))i)"};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter5 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter6 = {
- "interactionLayout", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter7 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__PerformInteraction__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformInteraction__request = {
- "UI",
- "PerformInteraction",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_PerformInteraction,
- UI__PerformInteraction__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__response__parameter1 = {
- "choiceID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__response__parameter2 = {
- "manualTextEntry", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__PerformInteraction__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformInteraction__response = {
- "UI",
- "PerformInteraction",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_PerformInteraction,
- UI__PerformInteraction__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__SetMediaClockTimer__request__parameter1 = {
- {"startTime", ford_message_descriptions::Struct, false},
- Structs::Common__TimeFormat__parameters};
-const ford_message_descriptions::StructDescription
- UI__SetMediaClockTimer__request__parameter2 = {
- {"endTime", ford_message_descriptions::Struct, false},
- Structs::Common__TimeFormat__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__SetMediaClockTimer__request__parameter3 = {
- "updateMode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__SetMediaClockTimer__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetMediaClockTimer__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetMediaClockTimer__request = {
- "UI",
- "SetMediaClockTimer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetMediaClockTimer,
- UI__SetMediaClockTimer__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SetMediaClockTimer__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetMediaClockTimer__response = {
- "UI",
- "SetMediaClockTimer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetMediaClockTimer,
- UI__SetMediaClockTimer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__SetGlobalProperties__request__parameter1 = {
- "vrHelpTitle", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- UI__SetGlobalProperties__request__parameter2_array = {
- {"vrHelp", ford_message_descriptions::Struct, true},
- Structs::Common__VrHelpItem__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SetGlobalProperties__request__parameter2 = {
- {"vrHelp", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter2_array,
- "(s(b(si))i)"};
-const ford_message_descriptions::ParameterDescription
- UI__SetGlobalProperties__request__parameter3 = {
- "menuTitle", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- UI__SetGlobalProperties__request__parameter4 = {
- {"menuIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- UI__SetGlobalProperties__request__parameter5 = {
- {"keyboardProperties", ford_message_descriptions::Struct, false},
- Structs::Common__KeyboardProperties__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__SetGlobalProperties__request__parameter6 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetGlobalProperties__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter6,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetGlobalProperties__request = {
- "UI",
- "SetGlobalProperties",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetGlobalProperties,
- UI__SetGlobalProperties__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SetGlobalProperties__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetGlobalProperties__response = {
- "UI",
- "SetGlobalProperties",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetGlobalProperties,
- UI__SetGlobalProperties__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnCommand__notification__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnCommand__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnCommand__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnCommand__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnCommand__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnCommand__notification = {"UI",
- "OnCommand",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnCommand,
- UI__OnCommand__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnSystemContext__notification__parameter1 = {
- "systemContext", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnSystemContext__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- UI__OnSystemContext__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnSystemContext__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnSystemContext__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnSystemContext__notification = {
- "UI",
- "OnSystemContext",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnSystemContext,
- UI__OnSystemContext__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetCapabilities__request = {"UI",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_GetCapabilities,
- UI__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter1 = {
- {"displayCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__DisplayCapabilities__parameters};
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter2 = {
- {"audioPassThruCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__AudioPassThruCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__GetCapabilities__response__parameter3 = {
- "hmiZoneCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter4_array = {
- {"softButtonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__GetCapabilities__response__parameter4 = {
- {"softButtonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter4_array,
- "(bbbb)"};
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter5 = {
- {"hmiCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__HMICapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- UI__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetCapabilities__response = {"UI",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_GetCapabilities,
- UI__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter1 = {
- "appName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter2 = {
- "ngnMediaScreenAppName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter3 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter4_array = {
- "appHMIType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- UI__ChangeRegistration__request__parameter4 = {
- {"appHMIType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter4_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter5 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__ChangeRegistration__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ChangeRegistration__request = {
- "UI",
- "ChangeRegistration",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ChangeRegistration,
- UI__ChangeRegistration__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__ChangeRegistration__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__ChangeRegistration__response = {
- "UI",
- "ChangeRegistration",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ChangeRegistration,
- UI__ChangeRegistration__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnLanguageChange__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnLanguageChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnLanguageChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnLanguageChange__notification = {
- "UI",
- "OnLanguageChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnLanguageChange,
- UI__OnLanguageChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__GetSupportedLanguages__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetSupportedLanguages__request = {
- "UI",
- "GetSupportedLanguages",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_GetSupportedLanguages,
- UI__GetSupportedLanguages__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__GetSupportedLanguages__response__parameter1_array = {
- "languages", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- UI__GetSupportedLanguages__response__parameter1 = {
- {"languages", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetSupportedLanguages__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- UI__GetSupportedLanguages__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetSupportedLanguages__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetSupportedLanguages__response = {
- "UI",
- "GetSupportedLanguages",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_GetSupportedLanguages,
- UI__GetSupportedLanguages__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__GetLanguage__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__GetLanguage__request = {
- "UI",
- "GetLanguage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_GetLanguage,
- UI__GetLanguage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__GetLanguage__response__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- UI__GetLanguage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetLanguage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__GetLanguage__response =
- {"UI",
- "GetLanguage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_GetLanguage,
- UI__GetLanguage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnDriverDistraction__notification__parameter1 = {
- "state", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnDriverDistraction__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnDriverDistraction__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnDriverDistraction__notification = {
- "UI",
- "OnDriverDistraction",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnDriverDistraction,
- UI__OnDriverDistraction__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__SetAppIcon__request__parameter1 = {
- {"syncFileName", ford_message_descriptions::Struct, true},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__SetAppIcon__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetAppIcon__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetAppIcon__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetAppIcon__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription UI__SetAppIcon__request = {
- "UI",
- "SetAppIcon",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetAppIcon,
- UI__SetAppIcon__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SetAppIcon__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__SetAppIcon__response = {
- "UI",
- "SetAppIcon",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetAppIcon,
- UI__SetAppIcon__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__SetDisplayLayout__request__parameter1 = {
- "displayLayout", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- UI__SetDisplayLayout__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetDisplayLayout__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetDisplayLayout__request = {"UI",
- "SetDisplayLayout",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetDisplayLayout,
- UI__SetDisplayLayout__request__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter1 = {
- {"displayCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__DisplayCapabilities__parameters};
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter2_array = {
- {"buttonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SetDisplayLayout__response__parameter2 = {
- {"buttonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter2_array,
- "(ibbb)"};
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter3_array = {
- {"softButtonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SetDisplayLayout__response__parameter3 = {
- {"softButtonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter3_array,
- "(bbbb)"};
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter4 = {
- {"presetBankCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__PresetBankCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- UI__SetDisplayLayout__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetDisplayLayout__response = {
- "UI",
- "SetDisplayLayout",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetDisplayLayout,
- UI__SetDisplayLayout__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ShowCustomForm__request__parameter1 = {
- "customFormID", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- UI__ShowCustomForm__request__parameter2 = {
- "parentFormID", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__ShowCustomForm__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ShowCustomForm__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ShowCustomForm__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ShowCustomForm__request = {"UI",
- "ShowCustomForm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ShowCustomForm,
- UI__ShowCustomForm__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ShowCustomForm__response__parameter1 = {
- "info", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__ShowCustomForm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ShowCustomForm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ShowCustomForm__response = {"UI",
- "ShowCustomForm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ShowCustomForm,
- UI__ShowCustomForm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnKeyboardInput__notification__parameter1 = {
- "event", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnKeyboardInput__notification__parameter2 = {
- "data", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__OnKeyboardInput__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnKeyboardInput__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnKeyboardInput__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnKeyboardInput__notification = {
- "UI",
- "OnKeyboardInput",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnKeyboardInput,
- UI__OnKeyboardInput__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnTouchEvent__notification__parameter1 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- UI__OnTouchEvent__notification__parameter2_array = {
- {"event", ford_message_descriptions::Struct, true},
- Structs::Common__TouchEvent__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__OnTouchEvent__notification__parameter2 = {
- {"event", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnTouchEvent__notification__parameter2_array,
- "(iaia(ii))"};
-const ford_message_descriptions::ParameterDescription*
- UI__OnTouchEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnTouchEvent__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnTouchEvent__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnTouchEvent__notification = {
- "UI",
- "OnTouchEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnTouchEvent,
- UI__OnTouchEvent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter1 = {
- "numTicks", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter2 = {
- "position", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter3 = {
- "sliderHeader", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter4_array = {
- "sliderFooter", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- UI__Slider__request__parameter4 = {
- {"sliderFooter", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter4_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter5 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter6 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__Slider__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter6,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Slider__request = {
- "UI",
- "Slider",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_Slider,
- UI__Slider__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__Slider__response__parameter1 = {
- "sliderPosition", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- UI__Slider__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Slider__response = {
- "UI",
- "Slider",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_Slider,
- UI__Slider__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__ScrollableMessage__request__parameter1 = {
- {"messageText", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__ScrollableMessage__request__parameter2 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__ScrollableMessage__request__parameter3_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__ScrollableMessage__request__parameter3 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter3_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- UI__ScrollableMessage__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__ScrollableMessage__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ScrollableMessage__request = {
- "UI",
- "ScrollableMessage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ScrollableMessage,
- UI__ScrollableMessage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__ScrollableMessage__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__ScrollableMessage__response = {
- "UI",
- "ScrollableMessage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ScrollableMessage,
- UI__ScrollableMessage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__PerformAudioPassThru__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__PerformAudioPassThru__request__parameter2_array = {
- {"audioPassThruDisplayTexts", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__PerformAudioPassThru__request__parameter2 = {
- {"audioPassThruDisplayTexts", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter2_array,
- "(is)"};
-const ford_message_descriptions::ParameterDescription
- UI__PerformAudioPassThru__request__parameter3 = {
- "maxDuration", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__PerformAudioPassThru__request__parameter4 = {
- "muteAudio", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- UI__PerformAudioPassThru__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformAudioPassThru__request = {
- "UI",
- "PerformAudioPassThru",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_PerformAudioPassThru,
- UI__PerformAudioPassThru__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__PerformAudioPassThru__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformAudioPassThru__response = {
- "UI",
- "PerformAudioPassThru",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_PerformAudioPassThru,
- UI__PerformAudioPassThru__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__EndAudioPassThru__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__EndAudioPassThru__request = {"UI",
- "EndAudioPassThru",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_EndAudioPassThru,
- UI__EndAudioPassThru__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__EndAudioPassThru__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__EndAudioPassThru__response = {
- "UI",
- "EndAudioPassThru",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_EndAudioPassThru,
- UI__EndAudioPassThru__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__IsReady__request = {
- "UI",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_IsReady,
- UI__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- UI__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__IsReady__response = {
- "UI",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_IsReady,
- UI__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ClosePopUp__request__parameter1 = {
- "methodName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__ClosePopUp__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ClosePopUp__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__ClosePopUp__request = {
- "UI",
- "ClosePopUp",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ClosePopUp,
- UI__ClosePopUp__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__ClosePopUp__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__ClosePopUp__response = {
- "UI",
- "ClosePopUp",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ClosePopUp,
- UI__ClosePopUp__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnResetTimeout__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnResetTimeout__notification__parameter2 = {
- "methodName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnResetTimeout__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnResetTimeout__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnResetTimeout__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnResetTimeout__notification = {
- "UI",
- "OnResetTimeout",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnResetTimeout,
- UI__OnResetTimeout__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnRecordStart__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnRecordStart__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnRecordStart__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnRecordStart__notification = {
- "UI",
- "OnRecordStart",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnRecordStart,
- UI__OnRecordStart__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__SendHapticData__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__SendHapticData__request__parameter2_array = {
- {"hapticRectData", ford_message_descriptions::Struct, true},
- Structs::Common__HapticRect__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SendHapticData__request__parameter2 = {
- {"hapticRectData", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SendHapticData__request__parameter2_array,
- "(i(dddd))"};
-const ford_message_descriptions::ParameterDescription*
- UI__SendHapticData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SendHapticData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SendHapticData__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SendHapticData__request = {"UI",
- "SendHapticData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SendHapticData,
- UI__SendHapticData__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SendHapticData__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__SendHapticData__response = {"UI",
- "SendHapticData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SendHapticData,
- UI__SendHapticData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__IsReady__request = {"Navigation",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_IsReady,
- Navigation__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__IsReady__response = {"Navigation",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_IsReady,
- Navigation__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter2 = {
- "longitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter3 = {
- "latitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter4 = {
- "locationName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter5 = {
- "locationDescription", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter6_array = {
- "addressLines", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Navigation__SendLocation__request__parameter6 = {
- {"addressLines", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter6_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter7 = {
- "phoneNumber", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Navigation__SendLocation__request__parameter8 = {
- {"locationImage", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription*
- Navigation__SendLocation__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SendLocation__request = {
- "Navigation",
- "SendLocation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_SendLocation,
- Navigation__SendLocation__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__SendLocation__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SendLocation__response = {
- "Navigation",
- "SendLocation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_SendLocation,
- Navigation__SendLocation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__DialNumber__request__parameter1 = {
- "number", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__DialNumber__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__DialNumber__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__DialNumber__request = {
- "Navigation",
- "DialNumber",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_DialNumber,
- Navigation__DialNumber__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__DialNumber__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__DialNumber__response = {
- "Navigation",
- "DialNumber",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_DialNumber,
- Navigation__DialNumber__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter1_array = {
- {"navigationTexts", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__ShowConstantTBT__request__parameter1 = {
- {"navigationTexts", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter1_array,
- "(is)"};
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter2 = {
- {"turnIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter3 = {
- {"nextTurnIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter4 = {
- "distanceToManeuver", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter5 = {
- "distanceToManeuverScale", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter6 = {
- "maneuverComplete", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter7_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__ShowConstantTBT__request__parameter7 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter7_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter8 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__ShowConstantTBT__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__ShowConstantTBT__request = {
- "Navigation",
- "ShowConstantTBT",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_ShowConstantTBT,
- Navigation__ShowConstantTBT__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__ShowConstantTBT__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__ShowConstantTBT__response = {
- "Navigation",
- "ShowConstantTBT",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_ShowConstantTBT,
- Navigation__ShowConstantTBT__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__AlertManeuver__request__parameter1_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__AlertManeuver__request__parameter1 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__AlertManeuver__request__parameter1_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- Navigation__AlertManeuver__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__AlertManeuver__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__AlertManeuver__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__AlertManeuver__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__AlertManeuver__request = {
- "Navigation",
- "AlertManeuver",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_AlertManeuver,
- Navigation__AlertManeuver__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__AlertManeuver__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__AlertManeuver__response = {
- "Navigation",
- "AlertManeuver",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_AlertManeuver,
- Navigation__AlertManeuver__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__UpdateTurnList__request__parameter1_array = {
- {"turnList", ford_message_descriptions::Struct, true},
- Structs::Common__Turn__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__UpdateTurnList__request__parameter1 = {
- {"turnList", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter1_array,
- "((b(is))(b(si)))"};
-const ford_message_descriptions::StructDescription
- Navigation__UpdateTurnList__request__parameter2_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__UpdateTurnList__request__parameter2 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter2_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- Navigation__UpdateTurnList__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__UpdateTurnList__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UpdateTurnList__request = {
- "Navigation",
- "UpdateTurnList",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_UpdateTurnList,
- Navigation__UpdateTurnList__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__UpdateTurnList__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UpdateTurnList__response = {
- "Navigation",
- "UpdateTurnList",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_UpdateTurnList,
- Navigation__UpdateTurnList__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__OnTBTClientState__notification__parameter1 = {
- "state", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnTBTClientState__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnTBTClientState__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnTBTClientState__notification = {
- "Navigation",
- "OnTBTClientState",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnTBTClientState,
- Navigation__OnTBTClientState__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__SetVideoConfig__request__parameter1 = {
- {"config", ford_message_descriptions::Struct, true},
- Structs::Common__VideoConfig__parameters};
-const ford_message_descriptions::ParameterDescription
- Navigation__SetVideoConfig__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__SetVideoConfig__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SetVideoConfig__request = {
- "Navigation",
- "SetVideoConfig",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_SetVideoConfig,
- Navigation__SetVideoConfig__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__SetVideoConfig__response__parameter1_array = {
- "rejectedParams", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Navigation__SetVideoConfig__response__parameter1 = {
- {"rejectedParams", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__response__parameter1_array,
- "s"};
-const ford_message_descriptions::ParameterDescription*
- Navigation__SetVideoConfig__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SetVideoConfig__response = {
- "Navigation",
- "SetVideoConfig",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_SetVideoConfig,
- Navigation__SetVideoConfig__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StartStream__request__parameter1 = {
- "url", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__StartStream__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartStream__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartStream__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartStream__request = {
- "Navigation",
- "StartStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StartStream,
- Navigation__StartStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartStream__response = {
- "Navigation",
- "StartStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StartStream,
- Navigation__StartStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StopStream__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StopStream__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopStream__request = {
- "Navigation",
- "StopStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StopStream,
- Navigation__StopStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopStream__response = {
- "Navigation",
- "StopStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StopStream,
- Navigation__StopStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StartAudioStream__request__parameter1 = {
- "url", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__StartAudioStream__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartAudioStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartAudioStream__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartAudioStream__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartAudioStream__request = {
- "Navigation",
- "StartAudioStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StartAudioStream,
- Navigation__StartAudioStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartAudioStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartAudioStream__response = {
- "Navigation",
- "StartAudioStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StartAudioStream,
- Navigation__StartAudioStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StopAudioStream__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopAudioStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StopAudioStream__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopAudioStream__request = {
- "Navigation",
- "StopAudioStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StopAudioStream,
- Navigation__StopAudioStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopAudioStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopAudioStream__response = {
- "Navigation",
- "StopAudioStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StopAudioStream,
- Navigation__StopAudioStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__OnAudioDataStreaming__notification__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnAudioDataStreaming__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnAudioDataStreaming__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnAudioDataStreaming__notification = {
- "Navigation",
- "OnAudioDataStreaming",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnAudioDataStreaming,
- Navigation__OnAudioDataStreaming__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__OnVideoDataStreaming__notification__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnVideoDataStreaming__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnVideoDataStreaming__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnVideoDataStreaming__notification = {
- "Navigation",
- "OnVideoDataStreaming",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnVideoDataStreaming,
- Navigation__OnVideoDataStreaming__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__GetWayPoints__request__parameter1 = {
- "wayPointType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__GetWayPoints__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__GetWayPoints__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__GetWayPoints__request = {
- "Navigation",
- "GetWayPoints",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_GetWayPoints,
- Navigation__GetWayPoints__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__GetWayPoints__response__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- Navigation__GetWayPoints__response__parameter2_array = {
- {"wayPoints", ford_message_descriptions::Struct, true},
- Structs::Common__LocationDetails__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__GetWayPoints__response__parameter2 = {
- {"wayPoints", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__response__parameter2_array,
- "((b(dd))(bs)(bas)(bs)(bs)(b(si))(b((bs)(bs)(bs)(bs)(bs)(bs)(bs)(bs)("
- "bs))))"};
-const ford_message_descriptions::ParameterDescription*
- Navigation__GetWayPoints__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__GetWayPoints__response = {
- "Navigation",
- "GetWayPoints",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_GetWayPoints,
- Navigation__GetWayPoints__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__OnWayPointChange__notification__parameter1_array = {
- {"wayPoints", ford_message_descriptions::Struct, true},
- Structs::Common__LocationDetails__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__OnWayPointChange__notification__parameter1 = {
- {"wayPoints", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnWayPointChange__notification__parameter1_array,
- "((b(dd))(bs)(bas)(bs)(bs)(b(si))(b((bs)(bs)(bs)(bs)(bs)(bs)(bs)(bs)("
- "bs))))"};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnWayPointChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnWayPointChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnWayPointChange__notification = {
- "Navigation",
- "OnWayPointChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnWayPointChange,
- Navigation__OnWayPointChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__SubscribeWayPoints__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SubscribeWayPoints__request = {
- "Navigation",
- "SubscribeWayPoints",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints,
- Navigation__SubscribeWayPoints__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__SubscribeWayPoints__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SubscribeWayPoints__response = {
- "Navigation",
- "SubscribeWayPoints",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints,
- Navigation__SubscribeWayPoints__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__UnsubscribeWayPoints__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UnsubscribeWayPoints__request = {
- "Navigation",
- "UnsubscribeWayPoints",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints,
- Navigation__UnsubscribeWayPoints__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__UnsubscribeWayPoints__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UnsubscribeWayPoints__response = {
- "Navigation",
- "UnsubscribeWayPoints",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints,
- Navigation__UnsubscribeWayPoints__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__IsReady__request = {"VehicleInfo",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_IsReady,
- VehicleInfo__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__IsReady__response = {
- "VehicleInfo",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_IsReady,
- VehicleInfo__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVehicleType__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleType__request = {
- "VehicleInfo",
- "GetVehicleType",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
- VehicleInfo__GetVehicleType__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleType__response__parameter1 = {
- {"vehicleType", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleType__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVehicleType__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleType__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleType__response = {
- "VehicleInfo",
- "GetVehicleType",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
- VehicleInfo__GetVehicleType__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__ReadDID__request__parameter1 = {
- "ecuName", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__ReadDID__request__parameter2_array = {
- "didLocation", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__ReadDID__request__parameter2 = {
- {"didLocation", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter2_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__ReadDID__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__ReadDID__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__ReadDID__request = {"VehicleInfo",
- "ReadDID",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_ReadDID,
- VehicleInfo__ReadDID__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__ReadDID__response__parameter1_array = {
- {"didResult", ford_message_descriptions::Struct, true},
- Structs::Common__DIDResult__parameters};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__ReadDID__response__parameter1 = {
- {"didResult", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__response__parameter1_array,
- "(ii(bs))"};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__ReadDID__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__ReadDID__response = {
- "VehicleInfo",
- "ReadDID",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_ReadDID,
- VehicleInfo__ReadDID__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__request__parameter1 = {
- "ecuName", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__request__parameter2 = {
- "dtcMask", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDTCs__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDTCs__request = {"VehicleInfo",
- "GetDTCs",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetDTCs,
- VehicleInfo__GetDTCs__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__response__parameter1 = {
- "ecuHeader", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__response__parameter2_array = {
- "dtc", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__GetDTCs__response__parameter2 = {
- {"dtc", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter2_array,
- "s"};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDTCs__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDTCs__response = {
- "VehicleInfo",
- "GetDTCs",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetDTCs,
- VehicleInfo__GetDTCs__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter1 = {
- "targetID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter2 = {
- "messageLength", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter3_array = {
- "messageData", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__DiagnosticMessage__request__parameter3 = {
- {"messageData", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter3_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__DiagnosticMessage__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__DiagnosticMessage__request = {
- "VehicleInfo",
- "DiagnosticMessage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
- VehicleInfo__DiagnosticMessage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__response__parameter1_array = {
- "messageDataResult", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__DiagnosticMessage__response__parameter1 = {
- {"messageDataResult", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__DiagnosticMessage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__DiagnosticMessage__response = {
- "VehicleInfo",
- "DiagnosticMessage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
- VehicleInfo__DiagnosticMessage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter1 = {
- "gps", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter2 = {
- "speed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter3 = {
- "rpm", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter4 = {
- "fuelLevel", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter7 = {
- "externalTemperature", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter8 = {
- "prndl", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter9 = {
- "tirePressure", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter10 = {
- "odometer", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter11 = {
- "beltStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter12 = {
- "bodyInformation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter13 = {
- "deviceStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter14 = {
- "driverBraking", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter15 = {
- "wiperStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter16 = {
- "headLampStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter17 = {
- "engineTorque", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter18 = {
- "accPedalPosition", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter19 = {
- "steeringWheelAngle", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter20 = {
- "eCallInfo", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter21 = {
- "airbagStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter22 = {
- "emergencyEvent", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter23 = {
- "clusterModeStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter24 = {
- "myKey", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__SubscribeVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter24,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVehicleData__request = {
- "VehicleInfo",
- "SubscribeVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
- VehicleInfo__SubscribeVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter2 = {
- {"speed", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter3 = {
- {"rpm", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter4 = {
- {"fuelLevel", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter5 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter6 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter7 = {
- {"externalTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter8 = {
- {"prndl", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter9 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter10 = {
- {"odometer", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter11 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter12 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter13 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter14 = {
- {"driverBraking", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter15 = {
- {"wiperStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter16 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter17 = {
- {"engineTorque", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter18 = {
- {"accPedalPosition", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter19 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter20 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter21 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter22 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter23 = {
- {"clusterModes", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter24 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__SubscribeVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter24,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVehicleData__response = {
- "VehicleInfo",
- "SubscribeVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
- VehicleInfo__SubscribeVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter2 = {
- "gps", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter3 = {
- "speed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter4 = {
- "rpm", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter5 = {
- "fuelLevel", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter6 = {
- "fuelLevel_State", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter7 = {
- "instantFuelConsumption", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter8 = {
- "externalTemperature", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter9 = {
- "prndl", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter10 = {
- "tirePressure", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter11 = {
- "odometer", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter12 = {
- "beltStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter13 = {
- "bodyInformation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter14 = {
- "deviceStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter15 = {
- "driverBraking", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter16 = {
- "wiperStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter17 = {
- "headLampStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter18 = {
- "engineTorque", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter21 = {
- "eCallInfo", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter22 = {
- "airbagStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter23 = {
- "emergencyEvent", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter24 = {
- "clusterModeStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter25 = {
- "myKey", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__UnsubscribeVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVehicleData__request = {
- "VehicleInfo",
- "UnsubscribeVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
- VehicleInfo__UnsubscribeVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter2 = {
- {"speed", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter3 = {
- {"rpm", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter4 = {
- {"fuelLevel", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter5 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter6 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter7 = {
- {"externalTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter8 = {
- {"prndl", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter9 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter10 = {
- {"odometer", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter11 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter12 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter13 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter14 = {
- {"driverBraking", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter15 = {
- {"wiperStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter16 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter17 = {
- {"engineTorque", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter18 = {
- {"accPedalPosition", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter19 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter20 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter21 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter22 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter23 = {
- {"clusterModes", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter24 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__UnsubscribeVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter24,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVehicleData__response = {
- "VehicleInfo",
- "UnsubscribeVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
- VehicleInfo__UnsubscribeVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter1 = {
- "gps", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter2 = {
- "speed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter3 = {
- "rpm", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter4 = {
- "fuelLevel", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter7 = {
- "externalTemperature", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter8 = {
- "vin", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter9 = {
- "prndl", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter10 = {
- "tirePressure", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter11 = {
- "odometer", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter12 = {
- "beltStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter13 = {
- "bodyInformation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter14 = {
- "deviceStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter15 = {
- "driverBraking", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter16 = {
- "wiperStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter17 = {
- "headLampStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter18 = {
- "engineTorque", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter21 = {
- "eCallInfo", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter22 = {
- "airbagStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter23 = {
- "emergencyEvent", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter24 = {
- "clusterModeStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter25 = {
- "myKey", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__GetVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleData__request = {
- "VehicleInfo",
- "GetVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData,
- VehicleInfo__GetVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter2 = {
- "speed", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter3 = {
- "rpm", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter4 = {
- "fuelLevel", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter7 = {
- "externalTemperature", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter8 = {
- "vin", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter9 = {
- "prndl", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter10 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter11 = {
- "odometer", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter12 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter13 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter14 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter15 = {
- "driverBraking", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter16 = {
- "wiperStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter17 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter18 = {
- "engineTorque", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Float, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter21 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter22 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter23 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter24 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, false},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter25 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__GetVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleData__response = {
- "VehicleInfo",
- "GetVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData,
- VehicleInfo__GetVehicleData__response__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter2 = {
- "speed", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter3 = {
- "rpm", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter4 = {
- "fuelLevel", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter7 = {
- "externalTemperature", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter8 = {
- "vin", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter9 = {
- "prndl", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter10 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter11 = {
- "odometer", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter12 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter13 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter14 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter15 = {
- "driverBraking", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter16 = {
- "wiperStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter17 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter18 = {
- "engineTorque", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Float, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter21 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter22 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter23 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter24 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, false},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter25 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__OnVehicleData__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnVehicleData__notification = {
- "VehicleInfo",
- "OnVehicleData",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnVehicleData,
- VehicleInfo__OnVehicleData__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetGpsData__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetGpsData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetGpsData__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetGpsData__request = {
- "VehicleInfo",
- "GetGpsData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetGpsData,
- VehicleInfo__GetGpsData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetGpsData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetGpsData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetGpsData__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetGpsData__response = {
- "VehicleInfo",
- "GetGpsData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetGpsData,
- VehicleInfo__GetGpsData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSpeed__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSpeed__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSpeed__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSpeed__request = {
- "VehicleInfo",
- "GetSpeed",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetSpeed,
- VehicleInfo__GetSpeed__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSpeed__response__parameter1 = {
- "speed", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSpeed__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSpeed__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSpeed__response = {
- "VehicleInfo",
- "GetSpeed",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetSpeed,
- VehicleInfo__GetSpeed__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetRpm__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetRpm__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetRpm__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetRpm__request = {"VehicleInfo",
- "GetRpm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetRpm,
- VehicleInfo__GetRpm__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetRpm__response__parameter1 = {
- "rpm", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetRpm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetRpm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetRpm__response = {"VehicleInfo",
- "GetRpm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetRpm,
- VehicleInfo__GetRpm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevel__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevel__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevel__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevel__request = {
- "VehicleInfo",
- "GetFuelLevel",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel,
- VehicleInfo__GetFuelLevel__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevel__response__parameter1 = {
- "fuelLevel", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevel__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevel__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevel__response = {
- "VehicleInfo",
- "GetFuelLevel",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel,
- VehicleInfo__GetFuelLevel__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevelState__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevelState__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevelState__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevelState__request = {
- "VehicleInfo",
- "GetFuelLevelState",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
- VehicleInfo__GetFuelLevelState__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevelState__response__parameter1 = {
- "fuelLevel_State", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevelState__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevelState__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevelState__response = {
- "VehicleInfo",
- "GetFuelLevelState",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
- VehicleInfo__GetFuelLevelState__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetInstantFuelConsumption__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetInstantFuelConsumption__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetInstantFuelConsumption__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetInstantFuelConsumption__request = {
- "VehicleInfo",
- "GetInstantFuelConsumption",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
- VehicleInfo__GetInstantFuelConsumption__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetInstantFuelConsumption__response__parameter1 = {
- "instantFuelConsumption", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetInstantFuelConsumption__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetInstantFuelConsumption__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetInstantFuelConsumption__response = {
- "VehicleInfo",
- "GetInstantFuelConsumption",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
- VehicleInfo__GetInstantFuelConsumption__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetExternalTemperature__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetExternalTemperature__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetExternalTemperature__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetExternalTemperature__request = {
- "VehicleInfo",
- "GetExternalTemperature",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
- VehicleInfo__GetExternalTemperature__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetExternalTemperature__response__parameter1 = {
- "externalTemperature", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetExternalTemperature__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetExternalTemperature__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetExternalTemperature__response = {
- "VehicleInfo",
- "GetExternalTemperature",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
- VehicleInfo__GetExternalTemperature__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVin__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVin__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVin__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVin__request = {"VehicleInfo",
- "GetVin",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetVin,
- VehicleInfo__GetVin__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVin__response__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVin__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVin__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVin__response = {"VehicleInfo",
- "GetVin",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetVin,
- VehicleInfo__GetVin__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetPrndl__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetPrndl__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetPrndl__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetPrndl__request = {
- "VehicleInfo",
- "GetPrndl",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetPrndl,
- VehicleInfo__GetPrndl__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetPrndl__response__parameter1 = {
- "prndl", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetPrndl__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetPrndl__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetPrndl__response = {
- "VehicleInfo",
- "GetPrndl",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetPrndl,
- VehicleInfo__GetPrndl__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetTirePressure__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetTirePressure__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetTirePressure__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetTirePressure__request = {
- "VehicleInfo",
- "GetTirePressure",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure,
- VehicleInfo__GetTirePressure__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetTirePressure__response__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetTirePressure__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetTirePressure__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetTirePressure__response = {
- "VehicleInfo",
- "GetTirePressure",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure,
- VehicleInfo__GetTirePressure__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetOdometer__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetOdometer__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetOdometer__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetOdometer__request = {
- "VehicleInfo",
- "GetOdometer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetOdometer,
- VehicleInfo__GetOdometer__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetOdometer__response__parameter1 = {
- "odometer", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetOdometer__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetOdometer__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetOdometer__response = {
- "VehicleInfo",
- "GetOdometer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetOdometer,
- VehicleInfo__GetOdometer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetBeltStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBeltStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBeltStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBeltStatus__request = {
- "VehicleInfo",
- "GetBeltStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus,
- VehicleInfo__GetBeltStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetBeltStatus__response__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBeltStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBeltStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBeltStatus__response = {
- "VehicleInfo",
- "GetBeltStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus,
- VehicleInfo__GetBeltStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetBodyInformation__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBodyInformation__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBodyInformation__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBodyInformation__request = {
- "VehicleInfo",
- "GetBodyInformation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
- VehicleInfo__GetBodyInformation__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetBodyInformation__response__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBodyInformation__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBodyInformation__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBodyInformation__response = {
- "VehicleInfo",
- "GetBodyInformation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
- VehicleInfo__GetBodyInformation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDeviceStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDeviceStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDeviceStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDeviceStatus__request = {
- "VehicleInfo",
- "GetDeviceStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus,
- VehicleInfo__GetDeviceStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetDeviceStatus__response__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDeviceStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDeviceStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDeviceStatus__response = {
- "VehicleInfo",
- "GetDeviceStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus,
- VehicleInfo__GetDeviceStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDriverBraking__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDriverBraking__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDriverBraking__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDriverBraking__request = {
- "VehicleInfo",
- "GetDriverBraking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking,
- VehicleInfo__GetDriverBraking__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDriverBraking__response__parameter1 = {
- "driverBraking", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDriverBraking__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDriverBraking__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDriverBraking__response = {
- "VehicleInfo",
- "GetDriverBraking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking,
- VehicleInfo__GetDriverBraking__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetWiperStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetWiperStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetWiperStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetWiperStatus__request = {
- "VehicleInfo",
- "GetWiperStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus,
- VehicleInfo__GetWiperStatus__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetWiperStatus__response__parameter1 = {
- "wiperStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetWiperStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetWiperStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetWiperStatus__response = {
- "VehicleInfo",
- "GetWiperStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus,
- VehicleInfo__GetWiperStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetHeadLampStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetHeadLampStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetHeadLampStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetHeadLampStatus__request = {
- "VehicleInfo",
- "GetHeadLampStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
- VehicleInfo__GetHeadLampStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetHeadLampStatus__response__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetHeadLampStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetHeadLampStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetHeadLampStatus__response = {
- "VehicleInfo",
- "GetHeadLampStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
- VehicleInfo__GetHeadLampStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetEngineTorque__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEngineTorque__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEngineTorque__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEngineTorque__request = {
- "VehicleInfo",
- "GetEngineTorque",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque,
- VehicleInfo__GetEngineTorque__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetEngineTorque__response__parameter1 = {
- "engineTorque", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEngineTorque__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEngineTorque__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEngineTorque__response = {
- "VehicleInfo",
- "GetEngineTorque",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque,
- VehicleInfo__GetEngineTorque__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetAccPedalPosition__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAccPedalPosition__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAccPedalPosition__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAccPedalPosition__request = {
- "VehicleInfo",
- "GetAccPedalPosition",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition,
- VehicleInfo__GetAccPedalPosition__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetAccPedalPosition__response__parameter1 = {
- "accPedalPosition", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAccPedalPosition__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAccPedalPosition__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAccPedalPosition__response = {
- "VehicleInfo",
- "GetAccPedalPosition",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition,
- VehicleInfo__GetAccPedalPosition__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSteeringWheelAngle__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSteeringWheelAngle__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSteeringWheelAngle__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSteeringWheelAngle__request = {
- "VehicleInfo",
- "GetSteeringWheelAngle",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
- VehicleInfo__GetSteeringWheelAngle__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSteeringWheelAngle__response__parameter1 = {
- "steeringWheelAngle", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSteeringWheelAngle__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSteeringWheelAngle__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSteeringWheelAngle__response = {
- "VehicleInfo",
- "GetSteeringWheelAngle",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
- VehicleInfo__GetSteeringWheelAngle__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetECallInfo__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetECallInfo__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetECallInfo__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetECallInfo__request = {
- "VehicleInfo",
- "GetECallInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo,
- VehicleInfo__GetECallInfo__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetECallInfo__response__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetECallInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetECallInfo__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetECallInfo__response = {
- "VehicleInfo",
- "GetECallInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo,
- VehicleInfo__GetECallInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetAirbagStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAirbagStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAirbagStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAirbagStatus__request = {
- "VehicleInfo",
- "GetAirbagStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus,
- VehicleInfo__GetAirbagStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetAirbagStatus__response__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAirbagStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAirbagStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAirbagStatus__response = {
- "VehicleInfo",
- "GetAirbagStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus,
- VehicleInfo__GetAirbagStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetEmergencyEvent__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEmergencyEvent__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEmergencyEvent__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEmergencyEvent__request = {
- "VehicleInfo",
- "GetEmergencyEvent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent,
- VehicleInfo__GetEmergencyEvent__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetEmergencyEvent__response__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEmergencyEvent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEmergencyEvent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEmergencyEvent__response = {
- "VehicleInfo",
- "GetEmergencyEvent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent,
- VehicleInfo__GetEmergencyEvent__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetClusterModeStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetClusterModeStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetClusterModeStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetClusterModeStatus__request = {
- "VehicleInfo",
- "GetClusterModeStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
- VehicleInfo__GetClusterModeStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetClusterModeStatus__response__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetClusterModeStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetClusterModeStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetClusterModeStatus__response = {
- "VehicleInfo",
- "GetClusterModeStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
- VehicleInfo__GetClusterModeStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetMyKey__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetMyKey__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetMyKey__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetMyKey__request = {
- "VehicleInfo",
- "GetMyKey",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetMyKey,
- VehicleInfo__GetMyKey__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetMyKey__response__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetMyKey__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetMyKey__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetMyKey__response = {
- "VehicleInfo",
- "GetMyKey",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetMyKey,
- VehicleInfo__GetMyKey__response__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnGpsData__notification__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnGpsData__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnGpsData__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnGpsData__notification = {
- "VehicleInfo",
- "OnGpsData",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnGpsData,
- VehicleInfo__OnGpsData__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnSpeed__notification__parameter1 = {
- "speed", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnSpeed__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnSpeed__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnSpeed__notification = {
- "VehicleInfo",
- "OnSpeed",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnSpeed,
- VehicleInfo__OnSpeed__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnRpm__notification__parameter1 = {
- "rpm", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnRpm__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnRpm__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnRpm__notification = {
- "VehicleInfo",
- "OnRpm",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnRpm,
- VehicleInfo__OnRpm__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnFuelLevel__notification__parameter1 = {
- "fuelLevel", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnFuelLevel__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnFuelLevel__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnFuelLevel__notification = {
- "VehicleInfo",
- "OnFuelLevel",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnFuelLevel,
- VehicleInfo__OnFuelLevel__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnFuelLevelState__notification__parameter1 = {
- "fuelLevel_State", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnFuelLevelState__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnFuelLevelState__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnFuelLevelState__notification = {
- "VehicleInfo",
- "OnFuelLevelState",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState,
- VehicleInfo__OnFuelLevelState__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnInstantFuelConsumption__notification__parameter1 = {
- "instantFuelConsumption", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnInstantFuelConsumption__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnInstantFuelConsumption__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnInstantFuelConsumption__notification = {
- "VehicleInfo",
- "OnInstantFuelConsumption",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption,
- VehicleInfo__OnInstantFuelConsumption__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnExternalTemperature__notification__parameter1 = {
- "externalTemperature", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnExternalTemperature__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnExternalTemperature__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnExternalTemperature__notification = {
- "VehicleInfo",
- "OnExternalTemperature",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature,
- VehicleInfo__OnExternalTemperature__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVin__notification__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnVin__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVin__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnVin__notification = {
- "VehicleInfo",
- "OnVin",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnVin,
- VehicleInfo__OnVin__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnPrndl__notification__parameter1 = {
- "prndl", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnPrndl__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnPrndl__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnPrndl__notification = {
- "VehicleInfo",
- "OnPrndl",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnPrndl,
- VehicleInfo__OnPrndl__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnTirePressure__notification__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnTirePressure__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnTirePressure__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnTirePressure__notification = {
- "VehicleInfo",
- "OnTirePressure",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnTirePressure,
- VehicleInfo__OnTirePressure__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnOdometer__notification__parameter1 = {
- "odometer", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnOdometer__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnOdometer__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnOdometer__notification = {
- "VehicleInfo",
- "OnOdometer",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnOdometer,
- VehicleInfo__OnOdometer__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnBeltStatus__notification__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnBeltStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnBeltStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnBeltStatus__notification = {
- "VehicleInfo",
- "OnBeltStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnBeltStatus,
- VehicleInfo__OnBeltStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnBodyInformation__notification__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnBodyInformation__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnBodyInformation__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnBodyInformation__notification = {
- "VehicleInfo",
- "OnBodyInformation",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnBodyInformation,
- VehicleInfo__OnBodyInformation__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnDeviceStatus__notification__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnDeviceStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnDeviceStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnDeviceStatus__notification = {
- "VehicleInfo",
- "OnDeviceStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus,
- VehicleInfo__OnDeviceStatus__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnDriverBraking__notification__parameter1 = {
- "driverBraking", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnDriverBraking__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnDriverBraking__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnDriverBraking__notification = {
- "VehicleInfo",
- "OnDriverBraking",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnDriverBraking,
- VehicleInfo__OnDriverBraking__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnWiperStatus__notification__parameter1 = {
- "wiperStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnWiperStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnWiperStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnWiperStatus__notification = {
- "VehicleInfo",
- "OnWiperStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnWiperStatus,
- VehicleInfo__OnWiperStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnHeadLampStatus__notification__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnHeadLampStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnHeadLampStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnHeadLampStatus__notification = {
- "VehicleInfo",
- "OnHeadLampStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus,
- VehicleInfo__OnHeadLampStatus__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnEngineTorque__notification__parameter1 = {
- "engineTorque", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnEngineTorque__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnEngineTorque__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnEngineTorque__notification = {
- "VehicleInfo",
- "OnEngineTorque",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnEngineTorque,
- VehicleInfo__OnEngineTorque__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnAccPedalPosition__notification__parameter1 = {
- "accPedalPosition", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnAccPedalPosition__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnAccPedalPosition__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnAccPedalPosition__notification = {
- "VehicleInfo",
- "OnAccPedalPosition",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition,
- VehicleInfo__OnAccPedalPosition__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnSteeringWheelAngle__notification__parameter1 = {
- "steeringWheelAngle", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnSteeringWheelAngle__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnSteeringWheelAngle__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnSteeringWheelAngle__notification = {
- "VehicleInfo",
- "OnSteeringWheelAngle",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle,
- VehicleInfo__OnSteeringWheelAngle__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnECallInfo__notification__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnECallInfo__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnECallInfo__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnECallInfo__notification = {
- "VehicleInfo",
- "OnECallInfo",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnECallInfo,
- VehicleInfo__OnECallInfo__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnAirbagStatus__notification__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnAirbagStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnAirbagStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnAirbagStatus__notification = {
- "VehicleInfo",
- "OnAirbagStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnAirbagStatus,
- VehicleInfo__OnAirbagStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnEmergencyEvent__notification__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnEmergencyEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnEmergencyEvent__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnEmergencyEvent__notification = {
- "VehicleInfo",
- "OnEmergencyEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnEmergencyEvent,
- VehicleInfo__OnEmergencyEvent__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnClusterModeStatus__notification__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnClusterModeStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnClusterModeStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnClusterModeStatus__notification = {
- "VehicleInfo",
- "OnClusterModeStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnClusterModeStatus,
- VehicleInfo__OnClusterModeStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnMyKey__notification__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnMyKey__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnMyKey__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnMyKey__notification = {
- "VehicleInfo",
- "OnMyKey",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnMyKey,
- VehicleInfo__OnMyKey__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeGps__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeGps__request = {
- "VehicleInfo",
- "SubscribeGps",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps,
- VehicleInfo__SubscribeGps__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeGps__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeGps__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeGps__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeGps__response = {
- "VehicleInfo",
- "SubscribeGps",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps,
- VehicleInfo__SubscribeGps__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeGps__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeGps__request = {
- "VehicleInfo",
- "UnsubscribeGps",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps,
- VehicleInfo__UnsubscribeGps__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeGps__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeGps__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeGps__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeGps__response = {
- "VehicleInfo",
- "UnsubscribeGps",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps,
- VehicleInfo__UnsubscribeGps__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSpeed__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSpeed__request = {
- "VehicleInfo",
- "SubscribeSpeed",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed,
- VehicleInfo__SubscribeSpeed__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeSpeed__response__parameter1 = {
- {"speed", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSpeed__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeSpeed__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSpeed__response = {
- "VehicleInfo",
- "SubscribeSpeed",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed,
- VehicleInfo__SubscribeSpeed__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSpeed__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSpeed__request = {
- "VehicleInfo",
- "UnsubscribeSpeed",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed,
- VehicleInfo__UnsubscribeSpeed__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeSpeed__response__parameter1 = {
- {"speed", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSpeed__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeSpeed__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSpeed__response = {
- "VehicleInfo",
- "UnsubscribeSpeed",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed,
- VehicleInfo__UnsubscribeSpeed__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeRpm__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeRpm__request = {
- "VehicleInfo",
- "SubscribeRpm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm,
- VehicleInfo__SubscribeRpm__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeRpm__response__parameter1 = {
- {"rpm", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeRpm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeRpm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeRpm__response = {
- "VehicleInfo",
- "SubscribeRpm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm,
- VehicleInfo__SubscribeRpm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeRpm__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeRpm__request = {
- "VehicleInfo",
- "UnsubscribeRpm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm,
- VehicleInfo__UnsubscribeRpm__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeRpm__response__parameter1 = {
- {"rpm", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeRpm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeRpm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeRpm__response = {
- "VehicleInfo",
- "UnsubscribeRpm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm,
- VehicleInfo__UnsubscribeRpm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel__request = {
- "VehicleInfo",
- "SubscribeFuelLevel",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel,
- VehicleInfo__SubscribeFuelLevel__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeFuelLevel__response__parameter1 = {
- {"fuelLevel", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeFuelLevel__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel__response = {
- "VehicleInfo",
- "SubscribeFuelLevel",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel,
- VehicleInfo__SubscribeFuelLevel__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel__request = {
- "VehicleInfo",
- "UnsubscribeFuelLevel",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
- VehicleInfo__UnsubscribeFuelLevel__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeFuelLevel__response__parameter1 = {
- {"fuelLevel", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeFuelLevel__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel__response = {
- "VehicleInfo",
- "UnsubscribeFuelLevel",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
- VehicleInfo__UnsubscribeFuelLevel__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel_State__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel_State__request = {
- "VehicleInfo",
- "SubscribeFuelLevel_State",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- VehicleInfo__SubscribeFuelLevel_State__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeFuelLevel_State__response__parameter1 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel_State__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeFuelLevel_State__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel_State__response = {
- "VehicleInfo",
- "SubscribeFuelLevel_State",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- VehicleInfo__SubscribeFuelLevel_State__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel_State__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel_State__request = {
- "VehicleInfo",
- "UnsubscribeFuelLevel_State",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
- VehicleInfo__UnsubscribeFuelLevel_State__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeFuelLevel_State__response__parameter1 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel_State__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeFuelLevel_State__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel_State__response = {
- "VehicleInfo",
- "UnsubscribeFuelLevel_State",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
- VehicleInfo__UnsubscribeFuelLevel_State__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeInstantFuelConsumption__request__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeInstantFuelConsumption__request = {
- "VehicleInfo",
- "SubscribeInstantFuelConsumption",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- VehicleInfo__SubscribeInstantFuelConsumption__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeInstantFuelConsumption__response__parameter1 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeInstantFuelConsumption__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeInstantFuelConsumption__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeInstantFuelConsumption__response = {
- "VehicleInfo",
- "SubscribeInstantFuelConsumption",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- VehicleInfo__SubscribeInstantFuelConsumption__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeInstantFuelConsumption__request__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeInstantFuelConsumption__request = {
- "VehicleInfo",
- "UnsubscribeInstantFuelConsumption",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
- VehicleInfo__UnsubscribeInstantFuelConsumption__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameter1 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeInstantFuelConsumption__response = {
- "VehicleInfo",
- "UnsubscribeInstantFuelConsumption",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
- VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeExternalTemperature__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeExternalTemperature__request = {
- "VehicleInfo",
- "SubscribeExternalTemperature",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- VehicleInfo__SubscribeExternalTemperature__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeExternalTemperature__response__parameter1 = {
- {"externalTemperature", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeExternalTemperature__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeExternalTemperature__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeExternalTemperature__response = {
- "VehicleInfo",
- "SubscribeExternalTemperature",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- VehicleInfo__SubscribeExternalTemperature__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeExternalTemperature__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeExternalTemperature__request = {
- "VehicleInfo",
- "UnsubscribeExternalTemperature",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
- VehicleInfo__UnsubscribeExternalTemperature__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeExternalTemperature__response__parameter1 = {
- {"externalTemperature", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeExternalTemperature__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeExternalTemperature__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeExternalTemperature__response = {
- "VehicleInfo",
- "UnsubscribeExternalTemperature",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
- VehicleInfo__UnsubscribeExternalTemperature__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribePrndl__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribePrndl__request = {
- "VehicleInfo",
- "SubscribePrndl",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl,
- VehicleInfo__SubscribePrndl__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribePrndl__response__parameter1 = {
- {"prndl", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribePrndl__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribePrndl__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribePrndl__response = {
- "VehicleInfo",
- "SubscribePrndl",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl,
- VehicleInfo__SubscribePrndl__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribePrndl__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribePrndl__request = {
- "VehicleInfo",
- "UnsubscribePrndl",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl,
- VehicleInfo__UnsubscribePrndl__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribePrndl__response__parameter1 = {
- {"prndl", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribePrndl__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribePrndl__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribePrndl__response = {
- "VehicleInfo",
- "UnsubscribePrndl",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl,
- VehicleInfo__UnsubscribePrndl__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeVin__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVin__request = {
- "VehicleInfo",
- "SubscribeVin",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin,
- VehicleInfo__SubscribeVin__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVin__response__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeVin__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVin__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVin__response = {
- "VehicleInfo",
- "SubscribeVin",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin,
- VehicleInfo__SubscribeVin__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeVin__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVin__request = {
- "VehicleInfo",
- "UnsubscribeVin",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin,
- VehicleInfo__UnsubscribeVin__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVin__response__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeVin__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVin__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVin__response = {
- "VehicleInfo",
- "UnsubscribeVin",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin,
- VehicleInfo__UnsubscribeVin__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeTirePressure__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeTirePressure__request = {
- "VehicleInfo",
- "SubscribeTirePressure",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- VehicleInfo__SubscribeTirePressure__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeTirePressure__response__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeTirePressure__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeTirePressure__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeTirePressure__response = {
- "VehicleInfo",
- "SubscribeTirePressure",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- VehicleInfo__SubscribeTirePressure__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeTirePressure__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeTirePressure__request = {
- "VehicleInfo",
- "UnsubscribeTirePressure",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
- VehicleInfo__UnsubscribeTirePressure__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeTirePressure__response__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeTirePressure__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeTirePressure__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeTirePressure__response = {
- "VehicleInfo",
- "UnsubscribeTirePressure",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
- VehicleInfo__UnsubscribeTirePressure__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeOdometer__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeOdometer__request = {
- "VehicleInfo",
- "SubscribeOdometer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer,
- VehicleInfo__SubscribeOdometer__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeOdometer__response__parameter1 = {
- {"odometer", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeOdometer__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeOdometer__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeOdometer__response = {
- "VehicleInfo",
- "SubscribeOdometer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer,
- VehicleInfo__SubscribeOdometer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeOdometer__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeOdometer__request = {
- "VehicleInfo",
- "UnsubscribeOdometer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer,
- VehicleInfo__UnsubscribeOdometer__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeOdometer__response__parameter1 = {
- {"odometer", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeOdometer__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeOdometer__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeOdometer__response = {
- "VehicleInfo",
- "UnsubscribeOdometer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer,
- VehicleInfo__UnsubscribeOdometer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBeltStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBeltStatus__request = {
- "VehicleInfo",
- "SubscribeBeltStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- VehicleInfo__SubscribeBeltStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeBeltStatus__response__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBeltStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeBeltStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBeltStatus__response = {
- "VehicleInfo",
- "SubscribeBeltStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- VehicleInfo__SubscribeBeltStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBeltStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBeltStatus__request = {
- "VehicleInfo",
- "UnsubscribeBeltStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
- VehicleInfo__UnsubscribeBeltStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeBeltStatus__response__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBeltStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeBeltStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBeltStatus__response = {
- "VehicleInfo",
- "UnsubscribeBeltStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
- VehicleInfo__UnsubscribeBeltStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBodyInformation__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBodyInformation__request = {
- "VehicleInfo",
- "SubscribeBodyInformation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- VehicleInfo__SubscribeBodyInformation__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeBodyInformation__response__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBodyInformation__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeBodyInformation__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBodyInformation__response = {
- "VehicleInfo",
- "SubscribeBodyInformation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- VehicleInfo__SubscribeBodyInformation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBodyInformation__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBodyInformation__request = {
- "VehicleInfo",
- "UnsubscribeBodyInformation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
- VehicleInfo__UnsubscribeBodyInformation__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeBodyInformation__response__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBodyInformation__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeBodyInformation__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBodyInformation__response = {
- "VehicleInfo",
- "UnsubscribeBodyInformation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
- VehicleInfo__UnsubscribeBodyInformation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDeviceStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDeviceStatus__request = {
- "VehicleInfo",
- "SubscribeDeviceStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- VehicleInfo__SubscribeDeviceStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeDeviceStatus__response__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDeviceStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeDeviceStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDeviceStatus__response = {
- "VehicleInfo",
- "SubscribeDeviceStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- VehicleInfo__SubscribeDeviceStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDeviceStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDeviceStatus__request = {
- "VehicleInfo",
- "UnsubscribeDeviceStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
- VehicleInfo__UnsubscribeDeviceStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeDeviceStatus__response__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDeviceStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeDeviceStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDeviceStatus__response = {
- "VehicleInfo",
- "UnsubscribeDeviceStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
- VehicleInfo__UnsubscribeDeviceStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDriverBraking__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDriverBraking__request = {
- "VehicleInfo",
- "SubscribeDriverBraking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- VehicleInfo__SubscribeDriverBraking__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeDriverBraking__response__parameter1 = {
- {"driverBraking", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDriverBraking__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeDriverBraking__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDriverBraking__response = {
- "VehicleInfo",
- "SubscribeDriverBraking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- VehicleInfo__SubscribeDriverBraking__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDriverBraking__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDriverBraking__request = {
- "VehicleInfo",
- "UnsubscribeDriverBraking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
- VehicleInfo__UnsubscribeDriverBraking__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeDriverBraking__response__parameter1 = {
- {"driverBraking", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDriverBraking__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeDriverBraking__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDriverBraking__response = {
- "VehicleInfo",
- "UnsubscribeDriverBraking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
- VehicleInfo__UnsubscribeDriverBraking__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeWiperStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeWiperStatus__request = {
- "VehicleInfo",
- "SubscribeWiperStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- VehicleInfo__SubscribeWiperStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeWiperStatus__response__parameter1 = {
- {"wiperStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeWiperStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeWiperStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeWiperStatus__response = {
- "VehicleInfo",
- "SubscribeWiperStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- VehicleInfo__SubscribeWiperStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeWiperStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeWiperStatus__request = {
- "VehicleInfo",
- "UnsubscribeWiperStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
- VehicleInfo__UnsubscribeWiperStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeWiperStatus__response__parameter1 = {
- {"wiperStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeWiperStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeWiperStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeWiperStatus__response = {
- "VehicleInfo",
- "UnsubscribeWiperStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
- VehicleInfo__UnsubscribeWiperStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeHeadLampStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeHeadLampStatus__request = {
- "VehicleInfo",
- "SubscribeHeadLampStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- VehicleInfo__SubscribeHeadLampStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeHeadLampStatus__response__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeHeadLampStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeHeadLampStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeHeadLampStatus__response = {
- "VehicleInfo",
- "SubscribeHeadLampStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- VehicleInfo__SubscribeHeadLampStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeHeadLampStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeHeadLampStatus__request = {
- "VehicleInfo",
- "UnsubscribeHeadLampStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
- VehicleInfo__UnsubscribeHeadLampStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeHeadLampStatus__response__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeHeadLampStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeHeadLampStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeHeadLampStatus__response = {
- "VehicleInfo",
- "UnsubscribeHeadLampStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
- VehicleInfo__UnsubscribeHeadLampStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEngineTorque__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEngineTorque__request = {
- "VehicleInfo",
- "SubscribeEngineTorque",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- VehicleInfo__SubscribeEngineTorque__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeEngineTorque__response__parameter1 = {
- {"engineTorque", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEngineTorque__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeEngineTorque__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEngineTorque__response = {
- "VehicleInfo",
- "SubscribeEngineTorque",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- VehicleInfo__SubscribeEngineTorque__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEngineTorque__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEngineTorque__request = {
- "VehicleInfo",
- "UnsubscribeEngineTorque",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
- VehicleInfo__UnsubscribeEngineTorque__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeEngineTorque__response__parameter1 = {
- {"engineTorque", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEngineTorque__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeEngineTorque__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEngineTorque__response = {
- "VehicleInfo",
- "UnsubscribeEngineTorque",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
- VehicleInfo__UnsubscribeEngineTorque__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAccPedalPosition__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAccPedalPosition__request = {
- "VehicleInfo",
- "SubscribeAccPedalPosition",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- VehicleInfo__SubscribeAccPedalPosition__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeAccPedalPosition__response__parameter1 = {
- {"accPedalPosition", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAccPedalPosition__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeAccPedalPosition__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAccPedalPosition__response = {
- "VehicleInfo",
- "SubscribeAccPedalPosition",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- VehicleInfo__SubscribeAccPedalPosition__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAccPedalPosition__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAccPedalPosition__request = {
- "VehicleInfo",
- "UnsubscribeAccPedalPosition",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
- VehicleInfo__UnsubscribeAccPedalPosition__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeAccPedalPosition__response__parameter1 = {
- {"accPedalPosition", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAccPedalPosition__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeAccPedalPosition__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAccPedalPosition__response = {
- "VehicleInfo",
- "UnsubscribeAccPedalPosition",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
- VehicleInfo__UnsubscribeAccPedalPosition__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSteeringWheelAngle__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSteeringWheelAngle__request = {
- "VehicleInfo",
- "SubscribeSteeringWheelAngle",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- VehicleInfo__SubscribeSteeringWheelAngle__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeSteeringWheelAngle__response__parameter1 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSteeringWheelAngle__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeSteeringWheelAngle__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSteeringWheelAngle__response = {
- "VehicleInfo",
- "SubscribeSteeringWheelAngle",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- VehicleInfo__SubscribeSteeringWheelAngle__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSteeringWheelAngle__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSteeringWheelAngle__request = {
- "VehicleInfo",
- "UnsubscribeSteeringWheelAngle",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
- VehicleInfo__UnsubscribeSteeringWheelAngle__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameter1 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSteeringWheelAngle__response = {
- "VehicleInfo",
- "UnsubscribeSteeringWheelAngle",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
- VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeECallInfo__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeECallInfo__request = {
- "VehicleInfo",
- "SubscribeECallInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- VehicleInfo__SubscribeECallInfo__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeECallInfo__response__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeECallInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeECallInfo__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeECallInfo__response = {
- "VehicleInfo",
- "SubscribeECallInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- VehicleInfo__SubscribeECallInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeECallInfo__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeECallInfo__request = {
- "VehicleInfo",
- "UnsubscribeECallInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
- VehicleInfo__UnsubscribeECallInfo__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeECallInfo__response__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeECallInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeECallInfo__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeECallInfo__response = {
- "VehicleInfo",
- "UnsubscribeECallInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
- VehicleInfo__UnsubscribeECallInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAirbagStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAirbagStatus__request = {
- "VehicleInfo",
- "SubscribeAirbagStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- VehicleInfo__SubscribeAirbagStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeAirbagStatus__response__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAirbagStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeAirbagStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAirbagStatus__response = {
- "VehicleInfo",
- "SubscribeAirbagStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- VehicleInfo__SubscribeAirbagStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAirbagStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAirbagStatus__request = {
- "VehicleInfo",
- "UnsubscribeAirbagStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
- VehicleInfo__UnsubscribeAirbagStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeAirbagStatus__response__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAirbagStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeAirbagStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAirbagStatus__response = {
- "VehicleInfo",
- "UnsubscribeAirbagStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
- VehicleInfo__UnsubscribeAirbagStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEmergencyEvent__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEmergencyEvent__request = {
- "VehicleInfo",
- "SubscribeEmergencyEvent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- VehicleInfo__SubscribeEmergencyEvent__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeEmergencyEvent__response__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEmergencyEvent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeEmergencyEvent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEmergencyEvent__response = {
- "VehicleInfo",
- "SubscribeEmergencyEvent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- VehicleInfo__SubscribeEmergencyEvent__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEmergencyEvent__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEmergencyEvent__request = {
- "VehicleInfo",
- "UnsubscribeEmergencyEvent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
- VehicleInfo__UnsubscribeEmergencyEvent__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeEmergencyEvent__response__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEmergencyEvent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeEmergencyEvent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEmergencyEvent__response = {
- "VehicleInfo",
- "UnsubscribeEmergencyEvent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
- VehicleInfo__UnsubscribeEmergencyEvent__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeClusterModeStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeClusterModeStatus__request = {
- "VehicleInfo",
- "SubscribeClusterModeStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- VehicleInfo__SubscribeClusterModeStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeClusterModeStatus__response__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeClusterModeStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeClusterModeStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeClusterModeStatus__response = {
- "VehicleInfo",
- "SubscribeClusterModeStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- VehicleInfo__SubscribeClusterModeStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeClusterModeStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeClusterModeStatus__request = {
- "VehicleInfo",
- "UnsubscribeClusterModeStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
- VehicleInfo__UnsubscribeClusterModeStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeClusterModeStatus__response__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeClusterModeStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeClusterModeStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeClusterModeStatus__response = {
- "VehicleInfo",
- "UnsubscribeClusterModeStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
- VehicleInfo__UnsubscribeClusterModeStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeMyKey__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeMyKey__request = {
- "VehicleInfo",
- "SubscribeMyKey",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey,
- VehicleInfo__SubscribeMyKey__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeMyKey__response__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeMyKey__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeMyKey__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeMyKey__response = {
- "VehicleInfo",
- "SubscribeMyKey",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey,
- VehicleInfo__SubscribeMyKey__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeMyKey__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeMyKey__request = {
- "VehicleInfo",
- "UnsubscribeMyKey",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey,
- VehicleInfo__UnsubscribeMyKey__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeMyKey__response__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeMyKey__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeMyKey__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeMyKey__response = {
- "VehicleInfo",
- "UnsubscribeMyKey",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey,
- VehicleInfo__UnsubscribeMyKey__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__ActivateApp__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__ActivateApp__request =
- {"SDL",
- "ActivateApp",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_ActivateApp,
- SDL__ActivateApp__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter1 = {
- "isSDLAllowed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::StructDescription
- SDL__ActivateApp__response__parameter2 = {
- {"device", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter3 = {
- "isPermissionsConsentNeeded", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter4 = {
- "isAppPermissionsRevoked", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::StructDescription
- SDL__ActivateApp__response__parameter5_array = {
- {"appRevokedPermissions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__ActivateApp__response__parameter5 = {
- {"appRevokedPermissions", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter5_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter6 = {
- "isAppRevoked", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter7 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- SDL__ActivateApp__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__ActivateApp__response =
- {"SDL",
- "ActivateApp",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_ActivateApp,
- SDL__ActivateApp__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetUserFriendlyMessage__request__parameter1_array = {
- "messageCodes", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- SDL__GetUserFriendlyMessage__request__parameter1 = {
- {"messageCodes", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter1_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- SDL__GetUserFriendlyMessage__request__parameter2 = {
- "language", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetUserFriendlyMessage__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetUserFriendlyMessage__request = {
- "SDL",
- "GetUserFriendlyMessage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetUserFriendlyMessage,
- SDL__GetUserFriendlyMessage__request__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__GetUserFriendlyMessage__response__parameter1_array = {
- {"messages", ford_message_descriptions::Struct, true},
- Structs::Common__UserFriendlyMessage__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__GetUserFriendlyMessage__response__parameter1 = {
- {"messages", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__response__parameter1_array,
- "(s(bs)(bs)(bs)(bs)(bs))"};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetUserFriendlyMessage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetUserFriendlyMessage__response = {
- "SDL",
- "GetUserFriendlyMessage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetUserFriendlyMessage,
- SDL__GetUserFriendlyMessage__response__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__OnAllowSDLFunctionality__notification__parameter1 = {
- {"device", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAllowSDLFunctionality__notification__parameter2 = {
- "allowed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAllowSDLFunctionality__notification__parameter3 = {
- "source", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnAllowSDLFunctionality__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnAllowSDLFunctionality__notification = {
- "SDL",
- "OnAllowSDLFunctionality",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality,
- SDL__OnAllowSDLFunctionality__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnReceivedPolicyUpdate__notification__parameter1 = {
- "policyfile", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnReceivedPolicyUpdate__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnReceivedPolicyUpdate__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnReceivedPolicyUpdate__notification = {
- "SDL",
- "OnReceivedPolicyUpdate",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate,
- SDL__OnReceivedPolicyUpdate__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- SDL__OnPolicyUpdate__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnPolicyUpdate__notification = {
- "SDL",
- "OnPolicyUpdate",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnPolicyUpdate,
- SDL__OnPolicyUpdate__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetListOfPermissions__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetListOfPermissions__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetListOfPermissions__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetListOfPermissions__request = {
- "SDL",
- "GetListOfPermissions",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetListOfPermissions,
- SDL__GetListOfPermissions__request__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__GetListOfPermissions__response__parameter1_array = {
- {"allowedFunctions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__GetListOfPermissions__response__parameter1 = {
- {"allowedFunctions", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetListOfPermissions__response__parameter1_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetListOfPermissions__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetListOfPermissions__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetListOfPermissions__response = {
- "SDL",
- "GetListOfPermissions",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetListOfPermissions,
- SDL__GetListOfPermissions__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionConsent__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- SDL__OnAppPermissionConsent__notification__parameter2_array = {
- {"consentedFunctions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__OnAppPermissionConsent__notification__parameter2 = {
- {"consentedFunctions", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter2_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionConsent__notification__parameter3 = {
- "source", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnAppPermissionConsent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnAppPermissionConsent__notification = {
- "SDL",
- "OnAppPermissionConsent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnAppPermissionConsent,
- SDL__OnAppPermissionConsent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter2 = {
- "isAppPermissionsRevoked", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::StructDescription
- SDL__OnAppPermissionChanged__notification__parameter3_array = {
- {"appRevokedPermissions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__OnAppPermissionChanged__notification__parameter3 = {
- {"appRevokedPermissions", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter3_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter4 = {
- "appRevoked", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter5 = {
- "appPermissionsConsentNeeded",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter6 = {
- "appUnauthorized", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter7 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter8_array = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- SDL__OnAppPermissionChanged__notification__parameter8 = {
- {"requestType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter8_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnAppPermissionChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnAppPermissionChanged__notification = {
- "SDL",
- "OnAppPermissionChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnAppPermissionChanged,
- SDL__OnAppPermissionChanged__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__OnSDLConsentNeeded__notification__parameter1 = {
- {"device", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnSDLConsentNeeded__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnSDLConsentNeeded__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnSDLConsentNeeded__notification = {
- "SDL",
- "OnSDLConsentNeeded",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnSDLConsentNeeded,
- SDL__OnSDLConsentNeeded__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- SDL__UpdateSDL__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription SDL__UpdateSDL__request = {
- "SDL",
- "UpdateSDL",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_UpdateSDL,
- SDL__UpdateSDL__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__UpdateSDL__response__parameter1 = {
- "result", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__UpdateSDL__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__UpdateSDL__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__UpdateSDL__response = {
- "SDL",
- "UpdateSDL",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_UpdateSDL,
- SDL__UpdateSDL__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- SDL__GetStatusUpdate__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetStatusUpdate__request = {"SDL",
- "GetStatusUpdate",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetStatusUpdate,
- SDL__GetStatusUpdate__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetStatusUpdate__response__parameter1 = {
- "status", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetStatusUpdate__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetStatusUpdate__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetStatusUpdate__response = {
- "SDL",
- "GetStatusUpdate",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetStatusUpdate,
- SDL__GetStatusUpdate__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnStatusUpdate__notification__parameter1 = {
- "status", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnStatusUpdate__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnStatusUpdate__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnStatusUpdate__notification = {
- "SDL",
- "OnStatusUpdate",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnStatusUpdate,
- SDL__OnStatusUpdate__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnSystemError__notification__parameter1 = {
- "error", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnSystemError__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnSystemError__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnSystemError__notification = {
- "SDL",
- "OnSystemError",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnSystemError,
- SDL__OnSystemError__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__AddStatisticsInfo__notification__parameter1 = {
- "statisticType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__AddStatisticsInfo__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__AddStatisticsInfo__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__AddStatisticsInfo__notification = {
- "SDL",
- "AddStatisticsInfo",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_AddStatisticsInfo,
- SDL__AddStatisticsInfo__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetURLS__request__parameter1 = {
- "service", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetURLS__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetURLS__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__GetURLS__request = {
- "SDL",
- "GetURLS",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetURLS,
- SDL__GetURLS__request__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__GetURLS__response__parameter1_array = {
- {"urls", ford_message_descriptions::Struct, true},
- Structs::Common__ServiceInfo__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__GetURLS__response__parameter1 = {
- {"urls", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetURLS__response__parameter1_array,
- "(s(bs))"};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetURLS__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetURLS__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__GetURLS__response = {
- "SDL",
- "GetURLS",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetURLS,
- SDL__GetURLS__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnDeviceStateChanged__notification__parameter1 = {
- "deviceState", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- SDL__OnDeviceStateChanged__notification__parameter2 = {
- "deviceInternalId", ford_message_descriptions::String, true};
-const ford_message_descriptions::StructDescription
- SDL__OnDeviceStateChanged__notification__parameter3 = {
- {"deviceId", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnDeviceStateChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnDeviceStateChanged__notification = {
- "SDL",
- "OnDeviceStateChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnDeviceStateChanged,
- SDL__OnDeviceStateChanged__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- RC__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription RC__IsReady__request = {
- "RC",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_IsReady,
- RC__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- RC__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription RC__IsReady__response = {
- "RC",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_IsReady,
- RC__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- RC__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetCapabilities__request = {"RC",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_GetCapabilities,
- RC__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__GetCapabilities__response__parameter1 = {
- {"remoteControlCapability", ford_message_descriptions::Struct, false},
- Structs::Common__RemoteControlCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- RC__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetCapabilities__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetCapabilities__response = {"RC",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_GetCapabilities,
- RC__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__SetInteriorVehicleData__request__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription
- RC__SetInteriorVehicleData__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- RC__SetInteriorVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__SetInteriorVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__SetInteriorVehicleData__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__SetInteriorVehicleData__request = {
- "RC",
- "SetInteriorVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_SetInteriorVehicleData,
- RC__SetInteriorVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__SetInteriorVehicleData__response__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription*
- RC__SetInteriorVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__SetInteriorVehicleData__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__SetInteriorVehicleData__response = {
- "RC",
- "SetInteriorVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_SetInteriorVehicleData,
- RC__SetInteriorVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__request__parameter1 = {
- "moduleType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__request__parameter2 = {
- "subscribe", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleData__request = {
- "RC",
- "GetInteriorVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_GetInteriorVehicleData,
- RC__GetInteriorVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__GetInteriorVehicleData__response__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__response__parameter2 = {
- "isSubscribed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleData__response = {
- "RC",
- "GetInteriorVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_GetInteriorVehicleData,
- RC__GetInteriorVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleDataConsent__request__parameter1 = {
- "moduleType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleDataConsent__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleDataConsent__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleDataConsent__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleDataConsent__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleDataConsent__request = {
- "RC",
- "GetInteriorVehicleDataConsent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
- RC__GetInteriorVehicleDataConsent__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleDataConsent__response__parameter1 = {
- "allowed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleDataConsent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleDataConsent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleDataConsent__response = {
- "RC",
- "GetInteriorVehicleDataConsent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
- RC__GetInteriorVehicleDataConsent__response__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__OnInteriorVehicleData__notification__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription*
- RC__OnInteriorVehicleData__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__OnInteriorVehicleData__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__OnInteriorVehicleData__notification = {
- "RC",
- "OnInteriorVehicleData",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::RC_OnInteriorVehicleData,
- RC__OnInteriorVehicleData__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__OnRemoteControlSettings__notification__parameter1 = {
- "allowed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- RC__OnRemoteControlSettings__notification__parameter2 = {
- "accessMode", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- RC__OnRemoteControlSettings__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__OnRemoteControlSettings__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__OnRemoteControlSettings__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__OnRemoteControlSettings__notification = {
- "RC",
- "OnRemoteControlSettings",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::RC_OnRemoteControlSettings,
- RC__OnRemoteControlSettings__notification__parameters};
-}
-
-namespace ford_message_descriptions {
-
-const MessageDescription* message_descriptions[] = {
- &Buttons__GetCapabilities__request,
- &Buttons__GetCapabilities__response,
- &Buttons__OnButtonEvent__notification,
- &Buttons__OnButtonPress__notification,
- &Buttons__OnButtonSubscription__notification,
- &BasicCommunication__OnReady__notification,
- &BasicCommunication__OnStartDeviceDiscovery__notification,
- &BasicCommunication__OnUpdateDeviceList__notification,
- &BasicCommunication__OnPhoneCall__notification,
- &BasicCommunication__OnEmergencyEvent__notification,
- &BasicCommunication__OnResumeAudioSource__notification,
- &BasicCommunication__OnSDLPersistenceComplete__notification,
- &BasicCommunication__UpdateAppList__request,
- &BasicCommunication__UpdateAppList__response,
- &BasicCommunication__UpdateDeviceList__request,
- &BasicCommunication__UpdateDeviceList__response,
- &BasicCommunication__OnFileRemoved__notification,
- &BasicCommunication__AllowDeviceToConnect__request,
- &BasicCommunication__AllowDeviceToConnect__response,
- &BasicCommunication__OnDeviceChosen__notification,
- &BasicCommunication__OnFindApplications__notification,
- &BasicCommunication__ActivateApp__request,
- &BasicCommunication__ActivateApp__response,
- &BasicCommunication__OnAppActivated__notification,
- &BasicCommunication__OnAppDeactivated__notification,
- &BasicCommunication__OnAppRegistered__notification,
- &BasicCommunication__OnAppUnregistered__notification,
- &BasicCommunication__OnExitApplication__notification,
- &BasicCommunication__OnExitAllApplications__notification,
- &BasicCommunication__OnAwakeSDL__notification,
- &BasicCommunication__MixingAudioSupported__request,
- &BasicCommunication__MixingAudioSupported__response,
- &BasicCommunication__PlayTone__notification,
- &BasicCommunication__DialNumber__request,
- &BasicCommunication__DialNumber__response,
- &BasicCommunication__OnSystemRequest__notification,
- &BasicCommunication__SystemRequest__request,
- &BasicCommunication__SystemRequest__response,
- &BasicCommunication__PolicyUpdate__request,
- &BasicCommunication__PolicyUpdate__response,
- &BasicCommunication__OnSDLClose__notification,
- &BasicCommunication__OnPutFile__notification,
- &BasicCommunication__GetSystemInfo__request,
- &BasicCommunication__GetSystemInfo__response,
- &BasicCommunication__OnSystemInfoChanged__notification,
- &BasicCommunication__OnIgnitionCycleOver__notification,
- &BasicCommunication__DecryptCertificate__request,
- &BasicCommunication__DecryptCertificate__response,
- &BasicCommunication__OnEventChanged__notification,
- &VR__IsReady__request,
- &VR__IsReady__response,
- &VR__Started__notification,
- &VR__Stopped__notification,
- &VR__AddCommand__request,
- &VR__AddCommand__response,
- &VR__DeleteCommand__request,
- &VR__DeleteCommand__response,
- &VR__PerformInteraction__request,
- &VR__PerformInteraction__response,
- &VR__OnCommand__notification,
- &VR__ChangeRegistration__request,
- &VR__ChangeRegistration__response,
- &VR__OnLanguageChange__notification,
- &VR__GetSupportedLanguages__request,
- &VR__GetSupportedLanguages__response,
- &VR__GetLanguage__request,
- &VR__GetLanguage__response,
- &VR__GetCapabilities__request,
- &VR__GetCapabilities__response,
- &TTS__GetCapabilities__request,
- &TTS__GetCapabilities__response,
- &TTS__Started__notification,
- &TTS__Stopped__notification,
- &TTS__IsReady__request,
- &TTS__IsReady__response,
- &TTS__Speak__request,
- &TTS__Speak__response,
- &TTS__StopSpeaking__request,
- &TTS__StopSpeaking__response,
- &TTS__ChangeRegistration__request,
- &TTS__ChangeRegistration__response,
- &TTS__OnLanguageChange__notification,
- &TTS__GetSupportedLanguages__request,
- &TTS__GetSupportedLanguages__response,
- &TTS__GetLanguage__request,
- &TTS__GetLanguage__response,
- &TTS__SetGlobalProperties__request,
- &TTS__SetGlobalProperties__response,
- &TTS__OnResetTimeout__notification,
- &UI__Alert__request,
- &UI__Alert__response,
- &UI__Show__request,
- &UI__Show__response,
- &UI__AddCommand__request,
- &UI__AddCommand__response,
- &UI__DeleteCommand__request,
- &UI__DeleteCommand__response,
- &UI__AddSubMenu__request,
- &UI__AddSubMenu__response,
- &UI__DeleteSubMenu__request,
- &UI__DeleteSubMenu__response,
- &UI__PerformInteraction__request,
- &UI__PerformInteraction__response,
- &UI__SetMediaClockTimer__request,
- &UI__SetMediaClockTimer__response,
- &UI__SetGlobalProperties__request,
- &UI__SetGlobalProperties__response,
- &UI__OnCommand__notification,
- &UI__OnSystemContext__notification,
- &UI__GetCapabilities__request,
- &UI__GetCapabilities__response,
- &UI__ChangeRegistration__request,
- &UI__ChangeRegistration__response,
- &UI__OnLanguageChange__notification,
- &UI__GetSupportedLanguages__request,
- &UI__GetSupportedLanguages__response,
- &UI__GetLanguage__request,
- &UI__GetLanguage__response,
- &UI__OnDriverDistraction__notification,
- &UI__SetAppIcon__request,
- &UI__SetAppIcon__response,
- &UI__SetDisplayLayout__request,
- &UI__SetDisplayLayout__response,
- &UI__ShowCustomForm__request,
- &UI__ShowCustomForm__response,
- &UI__OnKeyboardInput__notification,
- &UI__OnTouchEvent__notification,
- &UI__Slider__request,
- &UI__Slider__response,
- &UI__ScrollableMessage__request,
- &UI__ScrollableMessage__response,
- &UI__PerformAudioPassThru__request,
- &UI__PerformAudioPassThru__response,
- &UI__EndAudioPassThru__request,
- &UI__EndAudioPassThru__response,
- &UI__IsReady__request,
- &UI__IsReady__response,
- &UI__ClosePopUp__request,
- &UI__ClosePopUp__response,
- &UI__OnResetTimeout__notification,
- &UI__OnRecordStart__notification,
- &UI__SendHapticData__request,
- &UI__SendHapticData__response,
- &Navigation__IsReady__request,
- &Navigation__IsReady__response,
- &Navigation__SendLocation__request,
- &Navigation__SendLocation__response,
- &Navigation__DialNumber__request,
- &Navigation__DialNumber__response,
- &Navigation__ShowConstantTBT__request,
- &Navigation__ShowConstantTBT__response,
- &Navigation__AlertManeuver__request,
- &Navigation__AlertManeuver__response,
- &Navigation__UpdateTurnList__request,
- &Navigation__UpdateTurnList__response,
- &Navigation__OnTBTClientState__notification,
- &Navigation__SetVideoConfig__request,
- &Navigation__SetVideoConfig__response,
- &Navigation__StartStream__request,
- &Navigation__StartStream__response,
- &Navigation__StopStream__request,
- &Navigation__StopStream__response,
- &Navigation__StartAudioStream__request,
- &Navigation__StartAudioStream__response,
- &Navigation__StopAudioStream__request,
- &Navigation__StopAudioStream__response,
- &Navigation__OnAudioDataStreaming__notification,
- &Navigation__OnVideoDataStreaming__notification,
- &Navigation__GetWayPoints__request,
- &Navigation__GetWayPoints__response,
- &Navigation__OnWayPointChange__notification,
- &Navigation__SubscribeWayPoints__request,
- &Navigation__SubscribeWayPoints__response,
- &Navigation__UnsubscribeWayPoints__request,
- &Navigation__UnsubscribeWayPoints__response,
- &VehicleInfo__IsReady__request,
- &VehicleInfo__IsReady__response,
- &VehicleInfo__GetVehicleType__request,
- &VehicleInfo__GetVehicleType__response,
- &VehicleInfo__ReadDID__request,
- &VehicleInfo__ReadDID__response,
- &VehicleInfo__GetDTCs__request,
- &VehicleInfo__GetDTCs__response,
- &VehicleInfo__DiagnosticMessage__request,
- &VehicleInfo__DiagnosticMessage__response,
- &VehicleInfo__SubscribeVehicleData__request,
- &VehicleInfo__SubscribeVehicleData__response,
- &VehicleInfo__UnsubscribeVehicleData__request,
- &VehicleInfo__UnsubscribeVehicleData__response,
- &VehicleInfo__GetVehicleData__request,
- &VehicleInfo__GetVehicleData__response,
- &VehicleInfo__OnVehicleData__notification,
- &VehicleInfo__GetGpsData__request,
- &VehicleInfo__GetGpsData__response,
- &VehicleInfo__GetSpeed__request,
- &VehicleInfo__GetSpeed__response,
- &VehicleInfo__GetRpm__request,
- &VehicleInfo__GetRpm__response,
- &VehicleInfo__GetFuelLevel__request,
- &VehicleInfo__GetFuelLevel__response,
- &VehicleInfo__GetFuelLevelState__request,
- &VehicleInfo__GetFuelLevelState__response,
- &VehicleInfo__GetInstantFuelConsumption__request,
- &VehicleInfo__GetInstantFuelConsumption__response,
- &VehicleInfo__GetExternalTemperature__request,
- &VehicleInfo__GetExternalTemperature__response,
- &VehicleInfo__GetVin__request,
- &VehicleInfo__GetVin__response,
- &VehicleInfo__GetPrndl__request,
- &VehicleInfo__GetPrndl__response,
- &VehicleInfo__GetTirePressure__request,
- &VehicleInfo__GetTirePressure__response,
- &VehicleInfo__GetOdometer__request,
- &VehicleInfo__GetOdometer__response,
- &VehicleInfo__GetBeltStatus__request,
- &VehicleInfo__GetBeltStatus__response,
- &VehicleInfo__GetBodyInformation__request,
- &VehicleInfo__GetBodyInformation__response,
- &VehicleInfo__GetDeviceStatus__request,
- &VehicleInfo__GetDeviceStatus__response,
- &VehicleInfo__GetDriverBraking__request,
- &VehicleInfo__GetDriverBraking__response,
- &VehicleInfo__GetWiperStatus__request,
- &VehicleInfo__GetWiperStatus__response,
- &VehicleInfo__GetHeadLampStatus__request,
- &VehicleInfo__GetHeadLampStatus__response,
- &VehicleInfo__GetEngineTorque__request,
- &VehicleInfo__GetEngineTorque__response,
- &VehicleInfo__GetAccPedalPosition__request,
- &VehicleInfo__GetAccPedalPosition__response,
- &VehicleInfo__GetSteeringWheelAngle__request,
- &VehicleInfo__GetSteeringWheelAngle__response,
- &VehicleInfo__GetECallInfo__request,
- &VehicleInfo__GetECallInfo__response,
- &VehicleInfo__GetAirbagStatus__request,
- &VehicleInfo__GetAirbagStatus__response,
- &VehicleInfo__GetEmergencyEvent__request,
- &VehicleInfo__GetEmergencyEvent__response,
- &VehicleInfo__GetClusterModeStatus__request,
- &VehicleInfo__GetClusterModeStatus__response,
- &VehicleInfo__GetMyKey__request,
- &VehicleInfo__GetMyKey__response,
- &VehicleInfo__OnGpsData__notification,
- &VehicleInfo__OnSpeed__notification,
- &VehicleInfo__OnRpm__notification,
- &VehicleInfo__OnFuelLevel__notification,
- &VehicleInfo__OnFuelLevelState__notification,
- &VehicleInfo__OnInstantFuelConsumption__notification,
- &VehicleInfo__OnExternalTemperature__notification,
- &VehicleInfo__OnVin__notification,
- &VehicleInfo__OnPrndl__notification,
- &VehicleInfo__OnTirePressure__notification,
- &VehicleInfo__OnOdometer__notification,
- &VehicleInfo__OnBeltStatus__notification,
- &VehicleInfo__OnBodyInformation__notification,
- &VehicleInfo__OnDeviceStatus__notification,
- &VehicleInfo__OnDriverBraking__notification,
- &VehicleInfo__OnWiperStatus__notification,
- &VehicleInfo__OnHeadLampStatus__notification,
- &VehicleInfo__OnEngineTorque__notification,
- &VehicleInfo__OnAccPedalPosition__notification,
- &VehicleInfo__OnSteeringWheelAngle__notification,
- &VehicleInfo__OnECallInfo__notification,
- &VehicleInfo__OnAirbagStatus__notification,
- &VehicleInfo__OnEmergencyEvent__notification,
- &VehicleInfo__OnClusterModeStatus__notification,
- &VehicleInfo__OnMyKey__notification,
- &VehicleInfo__SubscribeGps__request,
- &VehicleInfo__SubscribeGps__response,
- &VehicleInfo__UnsubscribeGps__request,
- &VehicleInfo__UnsubscribeGps__response,
- &VehicleInfo__SubscribeSpeed__request,
- &VehicleInfo__SubscribeSpeed__response,
- &VehicleInfo__UnsubscribeSpeed__request,
- &VehicleInfo__UnsubscribeSpeed__response,
- &VehicleInfo__SubscribeRpm__request,
- &VehicleInfo__SubscribeRpm__response,
- &VehicleInfo__UnsubscribeRpm__request,
- &VehicleInfo__UnsubscribeRpm__response,
- &VehicleInfo__SubscribeFuelLevel__request,
- &VehicleInfo__SubscribeFuelLevel__response,
- &VehicleInfo__UnsubscribeFuelLevel__request,
- &VehicleInfo__UnsubscribeFuelLevel__response,
- &VehicleInfo__SubscribeFuelLevel_State__request,
- &VehicleInfo__SubscribeFuelLevel_State__response,
- &VehicleInfo__UnsubscribeFuelLevel_State__request,
- &VehicleInfo__UnsubscribeFuelLevel_State__response,
- &VehicleInfo__SubscribeInstantFuelConsumption__request,
- &VehicleInfo__SubscribeInstantFuelConsumption__response,
- &VehicleInfo__UnsubscribeInstantFuelConsumption__request,
- &VehicleInfo__UnsubscribeInstantFuelConsumption__response,
- &VehicleInfo__SubscribeExternalTemperature__request,
- &VehicleInfo__SubscribeExternalTemperature__response,
- &VehicleInfo__UnsubscribeExternalTemperature__request,
- &VehicleInfo__UnsubscribeExternalTemperature__response,
- &VehicleInfo__SubscribePrndl__request,
- &VehicleInfo__SubscribePrndl__response,
- &VehicleInfo__UnsubscribePrndl__request,
- &VehicleInfo__UnsubscribePrndl__response,
- &VehicleInfo__SubscribeVin__request,
- &VehicleInfo__SubscribeVin__response,
- &VehicleInfo__UnsubscribeVin__request,
- &VehicleInfo__UnsubscribeVin__response,
- &VehicleInfo__SubscribeTirePressure__request,
- &VehicleInfo__SubscribeTirePressure__response,
- &VehicleInfo__UnsubscribeTirePressure__request,
- &VehicleInfo__UnsubscribeTirePressure__response,
- &VehicleInfo__SubscribeOdometer__request,
- &VehicleInfo__SubscribeOdometer__response,
- &VehicleInfo__UnsubscribeOdometer__request,
- &VehicleInfo__UnsubscribeOdometer__response,
- &VehicleInfo__SubscribeBeltStatus__request,
- &VehicleInfo__SubscribeBeltStatus__response,
- &VehicleInfo__UnsubscribeBeltStatus__request,
- &VehicleInfo__UnsubscribeBeltStatus__response,
- &VehicleInfo__SubscribeBodyInformation__request,
- &VehicleInfo__SubscribeBodyInformation__response,
- &VehicleInfo__UnsubscribeBodyInformation__request,
- &VehicleInfo__UnsubscribeBodyInformation__response,
- &VehicleInfo__SubscribeDeviceStatus__request,
- &VehicleInfo__SubscribeDeviceStatus__response,
- &VehicleInfo__UnsubscribeDeviceStatus__request,
- &VehicleInfo__UnsubscribeDeviceStatus__response,
- &VehicleInfo__SubscribeDriverBraking__request,
- &VehicleInfo__SubscribeDriverBraking__response,
- &VehicleInfo__UnsubscribeDriverBraking__request,
- &VehicleInfo__UnsubscribeDriverBraking__response,
- &VehicleInfo__SubscribeWiperStatus__request,
- &VehicleInfo__SubscribeWiperStatus__response,
- &VehicleInfo__UnsubscribeWiperStatus__request,
- &VehicleInfo__UnsubscribeWiperStatus__response,
- &VehicleInfo__SubscribeHeadLampStatus__request,
- &VehicleInfo__SubscribeHeadLampStatus__response,
- &VehicleInfo__UnsubscribeHeadLampStatus__request,
- &VehicleInfo__UnsubscribeHeadLampStatus__response,
- &VehicleInfo__SubscribeEngineTorque__request,
- &VehicleInfo__SubscribeEngineTorque__response,
- &VehicleInfo__UnsubscribeEngineTorque__request,
- &VehicleInfo__UnsubscribeEngineTorque__response,
- &VehicleInfo__SubscribeAccPedalPosition__request,
- &VehicleInfo__SubscribeAccPedalPosition__response,
- &VehicleInfo__UnsubscribeAccPedalPosition__request,
- &VehicleInfo__UnsubscribeAccPedalPosition__response,
- &VehicleInfo__SubscribeSteeringWheelAngle__request,
- &VehicleInfo__SubscribeSteeringWheelAngle__response,
- &VehicleInfo__UnsubscribeSteeringWheelAngle__request,
- &VehicleInfo__UnsubscribeSteeringWheelAngle__response,
- &VehicleInfo__SubscribeECallInfo__request,
- &VehicleInfo__SubscribeECallInfo__response,
- &VehicleInfo__UnsubscribeECallInfo__request,
- &VehicleInfo__UnsubscribeECallInfo__response,
- &VehicleInfo__SubscribeAirbagStatus__request,
- &VehicleInfo__SubscribeAirbagStatus__response,
- &VehicleInfo__UnsubscribeAirbagStatus__request,
- &VehicleInfo__UnsubscribeAirbagStatus__response,
- &VehicleInfo__SubscribeEmergencyEvent__request,
- &VehicleInfo__SubscribeEmergencyEvent__response,
- &VehicleInfo__UnsubscribeEmergencyEvent__request,
- &VehicleInfo__UnsubscribeEmergencyEvent__response,
- &VehicleInfo__SubscribeClusterModeStatus__request,
- &VehicleInfo__SubscribeClusterModeStatus__response,
- &VehicleInfo__UnsubscribeClusterModeStatus__request,
- &VehicleInfo__UnsubscribeClusterModeStatus__response,
- &VehicleInfo__SubscribeMyKey__request,
- &VehicleInfo__SubscribeMyKey__response,
- &VehicleInfo__UnsubscribeMyKey__request,
- &VehicleInfo__UnsubscribeMyKey__response,
- &SDL__ActivateApp__request,
- &SDL__ActivateApp__response,
- &SDL__GetUserFriendlyMessage__request,
- &SDL__GetUserFriendlyMessage__response,
- &SDL__OnAllowSDLFunctionality__notification,
- &SDL__OnReceivedPolicyUpdate__notification,
- &SDL__OnPolicyUpdate__notification,
- &SDL__GetListOfPermissions__request,
- &SDL__GetListOfPermissions__response,
- &SDL__OnAppPermissionConsent__notification,
- &SDL__OnAppPermissionChanged__notification,
- &SDL__OnSDLConsentNeeded__notification,
- &SDL__UpdateSDL__request,
- &SDL__UpdateSDL__response,
- &SDL__GetStatusUpdate__request,
- &SDL__GetStatusUpdate__response,
- &SDL__OnStatusUpdate__notification,
- &SDL__OnSystemError__notification,
- &SDL__AddStatisticsInfo__notification,
- &SDL__GetURLS__request,
- &SDL__GetURLS__response,
- &SDL__OnDeviceStateChanged__notification,
- &RC__IsReady__request,
- &RC__IsReady__response,
- &RC__GetCapabilities__request,
- &RC__GetCapabilities__response,
- &RC__SetInteriorVehicleData__request,
- &RC__SetInteriorVehicleData__response,
- &RC__GetInteriorVehicleData__request,
- &RC__GetInteriorVehicleData__response,
- &RC__GetInteriorVehicleDataConsent__request,
- &RC__GetInteriorVehicleDataConsent__response,
- &RC__OnInteriorVehicleData__notification,
- &RC__OnRemoteControlSettings__notification,
- NULL};
-}
diff --git a/src/components/dbus/src/schema.cc b/src/components/dbus/src/schema.cc
deleted file mode 100644
index 3107d9ce6c..0000000000
--- a/src/components/dbus/src/schema.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "dbus/schema.h"
-
-#include <algorithm>
-#include <functional>
-
-namespace dbus {
-
-struct Description {
- MessageId id;
- MessageName name;
- MessageType type;
- ListArgs args;
-};
-
-struct IsId : public std::unary_function<const Description*, bool> {
- explicit IsId(MessageId id) : id_(id) {}
- bool operator()(const Description* desc) {
- return desc->id == id_;
- }
-
- private:
- MessageId id_;
-};
-
-struct IsName : public std::unary_function<const Description*, bool> {
- explicit IsName(const MessageName& name) : name_(name) {}
- bool operator()(const Description* desc) {
- return desc->name == name_;
- }
-
- private:
- MessageName name_;
-};
-
-struct IsIdType : public std::unary_function<const Description*, bool> {
- explicit IsIdType(const MessageId& id, const MessageType& type)
- : id_(id), type_(type) {}
- bool operator()(const Description* desc) {
- return desc->id == id_ && desc->type == type_;
- }
-
- private:
- MessageId id_;
- MessageType type_;
-};
-
-struct IsNameType : public std::unary_function<const Description*, bool> {
- explicit IsNameType(const MessageName& name, const MessageType& type)
- : name_(name), type_(type) {}
- bool operator()(const Description* desc) {
- return desc->name == name_ && desc->type == type_;
- }
-
- private:
- MessageName name_;
- MessageType type_;
-};
-
-DBusSchema::DBusSchema(const MessageDescription** array) {
- const MessageDescription** msg = array;
- while (*msg != NULL) {
- Description* desc = new Description();
- desc->id = (*msg)->function_id;
- desc->name = std::make_pair((*msg)->interface, (*msg)->name);
- desc->type = (*msg)->message_type;
- const ParameterDescription** param;
- param = (*msg)->parameters;
- while (*param != NULL) {
- desc->args.push_back(*param);
- param++;
- }
- msgs_.push_back(desc);
- msg++;
- }
-}
-
-MessageName DBusSchema::getMessageName(MessageId id) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsId(id));
- if (msgs_.end() != it) {
- return (*it)->name;
- }
- return MessageName();
-}
-
-MessageId DBusSchema::getMessageId(const MessageName& name) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsName(name));
- if (msgs_.end() != it) {
- return (*it)->id;
- }
- return hmi_apis::FunctionID::eType::INVALID_ENUM;
-}
-
-ListArgs DBusSchema::getListArgs(MessageId id, MessageType type) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsIdType(id, type));
- if (msgs_.end() != it) {
- return (*it)->args;
- }
- return ListArgs();
-}
-
-ListArgs DBusSchema::getListArgs(const MessageName& name,
- MessageType type) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsNameType(name, type));
- if (msgs_.end() != it) {
- return (*it)->args;
- }
- return ListArgs();
-}
-
-} // namespace dbus_schema
diff --git a/src/components/dbus/test/CMakeLists.txt b/src/components/dbus/test/CMakeLists.txt
deleted file mode 100644
index 914bd2ca84..0000000000
--- a/src/components/dbus/test/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
-include_directories (
- ${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/dbus/include/
- ${COMPONENTS_DIR}/dbus/test/include/
-)
-
-#FIXME: exclude some tests
-set (EXCLUDE_PATHS
- dbus_message_controller_test.cc
-)
-
-collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" ${EXCLUDE_PATHS})
-
-set (LIBRARIES
- gmock
- DBus
- formatters
- SmartObjects
-)
-
-create_test(test_DBus_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/dbus/test/dbus_adapter_test.cc b/src/components/dbus/test/dbus_adapter_test.cc
deleted file mode 100644
index 74a6de1aa9..0000000000
--- a/src/components/dbus/test/dbus_adapter_test.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * \file test_dbus_adapter.cc
- * \brief
- *
- * 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 <gtest/gtest.h>
-#include "dbus/dbus_adapter.h"
-
-using ::dbus::DBusAdapter;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-class DBusAdapterTest : public ::testing::Test {};
-
-TEST_F(DBusAdapterTest, Initialization) {
- const std::string kSdlServiceName = "test.ford.sdl.core";
- const std::string kSdlObjectPath = "/";
- const std::string kHmiServiceName = "test.ford.sdl.hmi";
- const std::string kHmiObjectPath = "/";
- ::dbus::DBusAdapter adapter(
- kSdlServiceName, kSdlObjectPath, kHmiServiceName, kHmiObjectPath);
- EXPECT_TRUE(adapter.Init());
-}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/dbus/test/dbus_message_controller_test.cc b/src/components/dbus/test/dbus_message_controller_test.cc
deleted file mode 100644
index c06e144f9b..0000000000
--- a/src/components/dbus/test/dbus_message_controller_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * \file test_dbus_adapter.cc
- * \brief
- *
- * 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 <pthread.h>
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-#include "dbus/mock_dbus_message_controller.h"
-#include "dbus/mock_subscriber.h"
-
-using ::testing::_;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-ACTION_P(SignalTest, test) {
- if (test->thread_id != pthread_self()) {
- pthread_mutex_lock(&test->test_mutex);
- pthread_cond_signal(&test->test_cond);
- pthread_mutex_unlock(&test->test_mutex);
- } else {
- test->one_thread = true;
- }
-}
-
-class DBusMessageControllerTest : public ::testing::Test {
- public:
- volatile bool one_thread;
- pthread_t thread_id;
- static pthread_mutex_t test_mutex;
- static pthread_cond_t test_cond;
-
- protected:
- MockDBusMessageController* controller_;
- MockSubscriber* subscriber_;
-
- static void SetUpTestCase() {}
-
- static void TearDownTestCase() {}
-
- virtual void SetUp() {
- const std::string kService = "sdl.core.test_api";
- const std::string kPath = "/dbus_test";
- controller_ = new MockDBusMessageController(kService, kPath);
- subscriber_ = new MockSubscriber(kService, kPath);
- ASSERT_TRUE(controller_->Init());
- ASSERT_TRUE(subscriber_->Start());
- }
-
- void TearDown() OVERRIDE {
- delete controller_;
- delete subscriber_;
- }
-
- bool waitCond(int seconds) {
- if (one_thread)
- return true;
- timespec elapsed;
- clock_gettime(CLOCK_REALTIME, &elapsed);
- elapsed.tv_sec += seconds;
- return pthread_cond_timedwait(&test_cond, &test_mutex, &elapsed) !=
- ETIMEDOUT;
- }
-};
-
-pthread_mutex_t DBusMessageControllerTest::test_mutex;
-pthread_cond_t DBusMessageControllerTest::test_cond;
-
-TEST_F(DBusMessageControllerTest, Receive) {
- std::string text = "Test message for call method DBus";
- EXPECT_CALL(*controller_, Recv(text)).Times(1).WillOnce(SignalTest(this));
- subscriber_->Send(text);
- EXPECT_TRUE(waitCond(1));
-}
-
-TEST_F(DBusMessageControllerTest, DISABLED_Send) {
- const std::string kText = "Test message for signal DBus";
- // EXPECT_CALL(*subscriber_, Receive(kText)).Times(1);
- controller_->Send(kText);
-}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h b/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h
deleted file mode 100644
index 30410a6c7e..0000000000
--- a/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
-#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
-
-#include <pthread.h>
-#include "dbus/dbus_message_controller.h"
-
-namespace test {
-namespace components {
-namespace dbus_test {
-
-class MockDBusMessageController : public ::dbus::DBusMessageController {
- public:
- MOCK_METHOD1(Recv, void(std::string&));
-
- MockDBusMessageController(const std::string& serviceName,
- const std::string& path)
- : DBusMessageController(serviceName, path), thread_() {}
-
- virtual void processResponse(std::string method, Json::Value& root) {}
- virtual void processRequest(Json::Value& root) {}
- virtual void processNotification(Json::Value& root) {}
-
- bool Init() {
- return ::hmi_message_handler::DBusMessageController::Init() &&
- pthread_create(&thread_, 0, &Run, this) == 0;
- }
-
- private:
- pthread_t thread_;
- static void* Run(void* data) {
- if (NULL != data) {
- static_cast<MockDBusMessageController*>(data)
- ->MethodForReceiverThread(nullptr);
- }
- return 0;
- }
-};
-
-} // namespace dbus_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
diff --git a/src/components/dbus/test/include/dbus/mock_subscriber.h b/src/components/dbus/test/include/dbus/mock_subscriber.h
deleted file mode 100644
index b2a369e371..0000000000
--- a/src/components/dbus/test/include/dbus/mock_subscriber.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
-#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
-
-#include <string>
-
-struct DBusConnection;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-class MockSubscriber {
- public:
- MockSubscriber(const std::string nameService, const std::string path);
- virtual ~MockSubscriber();
- virtual void Receive();
- bool Start();
- void Send(const std::string& message);
-
- private:
- std::string nameService_;
- std::string path_;
- DBusConnection* conn_;
-};
-
-} // namespace dbus
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
diff --git a/src/components/dbus/test/mock_subscriber.cc b/src/components/dbus/test/mock_subscriber.cc
deleted file mode 100644
index 2c5dccaa50..0000000000
--- a/src/components/dbus/test/mock_subscriber.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "dbus/dbus.h"
-#include "dbus/mock_subscriber.h"
-
-namespace test {
-namespace components {
-namespace dbus {
-
-MockSubscriber::MockSubscriber(const std::string nameService,
- const std::string path)
- : nameService_(nameService), path_(path), conn_(NULL) {}
-
-MockSubscriber::~MockSubscriber() {}
-
-void MockSubscriber::Receive() {}
-
-bool MockSubscriber::Start() {
- DBusError err;
- dbus_error_init(&err);
- conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
- if (dbus_error_is_set(&err)) {
- dbus_error_free(&err);
- return false;
- }
-
- std::string rule = "type='signal',interface='" + nameService_ + "'";
- dbus_bus_add_match(conn_, rule.c_str(), &err);
- dbus_connection_flush(conn_);
- if (dbus_error_is_set(&err)) {
- dbus_error_free(&err);
- return false;
- }
- return true;
-}
-
-void MockSubscriber::Send(const std::string& message) {}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/dbus/test/schema_test.cc b/src/components/dbus/test/schema_test.cc
deleted file mode 100644
index 37831279b9..0000000000
--- a/src/components/dbus/test/schema_test.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * \file test_schema.cc
- * \brief
- *
- * 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 <gtest/gtest.h>
-#include "dbus/schema.h"
-
-using dbus::DBusSchema;
-using dbus::MessageId;
-using dbus::MessageName;
-using dbus::MessageType;
-using dbus::ListArgs;
-using ford_message_descriptions::ParameterDescription;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-class DBusSchemaTest : public ::testing::Test {
- protected:
- static void SetUpTestCase() {
- schema_ = new DBusSchema(ford_message_descriptions::message_descriptions);
- }
-
- static void TearDownTestCase() {
- delete schema_;
- }
-
- static const DBusSchema* schema_;
- static const int test_negative_value = -3;
-};
-
-const DBusSchema* DBusSchemaTest::schema_ = 0;
-
-TEST_F(DBusSchemaTest, GetName) {
- const MessageId kId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- const MessageName kExpName("Buttons", "GetCapabilities");
- MessageName name = schema_->getMessageName(kId);
- EXPECT_EQ(kExpName, name);
-
- const MessageId kIdWrong = static_cast<const MessageId>(test_negative_value);
- const MessageName kExpNameWrong("", "");
- name = schema_->getMessageName(kIdWrong);
- EXPECT_EQ(kExpNameWrong, name);
-}
-
-TEST_F(DBusSchemaTest, GetId) {
- const MessageName kName("Buttons", "GetCapabilities");
- const MessageId kExpId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- MessageId id = schema_->getMessageId(kName);
- EXPECT_EQ(kExpId, id);
-
- const MessageName kNameWrong("TestInterface", "TestMessage");
- const MessageId kExpIdWrong = hmi_apis::FunctionID::INVALID_ENUM;
- id = schema_->getMessageId(kNameWrong);
- EXPECT_EQ(kExpIdWrong, id);
-}
-
-TEST_F(DBusSchemaTest, GetListArg) {
- const MessageName kName("Buttons", "GetCapabilities");
- const MessageType kType = hmi_apis::messageType::response;
- const MessageId kId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- ListArgs argsName = schema_->getListArgs(kName, kType);
- const ParameterDescription** params =
- ford_message_descriptions::message_descriptions[1]->parameters;
- EXPECT_EQ(params[0], argsName[0]);
- EXPECT_EQ(params[1], argsName[1]);
-
- ListArgs argsId = schema_->getListArgs(kId, kType);
- EXPECT_EQ(params[0], argsId[0]);
- EXPECT_EQ(params[1], argsId[1]);
-
- const MessageId kIdWrong = static_cast<const MessageId>(test_negative_value);
- const MessageName kNameWrong("TestInterface", "TestMessage");
- const MessageType kTypeWrong =
- static_cast<const MessageType>(test_negative_value);
- const ListArgs kExpListWrong;
- argsName = schema_->getListArgs(kNameWrong, kTypeWrong);
- EXPECT_EQ(kExpListWrong, argsName);
-
- argsId = schema_->getListArgs(kIdWrong, kTypeWrong);
- EXPECT_EQ(kExpListWrong, argsId);
-}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/formatters/include/formatters/CFormatterJsonBase.h b/src/components/formatters/include/formatters/CFormatterJsonBase.h
index 1df706839f..66ffa0c1c5 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonBase.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonBase.h
@@ -38,9 +38,9 @@
#include "smart_objects/smart_object.h"
#include "json/json.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
namespace meta_formatter_error_code {
/**
@@ -99,7 +99,7 @@ class CFormatterJsonBase {
*/
static void jsonValueToObj(
const Json::Value& value,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
/**
* @brief The method constructs a JSON object from the input SmartObject
@@ -109,11 +109,11 @@ class CFormatterJsonBase {
*input SmartObject.
*/
static void objToJsonValue(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
Json::Value& value);
};
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
index f22b1216ab..d2fdf87957 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
@@ -40,9 +40,9 @@
#include "formatters/CSmartFactory.h"
#include "formatters/meta_formatter.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Class is used to convert SmartObjects to JSON string and vice versa.
@@ -69,7 +69,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @brief Extracts a message type from the SmartObject
*/
static const std::string getMessageType(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj);
/**
* @brief Extracts a message type from the root JSON object.
@@ -117,7 +117,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
static const int32_t kMessageTypeNotFound;
static const int32_t kCorrelationIdNotFound;
- typedef NsSmartDeviceLink::NsJSONHandler::Formatters::
+ typedef ns_smart_device_link::ns_json_handler::formatters::
meta_formatter_error_code::tMetaFormatterErrorCode
tMetaFormatterErrorCode;
@@ -129,7 +129,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @return true if success, false otherwise
*/
static bool toString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& outStr);
/**
@@ -142,7 +142,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
template <typename FunctionId, typename MessageType>
static int32_t fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out);
+ ns_smart_device_link::ns_smart_objects::SmartObject& out);
/**
* @brief Converts to string the smart object against the given schema
@@ -154,17 +154,17 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
std::string& outStr);
};
// ----------------------------------------------------------------------------
template <typename FunctionId, typename MessageType>
-int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
+int32_t formatters::CFormatterJsonSDLRPCv1::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
try {
@@ -189,7 +189,7 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
MessageType messageType = MessageType::INVALID_ENUM;
if (kSuccess == result) {
- if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<MessageType>::StringToEnum(
type, &messageType)) {
// If MessageType is not found than FunctionId and CorrelationId can not
// be found either
@@ -199,14 +199,14 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
}
if (kSuccess == result) {
- if (!NsSmartObjects::EnumConversionHelper<FunctionId>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<FunctionId>::StringToEnum(
root[type][S_NAME].asString(), &functionId)) {
result = kFunctionIdNotFound;
functionId = FunctionId::INVALID_ENUM;
}
}
- namespace S = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace S = ns_smart_device_link::ns_json_handler::strings;
if (!(result & kMessageTypeNotFound)) {
jsonValueToObj(root[type][S_PARAMETERS], out[S::S_MSG_PARAMS]);
@@ -234,6 +234,6 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
}
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
index 8260a35959..e248954552 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
@@ -38,9 +38,9 @@
#include "CFormatterJsonBase.h"
#include "formatters/CSmartFactory.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Class is used to convert SmartObjects to JSON string and vice versa.
@@ -64,7 +64,7 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
CFormatterJsonSDLRPCv2(const CFormatterJsonSDLRPCv2&);
public:
- typedef NsSmartDeviceLink::NsJSONHandler::Formatters::
+ typedef ns_smart_device_link::ns_json_handler::formatters::
meta_formatter_error_code::tMetaFormatterErrorCode
tMetaFormatterErrorCode;
@@ -76,7 +76,7 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, false otherwise
*/
static bool toString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& outStr);
/**
@@ -91,10 +91,11 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, otherwise - false
*/
template <typename FunctionId, typename MessageType>
- static bool fromString(const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
- FunctionId functionId,
- MessageType messageType);
+ static bool fromString(
+ const std::string& str,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
+ FunctionId functionId,
+ MessageType messageType);
/**
* @brief Creates a SmartObject from a JSON string.
@@ -113,11 +114,12 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, otherwise - false
*/
template <typename FunctionId, typename MessageType>
- static bool fromString(const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
- FunctionId functionId,
- MessageType messageType,
- int32_t correlationId);
+ static bool fromString(
+ const std::string& str,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
+ FunctionId functionId,
+ MessageType messageType,
+ int32_t correlationId);
/**
* @brief Converts to string the smart object against the given schema
@@ -129,15 +131,15 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
std::string& outStr);
};
template <typename FunctionId, typename MessageType>
inline bool CFormatterJsonSDLRPCv2::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
FunctionId functionId,
MessageType messageType) {
bool result = true;
@@ -146,7 +148,7 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
Json::Value root;
Json::Reader reader;
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
bool result = reader.parse(str, root);
if (true == result) {
@@ -167,12 +169,12 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
template <typename FunctionId, typename MessageType>
inline bool CFormatterJsonSDLRPCv2::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
FunctionId functionId,
MessageType messageType,
int32_t correlationId) {
bool result = fromString(str, out, functionId, messageType);
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
if (true == result) {
out[strings::S_PARAMS][strings::S_CORRELATION_ID] = correlationId;
@@ -182,6 +184,6 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
}
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_
diff --git a/src/components/formatters/include/formatters/CSmartFactory.h b/src/components/formatters/include/formatters/CSmartFactory.h
index 9fed89253b..a48eab2a6b 100644
--- a/src/components/formatters/include/formatters/CSmartFactory.h
+++ b/src/components/formatters/include/formatters/CSmartFactory.h
@@ -40,8 +40,8 @@
#include <map>
#include <string>
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
/**
* @brief String constants used by SmartFactory.
*/
@@ -82,6 +82,10 @@ extern const std::string S_PROTOCOL_TYPE;
extern const std::string S_CORRELATION_ID;
/**
+ * @brief String constant for RPC_MSG_VERSION.
+ */
+extern const std::string S_RPC_MSG_VERSION;
+/**
* @brief String constant for "code" param name.
*/
extern const std::string kCode;
@@ -149,8 +153,10 @@ class CSmartFactory {
*
* @return True if operation was successful or false otherwise.
*/
- bool attachSchema(NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const bool RemoveFakeParameters);
+ bool attachSchema(
+ ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Attach schema to the struct SmartObject.
@@ -160,8 +166,9 @@ class CSmartFactory {
*
* @return True if operation was successful of false otherwise.
*/
- bool AttachSchema(const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object);
+ bool AttachSchema(
+ const StructIdEnum struct_id,
+ ns_smart_device_link::ns_smart_objects::SmartObject& object);
/**
* @brief Create new SmartObject with attached function SmartSchema.
@@ -176,7 +183,7 @@ class CSmartFactory {
* SmartObject) function returns empty SmartObject with
* null type.
*/
- NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartObject CreateSmartObject(
const FunctionIdEnum function_id, const MessageTypeEnum message_type);
/**
@@ -191,7 +198,7 @@ class CSmartFactory {
* SmartObject) function returns empty SmartObject with
* null type.
*/
- NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartObject CreateSmartObject(
const StructIdEnum struct_id);
/**
@@ -210,7 +217,7 @@ class CSmartFactory {
*/
bool GetSchema(const FunctionIdEnum function_id,
const MessageTypeEnum message_type,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result);
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result);
/**
* @brief Get SmartSchema for specific struct.
@@ -227,7 +234,7 @@ class CSmartFactory {
* found or false otherwise.
*/
bool GetSchema(const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result);
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result);
protected:
/**
@@ -237,7 +244,7 @@ class CSmartFactory {
* functions.
*/
typedef std::map<SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ ns_smart_device_link::ns_smart_objects::CSmartSchema>
FuncionsSchemesMap;
/**
@@ -247,7 +254,7 @@ class CSmartFactory {
* structs.
*/
typedef std::map<StructIdEnum,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ ns_smart_device_link::ns_smart_objects::CSmartSchema>
StructsSchemesMap;
/**
@@ -268,8 +275,9 @@ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CSmartFactory(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const bool RemoveFakeParameters) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (false == object.keyExists(strings::S_PARAMS))
return false;
if (false == object[strings::S_PARAMS].keyExists(strings::S_MESSAGE_TYPE))
@@ -295,7 +303,9 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
}
object.setSchema(schemaIterator->second);
- schemaIterator->second.applySchema(object, RemoveFakeParameters);
+
+ schemaIterator->second.applySchema(
+ object, RemoveFakeParameters, MessageVersion);
return true;
}
@@ -303,7 +313,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::AttachSchema(
const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& object) {
typename StructsSchemesMap::iterator structs_iterator =
structs_schemes_.find(struct_id);
@@ -318,7 +328,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::AttachSchema(
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
-NsSmartDeviceLink::NsSmartObjects::SmartObject
+ns_smart_device_link::ns_smart_objects::SmartObject
CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
const FunctionIdEnum function_id, const MessageTypeEnum message_type) {
SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(function_id,
@@ -328,34 +338,34 @@ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
functions_schemes_.find(key);
if (schema_iterator != functions_schemes_.end()) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject function_object(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ ns_smart_device_link::ns_smart_objects::SmartObject function_object(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
function_object.setSchema(schema_iterator->second);
schema_iterator->second.applySchema(function_object, false);
return function_object;
}
- return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ return ns_smart_device_link::ns_smart_objects::SmartObject();
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
-NsSmartDeviceLink::NsSmartObjects::SmartObject
+ns_smart_device_link::ns_smart_objects::SmartObject
CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
const StructIdEnum struct_id) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject struct_object(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ ns_smart_device_link::ns_smart_objects::SmartObject struct_object(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
if (AttachSchema(struct_id, struct_object)) {
return struct_object;
}
- return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ return ns_smart_device_link::ns_smart_objects::SmartObject();
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
const FunctionIdEnum function_id,
const MessageTypeEnum message_type,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result) {
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result) {
SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(function_id,
message_type);
@@ -373,7 +383,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result) {
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result) {
typename StructsSchemesMap::iterator structs_iterator =
structs_schemes_.find(struct_id);
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
index 3d921ea901..842e176976 100644
--- a/src/components/formatters/include/formatters/formatter_json_rpc.h
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.h
@@ -45,9 +45,9 @@
#include "CFormatterJsonBase.h"
#include "formatters/CSmartFactory.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Formatter for JSON RPC format.
@@ -108,7 +108,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*
* @return true if success, false otherwise.
*/
- static bool ToString(const NsSmartObjects::SmartObject& obj,
+ static bool ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str);
/**
@@ -125,7 +125,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*/
template <typename FunctionId, typename MessageType>
static int32_t FromString(const std::string& str,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
private:
/**
@@ -223,7 +223,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*/
template <typename FunctionId>
static int32_t ParseFunctionId(const Json::Value& method_value,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
/**
* @brief Set method.
@@ -237,7 +237,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if function id was extracted successfully and set as a
* value of "method" field.
*/
- static bool SetMethod(const NsSmartObjects::SmartObject& params,
+ static bool SetMethod(const ns_smart_objects::SmartObject& params,
Json::Value& method_container);
/**
@@ -252,7 +252,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if request/response id was extracted successfully and set
* as a value of "id" field.
*/
- static bool SetId(const NsSmartObjects::SmartObject& params,
+ static bool SetId(const ns_smart_objects::SmartObject& params,
Json::Value& id_container);
/**
@@ -267,18 +267,18 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if message string was extracted successfully and set
* as a value of "message" field.
*/
- static bool SetMessage(const NsSmartObjects::SmartObject& params,
+ static bool SetMessage(const ns_smart_objects::SmartObject& params,
Json::Value& id_container);
};
template <typename FunctionId, typename MessageType>
int32_t FormatterJsonRpc::FromString(const std::string& str,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
try {
Json::Value root;
Json::Reader reader;
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
if (false == reader.parse(str, root)) {
result = kParsingError | kMethodNotSpecified | kUnknownMethod |
@@ -309,7 +309,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
result |= ParseFunctionId<FunctionId>(root[kMethod], out);
}
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
} else {
const Json::Value& id_value = root[kId];
@@ -323,7 +323,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
id_value.asDouble();
} else if (true == id_value.isNull()) {
out[strings::S_PARAMS][strings::S_CORRELATION_ID] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Null);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Null);
} else {
result |= kInvalidFormat | kInvalidId;
}
@@ -332,14 +332,14 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
message_type_string = kRequest;
result |= ParseFunctionId<FunctionId>(root[kMethod], out);
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
} else {
Json::Value method_container;
bool method_container_found = false;
if (true == root.isMember(kResult)) {
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
message_type_string = kResponse;
response_value = root[kResult];
@@ -348,7 +348,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
method_container_found = true;
} else if (true == root.isMember(kError)) {
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
message_type_string = kErrorResponse;
response_value = root[kError];
response_value_found = true;
@@ -382,7 +382,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
if (0 == (result & kUnknownMessageType)) {
MessageType message_type;
- if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<MessageType>::StringToEnum(
message_type_string, &message_type)) {
result |= kUnknownMessageType;
} else {
@@ -469,7 +469,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
template <typename FunctionId>
int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
if (false == method_value.isString()) {
@@ -477,11 +477,11 @@ int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
} else {
FunctionId function_id;
- if (!NsSmartObjects::EnumConversionHelper<FunctionId>::CStringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<FunctionId>::CStringToEnum(
method_value.asCString(), &function_id)) {
result |= kUnknownMethod;
} else {
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
out[strings::S_PARAMS][strings::S_FUNCTION_ID] = function_id;
}
@@ -490,8 +490,8 @@ int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
diff --git a/src/components/formatters/include/formatters/generic_json_formatter.h b/src/components/formatters/include/formatters/generic_json_formatter.h
index 2b5d95fd4a..c9b9431ee5 100644
--- a/src/components/formatters/include/formatters/generic_json_formatter.h
+++ b/src/components/formatters/include/formatters/generic_json_formatter.h
@@ -37,9 +37,9 @@
#include "CFormatterJsonBase.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
class GenericJsonFormatter : public CFormatterJsonBase {
public:
@@ -49,7 +49,7 @@ class GenericJsonFormatter : public CFormatterJsonBase {
* @param obj Input SmartObject.
* @param out_str Resulting JSON string.
*/
- static void ToString(const NsSmartObjects::SmartObject& obj,
+ static void ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str);
/**
@@ -61,11 +61,11 @@ class GenericJsonFormatter : public CFormatterJsonBase {
* @return true if success, false otherwise.
*/
static bool FromString(const std::string& str,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
};
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h
index 20abb3b848..36e39301f6 100644
--- a/src/components/formatters/include/formatters/meta_formatter.h
+++ b/src/components/formatters/include/formatters/meta_formatter.h
@@ -39,9 +39,9 @@
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Formats to string the smart object against given schema for given
@@ -66,13 +66,13 @@ class CMetaFormatter {
* @return true if successful, false - otherwise
*/
static bool CreateObjectByPattern(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
+ ns_smart_device_link::ns_smart_objects::SmartObject& result_object);
};
-} // namespace NsSmartDeviceLink
-} // namespace NsSmartDeviceLink::NsJSONHandler
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link
+} // namespace ns_smart_device_link::ns_json_handler
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_
diff --git a/src/components/formatters/src/CFormatterJsonBase.cc b/src/components/formatters/src/CFormatterJsonBase.cc
index 0a85a93d21..af8668543a 100644
--- a/src/components/formatters/src/CFormatterJsonBase.cc
+++ b/src/components/formatters/src/CFormatterJsonBase.cc
@@ -35,13 +35,13 @@
#include "formatters/CFormatterJsonBase.h"
#include "utils/convert_utils.h"
-void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
+void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
jsonValueToObj(const Json::Value& value,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj) {
try {
if (value.type() == Json::objectValue) {
- obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ obj = ns_smart_device_link::ns_smart_objects::SmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
Json::Value::Members members = value.getMemberNames();
@@ -49,8 +49,8 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
jsonValueToObj(value[members[i]], obj[members[i]]);
}
} else if (value.type() == Json::arrayValue) {
- obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Array);
+ obj = ns_smart_device_link::ns_smart_objects::SmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartType_Array);
for (uint32_t i = 0; i < value.size(); i++) {
jsonValueToObj(value[i], obj[i]);
@@ -72,11 +72,13 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
// ----------------------------------------------------------------------------
-void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
- objToJsonValue(const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
- Json::Value& item) {
+void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
+ objToJsonValue(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
+ Json::Value& item) {
try {
- if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == obj.getType()) {
+ if (ns_smart_device_link::ns_smart_objects::SmartType_Array ==
+ obj.getType()) {
item = Json::arrayValue;
for (uint32_t i = 0; i < obj.length(); i++) {
@@ -86,7 +88,7 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
item.append(value);
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Map ==
obj.getType()) {
item = Json::objectValue;
std::set<std::string> keys = obj.enumerate();
@@ -100,19 +102,19 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
item[*key] = value;
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Boolean ==
obj.getType()) {
item = obj.asBool();
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Integer ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Integer ==
obj.getType()) {
item = utils::ConvertInt64ToLongLongInt(obj.asInt());
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_UInteger ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_UInteger ==
obj.getType()) {
item = utils::ConvertUInt64ToLongLongUInt(obj.asUInt());
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Double ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Double ==
obj.getType()) {
item = obj.asDouble();
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Null ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Null ==
obj.getType()) {
item = Json::nullValue;
} else {
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
index b776b9abd8..121fd43131 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
@@ -34,12 +34,12 @@
#include "formatters/meta_formatter.h"
#include "utils/convert_utils.h"
-namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+namespace strings = ns_smart_device_link::ns_json_handler::strings;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
// ----------------------------------------------------------------------------
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
index 9e177ea4a8..ffbb644cc6 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
@@ -31,12 +31,12 @@
#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/meta_formatter.h"
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
-namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
+namespace strings = ns_smart_device_link::ns_json_handler::strings;
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
// ----------------------------------------------------------------------------
diff --git a/src/components/formatters/src/CSmartFactory.cc b/src/components/formatters/src/CSmartFactory.cc
index 6b0808fbfa..c1ee9133ca 100644
--- a/src/components/formatters/src/CSmartFactory.cc
+++ b/src/components/formatters/src/CSmartFactory.cc
@@ -34,19 +34,27 @@
#include "formatters/CSmartFactory.h"
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS(
+const std::string ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS(
"msg_params");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS("params");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID(
+const std::string ns_smart_device_link::ns_json_handler::strings::S_PARAMS(
+ "params");
+const std::string ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID(
"function_id");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE(
- "message_type");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION(
- "protocol_version");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE(
- "protocol_type");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID(
- "correlation_id");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::kCode("code");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::kMessage(
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE(
+ "message_type");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION(
+ "protocol_version");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE(
+ "protocol_type");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID(
+ "correlation_id");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_RPC_MSG_VERSION(
+ "rpc_msg_version");
+const std::string ns_smart_device_link::ns_json_handler::strings::kCode("code");
+const std::string ns_smart_device_link::ns_json_handler::strings::kMessage(
"message");
diff --git a/src/components/formatters/src/formatter_json_rpc.cc b/src/components/formatters/src/formatter_json_rpc.cc
index e349ced4d6..d50d04d0e9 100644
--- a/src/components/formatters/src/formatter_json_rpc.cc
+++ b/src/components/formatters/src/formatter_json_rpc.cc
@@ -35,11 +35,11 @@
#include "formatters/formatter_json_rpc.h"
#include "utils/convert_utils.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
-namespace strings = NsJSONHandler::strings;
+namespace strings = ns_json_handler::strings;
const char* FormatterJsonRpc::kRequest = "request";
const char* FormatterJsonRpc::kResponse = "response";
@@ -56,7 +56,7 @@ const char* FormatterJsonRpc::kCode = "code";
const char* FormatterJsonRpc::kData = "data";
const char* FormatterJsonRpc::kMessage = "message";
-bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
+bool FormatterJsonRpc::ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str) {
bool result = true;
try {
@@ -64,17 +64,17 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
root[kJsonRpc] = kJsonRpcExpectedValue;
- NsSmartObjects::SmartObject formatted_object(obj);
+ ns_smart_objects::SmartObject formatted_object(obj);
Json::Value msg_params_json(Json::objectValue);
formatted_object.getSchema().unapplySchema(formatted_object);
bool is_message_params = formatted_object.keyExists(strings::S_MSG_PARAMS);
bool empty_message_params = true;
if (true == is_message_params) {
- const NsSmartObjects::SmartObject& msg_params =
+ const ns_smart_objects::SmartObject& msg_params =
formatted_object.getElement(strings::S_MSG_PARAMS);
- result = (NsSmartObjects::SmartType_Map == msg_params.getType());
+ result = (ns_smart_objects::SmartType_Map == msg_params.getType());
if (true == result) {
objToJsonValue(msg_params, msg_params_json);
}
@@ -86,15 +86,16 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
if (false == formatted_object.keyExists(strings::S_PARAMS)) {
result = false;
} else {
- const NsSmartObjects::SmartObject& params =
+ const ns_smart_objects::SmartObject& params =
formatted_object.getElement(strings::S_PARAMS);
- if (NsSmartObjects::SmartType_Map != params.getType()) {
+ if (ns_smart_objects::SmartType_Map != params.getType()) {
result = false;
} else {
- const NsSmartObjects::SmartObject& message_type_object =
+ const ns_smart_objects::SmartObject& message_type_object =
params.getElement(strings::S_MESSAGE_TYPE);
- if (NsSmartObjects::SmartType_String != message_type_object.getType()) {
+ if (ns_smart_objects::SmartType_String !=
+ message_type_object.getType()) {
result = false;
} else {
const std::string message_type = message_type_object.asString();
@@ -113,10 +114,10 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
if (false == params.keyExists(strings::kCode)) {
result = false;
} else {
- const NsSmartObjects::SmartObject& code =
+ const ns_smart_objects::SmartObject& code =
params.getElement(strings::kCode);
- if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ if (ns_smart_objects::SmartType_Integer != code.getType()) {
result = false;
} else {
root[kResult][kCode] =
@@ -131,9 +132,9 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
result = result && SetMethod(params, root[kError][kData]);
result = result && SetMessage(params, root[kError]);
- const NsSmartObjects::SmartObject& code =
+ const ns_smart_objects::SmartObject& code =
params.getElement(strings::kCode);
- if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ if (ns_smart_objects::SmartType_Integer != code.getType()) {
result = false;
} else {
root[kError][kCode] =
@@ -151,15 +152,15 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
return result;
}
-bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetMethod(const ns_smart_objects::SmartObject& params,
Json::Value& method_container) {
bool result = false;
if (true == params.keyExists(strings::S_FUNCTION_ID)) {
- const NsSmartObjects::SmartObject& function_id =
+ const ns_smart_objects::SmartObject& function_id =
params.getElement(strings::S_FUNCTION_ID);
- if (NsSmartObjects::SmartType_String == function_id.getType()) {
+ if (ns_smart_objects::SmartType_String == function_id.getType()) {
method_container[kMethod] = function_id.asString();
result = true;
}
@@ -168,15 +169,15 @@ bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params,
return result;
}
-bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetId(const ns_smart_objects::SmartObject& params,
Json::Value& id_container) {
bool result = false;
if (true == params.keyExists(strings::S_CORRELATION_ID)) {
- const NsSmartObjects::SmartObject& id =
+ const ns_smart_objects::SmartObject& id =
params.getElement(strings::S_CORRELATION_ID);
- if (NsSmartObjects::SmartType_Integer == id.getType()) {
+ if (ns_smart_objects::SmartType_Integer == id.getType()) {
id_container[kId] = utils::ConvertUInt64ToLongLongUInt(id.asUInt());
result = true;
}
@@ -185,15 +186,15 @@ bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params,
return result;
}
-bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetMessage(const ns_smart_objects::SmartObject& params,
Json::Value& message_container) {
bool result = false;
if (true == params.keyExists(strings::kMessage)) {
- const NsSmartObjects::SmartObject& message =
+ const ns_smart_objects::SmartObject& message =
params.getElement(strings::kMessage);
- if (NsSmartObjects::SmartType_String == message.getType()) {
+ if (ns_smart_objects::SmartType_String == message.getType()) {
message_container[kMessage] = message.asString();
result = true;
}
@@ -202,6 +203,6 @@ bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject& params,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/generic_json_formatter.cc b/src/components/formatters/src/generic_json_formatter.cc
index 7789a915c2..07b03484d2 100644
--- a/src/components/formatters/src/generic_json_formatter.cc
+++ b/src/components/formatters/src/generic_json_formatter.cc
@@ -34,11 +34,11 @@
#include "formatters/generic_json_formatter.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
-void GenericJsonFormatter::ToString(const NsSmartObjects::SmartObject& obj,
+void GenericJsonFormatter::ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str) {
Json::Value json_root;
objToJsonValue(obj, json_root);
@@ -46,7 +46,7 @@ void GenericJsonFormatter::ToString(const NsSmartObjects::SmartObject& obj,
}
bool GenericJsonFormatter::FromString(const std::string& str,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
Json::Value json_root;
Json::Reader reader;
bool result = reader.parse(str, json_root);
@@ -58,6 +58,6 @@ bool GenericJsonFormatter::FromString(const std::string& str,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/meta_formatter.cc b/src/components/formatters/src/meta_formatter.cc
index fafb84e938..82dd611498 100644
--- a/src/components/formatters/src/meta_formatter.cc
+++ b/src/components/formatters/src/meta_formatter.cc
@@ -38,15 +38,15 @@
#include "formatters/meta_formatter.h"
-namespace formatter_ns = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+namespace formatter_ns = ns_smart_device_link::ns_json_handler::formatters;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
//---------------------------------------------------------------
bool formatter_ns::CMetaFormatter::CreateObjectByPattern(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
+ ns_smart_device_link::ns_smart_objects::SmartObject& result_object) {
if (smart_objects_ns::SmartType_Invalid == result_object.getType()) {
return false;
}
diff --git a/src/components/formatters/test/CFormatterJsonBase_test.cc b/src/components/formatters/test/CFormatterJsonBase_test.cc
index ff1f60b8df..1cd9c55bbc 100644
--- a/src/components/formatters/test/CFormatterJsonBase_test.cc
+++ b/src/components/formatters/test/CFormatterJsonBase_test.cc
@@ -42,8 +42,8 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
TEST(CFormatterJsonBaseTest, JSonStringValueToSmartObj_ExpectSuccessful) {
// Arrange value
diff --git a/src/components/formatters/test/CSmartFactory_test.cc b/src/components/formatters/test/CSmartFactory_test.cc
index 3713d076e2..3aba109e58 100644
--- a/src/components/formatters/test/CSmartFactory_test.cc
+++ b/src/components/formatters/test/CSmartFactory_test.cc
@@ -68,7 +68,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -82,7 +82,7 @@ TEST(CSmartFactoryTest,
EXPECT_FALSE(SmartType::SmartType_Map == obj.getType());
EXPECT_TRUE(SmartType::SmartType_Null == obj.getType());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -104,7 +104,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -127,7 +127,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OUT_OF_RANGE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OUT_OF_RANGE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -150,7 +150,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -174,7 +174,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -198,7 +198,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -236,7 +236,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -253,7 +253,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -270,7 +270,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(1u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -287,7 +287,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -304,12 +304,12 @@ TEST(CSmartFactoryTest,
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -328,13 +328,13 @@ TEST(
obj["image"]["position"] = 100;
// Check object "image"
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -352,13 +352,13 @@ TEST(
obj["image"]["position"] = 100;
// Check object "image"
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
// Check global object
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -377,13 +377,13 @@ TEST(
obj["image"]["position"] = 100;
// Check object "image"
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -402,7 +402,7 @@ TEST(
EXPECT_EQ(2u, keys.size());
// Check global object
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -422,7 +422,7 @@ TEST(
EXPECT_EQ(3u, keys.size());
// Check global object
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
index a4d40b4478..fe9d2ec0e1 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
@@ -43,7 +43,7 @@ TEST(CFormatterJsonSDLRPCv1Test, EmptySmartObjectToString) {
SmartObject srcObj;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -74,7 +74,7 @@ TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER,
srcObj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
@@ -108,7 +108,7 @@ TEST(CFormatterJsonSDLRPCv1Test,
srcObj[S_MSG_PARAMS][""] = "";
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -341,7 +341,7 @@ TEST(CFormatterJsonSDLRPCv1Test, StringRequestToSmObj) {
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
@@ -487,7 +487,7 @@ TEST(CFormatterJsonSDLRPCv1Test, StringNotificationToSmartObject) {
inputJsonString, obj);
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
index c7e6f61674..628e9956bb 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
@@ -42,7 +42,7 @@ TEST(CFormatterJsonSDLRPCv2Test, EmptySmartObjectToString) {
SmartObject srcObj;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -67,7 +67,7 @@ TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER,
srcObj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
@@ -94,7 +94,7 @@ TEST(CFormatterJsonSDLRPCv2Test,
srcObj[S_MSG_PARAMS][""] = "";
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -270,7 +270,7 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithoutCorIdToSmObj) {
EXPECT_EQ(true, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
@@ -317,7 +317,7 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithCorIdToSmObj) {
EXPECT_EQ(true, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
@@ -384,7 +384,7 @@ TEST(CFormatterJsonSDLRPCv2Test, StringNotificationToSmartObject) {
corId);
EXPECT_EQ(true, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc
index e882bed618..f397accbd4 100644
--- a/src/components/formatters/test/formatter_json_rpc_test.cc
+++ b/src/components/formatters/test/formatter_json_rpc_test.cc
@@ -49,9 +49,9 @@ namespace test {
namespace components {
namespace formatters_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_json_handler::strings;
void CompactJson(std::string& str) {
Json::Value root;
@@ -150,7 +150,7 @@ TEST(FormatterJsonRPCTest, UpperBoundValuesInSystemRequest_ToString_Success) {
hmi_apis::HMI_API factory;
EXPECT_TRUE(factory.attachSchema(obj, false));
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, obj.validate(&report));
+ EXPECT_EQ(errors::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string result;
// Convert SmartObject to Json string
diff --git a/src/components/formatters/test/generic_json_formatter_test.cc b/src/components/formatters/test/generic_json_formatter_test.cc
index 41ecfd9ee3..97840eb110 100644
--- a/src/components/formatters/test/generic_json_formatter_test.cc
+++ b/src/components/formatters/test/generic_json_formatter_test.cc
@@ -38,8 +38,8 @@ namespace components {
namespace formatters {
TEST(GenericJsonFormatter, ToString) {
- namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
- namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+ namespace smartobj = ns_smart_device_link::ns_smart_objects;
+ namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
smartobj::SmartObject obj;
std::string result;
@@ -93,8 +93,8 @@ TEST(GenericJsonFormatter, ToString) {
}
TEST(GenericJsonFormatter, FromString) {
- namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
- namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+ namespace smartobj = ns_smart_device_link::ns_smart_objects;
+ namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
smartobj::SmartObject result;
diff --git a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
index 8f5ee96ce5..4b1ca94b98 100644
--- a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
+++ b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
@@ -52,9 +52,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler;
+using namespace ns_smart_device_link::ns_json_handler::strings;
using namespace hmi_apis;
namespace TestType {
@@ -107,9 +107,9 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
protected:
typedef std::map<const StructIdentifiersTest::eType,
- utils::SharedPtr<ISchemaItem> > TStructsSchemaItems;
+ std::shared_ptr<ISchemaItem> > TStructsSchemaItems;
- static utils::SharedPtr<ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static std::shared_ptr<ISchemaItem> ProvideObjectSchemaItemForStruct(
TStructsSchemaItems& struct_schema_items,
const StructIdentifiersTest::eType struct_id);
@@ -147,10 +147,10 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items);
- static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_1(
+ static std::shared_ptr<ISchemaItem> InitStructSchemaItem_Common_1(
TStructsSchemaItems& struct_schema_items);
- static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_2();
+ static std::shared_ptr<ISchemaItem> InitStructSchemaItem_Common_2();
};
} // namespace formatters
diff --git a/src/components/formatters/test/include/formatters/create_smartSchema.h b/src/components/formatters/test/include/formatters/create_smartSchema.h
index 4d7a217317..73ff9ba77b 100644
--- a/src/components/formatters/test/include/formatters/create_smartSchema.h
+++ b/src/components/formatters/test/include/formatters/create_smartSchema.h
@@ -40,9 +40,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace FunctionIDTest {
enum eType {
diff --git a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
index a58f69e386..0ee21d092c 100644
--- a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
+++ b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
@@ -51,24 +51,24 @@ class CMetaFormatterTestHelper : public ::testing::Test {
virtual void TearDown();
void AnyObjectToJsonString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& result_string);
void FillObjectIdenticalToSchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void FillObjectIdenticalToSchemaWithoutNoMandatoriesParams(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void CompareObjects(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& first,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& second);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& first,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& second);
void FillObjectWithDefaultValues(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void FillObjectWithoutSomeMandatoryFields(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
// Members
std::set<FunctionIDTest::eType> function_id_items_;
diff --git a/src/components/formatters/test/src/SmartFactoryTestHelper.cc b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
index 2dd76f85f8..d48f9f58a0 100644
--- a/src/components/formatters/test/src/SmartFactoryTestHelper.cc
+++ b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
@@ -148,7 +148,7 @@ CSmartFactoryTest::CSmartFactoryTest()
void CSmartFactoryTest::InitStructSchemes(
TStructsSchemaItems& struct_schema_items) {
- utils::SharedPtr<ISchemaItem> struct_schema_item_Common_1 =
+ std::shared_ptr<ISchemaItem> struct_schema_item_Common_1 =
InitStructSchemaItem_Common_1(struct_schema_items);
struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_1,
struct_schema_item_Common_1));
@@ -156,7 +156,7 @@ void CSmartFactoryTest::InitStructSchemes(
std::make_pair(StructIdentifiersTest::Common_1,
CSmartSchema(struct_schema_item_Common_1)));
- utils::SharedPtr<ISchemaItem> struct_schema_item_Common_2 =
+ std::shared_ptr<ISchemaItem> struct_schema_item_Common_2 =
InitStructSchemaItem_Common_2();
struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_2,
struct_schema_item_Common_2));
@@ -187,7 +187,7 @@ void CSmartFactoryTest::InitFunctionSchemes(
CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
CObjectSchemaItem::Members root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members),
true);
@@ -269,7 +269,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function1_response(
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items) {
// Function parameter available.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -333,7 +333,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function2_response(
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items) {
// Function parameter available.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -399,7 +399,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response(
// Function parameter available.
//
// Must be true if VR is present and ready to communicate with SDL.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -431,12 +431,12 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response(
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
-utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
+std::shared_ptr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
TStructsSchemaItems& struct_schema_items) {
// Struct member text.
//
// Text to display
- utils::SharedPtr<ISchemaItem> text_SchemaItem =
+ std::shared_ptr<ISchemaItem> text_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
TSchemaItemParameter<size_t>(500),
TSchemaItemParameter<std::string>());
@@ -444,14 +444,14 @@ utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
// Struct member image.
//
// Image struct
- utils::SharedPtr<ISchemaItem> image_SchemaItem =
+ std::shared_ptr<ISchemaItem> image_SchemaItem =
ProvideObjectSchemaItemForStruct(struct_schema_items,
StructIdentifiersTest::Common_2);
// Struct member position.
//
// Position to display item
- utils::SharedPtr<ISchemaItem> position_SchemaItem =
+ std::shared_ptr<ISchemaItem> position_SchemaItem =
TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
TSchemaItemParameter<int32_t>(500),
TSchemaItemParameter<int32_t>());
@@ -472,19 +472,19 @@ utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
return CObjectSchemaItem::create(schema_members);
}
-utils::SharedPtr<ISchemaItem>
+std::shared_ptr<ISchemaItem>
CSmartFactoryTest::InitStructSchemaItem_Common_2() {
// Struct member text.
//
// Text to display
- utils::SharedPtr<ISchemaItem> text_SchemaItem =
+ std::shared_ptr<ISchemaItem> text_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
TSchemaItemParameter<size_t>(500),
TSchemaItemParameter<std::string>());
// Struct member position.
//
// Position to display item
- utils::SharedPtr<ISchemaItem> position_SchemaItem =
+ std::shared_ptr<ISchemaItem> position_SchemaItem =
TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
TSchemaItemParameter<int32_t>(500),
TSchemaItemParameter<int32_t>());
@@ -497,7 +497,7 @@ CSmartFactoryTest::InitStructSchemaItem_Common_2() {
return CObjectSchemaItem::create(schema_members);
}
-utils::SharedPtr<ISchemaItem>
+std::shared_ptr<ISchemaItem>
CSmartFactoryTest::ProvideObjectSchemaItemForStruct(
TStructsSchemaItems& struct_schema_items,
const StructIdentifiersTest::eType struct_id) {
@@ -506,5 +506,6 @@ CSmartFactoryTest::ProvideObjectSchemaItemForStruct(
if (it != struct_schema_items.end()) {
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::
+ create();
}
diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc
index 1497fbf281..3602fc3de7 100644
--- a/src/components/formatters/test/src/create_smartSchema.cc
+++ b/src/components/formatters/test/src/create_smartSchema.cc
@@ -35,9 +35,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
template <>
const EnumConversionHelper<FunctionIDTest::eType>::EnumToCStringMap
diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc
index 897c8d364d..b322510f6c 100644
--- a/src/components/formatters/test/src/meta_formatter_test_helper.cc
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -36,8 +36,8 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
void CMetaFormatterTestHelper::SetUp() {
function_id_items_.insert(FunctionIDTest::RegisterAppInterface);
diff --git a/src/components/functional_module/CMakeLists.txt b/src/components/functional_module/CMakeLists.txt
deleted file mode 100644
index 07db91fc38..0000000000
--- a/src/components/functional_module/CMakeLists.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-if (ENABLE_GCOV)
- set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs")
-else()
- set(GCOV_FLAGS "")
-endif()
-
-set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wno-deprecated-declarations -Wall -Werror ${GCOV_FLAGS}")
-
-if (CMAKE_BUILD_TYPE)
- if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
- set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
- set(CMAKE_CXX_FLAGS_DEBUG "")
- else ()
- set(CMAKE_CXX_FLAGS_RELEASE "")
- set(CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG")
- endif()
-endif()
-
-set(GCOV gcov)
-
-include_directories (
- ${COMPONENTS_DIR}/functional_module/include/
- ${COMPONENTS_DIR}/remote_control/include/
- ${COMPONENTS_DIR}/include/
- ${COMPONENTS_DIR}/application_manager/include
- ${COMPONENTS_DIR}/connection_handler/include/
- ${COMPONENTS_DIR}/utils/include
- ${POLICY_PATH}/include/
- ${POLICY_GLOBAL_INCLUDE_PATH}/
- ${COMPONENTS_DIR}/config_profile/include
- ${COMPONENTS_DIR}/smart_objects/include
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${CMAKE_BINARY_DIR}/src/components/
-
- ${COMPONENTS_DIR}/application_manager/test/include/
-)
-
-set (SOURCES
- ./src/generic_module.cc
- ./src/plugin_manager.cc
- ./src/timer/timer_director.cc
-)
-set (LIBRARIES
- ApplicationManager
- jsoncpp
-)
-
-add_library("FunctionalModule" ${SOURCES})
-target_link_libraries("FunctionalModule" ${LIBRARIES} )
-
-if(ENABLE_LOG)
- target_link_libraries("FunctionalModule" log4cxx -L${LOG4CXX_LIBS_DIRECTORY} ${GCOV})
-endif()
-
-if(BUILD_TESTS)
- add_subdirectory(test)
-endif()
diff --git a/src/components/functional_module/include/functional_module/function_ids.h b/src/components/functional_module/include/functional_module/function_ids.h
deleted file mode 100644
index 1a504df6c9..0000000000
--- a/src/components/functional_module/include/functional_module/function_ids.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace functional_modules {
-
-enum RCFunctionID {
- // Remote SDL functions ids
- BUTTON_PRESS = mobile_apis::FunctionID::ButtonPressID,
- GET_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::GetInteriorVehicleDataID,
- SET_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::SetInteriorVehicleDataID,
- ON_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::OnInteriorVehicleDataID,
- ON_REMOTE_CONTROL_SETTINGS = hmi_apis::FunctionID::RC_OnRemoteControlSettings,
-};
-
-namespace hmi_api {
-const char get_interior_vehicle_data[] = "RC.GetInteriorVehicleData";
-const char set_interior_vehicle_data[] = "RC.SetInteriorVehicleData";
-const char on_interior_vehicle_data[] = "RC.OnInteriorVehicleData";
-const char button_press[] = "Buttons.ButtonPress";
-const char on_remote_control_settings[] = "RC.OnRemoteControlSettings";
-
-const char get_user_consent[] = "RC.GetInteriorVehicleDataConsent";
-const char on_app_deactivated[] = "BasicCommunication.OnAppDeactivated";
-const char sdl_activate_app[] = "SDL.ActivateApp";
-}
-
-} // namespace functional_modules
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
diff --git a/src/components/functional_module/include/functional_module/generic_module.h b/src/components/functional_module/include/functional_module/generic_module.h
deleted file mode 100644
index 15d572be6d..0000000000
--- a/src/components/functional_module/include/functional_module/generic_module.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
-
-#include <deque>
-#include <string>
-#include "functional_module/module_observer.h"
-#include "functional_module/function_ids.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/service.h"
-
-namespace functional_modules {
-
-/**
- * @brief The PolicyEvent enum defines events related to policy
- */
-enum PolicyEvent { kApplicationPolicyUpdated = 0, kApplicationsDisabled };
-
-/**
- * @brief The ApplicationEvent enum defines events related to single application
- */
-enum ApplicationEvent { kApplicationExit = 0, kApplicationUnregistered };
-
-enum ProcessResult {
- NONE = -1,
- PROCESSED,
- PARTIALLY_PROCESSED,
- CANNOT_PROCESS,
- FAILED
-};
-
-enum ServiceState { IDLE = 0, SUSPENDED, LOWVOLTAGE, HMI_ADAPTER_INITIALIZED };
-
-typedef std::string HMIFunctionID;
-
-class GenericModule;
-typedef utils::SharedPtr<GenericModule> ModulePtr;
-
-struct PluginInfo {
- std::string name;
- int version;
- std::deque<RCFunctionID> rc_function_list;
- std::deque<HMIFunctionID> hmi_function_list;
-};
-
-class GenericModule {
- public:
- typedef std::deque<ModuleObserver*> Observers;
-
- virtual ~GenericModule();
- ModuleID GetModuleID() const {
- return kModuleId_;
- }
- virtual PluginInfo GetPluginInfo() const = 0;
-
- /**
- * @brief Setter for service (interface for plugin t access SDL functionality)
- * @param service pointer to new service instance
- */
- virtual void set_service(application_manager::ServicePtr service);
-
- /**
- * @brief Returns pointer to SDL core service interface
- * @return pointer to core service interface
- */
- virtual application_manager::ServicePtr service();
-
- virtual ProcessResult ProcessMessage(application_manager::MessagePtr msg) = 0;
- virtual ProcessResult ProcessHMIMessage(
- application_manager::MessagePtr msg) = 0;
- virtual void OnServiceStateChanged(ServiceState state);
-
- /**
- * @brief Adds pointer to observer of module to be notified about
- * exceptional sutiations in module.
- * Raw pointer is passed to avoid circular dependencies.
- * Module is not responsible for freeing observer's memory.
- */
- void AddObserver(ModuleObserver* const observer);
-
- /**
- * @brief Removes pointer to observer of module when it's no loger
- * wants to be notified about exceptional sutiations in module.
- * Raw pointer is passed to avoid circular dependencies.
- * Module is not responsible for freeing observer's memory.
- */
- void RemoveObserver(ModuleObserver* const observer);
-
- /**
- * @brief Remove extension created for specified application
- * @param app_id application id
- */
- virtual void RemoveAppExtension(uint32_t app_id) = 0;
-
- /**
- * @brief Check registering app can be handled by plugin
- * @param msg Registration message
- * @param app Application basis already create by Core
- */
- virtual bool IsAppForPlugin(
- application_manager::ApplicationSharedPtr app) = 0;
-
- /**
- * @brief Notify about change of HMILevel of plugin's app
- * @param app App with new HMILevel
- * @param old_level Old HMILevel of app
- */
- virtual void OnAppHMILevelChanged(
- application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType old_level) = 0;
-
- /**
- * @brief OnApplicationEvent Processes application related events
- * @param event Event
- * @param application Pointer to application struct
- */
- virtual void OnApplicationEvent(
- ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) = 0;
-
- /**
- * @brief OnPolicyEvent Processes policy related events
- * @param event Policy event
- */
- virtual void OnPolicyEvent(PolicyEvent event) = 0;
-
- protected:
- explicit GenericModule(ModuleID module_id);
- void NotifyObservers(ModuleObserver::Errors error);
-
- /**
- * @brief Remove extension for all applications
- */
- virtual void RemoveAppExtensions() = 0;
-
- private:
- application_manager::ServicePtr service_;
- const ModuleID kModuleId_;
-
- Observers observers_;
- ServiceState state_;
-
- friend class DriverGenericModuleTest;
- DISALLOW_COPY_AND_ASSIGN(GenericModule);
-};
-
-} // namespace functional_modules
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
diff --git a/src/components/functional_module/include/functional_module/module_observer.h b/src/components/functional_module/include/functional_module/module_observer.h
deleted file mode 100644
index a5e34db040..0000000000
--- a/src/components/functional_module/include/functional_module/module_observer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_
-
-namespace functional_modules {
-
-typedef int ModuleID;
-
-class ModuleObserver {
- public:
- enum Errors { NONE = -1, OUT_OF_MEMORY, FS_FAILURE };
- virtual ~ModuleObserver() {}
-
- /**
- * @brief OnError callback for module to notify SDL about internal error
- * @param error error type
- * @param module_id module that triggered error
- */
- virtual void OnError(Errors error, ModuleID module_id) = 0;
-};
-} // namespace functional_modules {
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_
diff --git a/src/components/functional_module/include/functional_module/plugin_manager.h b/src/components/functional_module/include/functional_module/plugin_manager.h
deleted file mode 100644
index c573d843b2..0000000000
--- a/src/components/functional_module/include/functional_module/plugin_manager.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
-
-#include <map>
-#include <string>
-#include "functional_module/generic_module.h"
-#include "application_manager/service.h"
-#include "application_manager/message.h"
-
-namespace functional_modules {
-
-class PluginManager : public ModuleObserver {
- public:
- PluginManager();
- ~PluginManager();
- typedef std::map<ModuleID, ModulePtr> Modules;
-
- /**
- * @brief LoadPlugins initialize loading plugins
- * @param plugin_path path to search to plugin shared libraries
- * @return count of loaded plugins
- */
- int LoadPlugins(const std::string& plugin_path);
-
- /**
- * @brief UnloadPlugins unload from memory all plugins
- */
- void UnloadPlugins();
-
- /**
- * @brief IsMessageForPlugin Verifies whether mobile message will be processed
- * by plugins
- * @param msg Mobile message
- * @return True if any of plugins will process the message, otherwise - false
- */
- bool IsMessageForPlugin(application_manager::MessagePtr msg);
-
- /**
- * @brief IsHMIMessageForPlugin Verifies whether HMI message will be processed
- * by plugins
- * @param msg HMI message
- * @return True if any of plugins will process the message, otherwise - false
- */
- bool IsHMIMessageForPlugin(application_manager::MessagePtr msg);
-
- /**
- * @brief ProcessMessage forwards mobile message to modules if any is
- * subsribed for the message.
- * @param msg Mobile message to process
- * @return Result of processing
- */
- ProcessResult ProcessMessage(application_manager::MessagePtr msg);
-
- /**
- * @brief ProcessHMIMessage forwards HMI message to modules if any is
- * subscribed for the message
- * @param msg HMI message to process
- * @return Result of processing
- */
- ProcessResult ProcessHMIMessage(application_manager::MessagePtr msg);
- void SetServiceHandler(application_manager::ServicePtr service) {
- service_ = service;
- }
- void OnServiceStateChanged(ServiceState state);
- void OnError(ModuleObserver::Errors error, ModuleID module_id) FINAL;
-
- /**
- * @brief Remove extension created for specified application
- * @param app_id application id
- */
- void RemoveAppExtension(uint32_t app_id);
-
- /**
- * @brief Check if app cooperates with one or more plugins, init it
- * inside plugin accordingly if needed.
- * @param app Application in question.
- */
- bool IsAppForPlugins(application_manager::ApplicationSharedPtr app);
-
- /**
- * Check if app cooperates with plugin
- * @param app application
- * @param module_id unique identifier of plugin
- * @return true if application cooperates with this plugin
- */
- bool IsAppForPlugin(application_manager::ApplicationSharedPtr app,
- ModuleID module_id) const;
-
- /**
- * @brief Notify plugins about change of HMILevel of app
- * if app is related to plugin
- * @param app App with new HMILevel
- * @param old_level Old HMILevel of app
- */
- void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType old_level);
-
- /**
- * @brief OnApplicationEvent Notifies modules on certain application events
- * @param event Event
- * @param application Pointer to application struct
- */
- void OnApplicationEvent(
- functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application);
-
- /**
- * @brief OnPolicyEvent Notifies modules on certain events from policy
- * @param event Policy event
- */
- void OnPolicyEvent(functional_modules::PolicyEvent event);
-
- Modules& plugins();
-
- private:
- Modules plugins_;
- std::map<ModuleID, void*> dlls_;
- std::map<RCFunctionID, ModulePtr> mobile_subscribers_;
- std::map<HMIFunctionID, ModulePtr> hmi_subscribers_;
- application_manager::ServicePtr service_;
-
- DISALLOW_COPY_AND_ASSIGN(PluginManager);
-};
-
-} // namespace functional_modules
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
diff --git a/src/components/functional_module/include/functional_module/timer/module_timer.h b/src/components/functional_module/include/functional_module/timer/module_timer.h
deleted file mode 100644
index e24259241b..0000000000
--- a/src/components/functional_module/include/functional_module/timer/module_timer.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
-
-#include <list>
-#include <deque>
-#include <algorithm>
-#include <time.h>
-#include "utils/lock.h"
-
-namespace functional_modules {
-
-typedef unsigned int TimeUnit; // seconds
-
-class Trackable {
- public:
- Trackable() : start_time_(0) {}
- virtual ~Trackable() {}
-
- /**
- * @brief custom_interval getter for custom interval
- * @return return timer interval for trackable message
- */
- virtual TimeUnit custom_interval() const {
- return 0;
- }
-
- /**
- * @brief start_time getter for start time of message
- * @return start time of message
- */
- virtual TimeUnit start_time() const {
- return start_time_;
- }
-
- /**
- * @brief set_start_time setting start time of message
- * @param start_time start time
- */
- virtual void set_start_time(TimeUnit start_time) {
- start_time_ = start_time;
- }
-
- private:
- TimeUnit start_time_;
-};
-
-template <class Trackable>
-class TimerObserver {
- public:
- virtual ~TimerObserver() {}
- virtual void OnTimeoutTriggered(const Trackable& expired) = 0;
-};
-
-template <class Trackable>
-class ModuleTimer {
- public:
- ModuleTimer();
- ~ModuleTimer();
- void set_period(TimeUnit period) {
- period_ = period;
- }
- TimeUnit period() const {
- return period_;
- }
- void AddObserver(TimerObserver<Trackable>* observer);
- void RemoveObserver(TimerObserver<Trackable>* observer);
-
- void CheckTimeout();
- /**
- * @brief Gets time in seconds when the nearest request timeout will be
- * triggered
- * @return time in seconds when the nearest request timeout will be triggered
- */
- TimeUnit GetSecondsToNearestTimeout();
-
- /*
- * @brief Adds object to be tracked by timer.
- If same object is already added replaces it with new one
- correspondingly updating start time of tracking.
- */
- void AddTrackable(const Trackable& object);
- void RemoveTrackable(const Trackable& object);
-
- protected:
- void Notify(const Trackable& object);
- void OnTimeout(const Trackable& object);
- TimeUnit CurrentTime() const;
- typename std::list<Trackable> trackables_;
- volatile TimeUnit period_;
-
- private:
- std::deque<TimerObserver<Trackable>*> observers_;
- mutable sync_primitives::Lock trackables_lock_;
- friend class ModuleTimerTest;
-};
-
-template <class Trackable>
-ModuleTimer<Trackable>::ModuleTimer()
- : period_(10) {}
-
-template <class Trackable>
-ModuleTimer<Trackable>::~ModuleTimer() {
- observers_.clear();
- sync_primitives::AutoLock auto_lock(trackables_lock_);
- trackables_.clear();
-}
-
-template <class Trackable>
-void ModuleTimer<Trackable>::AddObserver(TimerObserver<Trackable>* observer) {
- DCHECK(observer);
- if (!observer) {
- return;
- }
- observers_.push_back(observer);
-}
-
-template <class Trackable>
-void ModuleTimer<Trackable>::RemoveObserver(
- TimerObserver<Trackable>* observer) {
- DCHECK(observer);
- if (!observer) {
- return;
- }
- for (typename std::deque<TimerObserver<Trackable>*>::iterator it =
- observers_.begin();
- observers_.end() != it;
- ++it) {
- if (*it == observer) {
- observers_.erase(it);
- return;
- }
- }
-}
-
-template <class Trackable>
-void ModuleTimer<Trackable>::CheckTimeout() {
- sync_primitives::AutoLock trackables_lock(trackables_lock_);
- for (typename std::list<Trackable>::iterator it = trackables_.begin();
- trackables_.end() != it;
- ++it) {
- TimeUnit period = it->custom_interval();
- if (!period) {
- period = period_;
- }
- if (CurrentTime() - it->start_time() >= period) {
- OnTimeout(*it);
- it = trackables_.erase(it);
- }
- }
-}
-
-template <class Trackable>
-TimeUnit ModuleTimer<Trackable>::GetSecondsToNearestTimeout() {
- sync_primitives::AutoLock trackables_lock(trackables_lock_);
- TimeUnit result = period_;
- for (typename std::list<Trackable>::iterator it = trackables_.begin();
- trackables_.end() != it;
- ++it) {
- TimeUnit period = it->custom_interval();
- if (!period) {
- period = period_;
- }
- const TimeUnit current_secs_to_timeout =
- period - (CurrentTime() - it->start_time());
- if (result > current_secs_to_timeout) {
- result = current_secs_to_timeout;
- }
- }
- return result;
-}
-
-template <class Trackable>
-void ModuleTimer<Trackable>::AddTrackable(const Trackable& object) {
- sync_primitives::AutoLock trackables_lock(trackables_lock_);
- trackables_.remove(object);
- trackables_.push_back(object);
- trackables_.back().set_start_time(CurrentTime());
-}
-
-template <class Trackable>
-void ModuleTimer<Trackable>::RemoveTrackable(const Trackable& object) {
- sync_primitives::AutoLock trackables_lock(trackables_lock_);
- trackables_.remove(object);
-}
-
-template <class Trackable>
-void ModuleTimer<Trackable>::Notify(const Trackable& object) {
- for (typename std::deque<TimerObserver<Trackable>*>::const_iterator it =
- observers_.begin();
- observers_.end() != it;
- ++it) {
- (*it)->OnTimeoutTriggered(object);
- }
-}
-
-template <class Trackable>
-void ModuleTimer<Trackable>::OnTimeout(const Trackable& object) {
- Notify(object);
-}
-
-template <class Trackable>
-TimeUnit ModuleTimer<Trackable>::CurrentTime() const {
- // TODO(PV): move outside to platform-dependant parts
- struct timespec current_time;
- if (0 == clock_gettime(CLOCK_MONOTONIC, &current_time)) {
- return current_time.tv_sec;
- } else {
- return 0;
- }
-}
-
-} // namespace functional_modules
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
diff --git a/src/components/functional_module/include/functional_module/timer/timer_director.h b/src/components/functional_module/include/functional_module/timer/timer_director.h
deleted file mode 100644
index fb67b9b5de..0000000000
--- a/src/components/functional_module/include/functional_module/timer/timer_director.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
-
-#include <map>
-#include "utils/threads/thread.h"
-#include "utils/conditional_variable.h"
-#include "functional_module/timer/module_timer.h"
-
-namespace functional_modules {
-
-template <class T>
-class TimerThreadDelegate : public threads::ThreadDelegate {
- public:
- explicit TimerThreadDelegate(ModuleTimer<T>& timer);
- void threadMain();
- void exitThreadMain();
-
- /**
- * @brief Reset awaiting timer by notifying cond var
- */
- void ResetTimer();
-
- private:
- ModuleTimer<T>& timer_;
- volatile bool keep_running_;
- mutable sync_primitives::Lock keep_running_lock_;
- mutable sync_primitives::ConditionalVariable keep_running_cond_;
- friend class TimerThreadDelegateTest;
-};
-
-class TimerDirector {
- public:
- TimerDirector();
- ~TimerDirector();
-
- /**
- * @brief Register timer for execution in separate thread.
- Registers only one timer of a type. Attempt to register timer
- of already existing type will fail.
- */
- template <class T>
- void RegisterTimer(ModuleTimer<T>& timer);
- template <class T>
- void UnregisterTimer(const ModuleTimer<T>& timer);
- void UnregisterAllTimers();
- /**
- * @brief Reset awaiting timeout for specified module timer
- * @param timer timer to reset awaiting timeout
- */
- template <class T>
- void ResetTimer(ModuleTimer<T>& timer);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TimerDirector);
- std::map<std::string, threads::Thread*> timer_threads_;
-};
-
-} // namespace functional_modules
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
diff --git a/src/components/functional_module/src/generic_module.cc b/src/components/functional_module/src/generic_module.cc
deleted file mode 100644
index 142b1ef58c..0000000000
--- a/src/components/functional_module/src/generic_module.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "functional_module/generic_module.h"
-namespace functional_modules {
-
-typedef std::deque<ModuleObserver*>::iterator ModuleObserverIterator;
-
-GenericModule::GenericModule(ModuleID module_id)
- : kModuleId_(module_id), state_(ServiceState::IDLE) {}
-
-GenericModule::~GenericModule() {
- observers_.clear();
-}
-
-void GenericModule::AddObserver(ModuleObserver* const observer) {
- DCHECK(observer);
- if (!observer) {
- return;
- }
- observers_.push_back(observer);
-}
-
-void GenericModule::RemoveObserver(ModuleObserver* const observer) {
- DCHECK(observer);
- if (!observer) {
- return;
- }
- for (ModuleObserverIterator it = observers_.begin(); observers_.end() != it;
- ++it) {
- if (*it == observer) {
- observers_.erase(it);
- return;
- }
- }
-}
-
-void GenericModule::NotifyObservers(ModuleObserver::Errors error) {
- for (ModuleObserverIterator it = observers_.begin(); observers_.end() != it;
- ++it) {
- (*it)->OnError(error, kModuleId_);
- }
-}
-
-void GenericModule::set_service(application_manager::ServicePtr service) {
- service_ = service;
-}
-
-void GenericModule::OnServiceStateChanged(ServiceState state) {
- state_ = state;
-}
-
-application_manager::ServicePtr GenericModule::service() {
- return service_;
-}
-
-} // namespace functional_modules
diff --git a/src/components/functional_module/src/plugin_manager.cc b/src/components/functional_module/src/plugin_manager.cc
deleted file mode 100644
index a32fdbf773..0000000000
--- a/src/components/functional_module/src/plugin_manager.cc
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <dlfcn.h>
-#include <algorithm>
-#include "functional_module/plugin_manager.h"
-#include "functional_module/function_ids.h"
-#include "protocol/common.h"
-#include "utils/file_system.h"
-#include "utils/logger.h"
-#include "json/json.h"
-
-namespace functional_modules {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "PluginManager")
-
-namespace {
-const std::string ExtractMethodName(application_manager::MessagePtr msg) {
- DCHECK_OR_RETURN(msg, "");
- Json::Value value;
- Json::Reader reader;
- reader.parse(msg->json_message(), value);
-
- const char* kMethod = "method";
- const char* kResult = "result";
- const char* kError = "error";
- const char* kData = "data";
-
- if (value.isMember(kMethod)) {
- return value.get(kMethod, "").asCString();
- }
- if (value.isMember(kResult)) {
- const Json::Value& result = value.get(kResult, Json::Value());
- return result.get(kMethod, "").asCString();
- }
- if (value.isMember(kError)) {
- const Json::Value& error = value.get(kError, Json::Value());
- const Json::Value& data = error.get(kData, Json::Value());
- return data.get(kMethod, "").asCString();
- }
-
- return std::string();
-}
-} // namespace
-
-typedef std::map<ModuleID, ModulePtr>::iterator PluginsIterator;
-typedef std::map<RCFunctionID, ModulePtr>::iterator PluginFunctionsIterator;
-typedef std::map<HMIFunctionID, ModulePtr>::iterator PluginHMIFunctionsIterator;
-
-PluginManager::PluginManager() : service_() {
- LOG4CXX_DEBUG(logger_, "Creating plugin mgr");
-}
-
-PluginManager::~PluginManager() {
- mobile_subscribers_.clear();
- hmi_subscribers_.clear();
- UnloadPlugins();
-}
-
-int PluginManager::LoadPlugins(const std::string& plugin_path) {
- LOG4CXX_INFO(logger_, "Loading plugins from " << plugin_path);
- std::vector<std::string> plugin_files = file_system::ListFiles(plugin_path);
- for (size_t i = 0; i < plugin_files.size(); ++i) {
- size_t pos = plugin_files[i].find_last_of(".");
- if (std::string::npos != pos) {
- if (plugin_files[i].substr(pos + 1).compare("so") != 0) {
- continue;
- }
- } else {
- continue;
- }
- std::string full_name = plugin_path + '/' + plugin_files[i];
- void* generic_plugin_dll = dlopen(full_name.c_str(), RTLD_LAZY);
- if (NULL == generic_plugin_dll) {
- LOG4CXX_ERROR(logger_,
- "Failed to open dll " << plugin_files[i] << "\n"
- << dlerror());
- continue;
- }
- typedef GenericModule* (*Create)();
- Create create_manager =
- reinterpret_cast<Create>(dlsym(generic_plugin_dll, "Create"));
- char* error_string = dlerror();
- if (NULL != error_string) {
- LOG4CXX_ERROR(logger_,
- "Failed to export dll's " << plugin_files[i] << " symbols\n"
- << error_string);
- dlclose(generic_plugin_dll);
- continue;
- }
- ModulePtr module = create_manager();
- if (!module) {
- LOG4CXX_ERROR(logger_,
- "Failed to create plugin main class " << plugin_files[i]);
- dlclose(generic_plugin_dll);
- continue;
- } else {
- LOG4CXX_DEBUG(logger_,
- "Opened and working plugin from " << plugin_files[i]
- << " with id "
- << module->GetModuleID());
- dlls_.insert(std::pair<ModuleID, void*>(module->GetModuleID(),
- generic_plugin_dll));
- plugins_.insert(
- std::pair<ModuleID, ModulePtr>(module->GetModuleID(), module));
- std::deque<RCFunctionID> subscribers =
- module->GetPluginInfo().rc_function_list;
- for (size_t i = 0; i < subscribers.size(); ++i) {
- mobile_subscribers_.insert(
- std::pair<RCFunctionID, ModulePtr>(subscribers[i], module));
- }
-
- std::deque<HMIFunctionID> hmi_subscribers =
- module->GetPluginInfo().hmi_function_list;
- for (size_t i = 0; i < hmi_subscribers.size(); ++i) {
- hmi_subscribers_.insert(
- std::pair<HMIFunctionID, ModulePtr>(hmi_subscribers[i], module));
- }
- module->set_service(service_);
- module->AddObserver(this);
- }
- }
- return plugins_.size();
-}
-
-void PluginManager::UnloadPlugins() {
- for (Modules::iterator it = plugins_.begin(); plugins_.end() != it; ++it) {
- it->second->RemoveObserver(this);
- }
- plugins_.clear();
-
- for (std::map<ModuleID, void*>::iterator it = dlls_.begin();
- dlls_.end() != it;
- ++it) {
- dlclose(it->second);
- }
- dlls_.clear();
-}
-
-bool PluginManager::IsMessageForPlugin(application_manager::MessagePtr msg) {
- DCHECK(msg);
- if (!msg) {
- LOG4CXX_ERROR(logger_, "Null pointer message was received.");
- return false;
- }
- if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN !=
- msg->protocol_version() &&
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI !=
- msg->protocol_version()) {
- RCFunctionID id = static_cast<RCFunctionID>(msg->function_id());
- return (mobile_subscribers_.find(id) != mobile_subscribers_.end());
- } else {
- return false;
- }
-}
-
-bool PluginManager::IsHMIMessageForPlugin(application_manager::MessagePtr msg) {
- DCHECK(msg);
- if (!msg) {
- LOG4CXX_ERROR(logger_, "Null pointer message was received.");
- return false;
- }
-
- Json::Value value;
- Json::Reader reader;
- reader.parse(msg->json_message(), value);
- if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI ==
- msg->protocol_version()) {
- std::string msg_method;
- // Request or notification from HMI
- if (value.isMember("method") && value["method"].isString()) {
- msg_method = value["method"].asCString();
- // Response from HMI
- } else if (value.isMember("result") && value["result"].isMember("method") &&
- value["result"]["method"].isString()) {
- msg_method = value["result"]["method"].asCString();
- // Error response from HMI
- } else if (value.isMember("error") && value["error"].isMember("data") &&
- value["error"]["data"].isMember("method") &&
- value["error"]["data"]["method"].isString()) {
- msg_method = value["error"]["data"]["method"].asCString();
- } else {
- LOG4CXX_WARN(logger_,
- "Message with HMI protocol version can not be handled by "
- "plugin manager, because required 'method' field was not "
- "found, or was containing an invalid string.");
- return false;
- }
-
- return (hmi_subscribers_.find(msg_method) != hmi_subscribers_.end());
- }
-
- return false;
-}
-
-ProcessResult PluginManager::ProcessMessage(
- application_manager::MessagePtr msg) {
- DCHECK(msg);
- if (!msg) {
- LOG4CXX_ERROR(logger_, "Null pointer message was received.");
- return ProcessResult::CANNOT_PROCESS;
- }
-
- protocol_handler::MajorProtocolVersion version = msg->protocol_version();
- if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN ==
- version ||
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI == version) {
- return ProcessResult::CANNOT_PROCESS;
- }
-
- ProcessResult result = ProcessResult::CANNOT_PROCESS;
- PluginFunctionsIterator subscribed_plugin_itr =
- mobile_subscribers_.find(static_cast<RCFunctionID>(msg->function_id()));
- if (mobile_subscribers_.end() != subscribed_plugin_itr) {
- result = subscribed_plugin_itr->second->ProcessMessage(msg);
- if (ProcessResult::PROCESSED != result) {
- LOG4CXX_ERROR(logger_, "Plugin failed to process message.");
- }
- }
-
- return result;
-}
-
-ProcessResult PluginManager::ProcessHMIMessage(
- application_manager::MessagePtr msg) {
- DCHECK_OR_RETURN(msg, ProcessResult::CANNOT_PROCESS);
-
- if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI !=
- msg->protocol_version()) {
- return ProcessResult::CANNOT_PROCESS;
- }
-
- const std::string& msg_method = ExtractMethodName(msg);
- if (msg_method.empty()) {
- LOG4CXX_WARN(logger_,
- "Message with HMI protocol version can not be handled by "
- "plugin manager, because required 'method' field was not "
- "found, or was containing an invalid string.");
- return ProcessResult::CANNOT_PROCESS;
- }
-
- LOG4CXX_DEBUG(logger_, "Parsed method name is " << msg_method);
-
- ProcessResult result = ProcessResult::CANNOT_PROCESS;
- PluginHMIFunctionsIterator subscribed_plugin_itr =
- hmi_subscribers_.find(msg_method);
- if (hmi_subscribers_.end() != subscribed_plugin_itr) {
- result = subscribed_plugin_itr->second->ProcessHMIMessage(msg);
- }
-
- return result;
-}
-
-void PluginManager::OnServiceStateChanged(ServiceState state) {
- for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
- it->second->OnServiceStateChanged(state);
- }
-}
-
-void PluginManager::OnError(ModuleObserver::Errors error, ModuleID module_id) {
- std::string error_string;
- switch (error) {
- case ModuleObserver::Errors::OUT_OF_MEMORY:
- error_string = "Module run out of memory.";
- break;
- case ModuleObserver::Errors::FS_FAILURE:
- error_string = "Plugin failed to run file system operation.";
- break;
- default: {
- LOG4CXX_ERROR(logger_,
- "Error " << error_string << " was received from module "
- << module_id);
- } break;
- }
-}
-
-void PluginManager::RemoveAppExtension(uint32_t app_id) {
- for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
- it->second->RemoveAppExtension(app_id);
- }
-}
-
-bool PluginManager::IsAppForPlugins(
- application_manager::ApplicationSharedPtr app) {
- DCHECK(app);
- if (!app) {
- return false;
- }
-
- bool res = false;
- for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
- res = res || it->second->IsAppForPlugin(app);
- }
- return res;
-}
-
-bool PluginManager::IsAppForPlugin(
- application_manager::ApplicationSharedPtr app, ModuleID module_id) const {
- DCHECK_OR_RETURN(app, false);
- Modules::const_iterator i = plugins_.find(module_id);
- return i != plugins_.end() ? i->second->IsAppForPlugin(app) : false;
-}
-
-void PluginManager::OnAppHMILevelChanged(
- application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType old_level) {
- DCHECK_OR_RETURN_VOID(app);
- for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
- if (it->second->IsAppForPlugin(app)) {
- LOG4CXX_DEBUG(logger_,
- "Application " << app->name().AsMBString() << " of plugin "
- << it->second->GetModuleID()
- << " has changed level from " << old_level
- << " to " << app->hmi_level());
- it->second->OnAppHMILevelChanged(app, old_level);
- }
- }
-}
-
-typedef std::map<ModuleID, ModulePtr>::value_type PluginsValueType;
-
-struct HandleApplicationEvent {
- private:
- const functional_modules::ApplicationEvent event_;
- application_manager::ApplicationSharedPtr application_;
-
- public:
- HandleApplicationEvent(functional_modules::ApplicationEvent e,
- application_manager::ApplicationSharedPtr application)
- : event_(e), application_(application) {}
- void operator()(PluginsValueType& p) {
- p.second->OnApplicationEvent(event_, application_);
- }
-};
-
-struct HandlePolicyEvent {
- private:
- const functional_modules::PolicyEvent event_;
-
- public:
- HandlePolicyEvent(functional_modules::PolicyEvent e) : event_(e) {}
- void operator()(PluginsValueType& p) {
- p.second->OnPolicyEvent(event_);
- }
-};
-
-void PluginManager::OnApplicationEvent(
- functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (application) {
- std::for_each(plugins_.begin(),
- plugins_.end(),
- HandleApplicationEvent(event, application));
- }
-}
-
-void PluginManager::OnPolicyEvent(PolicyEvent event) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::for_each(plugins_.begin(), plugins_.end(), HandlePolicyEvent(event));
-}
-
-PluginManager::Modules& PluginManager::plugins() {
- return plugins_;
-}
-
-} // namespace functional_modules
diff --git a/src/components/functional_module/src/timer/timer_director.cc b/src/components/functional_module/src/timer/timer_director.cc
deleted file mode 100644
index 81ce117851..0000000000
--- a/src/components/functional_module/src/timer/timer_director.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include <typeinfo>
-#include "functional_module/timer/timer_director.h"
-#include "remote_control/rc_module_timer.h"
-#include "utils/logger.h"
-
-namespace functional_modules {
-
-template <class T>
-TimerThreadDelegate<T>::TimerThreadDelegate(ModuleTimer<T>& timer)
- : timer_(timer), keep_running_(false) {}
-
-template <class T>
-void TimerThreadDelegate<T>::threadMain() {
- if (keep_running_) {
- this->exitThreadMain();
- }
- {
- sync_primitives::AutoLock run_lock(keep_running_lock_);
- keep_running_ = true;
- }
- sync_primitives::AutoLock run_lock(keep_running_lock_);
- while (keep_running_) {
- const TimeUnit msecs_to_wait = timer_.GetSecondsToNearestTimeout() * 1000;
- sync_primitives::ConditionalVariable::WaitStatus wait_status =
- keep_running_cond_.WaitFor(run_lock, msecs_to_wait);
- if (sync_primitives::ConditionalVariable::kTimeout == wait_status &&
- keep_running_) {
- timer_.CheckTimeout();
- }
- }
-}
-
-template <class T>
-void TimerThreadDelegate<T>::exitThreadMain() {
- if (keep_running_) {
- sync_primitives::AutoLock run_lock(keep_running_lock_);
- keep_running_ = false;
- keep_running_cond_.NotifyOne();
- }
-}
-
-template <class T>
-void TimerThreadDelegate<T>::ResetTimer() {
- if (keep_running_) {
- sync_primitives::AutoLock run_lock(keep_running_lock_);
- keep_running_cond_.NotifyOne();
- }
-}
-
-TimerDirector::TimerDirector() {}
-
-TimerDirector::~TimerDirector() {
- UnregisterAllTimers();
-}
-
-template <class T>
-void TimerDirector::RegisterTimer(ModuleTimer<T>& timer) {
- std::string type_name = typeid(timer).name();
- std::map<std::string, threads::Thread*>::iterator it =
- timer_threads_.find(type_name);
- if (timer_threads_.end() != it) {
- // Attempt to register timer of already existing type fail.
- return;
- }
- TimerThreadDelegate<T>* delegate = new TimerThreadDelegate<T>(timer);
- threads::Thread* thread = threads::CreateThread(type_name.c_str(), delegate);
-
- const size_t kStackSize = 16384;
- if (thread->start(threads::ThreadOptions(kStackSize))) {
- timer_threads_.insert(std::make_pair(type_name, thread));
- } else {
- // Failed to start timer thread for
- }
-}
-
-template void TimerDirector::RegisterTimer<remote_control::TrackableMessage>(
- ModuleTimer<remote_control::TrackableMessage>& timer);
-
-template <class T>
-void TimerDirector::UnregisterTimer(const ModuleTimer<T>& timer) {
- std::string type_name = typeid(timer).name();
- std::map<std::string, threads::Thread*>::iterator it =
- timer_threads_.find(type_name);
- if (timer_threads_.end() == it) {
- /// Failed to unregister timer that was not registered
- return;
- }
- threads::ThreadDelegate* delegate = it->second->delegate();
- DeleteThread(it->second);
- delete delegate;
- timer_threads_.erase(it);
-}
-
-template void TimerDirector::UnregisterTimer<remote_control::TrackableMessage>(
- const ModuleTimer<remote_control::TrackableMessage>& timer);
-
-template <class T>
-void TimerDirector::ResetTimer(ModuleTimer<T>& timer) {
- const std::string type_name = typeid(timer).name();
- std::map<std::string, threads::Thread*>::iterator it =
- timer_threads_.find(type_name);
- if (timer_threads_.end() == it) {
- return;
- }
- TimerThreadDelegate<T>* delegate =
- static_cast<TimerThreadDelegate<T>*>(it->second->delegate());
- delegate->ResetTimer();
-}
-
-template void TimerDirector::ResetTimer<remote_control::TrackableMessage>(
- ModuleTimer<remote_control::TrackableMessage>& timer);
-
-void TimerDirector::UnregisterAllTimers() {
- for (std::map<std::string, threads::Thread*>::iterator it =
- timer_threads_.begin();
- timer_threads_.end() != it;
- ++it) {
- threads::ThreadDelegate* delegate = it->second->delegate();
- DeleteThread(it->second);
- delete delegate;
- }
- timer_threads_.clear();
-}
-
-} // namespace functional_modules
diff --git a/src/components/functional_module/test/CMakeLists.txt b/src/components/functional_module/test/CMakeLists.txt
deleted file mode 100644
index c4e966c84e..0000000000
--- a/src/components/functional_module/test/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-include_directories (
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${GMOCK_INCLUDE_DIRECTORY}
- ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/
- ${CMAKE_SOURCE_DIR}/src/components/include/
- ${CMAKE_SOURCE_DIR}/src/components/application_manager/include
- ${CMAKE_SOURCE_DIR}/src/components/connection_handler/include
- ${CMAKE_SOURCE_DIR}/src/components/utils/include
- ${CMAKE_SOURCE_DIR}/src/components/policy/include
- ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${CMAKE_BINARY_DIR}/src/components/
- include
- plugins
-)
-
-set (LIBRARIES
- gtest
- gmock
- gmock_main
- FunctionalModule
- dl
- ApplicationManager
- jsoncpp
- Utils
- ConfigProfile
- gcov
-)
-
-set(SOURCES
- ./src/generic_module_test.cc
- ./src/plugin_manager_test.cc
- ./src/module_timer_test.cc
-)
-
-# use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH FALSE)
-
-# when building, don't use the install RPATH already
-# (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
-
-SET(RPATH_DIRECTORIES
- /usr/local/lib
- /usr/local
- ${CMAKE_BINARY_DIR}/src/components/utils
-)
-
-SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}")
-
-add_subdirectory(plugins)
-
-create_test("function_module_test" "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/functional_module/test/include/driver_generic_module_test.h b/src/components/functional_module/test/include/driver_generic_module_test.h
deleted file mode 100644
index 23751f51c2..0000000000
--- a/src/components/functional_module/test/include/driver_generic_module_test.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_
-
-#include "functional_module/generic_module.h"
-
-namespace functional_modules {
-
-class DriverGenericModuleTest : public GenericModule {
- public:
- explicit DriverGenericModuleTest(ModuleID module_id)
- : GenericModule(module_id) {}
- virtual ~DriverGenericModuleTest() {}
- virtual PluginInfo GetPluginInfo() const {
- PluginInfo info;
- info.name = "DriverGenericModuleTest";
- info.version = 1;
- return info;
- }
- virtual ProcessResult ProcessMessage(application_manager::MessagePtr msg) {
- NotifyObservers(ModuleObserver::FS_FAILURE);
- return ProcessResult::FAILED;
- }
- virtual ProcessResult ProcessHMIMessage(application_manager::MessagePtr msg) {
- return ProcessResult::PROCESSED;
- }
- virtual void RemoveAppExtension(uint32_t app_id) {}
- virtual void RemoveAppExtensions() {}
- bool IsAppForPlugin(application_manager::ApplicationSharedPtr app) {
- return true;
- }
-
- void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr,
- mobile_apis::HMILevel::eType) {}
-
- const Observers& observers() {
- return observers_;
- }
-
- void OnApplicationEvent(functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr app) {}
-
- void OnPolicyEvent(functional_modules::PolicyEvent event) {}
-
- void OnUnregisterApplication(const uint32_t app_id) {}
-};
-
-} // namespace functional_modules
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_
diff --git a/src/components/functional_module/test/include/mock_application.h b/src/components/functional_module/test/include/mock_application.h
deleted file mode 100644
index 95bd4a0505..0000000000
--- a/src/components/functional_module/test/include/mock_application.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_
-
-#include "gmock/gmock.h"
-#include "application_manager/application.h"
-#include "application_manager/usage_statistics.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-class MockApplication : public Application {
- public:
- MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(curHash, const std::string&());
- MOCK_METHOD0(UpdateHash, void());
- MOCK_METHOD0(CloseActiveMessage, void());
- MOCK_CONST_METHOD0(IsFullscreen, bool());
- MOCK_METHOD0(MakeFullscreen, bool());
- MOCK_CONST_METHOD0(IsAudible, bool());
- MOCK_METHOD0(MakeNotAudible, void());
- MOCK_CONST_METHOD0(allowed_support_navigation, bool());
- MOCK_METHOD1(set_allowed_support_navigation, void(bool allow));
- MOCK_CONST_METHOD0(hmi_supports_navi_streaming, bool());
- MOCK_METHOD1(set_hmi_supports_navi_streaming, void(const bool& supports));
- MOCK_CONST_METHOD0(app_allowed, bool());
- MOCK_CONST_METHOD0(has_been_activated, bool());
- MOCK_CONST_METHOD0(version, const Version&());
- MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id));
- MOCK_CONST_METHOD0(hmi_app_id, uint32_t());
- MOCK_CONST_METHOD0(app_id, uint32_t());
- MOCK_CONST_METHOD0(name, const std::string&());
- MOCK_CONST_METHOD0(folder_name, const std::string());
- MOCK_CONST_METHOD0(is_media_application, bool());
- MOCK_CONST_METHOD0(hmi_level, const mobile_api::HMILevel::eType&());
- MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(system_context, const mobile_api::SystemContext::eType&());
- MOCK_CONST_METHOD0(audio_streaming_state,
- const mobile_api::AudioStreamingState::eType&());
- MOCK_CONST_METHOD0(app_icon_path, const std::string&());
- MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
- MOCK_METHOD1(set_tts_speak_state, void(bool state_tts_speak));
- MOCK_METHOD0(tts_speak_state, bool());
- MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
- MOCK_METHOD0(tts_properties_in_none, bool());
- MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
- MOCK_METHOD0(tts_properties_in_full, bool());
- MOCK_METHOD1(set_version, void(const Version& version));
- MOCK_METHOD1(set_name, void(const std::string& name));
- MOCK_METHOD1(set_is_media_application, void(bool is_media));
- MOCK_METHOD1(set_hmi_level,
- void(const mobile_api::HMILevel::eType& hmi_level));
- MOCK_METHOD0(increment_put_file_in_none_count, void());
- MOCK_METHOD0(increment_delete_file_in_none_count, void());
- MOCK_METHOD0(increment_list_files_in_none_count, void());
- MOCK_METHOD1(set_system_context,
- void(const mobile_api::SystemContext::eType& system_context));
- MOCK_METHOD1(set_audio_streaming_state,
- void(const mobile_api::AudioStreamingState::eType& state));
- MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
- MOCK_METHOD1(set_app_allowed, void(const bool& allowed));
- MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
- MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
- MOCK_METHOD1(set_grammar_id, void(uint32_t value));
- MOCK_METHOD1(set_protocol_version,
- void(const ProtocolVersion& protocol_version));
- MOCK_CONST_METHOD0(protocol_version, ProtocolVersion());
- MOCK_METHOD1(AddFile, bool(AppFile& file));
- MOCK_CONST_METHOD0(getAppFiles, const AppFilesMap&());
- MOCK_METHOD1(UpdateFile, bool(AppFile& file));
- MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
- MOCK_METHOD1(GetFile, const AppFile*(const std::string& file_name));
- MOCK_METHOD1(SubscribeToButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(IsSubscribedToButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(UnsubscribeFromButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type_));
- MOCK_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type_));
- MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type_));
- MOCK_METHOD2(IsCommandLimitsExceeded,
- bool(mobile_apis::FunctionID::eType cmd_id,
- TLimitSource source));
- MOCK_METHOD0(usage_report, UsageStatistics&());
- MOCK_METHOD1(SetInitialState, void(HmiStatePtr state));
- MOCK_METHOD2(SubscribeToSoftButtons,
- void(int32_t cmd_id, const SoftButtonID& softbuttons_id));
- MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
- MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
- MOCK_METHOD1(QueryInterface, AppExtensionPtr(AppExtensionUID uid));
- MOCK_METHOD1(AddExtension, bool(AppExtensionPtr extention));
- MOCK_METHOD1(RemoveExtension, bool(AppExtensionUID uid));
- MOCK_METHOD0(RemoveExtensions, void());
- MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(vr_help, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(tbt_state, const mobile_api::TBTState::eType&());
- MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(SubscribedButtons,
- const std::set<mobile_apis::ButtonName::eType>&());
- MOCK_CONST_METHOD0(SubscribesIVI,
- const application_manager::VehicleInfoSubscriptions&());
- MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
- MOCK_METHOD1(set_help_prompt,
- void(const smart_objects::SmartObject& help_prompt));
- MOCK_METHOD1(set_timeout_prompt,
- void(const smart_objects::SmartObject& timeout_prompt));
- MOCK_METHOD1(set_vr_help_title,
- void(const smart_objects::SmartObject& vr_help_title));
- MOCK_METHOD0(reset_vr_help_title, void());
- MOCK_METHOD1(set_vr_help, void(const smart_objects::SmartObject& vr_help));
- MOCK_METHOD0(reset_vr_help, void());
- MOCK_METHOD1(set_tbt_state,
- void(const mobile_api::TBTState::eType& tbt_state));
- MOCK_METHOD1(set_show_command,
- void(const smart_objects::SmartObject& show_command));
- MOCK_METHOD1(set_tbt_show_command,
- void(const smart_objects::SmartObject& tbt_show));
- MOCK_METHOD1(set_keyboard_props,
- void(const smart_objects::SmartObject& keyboard_props));
- MOCK_METHOD1(set_menu_title,
- void(const smart_objects::SmartObject& menu_title));
- MOCK_METHOD1(set_menu_icon,
- void(const smart_objects::SmartObject& menu_icon));
- MOCK_METHOD2(AddCommand,
- void(uint32_t cmd_id,
- const smart_objects::SmartObject& command));
- MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id));
- MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id));
- MOCK_METHOD2(AddSubMenu,
- void(uint32_t menu_id, const smart_objects::SmartObject& menu));
- MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id));
- MOCK_CONST_METHOD1(FindSubMenu,
- smart_objects::SmartObject*(uint32_t menu_id));
- MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name));
- MOCK_METHOD2(AddChoiceSet,
- void(uint32_t choice_set_id,
- const smart_objects::SmartObject& choice_set));
- MOCK_METHOD1(RemoveChoiceSet, void(uint32_t choice_set_id));
- MOCK_METHOD1(FindChoiceSet,
- smart_objects::SmartObject*(uint32_t choice_set_id));
- MOCK_METHOD2(AddPerformInteractionChoiceSet,
- void(uint32_t choice_set_id,
- const smart_objects::SmartObject& choice_set));
- MOCK_METHOD0(DeletePerformInteractionChoiceSetMap, void());
- MOCK_CONST_METHOD0(performinteraction_choice_set_map,
- DataAccessor<PerformChoiceSetMap>());
- MOCK_CONST_METHOD1(FindPerformInteractionChoiceSet,
- smart_objects::SmartObject*(uint32_t choice_set_id));
- MOCK_CONST_METHOD0(commands_map, DataAccessor<CommandsMap>());
- MOCK_CONST_METHOD0(sub_menu_map, DataAccessor<SubMenuMap>());
- MOCK_CONST_METHOD0(choice_set_map, DataAccessor<ChoiceSetMap>());
- MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active));
- MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t());
- MOCK_METHOD1(set_perform_interaction_ui_corrid, void(uint32_t choice));
- MOCK_CONST_METHOD0(perform_interaction_ui_corrid, uint32_t());
- MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode));
- MOCK_CONST_METHOD0(perform_interaction_mode, int32_t());
- MOCK_METHOD1(set_reset_global_properties_active, void(bool active));
- MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
- MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(mobile_app_id, std::string());
- MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(ngn_media_screen_name,
- const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(language, const mobile_api::Language::eType&());
- MOCK_CONST_METHOD0(ui_language, const mobile_api::Language::eType&());
- MOCK_METHOD1(set_app_types,
- void(const smart_objects::SmartObject& app_types));
- MOCK_METHOD1(set_vr_synonyms,
- void(const smart_objects::SmartObject& vr_synonyms));
- MOCK_METHOD1(set_mobile_app_id,
- void(const smart_objects::SmartObject& mobile_app_id));
- MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name));
- MOCK_METHOD1(set_ngn_media_screen_name,
- void(const smart_objects::SmartObject& ngn_name));
- MOCK_METHOD1(set_language, void(const mobile_api::Language::eType& language));
- MOCK_METHOD1(set_ui_language,
- void(const mobile_api::Language::eType& ui_language));
- MOCK_METHOD1(load_global_properties,
- void(const smart_objects::SmartObject& so));
- MOCK_METHOD1(set_mobile_app_id, void(const std::string& mobile_app_id));
- MOCK_METHOD0(ChangeSupportingAppHMIType, void());
- MOCK_CONST_METHOD0(is_navi, bool());
- MOCK_METHOD1(set_is_navi, void(bool allow));
- MOCK_CONST_METHOD0(hmi_supports_navi_video_streaming, bool());
- MOCK_METHOD1(set_hmi_supports_navi_video_streaming, void(bool supports));
- MOCK_CONST_METHOD0(hmi_supports_navi_audio_streaming, bool());
- MOCK_METHOD1(set_hmi_supports_navi_audio_streaming, void(bool supports));
- MOCK_CONST_METHOD0(is_voice_communication_supported, bool());
- MOCK_METHOD1(set_voice_communication_supported, void(bool));
- MOCK_METHOD1(set_activated, bool(bool is_active));
- MOCK_CONST_METHOD0(is_foreground, bool());
- MOCK_METHOD1(set_foreground, void(bool is_foreground));
- MOCK_CONST_METHOD0(IsAudioApplication, bool());
- MOCK_CONST_METHOD0(video_stream_retry_active, bool());
- MOCK_METHOD1(set_video_stream_retry_active, void(bool active));
- MOCK_CONST_METHOD0(audio_stream_retry_active, bool());
- MOCK_METHOD1(set_audio_stream_retry_active, void(bool active));
- MOCK_METHOD0(OnVideoStreamRetry, void());
- MOCK_METHOD0(OnAudioStreamRetry, void());
- MOCK_METHOD1(SubscribeToInteriorVehicleData,
- bool(smart_objects::SmartObject module));
- MOCK_METHOD1(IsSubscribedToInteriorVehicleData,
- bool(smart_objects::SmartObject module));
- MOCK_METHOD1(UnsubscribeFromInteriorVehicleData,
- bool(smart_objects::SmartObject module));
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_
diff --git a/src/components/functional_module/test/include/mock_module_observer.h b/src/components/functional_module/test/include/mock_module_observer.h
deleted file mode 100644
index bfa5117b29..0000000000
--- a/src/components/functional_module/test/include/mock_module_observer.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_
-
-#include "gmock/gmock.h"
-#include "functional_module/module_observer.h"
-
-namespace functional_modules {
-
-class MockModuleObserver : public ModuleObserver {
- public:
- MOCK_METHOD2(OnError, void(Errors error, ModuleID module_id));
- int ObserverMethod() {
- return 13;
- }
-};
-
-} // namespace functional_modules
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_
diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h
deleted file mode 100644
index d1fa7f2747..0000000000
--- a/src/components/functional_module/test/include/mock_service.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_
-#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_
-
-#include "gmock/gmock.h"
-#include "application_manager/service.h"
-
-namespace application_manager {
-
-class MockService : public Service {
- public:
- MOCK_METHOD1(CheckPolicyPermissions,
- mobile_apis::Result::eType(MessagePtr msg));
- MOCK_METHOD1(GetApplication, ApplicationSharedPtr(ApplicationId app_id));
- MOCK_METHOD1(SendMessageToHMI, void(const MessagePtr& message));
- MOCK_METHOD1(SendMessageToMobile, void(const MessagePtr& message));
- MOCK_METHOD0(GetNextCorrelationID, uint32_t());
- MOCK_METHOD1(GetApplications,
- std::vector<ApplicationSharedPtr>(AppExtensionUID));
- MOCK_METHOD2(ChangeNotifyHMILevel,
- void(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level));
- MOCK_METHOD2(NotifyHMIAboutHMILevel,
- void(ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType level));
- MOCK_CONST_METHOD0(GetRCCapabilities, const smart_objects::SmartObject*());
- MOCK_METHOD2(CheckModule,
- bool(const ApplicationId& app_id, const std::string& module));
- MOCK_METHOD1(RemoveHMIFakeParameters,
- void(application_manager::MessagePtr& message));
- MOCK_CONST_METHOD1(IsRemoteControlApplication,
- bool(ApplicationSharedPtr app));
- MOCK_CONST_METHOD1(IsInterfaceAvailable,
- bool(const HmiInterfaces::InterfaceID interface));
- MOCK_CONST_METHOD2(GetModuleTypes,
- bool(const std::string& application_id,
- std::vector<std::string>* modules));
- MOCK_METHOD1(ValidateMessageBySchema,
- application_manager::MessageValidationResult(
- const application_manager::Message& message));
- MOCK_CONST_METHOD0(GetSettings, const ApplicationManagerSettings&());
-};
-}
-// namespace application_manager
-
-#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_
diff --git a/src/components/functional_module/test/include/module_timer_test.h b/src/components/functional_module/test/include/module_timer_test.h
deleted file mode 100644
index 456346b544..0000000000
--- a/src/components/functional_module/test/include/module_timer_test.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "utils/macro.h"
-#include "functional_module/timer/module_timer.h"
-
-namespace functional_modules {
-
-class TestTrackable : public Trackable {
- public:
- explicit TestTrackable(TimeUnit interval = 0)
- : Trackable(), custom_interval_(interval) {}
-
- virtual TimeUnit custom_interval() const {
- return custom_interval_;
- }
-
- bool operator==(const TestTrackable& other) const {
- return custom_interval_ == other.custom_interval_;
- }
-
- private:
- TimeUnit custom_interval_;
-};
-
-class ModuleTimerTest {
- public:
- ModuleTimerTest(ModuleTimer<TestTrackable>& timer) : timer_(timer) {}
-
- TimeUnit period() const {
- return timer_.period_;
- }
-
- int observers_size() const {
- return timer_.observers_.size();
- }
-
- int trackables_size() const {
- return timer_.trackables_.size();
- }
-
- TestTrackable trackable(const TestTrackable& track) const {
- return *std::find(
- timer_.trackables_.begin(), timer_.trackables_.end(), track);
- }
-
- TimeUnit current_time() const {
- return timer_.CurrentTime();
- }
-
- private:
- ModuleTimer<TestTrackable>& timer_;
-};
-
-class MockTimerObserver : public TimerObserver<TestTrackable> {
- public:
- MOCK_METHOD1(OnTimeoutTriggered, void(const TestTrackable& expired));
-};
-} // namespace functional_modules
diff --git a/src/components/functional_module/test/plugins/CMakeLists.txt b/src/components/functional_module/test/plugins/CMakeLists.txt
deleted file mode 100644
index 7afe8387b8..0000000000
--- a/src/components/functional_module/test/plugins/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-set(target PluginMock)
-
-include_directories (
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${GMOCK_INCLUDE_DIRECTORY}
- ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/
- ${CMAKE_SOURCE_DIR}/src/components/include/
- ${JSONCPP_INCLUDE_DIRECTORY}
-)
-
-set(SOURCES
- ./mock_generic_module.cc
-)
-
-add_library(${target} SHARED ${SOURCES})
-target_link_libraries(${target})
-add_dependencies(${target} MOBILE_API HMI_API)
diff --git a/src/components/functional_module/test/plugins/mock_generic_module.cc b/src/components/functional_module/test/plugins/mock_generic_module.cc
deleted file mode 100644
index dcf6d7d4fe..0000000000
--- a/src/components/functional_module/test/plugins/mock_generic_module.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "mock_generic_module.h"
-
-using functional_modules::GenericModule;
-using functional_modules::RCFunctionID;
-using functional_modules::PluginInfo;
-
-using ::testing::_;
-using ::testing::Return;
-
-MockGenericModule::MockGenericModule() : GenericModule(19) {
- PluginInfo info;
- info.name = "MockGenericModule";
- info.version = 1;
- info.rc_function_list.push_back(static_cast<RCFunctionID>(101));
- info.hmi_function_list.push_back("HMI-Func-1");
-
- EXPECT_CALL(*this, GetPluginInfo()).Times(2).WillRepeatedly(Return(info));
- EXPECT_CALL(*this, set_service(_)).Times(1);
-}
-
-extern "C" GenericModule* Create() {
- return new MockGenericModule();
-}
diff --git a/src/components/functional_module/test/plugins/mock_generic_module.h b/src/components/functional_module/test/plugins/mock_generic_module.h
deleted file mode 100644
index faea0f135d..0000000000
--- a/src/components/functional_module/test/plugins/mock_generic_module.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_
-#define TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_
-
-#include "gmock/gmock.h"
-#include "functional_module/generic_module.h"
-
-using functional_modules::GenericModule;
-using functional_modules::PluginInfo;
-using functional_modules::ProcessResult;
-using functional_modules::ServiceState;
-
-using ::testing::_;
-using ::testing::Return;
-
-class MockGenericModule : public GenericModule {
- public:
- MockGenericModule();
- MOCK_CONST_METHOD0(GetPluginInfo, PluginInfo());
- MOCK_METHOD1(set_service, void(application_manager::ServicePtr service));
- MOCK_METHOD0(service, application_manager::ServicePtr());
- MOCK_METHOD1(ProcessMessage,
- ProcessResult(application_manager::MessagePtr msg));
- MOCK_METHOD1(ProcessHMIMessage,
- ProcessResult(application_manager::MessagePtr msg));
- MOCK_METHOD1(OnServiceStateChanged, void(ServiceState state));
- MOCK_METHOD1(RemoveAppExtension, void(uint32_t app_id));
- MOCK_METHOD1(IsAppForPlugin,
- bool(application_manager::ApplicationSharedPtr app));
- MOCK_METHOD2(OnAppHMILevelChanged,
- void(application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType old_level));
- MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id));
- MOCK_METHOD2(OnApplicationEvent,
- void(functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application));
- MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
- MOCK_METHOD0(RemoveAppExtensions, void());
-};
-
-#endif // TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_
diff --git a/src/components/functional_module/test/src/generic_module_test.cc b/src/components/functional_module/test/src/generic_module_test.cc
deleted file mode 100644
index 71d8325f6d..0000000000
--- a/src/components/functional_module/test/src/generic_module_test.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-#include "driver_generic_module_test.h"
-
-#include "mock_module_observer.h"
-#include "mock_service.h"
-
-using application_manager::ServicePtr;
-using application_manager::MockService;
-
-using ::testing::_;
-
-namespace functional_modules {
-
-TEST(GenericModuleTest, SetService) {
- DriverGenericModuleTest module(18);
- MockService* mock_service = new MockService();
- ServicePtr exp_service(mock_service);
-
- module.set_service(exp_service);
- ServicePtr out_service = module.service();
-
- EXPECT_EQ(exp_service.get(), out_service.get());
-}
-
-TEST(GenericModuleTest, RemoveObserver) {
- DriverGenericModuleTest module(18);
- MockModuleObserver* observer = new MockModuleObserver();
- module.AddObserver(observer);
-
- module.RemoveObserver(observer);
- const DriverGenericModuleTest::Observers& empty = module.observers();
- ASSERT_TRUE(empty.empty());
- delete observer;
-}
-
-TEST(GenericModuleTest, EmptyRemoveObserver) {
- DriverGenericModuleTest module(18);
- MockModuleObserver* observer = new MockModuleObserver();
- module.RemoveObserver(observer);
- const DriverGenericModuleTest::Observers& empty = module.observers();
- ASSERT_TRUE(empty.empty());
- delete observer;
-}
-
-TEST(GenericModuleTest, WrongRemoveObserver) {
- DriverGenericModuleTest module(18);
- MockModuleObserver observer;
- module.AddObserver(&observer);
-
- MockModuleObserver* wrong_observer = new MockModuleObserver();
- module.RemoveObserver(wrong_observer);
- const DriverGenericModuleTest::Observers& empty = module.observers();
- ASSERT_EQ(1u, empty.size());
- EXPECT_EQ(&observer, empty[0]);
- delete wrong_observer;
-}
-
-TEST(GenericModuleTest, CrashRemovedObserver) {
- DriverGenericModuleTest module(18);
- MockModuleObserver* observer = new MockModuleObserver();
- module.AddObserver(observer);
- EXPECT_EQ(13, observer->ObserverMethod());
- module.RemoveObserver(observer);
- EXPECT_EQ(13, observer->ObserverMethod());
- delete observer;
- MockModuleObserver second_observer;
- module.AddObserver(&second_observer);
- EXPECT_EQ(13, second_observer.ObserverMethod());
- module.RemoveObserver(&second_observer);
- EXPECT_EQ(13, second_observer.ObserverMethod());
-}
-
-TEST(GenericModuleTest, NotifyObservers) {
- DriverGenericModuleTest module(3);
- MockModuleObserver observer;
- module.AddObserver(&observer);
-
- EXPECT_CALL(observer, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
-
- application_manager::MessagePtr message;
- module.ProcessMessage(message);
-}
-
-TEST(GenericModuleTest, NotifyObserversComplex) {
- DriverGenericModuleTest module(3);
- MockModuleObserver observer_1;
- module.AddObserver(&observer_1);
- MockModuleObserver observer_2;
- module.AddObserver(&observer_2);
-
- EXPECT_CALL(observer_1, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
- EXPECT_CALL(observer_2, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
-
- application_manager::MessagePtr message;
- module.ProcessMessage(message);
-
- module.RemoveObserver(&observer_1);
- EXPECT_CALL(observer_1, OnError(ModuleObserver::FS_FAILURE, 3)).Times(0);
- EXPECT_CALL(observer_2, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
-
- module.ProcessMessage(message);
-}
-
-} // namespace functional_modules
diff --git a/src/components/functional_module/test/src/module_timer_test.cc b/src/components/functional_module/test/src/module_timer_test.cc
deleted file mode 100644
index 668c3e2955..0000000000
--- a/src/components/functional_module/test/src/module_timer_test.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-#include "module_timer_test.h"
-
-namespace functional_modules {
-
-TEST(ModuleTimerTest, set_period) {
- ModuleTimer<TestTrackable> timer;
- timer.set_period(10000);
- ModuleTimerTest test(timer);
- EXPECT_EQ(10000u, test.period());
-}
-
-TEST(ModuleTimerTest, add_observer) {
- ModuleTimer<TestTrackable> timer;
- ModuleTimerTest test(timer);
- for (size_t i = 0; i < 5; ++i) {
- MockTimerObserver observer;
- timer.AddObserver(&observer);
- }
- EXPECT_EQ(5, test.observers_size());
-}
-
-TEST(ModuleTimerTest, remove_observer) {
- ModuleTimer<TestTrackable> timer;
- ModuleTimerTest test(timer);
-
- MockTimerObserver observer;
- timer.AddObserver(&observer);
- MockTimerObserver observer2;
- timer.AddObserver(&observer2);
- timer.RemoveObserver(&observer);
- EXPECT_EQ(1, test.observers_size());
- MockTimerObserver observer3;
- timer.RemoveObserver(&observer3);
- EXPECT_EQ(1, test.observers_size());
- timer.RemoveObserver(&observer2);
- EXPECT_EQ(0, test.observers_size());
-}
-
-TEST(ModuleTimerTest, start) {
- ModuleTimer<TestTrackable> timer;
- ModuleTimerTest test(timer);
- timer.set_period(1);
- MockTimerObserver observer;
- timer.AddObserver(&observer);
- TestTrackable track;
- timer.AddTrackable(track);
- sleep(2);
- EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(1);
- timer.CheckTimeout();
- EXPECT_EQ(0, test.trackables_size());
- timer.set_period(4);
- timer.AddTrackable(track);
- sleep(2);
- EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(0);
- timer.CheckTimeout();
- EXPECT_EQ(1, test.trackables_size());
- TestTrackable track2(1);
- timer.AddTrackable(track2);
- timer.AddTrackable(track);
- sleep(2);
- EXPECT_CALL(observer, OnTimeoutTriggered(track2)).Times(1);
- EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(0);
- timer.CheckTimeout();
- EXPECT_EQ(1, test.trackables_size());
-}
-
-TEST(ModuleTimerTest, add_trackable) {
- ModuleTimer<TestTrackable> timer;
- ModuleTimerTest test(timer);
- timer.AddTrackable(TestTrackable());
- ASSERT_EQ(1, test.trackables_size());
- // adding the same object twice
- timer.AddTrackable(TestTrackable());
- EXPECT_EQ(1, test.trackables_size());
- // adding another object
- TestTrackable track(3);
- timer.AddTrackable(track);
- ASSERT_EQ(2, test.trackables_size());
- EXPECT_TRUE(test.trackable(track).start_time() - test.current_time() < 1);
- timer.AddTrackable(track);
- sleep(3);
- EXPECT_TRUE(test.current_time() - test.trackable(track).start_time() < 4 &&
- test.current_time() - test.trackable(track).start_time() > 2);
-}
-
-TEST(ModuleTimerTest, remove_trackable) {
- ModuleTimer<TestTrackable> timer;
- ModuleTimerTest test(timer);
- EXPECT_EQ(0, test.trackables_size());
- TestTrackable track1;
- TestTrackable track2(1);
- timer.AddTrackable(track1);
- timer.AddTrackable(track2);
- EXPECT_EQ(2, test.trackables_size());
- timer.RemoveTrackable(track2);
- ASSERT_EQ(1, test.trackables_size());
- TestTrackable track3(2);
- timer.RemoveTrackable(track3);
- ASSERT_EQ(1, test.trackables_size());
- timer.RemoveTrackable(track1);
- ASSERT_EQ(0, test.trackables_size());
-}
-
-TEST(ModuleTimerTest, notify) {
- ModuleTimer<TestTrackable> timer;
- ModuleTimerTest test(timer);
- timer.set_period(1);
- MockTimerObserver observer;
- timer.AddObserver(&observer);
- TestTrackable track;
- timer.AddTrackable(track);
- TestTrackable track2(2);
- timer.AddTrackable(track2);
- sleep(2);
- EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(1);
- EXPECT_CALL(observer, OnTimeoutTriggered(track2)).Times(0);
- timer.CheckTimeout();
- EXPECT_EQ(1, test.trackables_size());
-}
-
-} // namespace functional_modules
diff --git a/src/components/functional_module/test/src/plugin_manager_test.cc b/src/components/functional_module/test/src/plugin_manager_test.cc
deleted file mode 100644
index f99b8b798e..0000000000
--- a/src/components/functional_module/test/src/plugin_manager_test.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-#include "functional_module/plugin_manager.h"
-#include "mock_generic_module.h"
-#include "mock_service.h"
-#include "application_manager/mock_application.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-
-using application_manager::Message;
-using protocol_handler::MajorProtocolVersion;
-using application_manager::MockService;
-using test::components::application_manager_test::MockApplication;
-using ::testing::NiceMock;
-using ::testing::Expectation;
-using ::testing::ReturnRef;
-
-namespace functional_modules {
-
-class PluginManagerTest : public ::testing::Test {
- public:
- PluginManagerTest()
- : manager(utils::MakeShared<PluginManager>())
- , service(utils::MakeShared<MockService>()) {}
-
- protected:
- utils::SharedPtr<PluginManager> manager;
- utils::SharedPtr<MockService> service;
- MockGenericModule* module;
-
- void SetUp() OVERRIDE {
- manager->SetServiceHandler(service);
-
- ASSERT_EQ(1, manager->LoadPlugins("./plugins/"));
- const PluginManager::Modules& plugins = manager->plugins();
- PluginManager::Modules::const_iterator i = plugins.begin();
- module = static_cast<MockGenericModule*>(i->second.get());
- }
-};
-
-TEST_F(PluginManagerTest, ChangePluginsState) {
- ServiceState kState = ServiceState::SUSPENDED;
- EXPECT_CALL(*module, OnServiceStateChanged(kState));
- manager->OnServiceStateChanged(kState);
-}
-
-TEST_F(PluginManagerTest, RemoveAppExtension) {
- const uint32_t kAppId = 2;
- EXPECT_CALL(*module, RemoveAppExtension(kAppId)).Times(1);
- manager->RemoveAppExtension(kAppId);
-}
-
-TEST_F(PluginManagerTest, ProcessMessageFail) {
- Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
- protocol_handler::ServiceType::kRpc));
- application_manager::MessagePtr message(msg);
- msg->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN);
- EXPECT_CALL(*module, ProcessMessage(message)).Times(0);
- manager->ProcessMessage(message);
-}
-
-TEST_F(PluginManagerTest, ProcessMessagePass) {
- Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
- protocol_handler::ServiceType::kRpc));
- application_manager::MessagePtr message(msg);
- msg->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_3);
- msg->set_function_id(101); // see MockGenericModule
- EXPECT_CALL(*module, ProcessMessage(message))
- .Times(1)
- .WillOnce(Return(ProcessResult::PROCESSED));
- manager->ProcessMessage(message);
-}
-
-TEST_F(PluginManagerTest, SDL_events_triggers_module) {
- using namespace functional_modules;
- std::vector<ApplicationEvent> app_events;
- app_events.push_back(ApplicationEvent::kApplicationExit);
- app_events.push_back(ApplicationEvent::kApplicationUnregistered);
-
- application_manager::ApplicationSharedPtr dummy_ptr =
- utils::MakeShared<MockApplication>();
- std::vector<ApplicationEvent>::const_iterator ev = app_events.begin();
- for (; app_events.end() != ev; ++ev) {
- EXPECT_CALL(*module, OnApplicationEvent(*ev, dummy_ptr));
- manager->OnApplicationEvent(*ev, dummy_ptr);
- }
-
- std::vector<PolicyEvent> policy_events;
- policy_events.push_back(PolicyEvent::kApplicationPolicyUpdated);
- policy_events.push_back(PolicyEvent::kApplicationsDisabled);
-
- std::vector<PolicyEvent>::const_iterator ev_policy = policy_events.begin();
- for (; policy_events.end() != ev_policy; ++ev_policy) {
- EXPECT_CALL(*module, OnPolicyEvent(*ev_policy));
- manager->OnPolicyEvent(*ev_policy);
- }
-}
-
-TEST_F(PluginManagerTest, ProcessHMIMessageFail) {
- Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
- protocol_handler::ServiceType::kRpc));
- application_manager::MessagePtr message(msg);
- message->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN);
- EXPECT_CALL(*module, ProcessHMIMessage(message)).Times(0);
- manager->ProcessHMIMessage(message);
-}
-
-TEST_F(PluginManagerTest, ProcessHMIMessagePass) {
- Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
- protocol_handler::ServiceType::kRpc));
- application_manager::MessagePtr message(msg);
- message->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_HMI);
- std::string json = "{\"method\": \"HMI-Func-1\"}"; // see MockGenericModule
- message->set_json_message(json);
- EXPECT_CALL(*module, ProcessHMIMessage(message))
- .Times(1)
- .WillOnce(Return(ProcessResult::PROCESSED));
- manager->ProcessHMIMessage(message);
-}
-
-TEST_F(PluginManagerTest, IsAppForPlugins) {
- using test::components::application_manager_test::MockApplication;
- MockApplication* app = new MockApplication();
- application_manager::ApplicationSharedPtr app_ptr(app);
- EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).Times(1);
- manager->IsAppForPlugins(app_ptr);
-}
-
-TEST_F(PluginManagerTest, OnAppHMILevelChanged) {
- using test::components::application_manager_test::MockApplication;
- NiceMock<MockApplication>* app = new NiceMock<MockApplication>();
- application_manager::ApplicationSharedPtr app_ptr(app);
-
- const application_manager::custom_str::CustomString name("name");
- ON_CALL(*app, name()).WillByDefault(ReturnRef(name));
- mobile_apis::HMILevel::eType level = mobile_apis::HMILevel::eType::HMI_NONE;
- ON_CALL(*app, hmi_level()).WillByDefault(Return(level));
-
- Expectation is_for_plugin =
- EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(true));
- EXPECT_CALL(*module, OnAppHMILevelChanged(app_ptr, _))
- .Times(1)
- .After(is_for_plugin);
- manager->OnAppHMILevelChanged(app_ptr,
- mobile_apis::HMILevel::eType::HMI_FULL);
-}
-
-} // namespace functional_modules
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index 9fb233b446..8fafee1ac5 100644
--- a/src/components/hmi_message_handler/CMakeLists.txt
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -43,7 +43,6 @@ include_directories (
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}
${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/dbus/include/
${CMAKE_SOURCE_DIR}/
${LOG4CXX_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/hmi_message_handler/include
@@ -56,14 +55,6 @@ set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-if (HMIADAPTER STREQUAL "dbus")
- set(EXCLUDE_PATHS messagebroker_adapter.cc)
- set(DBUS_ADAPTER DBus)
-else()
- set(EXCLUDE_PATHS dbus_message_adapter.cc)
- set(DBUS_ADAPTER)
-endif ()
-
list(APPEND EXCLUDE_PATHS
mqueue_adapter.cc
)
@@ -72,7 +63,6 @@ collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
set(LIBRARIES
Utils
- ${DBUS_ADAPTER}
${RTLIB}
)
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
deleted file mode 100644
index beb7a9ad1d..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
-
-#include <string>
-#include "hmi_message_handler/hmi_message_adapter_impl.h"
-#include "dbus/dbus_message_controller.h"
-#include "smart_objects/smart_object.h"
-
-namespace hmi_message_handler {
-
-/**
- * \brief adapter for DBus
- */
-class DBusMessageAdapter : public HMIMessageAdapterImpl,
- public dbus::DBusMessageController {
- public:
- typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
- explicit DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler);
- ~DBusMessageAdapter();
- void SendMessageToHMI(MessageSharedPointer message);
-
- /**
- * \brief subscribes to signals
- */
- void SubscribeTo();
-
- private:
- static const std::string SDL_SERVICE_NAME;
- static const std::string SDL_OBJECT_PATH;
- static const std::string HMI_SERVICE_NAME;
- static const std::string HMI_OBJECT_PATH;
-
- /**
- * \brief sends request to HMI
- * \param obj request
- */
- void Request(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends notification to HMI
- * \param obj notification
- */
- void Notification(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends response to HMI
- * \param obj response
- */
- void Response(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends error response to HMI
- * \param obj error
- */
- void ErrorResponse(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends message to core
- * \param obj
- */
- void SendMessageToCore(const smart_objects::SmartObject& obj);
-};
-
-} // namespace hmi_message_handler
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
index 60dc50ad7a..0a2e3e0f99 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
@@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "json/json.h"
#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "websocket_session.h"
using namespace boost::beast::websocket;
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
index 9692c4aef4..4d177d250f 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
@@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "json/json.h"
#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/threads/thread.h"
#include "utils/threads/message_loop_thread.h"
#include "utils/message_queue.h"
@@ -152,7 +152,7 @@ class WebsocketSession : public std::enable_shared_from_this<WebsocketSession> {
std::string GetComponentName(std::string& method);
protected:
- sync_primitives::atomic_bool stop;
+ std::atomic_bool stop;
private:
void onMessageReceived(Json::Value message);
diff --git a/src/components/hmi_message_handler/mock_hmi_message_handler.h b/src/components/hmi_message_handler/mock_hmi_message_handler.h
index d9060088ff..f4ed601bed 100644
--- a/src/components/hmi_message_handler/mock_hmi_message_handler.h
+++ b/src/components/hmi_message_handler/mock_hmi_message_handler.h
@@ -50,9 +50,9 @@ class MockHMIMessageHandler : public ::hmi_message_handler::HMIMessageHandler {
MOCK_METHOD1(RemoveHMIMessageAdapter, void(HMIMessageAdapter* adapter));
MOCK_CONST_METHOD0(get_settings, const HMIMessageHandlerSettings&());
MOCK_METHOD1(OnMessageReceived,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(OnErrorSending,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(SendMessageToHMI, void(MessageSharedPointer message));
};
} // namespace hmi_message_handler_test
diff --git a/src/components/hmi_message_handler/src/dbus_message_adapter.cc b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
deleted file mode 100644
index 5b0b11e557..0000000000
--- a/src/components/hmi_message_handler/src/dbus_message_adapter.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "hmi_message_handler/dbus_message_adapter.h"
-#include <sstream>
-#include "utils/logger.h"
-#include "formatters/CSmartFactory.h"
-#include "smart_objects/smart_object.h"
-
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-namespace hmi_message_handler {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-
-const std::string DBusMessageAdapter::SDL_SERVICE_NAME = "com.ford.sdl.core";
-const std::string DBusMessageAdapter::SDL_OBJECT_PATH = "/";
-const std::string DBusMessageAdapter::HMI_SERVICE_NAME = "com.ford.sdl.hmi";
-const std::string DBusMessageAdapter::HMI_OBJECT_PATH = "/";
-
-std::vector<std::string>& split(const std::string& s,
- char delim,
- std::vector<std::string>& elems) {
- std::stringstream ss(s);
- std::string item;
- while (std::getline(ss, item, delim)) {
- elems.push_back(item);
- }
- return elems;
-}
-
-DBusMessageAdapter::DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler)
- : HMIMessageAdapterImpl(hmi_msg_handler)
- , DBusMessageController(SDL_SERVICE_NAME,
- SDL_OBJECT_PATH,
- HMI_SERVICE_NAME,
- HMI_OBJECT_PATH) {
- LOG4CXX_INFO(logger_, "Created DBusMessageAdapter");
-}
-
-DBusMessageAdapter::~DBusMessageAdapter() {}
-
-void DBusMessageAdapter::SendMessageToHMI(MessageSharedPointer message) {
- LOG4CXX_INFO(logger_, "DBusMessageAdapter::sendMessageToHMI");
-
- const smart_objects::SmartObject& smart = message->smart_object();
- switch (smart[sos::S_PARAMS][sos::S_MESSAGE_TYPE].asInt()) {
- case hmi_apis::messageType::request:
- Request(smart);
- break;
- case hmi_apis::messageType::notification:
- Notification(smart);
- break;
- case hmi_apis::messageType::response:
- Response(smart);
- break;
- case hmi_apis::messageType::error_response:
- ErrorResponse(smart);
- break;
- case hmi_apis::messageType::INVALID_ENUM:
- default:
- LOG4CXX_WARN(logger_, "Message type is invalid");
- }
-}
-
-void DBusMessageAdapter::SubscribeTo() {
- LOG4CXX_INFO(logger_, "DBusMessageAdapter::subscribeTo");
- DBusMessageController::SubscribeTo("Buttons", "OnButtonEvent");
- DBusMessageController::SubscribeTo("Buttons", "OnButtonPress");
- DBusMessageController::SubscribeTo("UI", "OnCommand");
- DBusMessageController::SubscribeTo("UI", "OnDriverDistraction");
- DBusMessageController::SubscribeTo("UI", "OnSystemContext");
- DBusMessageController::SubscribeTo("UI", "OnLanguageChange");
- DBusMessageController::SubscribeTo("UI", "OnKeyboardInput");
- DBusMessageController::SubscribeTo("UI", "OnTouchEvent");
- DBusMessageController::SubscribeTo("UI", "OnResetTimeout");
- DBusMessageController::SubscribeTo("TTS", "OnResetTimeout");
- DBusMessageController::SubscribeTo("VR", "Started");
- DBusMessageController::SubscribeTo("VR", "Stopped");
- DBusMessageController::SubscribeTo("VR", "OnCommand");
- DBusMessageController::SubscribeTo("VR", "OnLanguageChange");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnReady");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnAppDeactivated");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnStartDeviceDiscovery");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnUpdateDeviceList");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnFindApplications");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnAppActivated");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnExitApplication");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnExitAllApplications");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnDeviceChosen");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnIgnitionCycleOver");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnSystemRequest");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnSystemInfoChanged");
- DBusMessageController::SubscribeTo("TTS", "Started");
- DBusMessageController::SubscribeTo("TTS", "Stopped");
- DBusMessageController::SubscribeTo("TTS", "OnLanguageChange");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnGpsData");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnSpeed");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnRpm");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevel");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevelState");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnInstantFuelConsumption");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnExternalTemperature");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnVin");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnPrndl");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnTirePressure");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnOdometer");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnBeltStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnBodyInformation");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnDeviceStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnDriverBraking");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnWiperStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnHeadLampStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnEngineTorque");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnAccPedalPosition");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnSteeringWheelAngle");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnMyKey");
- DBusMessageController::SubscribeTo("Navigation", "OnTBTClientState");
- DBusMessageController::SubscribeTo("Navigation", "OnWayPointChange");
- DBusMessageController::SubscribeTo("SDL", "OnAllowSDLFunctionality");
- DBusMessageController::SubscribeTo("SDL", "OnReceivedPolicyUpdate");
- DBusMessageController::SubscribeTo("SDL", "OnPolicyUpdate");
- DBusMessageController::SubscribeTo("SDL", "OnAppPermissionConsent");
- DBusMessageController::SubscribeTo("SDL", "OnSystemError");
- DBusMessageController::SubscribeTo("SDL", "AddStatisticsInfo");
- DBusMessageController::SubscribeTo("SDL", "OnDeviceStateChanged");
-
- LOG4CXX_INFO(logger_, "Subscribed to notifications.");
-}
-
-void DBusMessageAdapter::SendMessageToCore(
- const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!handler()) {
- LOG4CXX_WARN(logger_, "DBusMessageAdapter hasn't handler");
- return;
- }
-
- MessageSharedPointer message = new application_manager::Message(
- protocol_handler::MessagePriority::kDefault); // todo: ykazakov constant
- // is a temp solution to
- // finish
- // merge
- // MessagePriority::FromServiceType(message.servicetype)
- // shall be used instead
- message->set_protocol_version(
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
- message->set_smart_object(obj);
- handler()->OnMessageReceived(message);
- LOG4CXX_INFO(logger_, "Successfully sent to observer");
-}
-
-void DBusMessageAdapter::Request(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- MethodCall(id, func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::Notification(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- Signal(func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::Response(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- MethodReturn(id, func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::ErrorResponse(const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Error");
- std::string error = obj[sos::S_PARAMS][sos::kCode].asString();
- std::string description = obj[sos::S_PARAMS][sos::kMessage].asString();
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- Error(id, error, description);
-}
-
-} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc
index 8d3b11add5..4f46026039 100644
--- a/src/components/hmi_message_handler/src/mb_controller.cc
+++ b/src/components/hmi_message_handler/src/mb_controller.cc
@@ -222,7 +222,7 @@ void CMessageBrokerController::exitReceivingThread() {
it;
for (it = mConnectionList.begin(); it != mConnectionList.end();) {
(*it)->Shutdown();
- mConnectionList.erase(it++);
+ it = mConnectionList.erase(it);
}
mConnectionListLock.Release();
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index 53a0d84362..d400cca335 100644
--- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -55,7 +55,7 @@ void MessageBrokerAdapter::SendMessageToHMI(
hmi_message_handler::MessageSharedPointer message) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!message.valid()) {
+ if (message.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Can`t send not valid message");
return;
}
diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc
index 26f15695c9..a148f48661 100644
--- a/src/components/hmi_message_handler/src/websocket_session.cc
+++ b/src/components/hmi_message_handler/src/websocket_session.cc
@@ -319,4 +319,4 @@ void WebsocketSession::LoopThreadDelegate::SetShutdown() {
message_queue_.Shutdown();
}
}
-} \ No newline at end of file
+}
diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt
index 9e855c563e..6d30d6ee51 100644
--- a/src/components/hmi_message_handler/test/CMakeLists.txt
+++ b/src/components/hmi_message_handler/test/CMakeLists.txt
@@ -56,7 +56,7 @@ collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
if (HMIADAPTER STREQUAL "messagebroker")
GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
- list(APPEND LIBRARIES ${BOOST_LIBS_DIRECTORY}/libboost_system.so)
+ list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
endif()
create_test(hmi_message_handler_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
index eead7106c6..73fe76640d 100644
--- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
@@ -31,8 +31,6 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "hmi_message_handler/hmi_message_handler_impl.h"
#include "hmi_message_handler/mock_hmi_message_adapter_impl.h"
@@ -45,7 +43,7 @@ namespace hmi_message_handler_test {
using ::testing::Return;
using hmi_message_handler::HMIMessageHandlerImpl;
-typedef utils::SharedPtr<MockHMIMessageAdapterImpl>
+typedef std::shared_ptr<MockHMIMessageAdapterImpl>
MockHMIMessageAdapterImplSPtr;
TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
@@ -60,7 +58,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
;
MockHMIMessageAdapterImplSPtr message_adapter_impl =
- utils::MakeShared<MockHMIMessageAdapterImpl>(message_handler);
+ std::make_shared<MockHMIMessageAdapterImpl>(message_handler);
EXPECT_EQ(message_handler, message_adapter_impl->get_handler());
@@ -71,7 +69,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
TEST(HMIMessageAdapterImplTest, Handler_NULLPointer_CorrectReturnedPointer) {
HMIMessageHandler* message_handler = NULL;
MockHMIMessageAdapterImplSPtr message_adapter_impl =
- utils::MakeShared<MockHMIMessageAdapterImpl>(message_handler);
+ std::make_shared<MockHMIMessageAdapterImpl>(message_handler);
EXPECT_EQ(NULL, message_adapter_impl->get_handler());
}
diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index fd459ea094..e66f900299 100644
--- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
@@ -86,7 +86,7 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
hmi_message_handler::MessageSharedPointer CreateMessage() {
// The ServiceType doesn't really matter
- return new application_manager::Message(
+ return std::make_shared<application_manager::Message>(
protocol_handler::MessagePriority::FromServiceType(
protocol_handler::ServiceType::kInvalidServiceType));
}
@@ -104,7 +104,7 @@ TEST_F(HMIMessageHandlerImplTest,
TEST_F(HMIMessageHandlerImplTest,
OnErrorSending_NotEmptyMessage_ExpectOnErrorSendingProceeded) {
// Arrange
- utils::SharedPtr<application_manager::Message> message = CreateMessage();
+ std::shared_ptr<application_manager::Message> message = CreateMessage();
EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(message));
// Act
@@ -113,7 +113,7 @@ TEST_F(HMIMessageHandlerImplTest,
TEST_F(HMIMessageHandlerImplTest, OnErrorSending_InvalidObserver_Cancelled) {
// Arrange
- utils::SharedPtr<application_manager::Message> message = CreateMessage();
+ std::shared_ptr<application_manager::Message> message = CreateMessage();
hmi_handler_->set_message_observer(NULL);
EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(_)).Times(0);
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index c7a50199b1..e6e5c89f45 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -33,25 +33,24 @@
#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+#include <ctime>
#include <string>
#include <vector>
#include <set>
#include "application_manager/application.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/commands/command.h"
+#include "application_manager/command_factory.h"
#include "connection_handler/connection_handler.h"
#include "utils/data_accessor.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_observable.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager_settings.h"
#include "application_manager/state_controller.h"
#include "application_manager/hmi_interfaces.h"
#include "policy/policy_types.h"
-#ifdef SDL_REMOTE_CONTROL
-#include "functional_module/plugin_manager.h"
-#endif
-
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
namespace resumption {
class LastState;
}
@@ -82,6 +81,12 @@ namespace application_manager {
namespace event_engine {
class EventDispatcher;
}
+namespace rpc_service {
+class RPCService;
+}
+namespace rpc_handler {
+class RPCHandler;
+}
class Application;
class StateControllerImpl;
@@ -94,7 +99,6 @@ struct ApplicationsAppIdSorter {
return lhs->app_id() < rhs->app_id();
}
};
-
struct ApplicationsPolicyAppIdSorter {
bool operator()(const ApplicationSharedPtr lhs,
const ApplicationSharedPtr rhs) {
@@ -135,8 +139,15 @@ class ApplicationManager {
virtual void set_hmi_message_handler(
hmi_message_handler::HMIMessageHandler* handler) = 0;
+
+ /**
+ * @brief set_protocol_handler
+ * @param handler
+ * set protocol handler
+ */
virtual void set_protocol_handler(
protocol_handler::ProtocolHandler* handler) = 0;
+
virtual void set_connection_handler(
connection_handler::ConnectionHandler* handler) = 0;
@@ -159,7 +170,6 @@ class ApplicationManager {
virtual AppSharedPtrs applications_by_button(uint32_t button) = 0;
virtual AppSharedPtrs applications_with_navi() = 0;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief application find application by device and policy identifier
* @param device_id device id
@@ -176,12 +186,12 @@ class ApplicationManager {
virtual std::vector<std::string> devices(
const std::string& policy_app_id) const = 0;
- virtual void SendPostMessageToMobile(const MessagePtr& message) = 0;
+ virtual plugin_manager::RPCPluginManager& GetPluginManager() = 0;
- virtual void SendPostMessageToHMI(const MessagePtr& message) = 0;
-
- virtual functional_modules::PluginManager& GetPluginManager() = 0;
-#endif // SDL_REMOTE_CONTROL
+#ifdef BUILD_TESTS
+ virtual void SetPluginManager(
+ std::unique_ptr<plugin_manager::RPCPluginManager>& plugin_manager) = 0;
+#endif
virtual std::vector<ApplicationSharedPtr>
applications_with_mobile_projection() = 0;
@@ -230,6 +240,18 @@ class ApplicationManager {
*/
virtual void set_application_id(const int32_t correlation_id,
const uint32_t app_id) = 0;
+ /**
+ * @brief get_current_audio_source
+ * @return current audio source
+ */
+ virtual uint32_t get_current_audio_source() const = 0;
+
+ /**
+ * @brief set_current_audio_source
+ * @param source
+ * set current audio source
+ */
+ virtual void set_current_audio_source(const uint32_t source) = 0;
/**
* @brief OnHMILevelChanged the callback that allows SDL to react when
@@ -251,30 +273,15 @@ class ApplicationManager {
*
**/
virtual void SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) = 0;
-
- /**
- * DEPRECATED
- * @brief Checks if Application is subscribed for way points
- * @param Application AppID
- * @return true if Application is subscribed for way points
- * otherwise false
- */
- virtual bool IsAppSubscribedForWayPoints(const uint32_t app_id) const = 0;
-
- /**
- * DEPRECATED
- * @brief Subscribe Application for way points
- * @param Application AppID
- */
- virtual void SubscribeAppForWayPoints(const uint32_t app_id) = 0;
+ const std::shared_ptr<Application> app) = 0;
/**
- * DEPRECATED
- * @brief Unsubscribe Application for way points
- * @param Application AppID
+ * @brief Checks if driver distraction state is valid, creates message
+ * which is sent to the application if allowed, otherwise it is added
+ * to a list of postponed messages.
+ * @param application contains registered application.
*/
- virtual void UnsubscribeAppFromWayPoints(const uint32_t app_id) = 0;
+ virtual void SendDriverDistractionState(ApplicationSharedPtr application) = 0;
/**
* @brief Checks if Application is subscribed for way points
@@ -306,25 +313,27 @@ class ApplicationManager {
* @brief Get subscribed for way points
* @return reference to set of subscribed apps for way points
*/
- virtual const std::set<int32_t> GetAppsSubscribedForWayPoints() const = 0;
-
- virtual void SendMessageToMobile(const commands::MessageSharedPtr message,
- bool final_message = false) = 0;
-
- virtual void SendMessageToHMI(const commands::MessageSharedPtr message) = 0;
+ virtual const std::set<uint32_t> GetAppsSubscribedForWayPoints() const = 0;
virtual void RemoveHMIFakeParameters(
- application_manager::MessagePtr& message) = 0;
-
- virtual bool ManageHMICommand(const commands::MessageSharedPtr message) = 0;
- virtual bool ManageMobileCommand(const commands::MessageSharedPtr message,
- commands::Command::CommandOrigin origin) = 0;
-
- virtual MessageValidationResult ValidateMessageBySchema(
- const Message& message) = 0;
+ application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id) = 0;
virtual mobile_api::HMILevel::eType GetDefaultHmiLevel(
ApplicationConstSharedPtr application) const = 0;
+
+ /**
+ * @brief Checks if required transport for resumption is available
+ *
+ * The required transport can be configured through smartDeviceLink.ini file.
+ *
+ * @param application an instance of the app to check
+ * @return true if the app is connected through one of the required
+ * transports, false otherwise
+ */
+ virtual bool CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const = 0;
+
/**
* @brief hmi_capabilities return capabilities of hmi
* @return capabilities of hmi
@@ -380,6 +389,11 @@ class ApplicationManager {
virtual policy::PolicyHandlerInterface& GetPolicyHandler() = 0;
virtual const policy::PolicyHandlerInterface& GetPolicyHandler() const = 0;
+ virtual rpc_service::RPCService& GetRPCService() const = 0;
+ virtual rpc_handler::RPCHandler& GetRPCHandler() const = 0;
+ virtual bool is_stopping() const = 0;
+ virtual bool is_audio_pass_thru_active() const = 0;
+
virtual uint32_t GetNextHMICorrelationID() = 0;
virtual uint32_t GenerateNewHMIAppID() = 0;
@@ -389,12 +403,10 @@ class ApplicationManager {
*/
virtual void EndNaviServices(uint32_t app_id) = 0;
- /* @brief Starts audio passthru process
- * @deprecated Use BeginAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is already in process
+ /**
+ * @brief returns true if low voltage state is active
*/
- DEPRECATED virtual bool BeginAudioPassThrough() = 0;
+ virtual bool IsLowVoltage() const = 0;
/**
* @brief Starts AudioPassThru process by given application
@@ -403,14 +415,6 @@ class ApplicationManager {
*/
virtual bool BeginAudioPassThru(uint32_t app_id) = 0;
- /*
- * @brief Finishes already started audio passthru process
- * @deprecated Use EndAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is not active
- */
- DEPRECATED virtual bool EndAudioPassThrough() = 0;
-
/**
* @brief Finishes already started AudioPassThru process by given application
* @param app_id ID of the application which started the process
@@ -431,10 +435,10 @@ class ApplicationManager {
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- virtual AppSharedPtrs IviInfoUpdated(
- mobile_apis::VehicleDataType::eType vehicle_info, int value) = 0;
+ virtual void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info,
+ int value) = 0;
- virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
+ virtual ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration) = 0;
virtual void SendUpdateAppList() = 0;
@@ -469,7 +473,7 @@ class ApplicationManager {
const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset) = 0;
+ const uint64_t offset) = 0;
/*
* @brief Sets SDL access to all mobile apps
*
@@ -613,6 +617,9 @@ class ApplicationManager {
virtual app_launch::AppLaunchCtrl& app_launch_ctrl() = 0;
+ virtual protocol_handler::MajorProtocolVersion SupportedSDLVersion()
+ const = 0;
+
/*
* @brief Converts connection string transport type representation
* to HMI Common_TransportType
@@ -669,30 +676,13 @@ class ApplicationManager {
* @return new regular HMI state
*/
virtual HmiStatePtr CreateRegularState(
- utils::SharedPtr<Application> app,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context) const = 0;
/**
- * DEPRECATED
- * @brief CreateRegularState create regular HMI state for application
- * @param app_id Application id
- * @param hmi_level of returned state
- * @param audio_state of returned state
- * @param system_context of returned state
- * @return new regular HMI state
- */
- virtual HmiStatePtr CreateRegularState(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) const = 0;
-
- virtual void SendAudioPassThroughNotification(
- uint32_t session_key, std::vector<uint8_t>& binary_data) = 0;
-
- /**
* @brief Checks if application can stream (streaming service is started and
* streaming is enabled in application)
* @param app_id Application id
@@ -723,6 +713,9 @@ class ApplicationManager {
std::vector<std::string>& rejected_params) = 0;
virtual const ApplicationManagerSettings& get_settings() const = 0;
+ // Extract the app ID to use internally based on the UseFullAppID .ini setting
+ virtual std::string GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const = 0;
virtual event_engine::EventDispatcher& event_dispatcher() = 0;
@@ -730,6 +723,10 @@ class ApplicationManager {
virtual void OnTimerSendTTSGlobalProperties() = 0;
virtual void OnLowVoltage() = 0;
virtual void OnWakeUp() = 0;
+
+ virtual bool IsSOStructValid(
+ const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities) = 0;
};
} // namespace application_manager
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index e745a831c6..8fdca4125f 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -38,6 +38,8 @@
#include <stdint.h>
#include <string>
+#include <map>
+#include <vector>
namespace application_manager {
class ApplicationManagerSettings : public RequestControlerSettings,
@@ -48,6 +50,8 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const std::pair<uint32_t, int32_t>& read_did_frequency() const = 0;
virtual const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency()
const = 0;
+ virtual const std::pair<uint32_t, int32_t>&
+ get_interior_vehicle_data_frequency() const = 0;
virtual uint32_t hash_string_size() const = 0;
virtual const uint32_t& app_dir_quota() const = 0;
virtual uint32_t stop_streaming_timeout() const = 0;
@@ -80,6 +84,7 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const std::string& video_stream_file() const = 0;
virtual const std::string& audio_stream_file() const = 0;
+ virtual bool use_full_app_id() const = 0;
virtual bool use_db_for_resumption() const = 0;
virtual const uint32_t& app_resumption_save_persistent_data_timeout()
const = 0;
@@ -87,6 +92,13 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const uint32_t& app_resuming_timeout() const = 0;
virtual uint16_t attempts_to_open_resumption_db() const = 0;
virtual uint16_t open_attempt_timeout_ms_resumption_db() const = 0;
+ virtual const std::map<std::string, std::vector<std::string> >&
+ transport_required_for_resumption_map() const = 0;
+ virtual const std::string& navigation_lowbandwidth_resumption_level()
+ const = 0;
+ virtual const std::string& projection_lowbandwidth_resumption_level()
+ const = 0;
+ virtual const std::string& media_lowbandwidth_resumption_level() const = 0;
virtual void set_config_file_name(const std::string& fileName) = 0;
virtual const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const = 0;
diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index f0859ece38..ee9274ead7 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -40,7 +40,6 @@
#include <queue>
#include "interfaces/MOBILE_API.h"
#include "application_manager/policies/policy_handler_observer.h"
-#include "application_manager/core_service.h"
#include "application_manager/application.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "utils/custom_string.h"
@@ -49,10 +48,11 @@
#include "smart_objects/smart_object.h"
#include "policy/policy_types.h"
#include "policy/policy_table/types.h"
+#include "policy/cache_manager_interface.h"
using namespace ::rpc::policy_table_interface_base;
namespace policy {
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyHandlerInterface {
public:
@@ -124,7 +124,7 @@ class PolicyHandlerInterface {
virtual void add_listener(PolicyHandlerObserver* listener) = 0;
virtual void remove_listener(PolicyHandlerObserver* listener) = 0;
- virtual utils::SharedPtr<usage_statistics::StatisticsManager>
+ virtual std::shared_ptr<usage_statistics::StatisticsManager>
GetStatisticManager() const = 0;
virtual void SendOnAppPermissionsChanged(
@@ -391,6 +391,32 @@ class PolicyHandlerInterface {
mobile_apis::RequestType::eType type) const = 0;
/**
+ * @brief Checks if certain request subtype is allowed for application
+ * @param policy_app_id Unique applicaion id
+ * @param request_subtype Request subtype
+ * @return true, if allowed, otherwise - false
+ */
+ virtual bool IsRequestSubTypeAllowed(
+ const std::string& policy_app_id,
+ const std::string& request_subtype) const = 0;
+
+ /**
+ * @brief Gets application request types state
+ * @param policy_app_id Unique application id
+ * @return request types state
+ */
+ virtual RequestType::State GetAppRequestTypeState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Gets application request subtypes state
+ * @param policy_app_id Unique application id
+ * @return request subtypes state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypeState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets application request types
* @param policy_app_id Unique application id
* @return request types
@@ -399,6 +425,14 @@ class PolicyHandlerInterface {
const std::string& policy_app_id) const = 0;
/**
+ * @brief Gets application request subtypes
+ * @param policy_app_id Unique application id
+ * @return app request subtypes
+ */
+ virtual const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets vehicle information
* @return Structure with vehicle information
*/
@@ -436,7 +470,6 @@ class PolicyHandlerInterface {
virtual void OnDeviceSwitching(const std::string& device_id_from,
const std::string& device_id_to) = 0;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Sets HMI default type for specified application
* @param application_id ID application
@@ -501,7 +534,6 @@ class PolicyHandlerInterface {
*/
virtual bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const = 0;
-#endif // SDL_REMOTE_CONTROL
private:
/**
diff --git a/src/components/include/application_manager/rpc_handler.h b/src/components/include/application_manager/rpc_handler.h
new file mode 100644
index 0000000000..9b6428f32d
--- /dev/null
+++ b/src/components/include/application_manager/rpc_handler.h
@@ -0,0 +1,60 @@
+/*
+ * 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_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
+
+#include "protocol_handler/protocol_observer.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+
+#ifdef TELEMETRY_MONITOR
+#include "application_manager/telemetry_observer.h"
+#endif // TELEMETRY_MONITOR
+
+namespace application_manager {
+namespace rpc_handler {
+
+class RPCHandler
+ : public hmi_message_handler::HMIMessageObserver,
+ public protocol_handler::ProtocolObserver
+#ifdef TELEMETRY_MONITOR
+ ,
+ public telemetry_monitor::TelemetryObservable<AMTelemetryObserver>
+#endif // TELEMETRY_MONITOR
+ {
+ public:
+ virtual ~RPCHandler() {}
+};
+
+} // namespace rpc_handler
+} // namespace application_manager
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
diff --git a/src/components/include/application_manager/rpc_service.h b/src/components/include/application_manager/rpc_service.h
new file mode 100644
index 0000000000..79b4007f71
--- /dev/null
+++ b/src/components/include/application_manager/rpc_service.h
@@ -0,0 +1,90 @@
+/*
+ * 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_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_H
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_H
+
+#include "application_manager/commands/command.h"
+#include "application_manager/message.h"
+#include "protocol_handler/protocol_handler.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+
+namespace application_manager {
+namespace rpc_service {
+
+class RPCService {
+ public:
+ virtual ~RPCService() {}
+
+ /**
+ * @brief ManageMobileCommand convert message to mobile command and execute it
+ * @param message pointer to received message
+ * @param origin origin of command
+ * @return true if command is executed, otherwise return false
+ */
+ virtual bool ManageMobileCommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) = 0;
+ /**
+ * @brief ManageHMICommand convert message to HMI command and execute it
+ * @param message pointer to received message
+ * @return true if command is executed, otherwise return false
+ */
+ virtual bool ManageHMICommand(const commands::MessageSharedPtr message) = 0;
+
+ /**
+ * @brief SendMessageToMobile Put message to the queue to be sent to mobile.
+ * @param message pointer to message to send
+ * @param final_message if true - connection to mobile will be closed
+ * after processing this message
+ */
+ virtual void SendMessageToMobile(const commands::MessageSharedPtr message,
+ bool final_message = false) = 0;
+ /**
+ * @brief SendMessageToHMI Put message to the queue to be sent to HMI.
+ * @param message pointer to message to send
+ */
+ virtual void SendMessageToHMI(const commands::MessageSharedPtr message) = 0;
+
+ /**
+ * @brief set_protocol_handler
+ * @param handler
+ * set protocol handler
+ */
+ virtual void set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) = 0;
+ virtual void set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) = 0;
+};
+} // namespace rpc_service
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_H
diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h
index 2fe0492b42..8f608488e9 100644
--- a/src/components/include/application_manager/state_controller.h
+++ b/src/components/include/application_manager/state_controller.h
@@ -49,6 +49,7 @@ class StateController {
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool SendActivateApp) = 0;
virtual void SetRegularState(ApplicationSharedPtr app,
@@ -58,6 +59,7 @@ class StateController {
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool SendActivateApp) = 0;
@@ -67,7 +69,8 @@ class StateController {
virtual void SetRegularState(
ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state) = 0;
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
@@ -82,9 +85,17 @@ class StateController {
virtual int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority) = 0;
+ /**
+ * @brief OnVideoStreamingStarted process video streaming started
+ * @param app projection or navigation application starting streaming
+ */
+ virtual void OnVideoStreamingStarted(ApplicationConstSharedPtr app) = 0;
- virtual void OnNaviStreamingStarted() = 0;
- virtual void OnNaviStreamingStopped() = 0;
+ /**
+ * @brief OnVideoStreamingStopped process video streaming stopped
+ * @param app projection or navigation application stopping streaming
+ */
+ virtual void OnVideoStreamingStopped(ApplicationConstSharedPtr app) = 0;
virtual void OnStateChanged(ApplicationSharedPtr app,
HmiStatePtr old_state,
HmiStatePtr new_state) = 0;
diff --git a/src/components/include/connection_handler/connection_handler.h b/src/components/include/connection_handler/connection_handler.h
index 1fcf5e4477..a50760b547 100644
--- a/src/components/include/connection_handler/connection_handler.h
+++ b/src/components/include/connection_handler/connection_handler.h
@@ -40,6 +40,7 @@
#include "connection_handler/connection.h"
#include "connection_handler/devices_discovery_starter.h"
#include "utils/macro.h"
+#include "utils/data_accessor.h"
/**
* \namespace connection_handler
@@ -51,6 +52,15 @@ enum CloseSessionReason { kCommon = 0, kFlood, kMalformed, kUnauthorizedApp };
class ConnectionHandlerObserver;
+// The SessionConnectionMap keeps track of the primary and secondary transports
+// associated with a session ID
+typedef struct {
+ transport_manager::ConnectionUID primary_transport;
+ transport_manager::ConnectionUID secondary_transport;
+ std::vector<protocol_handler::ServiceType> secondary_transport_services;
+} SessionTransports;
+typedef std::map<uint8_t, SessionTransports> SessionConnectionMap;
+
/**
* \class ConnectionHandler
* \brief SmartDeviceLink ConnectionHandler interface class
@@ -183,21 +193,6 @@ class ConnectionHandler {
connection_handler::DeviceHandle* device_id) const = 0;
/**
- * DEPRECATED
- * \brief information about given Connection Key.
- * \param key Unique key used by other components as session identifier
- * \param app_id Returned: ApplicationID
- * \param sessions_list Returned: List of session keys
- * \param device_id Returned: DeviceID
- * \return int32_t -1 in case of error or 0 in case of success
- */
- DEPRECATED virtual int32_t GetDataOnSessionKey(
- uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id) const = 0;
-
- /**
* @brief GetConnectedDevicesMAC allows to obtain MAC adresses for all
* currently connected devices.
*
@@ -217,6 +212,43 @@ class ConnectionHandler {
virtual DevicesDiscoveryStarter& get_device_discovery_starter() = 0;
/**
+ * \brief Add a session. This is meant to be called from Connection class.
+ * \param primary_transport_id the primary connection ID to associate with the
+ * newly created session
+ * \return new session id, or 0 if failed
+ **/
+ virtual uint32_t AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) = 0;
+
+ /**
+ * \brief Remove a session. This is meant to be called from Connection class.
+ * \param session_id ID of the session to remove
+ * \return true if successful, false otherwise
+ **/
+ virtual bool RemoveSession(uint8_t session_id) = 0;
+
+ virtual DataAccessor<SessionConnectionMap> session_connection_map() = 0;
+
+ /**
+ * \brief Associate a secondary transport ID with a session
+ * \param session_id the session ID
+ * \param connection_id the new secondary connection ID to associate with the
+ * session
+ * \return the SessionTransports (newly) associated with the session
+ **/
+ virtual SessionTransports SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) = 0;
+
+ /**
+ * \brief Retrieve the session transports associated with a session
+ * \param session_id the session ID
+ * \return the SessionTransports associated with the session
+ **/
+ virtual const SessionTransports GetSessionTransports(
+ uint8_t session_id) const = 0;
+
+ /**
* \brief Invoked when observer's OnServiceStartedCallback is completed
* \param session_key the key of started session passed to
* OnServiceStartedCallback().
@@ -232,6 +264,28 @@ class ConnectionHandler {
bool result,
std::vector<std::string>& rejected_params) = 0;
+ /**
+ * \brief Called when secondary transport with given session ID is established
+ * \param primary_connection_handle Set to identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * \param session_id session ID taken from Register Secondary Transport frame
+ * \return true if successful
+ **/
+ virtual bool OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) = 0;
+
+ /**
+ * \brief Called when secondary transport shuts down
+ * \param primary_connection_handle Identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * transport
+ **/
+ virtual void OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h
index b4c04c17c9..154a2a8e34 100644
--- a/src/components/include/connection_handler/connection_handler_observer.h
+++ b/src/components/include/connection_handler/connection_handler_observer.h
@@ -86,19 +86,6 @@ class ConnectionHandlerObserver {
/**
* \brief Callback function used by connection_handler
* when Mobile Application initiates start of new service.
- * \param deviceHandle Device identifier within which session has to be
- * started.
- * \param sessionKey Key of started session.
- * \param type Established service type
- */
- virtual bool OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type) = 0;
-
- /**
- * \brief Callback function used by connection_handler
- * when Mobile Application initiates start of new service.
* Result must be notified through NotifyServiceStartedResult().
* \param deviceHandle Device identifier within which session has to be
* started.
@@ -157,6 +144,23 @@ class ConnectionHandlerObserver {
virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const = 0;
#endif // ENABLE_SECURITY
+
+ /**
+ * \brief Called when secondary transport for a particular app is started.
+ * \param device_handle Device identifier on which the secondary transport is
+ * started.
+ * \param session_key session ID representing the app
+ */
+ virtual void OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) = 0;
+
+ /**
+ * \brief Called when secondary transport for a particular app is terminated.
+ * \param session_key session ID representing the app
+ */
+ virtual void OnSecondaryTransportEndedCallback(const int32_t session_key) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h
index 0676615b53..e7ba2619ee 100644
--- a/src/components/include/hmi_message_handler/hmi_message_observer.h
+++ b/src/components/include/hmi_message_handler/hmi_message_observer.h
@@ -33,8 +33,6 @@
#ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
-#include "utils/shared_ptr.h"
-
namespace application_manager {
class Message;
}
@@ -45,9 +43,9 @@ class HMIMessageObserver {
public:
virtual ~HMIMessageObserver() {}
virtual void OnMessageReceived(
- utils::SharedPtr<application_manager::Message> message) = 0;
+ std::shared_ptr<application_manager::Message> message) = 0;
virtual void OnErrorSending(
- utils::SharedPtr<application_manager::Message> message) = 0;
+ std::shared_ptr<application_manager::Message> message) = 0;
};
}
diff --git a/src/components/include/hmi_message_handler/hmi_message_sender.h b/src/components/include/hmi_message_handler/hmi_message_sender.h
index 91c20a1986..3f70f78a97 100644
--- a/src/components/include/hmi_message_handler/hmi_message_sender.h
+++ b/src/components/include/hmi_message_handler/hmi_message_sender.h
@@ -36,7 +36,7 @@
#include "application_manager/message.h"
namespace hmi_message_handler {
-typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
+typedef std::shared_ptr<application_manager::Message> MessageSharedPointer;
class HMIMessageSender {
public:
diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h
index e850a3fa2b..c446c87d1b 100644
--- a/src/components/include/policy/policy_external/policy/policy_listener.h
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -52,13 +52,6 @@ class PolicyListener {
const Permissions& permissions) = 0;
virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0;
virtual void OnUpdateStatusChanged(const std::string&) = 0;
-
- /**
- * Gets device ID
- * @param policy_app_id
- * @return device ID
- * @deprecated see std::vector<std::string> GetDevicesIds(const std::string&)
- */
virtual std::string OnCurrentDeviceIdUpdateRequired(
const std::string& policy_app_id) = 0;
virtual void OnSystemInfoUpdateRequired() = 0;
@@ -137,7 +130,6 @@ class PolicyListener {
virtual void GetRegisteredLinks(
std::map<std::string, std::string>& out_links) const = 0;
-#ifdef SDL_REMOTE_CONTROL
/**
* Gets devices ids by policy application id
* @param policy_app_id
@@ -173,8 +165,6 @@ class PolicyListener {
virtual void OnUpdateHMIStatus(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level) = 0;
-
-#endif // SDL_REMOTE_CONTROL
};
} // namespace policy
#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h
index 24905671fa..57f6d2f802 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -41,14 +41,12 @@
#include "policy/policy_table/types.h"
#include "policy/policy_listener.h"
#include "policy/usage_statistics/statistics_manager.h"
-
-#ifdef SDL_REMOTE_CONTROL
+#include "policy/cache_manager_interface.h"
#include "policy/access_remote.h"
-#endif // SDL_REMOTE_CONTROL
namespace policy {
class PolicySettings;
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyManager : public usage_statistics::StatisticsManager {
public:
@@ -487,6 +485,22 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& device_id_to) = 0;
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets request types for application
* @param policy_app_id Unique application id
* @return request types of application
@@ -495,6 +509,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string policy_app_id) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ virtual const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Get information about vehicle
* @return vehicle information
*/
@@ -540,7 +562,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
*/
virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Assigns new HMI types for specified application
* @param application_id Unique application id
@@ -588,8 +609,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @param access_remote pointer to new access_remote instance
*/
virtual void set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) = 0;
-#endif // SDL_REMOTE_CONTROL
+ std::shared_ptr<AccessRemote> access_remote) = 0;
/**
* @brief Checks if there is existing URL in the EndpointUrls vector with
diff --git a/src/components/include/policy/policy_external/policy/policy_settings.h b/src/components/include/policy/policy_external/policy/policy_settings.h
index def9fca05a..7eca5129ad 100644
--- a/src/components/include/policy/policy_external/policy/policy_settings.h
+++ b/src/components/include/policy/policy_external/policy/policy_settings.h
@@ -31,6 +31,8 @@ class PolicySettings {
*/
virtual const std::string& policies_snapshot_file_name() const = 0;
+ virtual bool use_full_app_id() const = 0;
+
/**
* @brief Returns system files folder path
*/
diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h
index e8de37d5de..3f6f555bcc 100644
--- a/src/components/include/policy/policy_regular/policy/policy_listener.h
+++ b/src/components/include/policy/policy_regular/policy/policy_listener.h
@@ -112,7 +112,6 @@ class PolicyListener {
*/
virtual void OnCertificateUpdated(const std::string& certificate_data) = 0;
-#ifdef SDL_REMOTE_CONTROL
/**
* Gets devices ids by policy application id
* @param policy_app_id
@@ -148,8 +147,6 @@ class PolicyListener {
virtual void OnUpdateHMIStatus(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level) = 0;
-
-#endif // SDL_REMOTE_CONTROL
};
} // namespace policy
#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
index 3e90cfc094..ee0bae7118 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -41,13 +41,12 @@
#include "policy/policy_table/types.h"
#include "policy/policy_listener.h"
#include "policy/usage_statistics/statistics_manager.h"
-#ifdef SDL_REMOTE_CONTROL
+#include "policy/cache_manager_interface.h"
#include "policy/access_remote.h"
-#endif // SDL_REMOTE_CONTROL
namespace policy {
class PolicySettings;
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyManager : public usage_statistics::StatisticsManager {
public:
@@ -466,6 +465,22 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets request types for application
* @param policy_app_id Unique application id
* @return request types of application
@@ -474,6 +489,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string policy_app_id) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ virtual const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Get information about vehicle
* @return vehicle information
*/
@@ -517,7 +540,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* urls vector
*/
virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
-#ifdef SDL_REMOTE_CONTROL
+
/**
* @brief Assigns new HMI types for specified application
* @param application_id Unique application id
@@ -566,8 +589,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @param access_remote pointer to new access_remote instance
*/
virtual void set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) = 0;
-#endif // SDL_REMOTE_CONTROL
+ std::shared_ptr<AccessRemote> access_remote) = 0;
/**
* @brief Checks if there is existing URL in the EndpointUrls vector with
diff --git a/src/components/include/policy/policy_regular/policy/policy_settings.h b/src/components/include/policy/policy_regular/policy/policy_settings.h
index def9fca05a..35a2d54c3a 100644
--- a/src/components/include/policy/policy_regular/policy/policy_settings.h
+++ b/src/components/include/policy/policy_regular/policy/policy_settings.h
@@ -36,6 +36,8 @@ class PolicySettings {
*/
virtual const std::string& system_files_path() const = 0;
+ virtual bool use_full_app_id() const = 0;
+
virtual ~PolicySettings() {}
};
} // namespace policy
diff --git a/src/components/include/protocol/bson_object_keys.h b/src/components/include/protocol/bson_object_keys.h
index 6f80aeec2b..56bd5cebd6 100644
--- a/src/components/include/protocol/bson_object_keys.h
+++ b/src/components/include/protocol/bson_object_keys.h
@@ -42,6 +42,12 @@ extern const char* height;
extern const char* width;
extern const char* video_protocol;
extern const char* video_codec;
+extern const char* secondary_transports;
+extern const char* audio_service_transports;
+extern const char* video_service_transports;
+extern const char* tcp_ip_address;
+extern const char* tcp_port;
+extern const char* reason;
} // namespace strings
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h
index 00d57a9bf5..1c95020a96 100644
--- a/src/components/include/protocol/common.h
+++ b/src/components/include/protocol/common.h
@@ -167,6 +167,22 @@ enum {
*/
FRAME_DATA_END_SERVICE_NACK = 0x06,
/**
+ *\brief Register Secondary Transport frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT = 0x07,
+ /**
+ *\brief Register Secondary Transport acknowledgement frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK = 0x08,
+ /**
+ *\brief Register Secondary Transport not acknowledgement frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK = 0x09,
+ /**
+ *\brief Transport Event Update frame
+ */
+ FRAME_DATA_TRANSPORT_EVENT_UPDATE = 0xFD,
+ /**
*\brief Service data ACK frame
*/
FRAME_DATA_SERVICE_DATA_ACK = 0xFE,
diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h
index 99cb73ce67..5171d42593 100644
--- a/src/components/include/protocol/raw_message.h
+++ b/src/components/include/protocol/raw_message.h
@@ -33,7 +33,7 @@
#define SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+#include <memory>
#include "protocol/service_type.h"
#include "protocol/message_priority.h"
@@ -114,6 +114,6 @@ class RawMessage {
bool waiting_;
DISALLOW_COPY_AND_ASSIGN(RawMessage);
};
-typedef utils::SharedPtr<RawMessage> RawMessagePtr;
+typedef std::shared_ptr<RawMessage> RawMessagePtr;
} // namespace protocol_handler
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index 6aafd7d53f..d65902030b 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -100,9 +100,23 @@ class ProtocolHandler {
*/
virtual void SendEndSession(int32_t connection_id, uint8_t session_id) = 0;
- virtual void SendEndService(int32_t connection_id,
+ /**
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
+ virtual void SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) = 0;
+
+ /**
+ * \brief Called to notify all handsheke handlers about handshake failure.
+ */
+ virtual void NotifyOnFailedHandshake() = 0;
+
/**
* \brief Protocol handler settings getter
* \return pointer to protocol handler settings class
@@ -111,27 +125,6 @@ class ProtocolHandler {
virtual SessionObserver& get_session_observer() = 0;
/**
- * \brief Called by connection handler to notify the result of
- * OnSessionStartedCallback().
- * \param connection_id Identifier of connection within which session exists
- * \param session_id session ID passed to OnSessionStartedCallback()
- * \param generated_session_id Generated session ID, will be 0 if session is
- * not started
- * \param hash_id Generated Hash ID
- * \param protection whether the service will be protected
- * \param rejected_params list of parameters' name that are rejected.
- * Only valid when generated_session_id is 0. Note, even if
- * generated_session_id is 0, the list may be empty.
- */
- DEPRECATED virtual void NotifySessionStartedResult(
- int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params) = 0;
-
- /**
* @brief Called by connection handler to notify the context of
* OnSessionStartedCallback().
* @param context reference to structure with started session data
diff --git a/src/components/include/protocol_handler/protocol_handler_settings.h b/src/components/include/protocol_handler/protocol_handler_settings.h
index e1107cb2a9..62a24df32c 100644
--- a/src/components/include/protocol_handler/protocol_handler_settings.h
+++ b/src/components/include/protocol_handler/protocol_handler_settings.h
@@ -34,12 +34,6 @@ class ProtocolHandlerSettings {
*/
virtual uint16_t max_supported_protocol_version() const = 0;
- /*
- * @brief Returns true, if SDL 4.0 is enabled
- * @deprecated Use max_supported_protocol_version instead
- */
- DEPRECATED virtual bool enable_protocol_4() const = 0;
-
virtual uint32_t multiframe_waiting_timeout() const = 0;
#ifdef ENABLE_SECURITY
/**
@@ -51,6 +45,28 @@ class ProtocolHandlerSettings {
*/
virtual const std::vector<int>& force_unprotected_service() const = 0;
#endif // ENABLE_SECURITY
+
+ /**
+ * @brief Returns true multiple transports is enabled
+ */
+ virtual const bool multiple_transports_enabled() const = 0;
+
+ /**
+ * @brief Returns list of secondary transports available
+ * for the named primary transport
+ */
+ virtual const std::vector<std::string>& secondary_transports_for_bluetooth()
+ const = 0;
+ virtual const std::vector<std::string>& secondary_transports_for_usb()
+ const = 0;
+ virtual const std::vector<std::string>& secondary_transports_for_wifi()
+ const = 0;
+
+ /**
+ * @brief Returns list of allowed transports for the named service
+ */
+ virtual const std::vector<std::string>& audio_service_transports() const = 0;
+ virtual const std::vector<std::string>& video_service_transports() const = 0;
};
} // namespace protocol_handler
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_SETTINGS_H_
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
index 3482c6569c..e71557fecf 100644
--- a/src/components/include/protocol_handler/session_observer.h
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -59,6 +59,7 @@ enum { HASH_ID_NOT_SUPPORTED = 0, HASH_ID_WRONG = 0xFFFF0000 };
* @brief Struct with data containing attributes of starting session
**/
struct SessionContext {
+ transport_manager::ConnectionUID primary_connection_id_;
transport_manager::ConnectionUID connection_id_;
uint8_t initial_session_id_;
uint8_t new_session_id_;
@@ -66,23 +67,24 @@ struct SessionContext {
uint32_t hash_id_;
bool is_protected_;
bool is_new_service_;
- bool is_ptu_required_;
/**
* @brief Constructor
*/
SessionContext()
- : connection_id_(0)
+ : primary_connection_id_(0)
+ , connection_id_(0)
, initial_session_id_(0)
, new_session_id_(0)
, service_type_(protocol_handler::kInvalidServiceType)
, hash_id_(0)
, is_protected_(false)
- , is_new_service_(false)
- , is_ptu_required_(false) {}
+ , is_new_service_(false) {}
/**
* @brief Constructor
+ * @param primary_connection_id Connection identifier of the primary
+ * connection in which the session is started
* @param connection_id_ Connection identifier within which session is
* started.
* @param session_id Session ID specified to OnSessionStartedCallback()
@@ -93,20 +95,21 @@ struct SessionContext {
* @param is_protected Whether service will be protected
* @param is_new_service Whether service was already established
**/
- SessionContext(transport_manager::ConnectionUID connection_id,
+ SessionContext(transport_manager::ConnectionUID primary_connection_id,
+ transport_manager::ConnectionUID connection_id,
uint8_t session_id,
uint8_t new_session_id,
protocol_handler::ServiceType service_type,
uint32_t hash_id,
const bool is_protected)
- : connection_id_(connection_id)
+ : primary_connection_id_(primary_connection_id)
+ , connection_id_(connection_id)
, initial_session_id_(session_id)
, new_session_id_(new_session_id)
, service_type_(service_type)
, hash_id_(hash_id)
, is_protected_(is_protected)
- , is_new_service_(false)
- , is_ptu_required_(false) {}
+ , is_new_service_(false) {}
};
/**
@@ -122,26 +125,6 @@ class SessionObserver {
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates start of new session.
- * \param connection_handle Connection identifier within which session
- * has to be started.
- * \param sessionId Identifier of the session to be start
- * \param service_type Type of service
- * \param protocol_version Version of protocol
- * \param is_protected would be service protected
- * \param hash_id pointer for session hash identifier, uint32_t* hash_id
- * \return uint32_t Id (number) of new session if successful, otherwise 0.
- * \deprecated
- */
- DEPRECATED virtual uint32_t OnSessionStartedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t sessionId,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id) = 0;
-
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates start of new session.
* Result must be notified through NotifySessionStartedContext().
* \param connection_handle Connection identifier within which session
* has to be started.
@@ -164,24 +147,6 @@ class SessionObserver {
* \param connection_handle Connection identifier within which session exists
* \param sessionId Identifier of the session to be ended
* \param hashCode Hash used only in second version of SmartDeviceLink
- * protocol.
- * If not equal to hash assigned to session on start then operation fails.
- * \param service_type Type of service
- * \return uint32_t 0 if operation fails, session key otherwise
- * \deprecated
- */
- DEPRECATED virtual uint32_t OnSessionEndedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t sessionId,
- const uint32_t& hashCode,
- const protocol_handler::ServiceType& service_type) = 0;
-
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates session ending.
- * \param connection_handle Connection identifier within which session exists
- * \param sessionId Identifier of the session to be ended
- * \param hashCode Hash used only in second version of SmartDeviceLink
* protocol. (Set to HASH_ID_WRONG if the hash is incorrect)
* If not equal to hash assigned to session on start then operation fails.
* \param service_type Type of service
@@ -208,6 +173,24 @@ class SessionObserver {
virtual void OnMalformedMessageCallback(const uint32_t& connection_key) = 0;
/**
+ * @brief Converts connection handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param connection_handle A connection identifier
+ * @return string representation of the transport of the device
+ */
+ virtual const std::string TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const = 0;
+
+ /**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ virtual const std::string TransportTypeProfileStringFromDeviceHandle(
+ transport_manager::DeviceHandle device_handle) const = 0;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
@@ -231,20 +214,6 @@ class SessionObserver {
uint8_t* sessionId) const = 0;
/**
- * DEPRECATED
- * \brief information about given Connection Key.
- * \param key Unique key used by other components as session identifier
- * \param app_id Returned: ApplicationID
- * \param sessions_list Returned: List of session keys
- * \param device_id Returned: DeviceID
- * \return int32_t -1 in case of error or 0 in case of success
- */
- virtual int32_t GetDataOnSessionKey(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id) const = 0;
-
- /**
* \brief information about given Connection Key.
* \param key Unique key used by other components as session identifier
* \param app_id Returned: ApplicationID
diff --git a/src/components/include/protocol_handler/telemetry_observer.h b/src/components/include/protocol_handler/telemetry_observer.h
index a76fbce717..b2bf94de35 100644
--- a/src/components/include/protocol_handler/telemetry_observer.h
+++ b/src/components/include/protocol_handler/telemetry_observer.h
@@ -45,12 +45,12 @@ class PHTelemetryObserver {
RawMessagePtr raw_msg;
uint32_t message_id;
uint8_t connection_key;
- TimevalStruct begin;
- TimevalStruct end;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
};
- virtual void StartMessageProcess(uint32_t message_id,
- const TimevalStruct& start_time) = 0;
- virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m) = 0;
+ virtual void StartMessageProcess(
+ uint32_t message_id, const date_time::TimeDuration& start_time) = 0;
+ virtual void EndMessageProcess(std::shared_ptr<MessageMetric> m) = 0;
virtual ~PHTelemetryObserver() {}
};
} // protocol_handler
diff --git a/src/components/include/security_manager/crypto_manager.h b/src/components/include/security_manager/crypto_manager.h
index 18c06ffe06..486b6da64f 100644
--- a/src/components/include/security_manager/crypto_manager.h
+++ b/src/components/include/security_manager/crypto_manager.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
+#include <time.h>
#include "application_manager/policies/policy_handler_observer.h"
#include "security_manager/security_manager_settings.h"
@@ -65,8 +66,16 @@ class CryptoManager : public policy::PolicyHandlerObserver {
virtual bool OnCertificateUpdated(const std::string& data) = 0;
virtual void ReleaseSSLContext(SSLContext* context) = 0;
virtual std::string LastError() const = 0;
-
- virtual bool IsCertificateUpdateRequired() const = 0;
+ /**
+ * @brief IsCertificateUpdateRequired checks if certificate update is needed
+ * @param system_time - time with which certificate expiration time
+ * should be compared
+ * @param certificates_time - certificate expiration time
+ * @return True if certificate expired and need to be updated
+ * otherwise False
+ */
+ virtual bool IsCertificateUpdateRequired(
+ const time_t system_time, const time_t certificates_time) const = 0;
/**
* \brief Crypto manager settings getter
* \return pointer to crypto manager settings class
diff --git a/src/components/include/security_manager/security_manager.h b/src/components/include/security_manager/security_manager.h
index 8f772f6a13..61ba43c74f 100644
--- a/src/components/include/security_manager/security_manager.h
+++ b/src/components/include/security_manager/security_manager.h
@@ -41,6 +41,7 @@
#include "protocol_handler/session_observer.h"
#include "security_manager/security_manager_listener.h"
+#include "application_manager/policies/policy_handler_observer.h"
namespace security_manager {
@@ -50,7 +51,8 @@ class CryptoManager;
* protocol_handler::ProtocolObserver
* and provide interface for handling Security queries from mobile side
*/
-class SecurityManager : public protocol_handler::ProtocolObserver {
+class SecurityManager : public protocol_handler::ProtocolObserver,
+ public policy::PolicyHandlerObserver {
public:
/**
* \brief InternalErrors is 1 byte identifier of internal error
@@ -70,6 +72,10 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
ERROR_INTERNAL = 0xFF,
ERROR_UNKNOWN_INTERNAL_ERROR = 0xFE // error value for testing
};
+
+ // SSL context creation strategy
+ enum ContextCreationStrategy { kUseExisting = 0, kForceRecreation };
+
/**
* \brief Sets pointer for Connection Handler layer for managing sessions
* \param session_observer pointer to object of the class implementing
@@ -114,13 +120,15 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
}
/**
- * \brief Create new SSLContext for connection or return exists
+ * @brief Create new SSLContext for connection or return exists
* Do not notify listeners, send security error on occure
- * \param connection_key Unique key used by other components as session
+ * @param connection_key Unique key used by other components as session
* identifier
+ * @param cc_strategy - SSL context creation strategy
* @return new \c SSLContext or \c NULL on any error
*/
- virtual SSLContext* CreateSSLContext(const uint32_t& connection_key) = 0;
+ virtual SSLContext* CreateSSLContext(const uint32_t& connection_key,
+ ContextCreationStrategy cc_strategy) = 0;
/**
* \brief Start handshake as SSL client
@@ -128,10 +136,26 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
virtual void StartHandshake(uint32_t connection_key) = 0;
/**
+ * @brief PostponeHandshake allows to postpone handshake. It notifies
+ * cryptomanager that certificate should be updated and adds specified
+ * connection key to the list of the certificate awaiting connections.
+ * @param connection_key the identifier for connection to postpone handshake.
+ */
+ virtual void PostponeHandshake(const uint32_t connection_key) = 0;
+
+ /**
* @brief Check whether certificate should be updated
+ * @param connection_key the connection identifier to check certificate for.
* @return true if certificate should be updated otherwise false
*/
- virtual bool IsCertificateUpdateRequired() = 0;
+ virtual bool IsCertificateUpdateRequired(const uint32_t connection_key) = 0;
+
+ /**
+ * @brief Checks whether system time ready notification
+ * was received from hmi
+ * @return true if received otherwise false
+ */
+ virtual bool IsSystemTimeProviderReady() const = 0;
/**
* @brief Notify all listeners that certificate update required
@@ -140,6 +164,11 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
virtual void NotifyOnCertificateUpdateRequired() = 0;
/**
+ * @brief Notify all listeners that handshake was failed
+ */
+ virtual void NotifyListenersOnHandshakeFailed() = 0;
+
+ /**
* @brief Check if policy certificate data is empty
* @return true if policy certificate data is empty otherwise false
*/
@@ -150,6 +179,18 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
*/
virtual void AddListener(SecurityManagerListener* const listener) = 0;
virtual void RemoveListener(SecurityManagerListener* const listener) = 0;
+
+ /**
+ * @brief OnCertificateUpdated allows to obtain notification when certificate
+ * has been updated with policy table update. Pass this certificate to crypto
+ * manager for further processing. Also process postopnes handshake for the
+ * certain connection key.
+ *
+ * @param data the certificates content.
+ *
+ * @return always true.
+ */
+ virtual bool OnCertificateUpdated(const std::string& data) = 0;
};
} // namespace security_manager
#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_H_
diff --git a/src/components/include/security_manager/security_manager_listener.h b/src/components/include/security_manager/security_manager_listener.h
index aeb3334a56..00a4c68134 100644
--- a/src/components/include/security_manager/security_manager_listener.h
+++ b/src/components/include/security_manager/security_manager_listener.h
@@ -47,6 +47,13 @@ class SecurityManagerListener {
*/
virtual bool OnHandshakeDone(uint32_t connection_key,
SSLContext::HandshakeResult result) = 0;
+
+ /**
+ * @brief Notification about handshake failure
+ * @return true on success notification handling or false otherwise
+ */
+ virtual bool OnHandshakeFailed() = 0;
+
/**
* @brief Notify listeners that certificate update is required.
*/
diff --git a/src/components/include/security_manager/security_manager_settings.h b/src/components/include/security_manager/security_manager_settings.h
index c6b97f85cc..0bbe0f4f96 100644
--- a/src/components/include/security_manager/security_manager_settings.h
+++ b/src/components/include/security_manager/security_manager_settings.h
@@ -33,12 +33,16 @@
#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_SETTINGS_H_
+#include <stddef.h>
+#include <string>
+#include <vector>
+
namespace security_manager {
enum Mode { CLIENT, SERVER };
-enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2 };
+enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2, DTLSv1 };
/**
- * \class ConnectionHandlerSettings
- * \brief Interface for connection handler component settings.
+ * \class CryptoManagerSettings
+ * \brief Interface for crypto manager component settings.
*/
class CryptoManagerSettings {
public:
@@ -50,8 +54,12 @@ class CryptoManagerSettings {
virtual const std::string& certificate_data() const = 0;
virtual const std::string& ciphers_list() const = 0;
virtual const std::string& ca_cert_path() const = 0;
+ virtual const std::string& module_cert_path() const = 0;
+ virtual const std::string& module_key_path() const = 0;
virtual size_t update_before_hours() const = 0;
virtual size_t maximum_payload_size() const = 0;
+ virtual const std::vector<int>& force_protected_service() const = 0;
+ virtual const std::vector<int>& force_unprotected_service() const = 0;
};
} // namespace security_manager
diff --git a/src/components/include/security_manager/security_query.h b/src/components/include/security_manager/security_query.h
index cdad1c746c..8aa5b60853 100644
--- a/src/components/include/security_manager/security_query.h
+++ b/src/components/include/security_manager/security_query.h
@@ -37,7 +37,7 @@
#include <cstddef>
#include <vector>
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace security_manager {
/**
@@ -189,6 +189,6 @@ class SecurityQuery {
/**
*\brief SmartPointer wrapper
*/
-typedef utils::SharedPtr<SecurityQuery> SecurityQueryPtr;
+typedef std::shared_ptr<SecurityQuery> SecurityQueryPtr;
} // namespace security_manager
#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
diff --git a/src/components/include/security_manager/ssl_context.h b/src/components/include/security_manager/ssl_context.h
index 86997edbd9..7d52c72abe 100644
--- a/src/components/include/security_manager/ssl_context.h
+++ b/src/components/include/security_manager/ssl_context.h
@@ -77,14 +77,16 @@ class SSLContext {
};
struct HandshakeContext {
- HandshakeContext() : expected_sn(""), expected_cn("") {}
+ HandshakeContext()
+ : expected_sn(""), expected_cn(""), system_time(time(NULL)) {}
HandshakeContext(const custom_str::CustomString& exp_sn,
const custom_str::CustomString& exp_cn)
- : expected_sn(exp_sn), expected_cn(exp_cn) {}
+ : expected_sn(exp_sn), expected_cn(exp_cn), system_time(time(NULL)) {}
custom_str::CustomString expected_sn;
custom_str::CustomString expected_cn;
+ time_t system_time;
};
virtual HandshakeResult StartHandshake(const uint8_t** const out_data,
@@ -103,6 +105,14 @@ class SSLContext {
size_t* out_data_size) = 0;
virtual bool IsInitCompleted() const = 0;
virtual bool IsHandshakePending() const = 0;
+ /**
+ * @brief GetCertificateDueDate gets certificate expiration date
+ * @param due_date - certificate expiration time to be received
+ * @return True if certificate expiration date received
+ * otherwise False
+ */
+ virtual bool GetCertificateDueDate(time_t& due_date) const = 0;
+ virtual bool HasCertificate() const = 0;
virtual size_t get_max_block_size(size_t mtu) const = 0;
virtual std::string LastError() const = 0;
diff --git a/src/components/include/test/application_manager/mock_app_extension.h b/src/components/include/test/application_manager/mock_app_extension.h
new file mode 100644
index 0000000000..5898bc9b72
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_app_extension.h
@@ -0,0 +1,62 @@
+/*
+ * 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_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/app_extension.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace {
+static unsigned MockAppExtensionUID = 123;
+} // namespace
+
+class MockAppExtension : public application_manager::AppExtension {
+ public:
+ MockAppExtension() : AppExtension(MockAppExtensionUID) {}
+ MOCK_METHOD1(SaveResumptionData,
+ void(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data));
+ MOCK_METHOD1(ProcessResumption,
+ void(const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
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 452a1e6c39..7f5f17a93d 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -35,6 +35,7 @@
#include <string>
#include <vector>
+#include <memory>
#include "gmock/gmock.h"
@@ -51,10 +52,13 @@
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/state_controller.h"
#include "smart_objects/smart_object.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/command_factory.h"
namespace test {
namespace components {
namespace application_manager_test {
+using application_manager::plugin_manager::RPCPluginManager;
class MockApplicationManager : public application_manager::ApplicationManager {
public:
@@ -74,22 +78,18 @@ class MockApplicationManager : public application_manager::ApplicationManager {
application, application_manager::ApplicationSharedPtr(uint32_t app_id));
MOCK_CONST_METHOD0(active_application,
application_manager::ApplicationSharedPtr());
-
-#ifdef SDL_REMOTE_CONTROL
MOCK_CONST_METHOD2(application,
application_manager::ApplicationSharedPtr(
const std::string& device_id,
const std::string& policy_app_id));
MOCK_METHOD2(ChangeAppsHMILevel,
void(uint32_t app_id, mobile_apis::HMILevel::eType level));
- MOCK_METHOD0(GetPluginManager, functional_modules::PluginManager&());
MOCK_CONST_METHOD1(
devices, std::vector<std::string>(const std::string& policy_app_id));
- MOCK_METHOD1(SendPostMessageToMobile,
- void(const application_manager::MessagePtr& message));
- MOCK_METHOD1(SendPostMessageToHMI,
- void(const application_manager::MessagePtr& message));
-#endif // SDL_REMOTE_CONTROL
+ MOCK_METHOD0(GetPluginManager, RPCPluginManager&());
+
+ MOCK_METHOD1(SetPluginManager,
+ void(std::unique_ptr<RPCPluginManager>& plugin_manager));
MOCK_CONST_METHOD1(
application_by_hmi_app,
@@ -121,21 +121,12 @@ class MockApplicationManager : public application_manager::ApplicationManager {
mobile_apis::HMILevel::eType to));
MOCK_METHOD1(
SendHMIStatusNotification,
- void(const utils::SharedPtr<application_manager::Application> app));
- MOCK_METHOD2(SendMessageToMobile,
- void(application_manager::commands::MessageSharedPtr, bool));
- MOCK_METHOD1(
- SendMessageToHMI,
- void(const application_manager::commands::MessageSharedPtr message));
- MOCK_METHOD1(RemoveHMIFakeParameters,
- void(application_manager::MessagePtr& message));
- MOCK_METHOD1(
- ManageHMICommand,
- bool(const application_manager::commands::MessageSharedPtr message));
- MOCK_METHOD2(
- ManageMobileCommand,
- bool(const application_manager::commands::MessageSharedPtr message,
- application_manager::commands::Command::CommandOrigin origin));
+ void(const std::shared_ptr<application_manager::Application> app));
+ MOCK_METHOD1(SendDriverDistractionState,
+ void(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD2(RemoveHMIFakeParameters,
+ void(application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id));
MOCK_CONST_METHOD1(
GetDefaultHmiLevel,
mobile_apis::HMILevel::eType(
@@ -143,10 +134,14 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&());
MOCK_CONST_METHOD0(hmi_capabilities,
const application_manager::HMICapabilities&());
+ MOCK_CONST_METHOD1(
+ CheckResumptionRequiredTransportAvailable,
+ bool(application_manager::ApplicationConstSharedPtr application));
MOCK_METHOD2(ProcessQueryApp,
void(const smart_objects::SmartObject& sm_object,
const uint32_t connection_key));
MOCK_CONST_METHOD0(is_attenuated_supported, bool());
+ MOCK_CONST_METHOD0(IsLowVoltage, bool());
MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited,
bool(application_manager::ApplicationConstSharedPtr app));
MOCK_METHOD1(OnApplicationRegistered,
@@ -158,22 +153,25 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD0(protocol_handler, protocol_handler::ProtocolHandler&());
MOCK_METHOD0(GetPolicyHandler, policy::PolicyHandlerInterface&());
MOCK_CONST_METHOD0(GetPolicyHandler, const policy::PolicyHandlerInterface&());
+ MOCK_CONST_METHOD0(GetRPCService,
+ application_manager::rpc_service::RPCService&());
+ MOCK_CONST_METHOD0(GetRPCHandler,
+ application_manager::rpc_handler::RPCHandler&());
+ MOCK_CONST_METHOD0(is_stopping, bool());
+ MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool());
MOCK_METHOD0(GetNextHMICorrelationID, uint32_t());
MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
MOCK_METHOD1(EndNaviServices, void(uint32_t app_id));
- DEPRECATED MOCK_METHOD0(BeginAudioPassThrough, bool());
MOCK_METHOD1(BeginAudioPassThru, bool(uint32_t app_id));
- DEPRECATED MOCK_METHOD0(EndAudioPassThrough, bool());
MOCK_METHOD1(EndAudioPassThru, bool(uint32_t app_id));
MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
MOCK_METHOD0(OnHMIStartedCooperation, void());
MOCK_CONST_METHOD0(IsHMICooperating, bool());
MOCK_METHOD2(IviInfoUpdated,
- std::vector<application_manager::ApplicationSharedPtr>(
- mobile_apis::VehicleDataType::eType vehicle_info,
- int value));
+ void(mobile_apis::VehicleDataType::eType vehicle_info,
+ int value));
MOCK_METHOD1(RegisterApplication,
- application_manager::ApplicationSharedPtr(const utils::SharedPtr<
+ application_manager::ApplicationSharedPtr(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration));
MOCK_METHOD0(SendUpdateAppList, void());
MOCK_METHOD2(MarkAppsGreyOut,
@@ -189,7 +187,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset));
+ const uint64_t offset));
MOCK_METHOD1(SetAllAppsAllowed, void(const bool allowed));
MOCK_METHOD1(
set_driver_distraction_state,
@@ -234,6 +232,8 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD0(resume_controller, resumption::ResumeCtrl&());
MOCK_METHOD0(hmi_interfaces, application_manager::HmiInterfaces&());
MOCK_METHOD0(app_launch_ctrl, app_launch::AppLaunchCtrl&());
+ MOCK_CONST_METHOD0(SupportedSDLVersion,
+ protocol_handler::MajorProtocolVersion());
MOCK_METHOD1(
GetDeviceTransportType,
hmi_apis::Common_TransportType::eType(const std::string& transport_type));
@@ -248,19 +248,13 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(uint32_t app_id,
protocol_handler::ServiceType service_type,
bool state));
- MOCK_CONST_METHOD4(CreateRegularState,
+ MOCK_CONST_METHOD5(CreateRegularState,
application_manager::HmiStatePtr(
application_manager::ApplicationSharedPtr app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context));
- DEPRECATED MOCK_CONST_METHOD4(
- CreateRegularState,
- application_manager::HmiStatePtr(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context));
MOCK_METHOD2(SendAudioPassThroughNotification,
void(uint32_t session_key, std::vector<uint8_t>& binary_data));
@@ -270,13 +264,16 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
MOCK_CONST_METHOD0(get_settings,
const application_manager::ApplicationManagerSettings&());
+ MOCK_CONST_METHOD1(
+ GetCorrectMobileIDFromMessage,
+ std::string(
+ const application_manager::commands::MessageSharedPtr& message));
MOCK_METHOD0(event_dispatcher,
application_manager::event_engine::EventDispatcher&());
- DEPRECATED MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints,
- bool(const uint32_t));
- DEPRECATED MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t));
- DEPRECATED MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t));
+ MOCK_METHOD2(IsSOStructValid,
+ bool(const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities));
MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints,
bool(application_manager::ApplicationSharedPtr));
MOCK_METHOD1(SubscribeAppForWayPoints,
@@ -284,7 +281,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD1(UnsubscribeAppFromWayPoints,
void(application_manager::ApplicationSharedPtr));
MOCK_CONST_METHOD0(IsAnyAppSubscribedForWayPoints, bool());
- MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<int32_t>());
+ MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<uint32_t>());
MOCK_CONST_METHOD1(
WaitingApplicationByID,
application_manager::ApplicationConstSharedPtr(const uint32_t));
@@ -306,14 +303,14 @@ class MockApplicationManager : public application_manager::ApplicationManager {
protocol_handler::ServiceType service_type,
bool result,
std::vector<std::string>& rejected_params));
- MOCK_METHOD1(ValidateMessageBySchema,
- application_manager::MessageValidationResult(
- const application_manager::Message& message));
MOCK_METHOD2(ProcessReconnection,
void(application_manager::ApplicationSharedPtr application,
const uint32_t connection_key));
MOCK_CONST_METHOD1(IsAppInReconnectMode,
bool(const std::string& policy_app_id));
+ MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&());
+ MOCK_CONST_METHOD0(get_current_audio_source, uint32_t());
+ MOCK_METHOD1(set_current_audio_source, void(const uint32_t));
};
} // namespace application_manager_test
diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h
index 25cf994566..cfabf41b91 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
@@ -55,6 +55,8 @@ class MockApplicationManagerSettings
// typedef for the return type.
MOCK_CONST_METHOD0(get_vehicle_data_frequency,
const std::pair<uint32_t, int32_t>&());
+ MOCK_CONST_METHOD0(get_interior_vehicle_data_frequency,
+ const std::pair<uint32_t, int32_t>&());
MOCK_CONST_METHOD0(hash_string_size, uint32_t());
MOCK_CONST_METHOD0(app_storage_folder, const std::string&());
MOCK_CONST_METHOD0(app_info_storage, const std::string&());
@@ -87,6 +89,7 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(named_audio_pipe_path, const std::string&());
MOCK_CONST_METHOD0(video_stream_file, const std::string&());
MOCK_CONST_METHOD0(audio_stream_file, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
MOCK_CONST_METHOD0(use_db_for_resumption, bool());
MOCK_CONST_METHOD0(app_resumption_save_persistent_data_timeout,
const uint32_t&());
@@ -95,6 +98,13 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(app_resuming_timeout, const uint32_t&());
MOCK_CONST_METHOD0(attempts_to_open_resumption_db, uint16_t());
MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, uint16_t());
+ MOCK_CONST_METHOD0(transport_required_for_resumption_map,
+ std::map<std::string, std::vector<std::string> >&());
+ MOCK_CONST_METHOD0(navigation_lowbandwidth_resumption_level,
+ const std::string&());
+ MOCK_CONST_METHOD0(projection_lowbandwidth_resumption_level,
+ const std::string&());
+ MOCK_CONST_METHOD0(media_lowbandwidth_resumption_level, const std::string&());
MOCK_METHOD1(set_config_file_name, void(const std::string& fileName));
// The following line won't really compile, as the return
// type has multiple template arguments. To fix it, use a
diff --git a/src/components/include/test/application_manager/mock_rpc_plugin.h b/src/components/include/test/application_manager/mock_rpc_plugin.h
new file mode 100644
index 0000000000..1f7dd8951b
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_rpc_plugin.h
@@ -0,0 +1,30 @@
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
+
+#include "gmock/gmock.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
+
+namespace application_manager {
+class CommandFactory;
+namespace plugin_manager {
+
+class MockRPCPlugin : public RPCPlugin {
+ public:
+ MOCK_METHOD4(Init,
+ bool(ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler));
+ MOCK_METHOD2(IsAbleToProcess,
+ bool(const int32_t function_id,
+ const commands::Command::CommandSource message_source));
+ MOCK_METHOD0(PluginName, std::string());
+ MOCK_METHOD0(GetCommandFactory, CommandFactory&());
+ MOCK_METHOD1(OnPolicyEvent, void(PolicyEvent event));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application));
+};
+} // namespace plugin_manager
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
diff --git a/src/components/include/test/application_manager/mock_rpc_plugin_manager.h b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h
new file mode 100644
index 0000000000..74763f00d6
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h
@@ -0,0 +1,24 @@
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_
+#include <string>
+
+#include "gmock/gmock.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+
+namespace application_manager {
+namespace plugin_manager {
+
+class MockRPCPluginManager : public RPCPluginManager {
+ public:
+ MOCK_METHOD1(LoadPlugins, uint32_t(const std::string& plugins_path));
+ MOCK_METHOD0(GetPlugins, std::vector<RPCPluginPtr>&());
+ MOCK_METHOD2(FindPluginToProcess,
+ utils::Optional<RPCPlugin>(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source));
+ MOCK_METHOD1(ForEachPlugin, void(std::function<void(RPCPlugin&)> functor));
+};
+
+} // namespace plugin_manager
+} // namespace application_manager
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_
diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h
new file mode 100644
index 0000000000..4eddbbe257
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_rpc_service.h
@@ -0,0 +1,34 @@
+#ifndef MOCK_RPC_SERVICE_H
+#define MOCK_RPC_SERVICE_H
+
+#include "gmock/gmock.h"
+#include "application_manager/rpc_service.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockRPCService : public application_manager::rpc_service::RPCService {
+ public:
+ MOCK_METHOD1(
+ ManageHMICommand,
+ bool(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD2(
+ ManageMobileCommand,
+ bool(const application_manager::commands::MessageSharedPtr message,
+ application_manager::commands::Command::CommandSource origin));
+ MOCK_METHOD2(SendMessageToMobile,
+ void(application_manager::commands::MessageSharedPtr, bool));
+ MOCK_METHOD1(
+ SendMessageToHMI,
+ void(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD1(set_protocol_handler,
+ void(protocol_handler::ProtocolHandler* handler));
+ MOCK_METHOD1(set_hmi_message_handler,
+ void(hmi_message_handler::HMIMessageHandler* handler));
+};
+}
+}
+}
+
+#endif // MOCK_RPC_SERVICE_H
diff --git a/src/components/include/test/application_manager/mock_state_controller.h b/src/components/include/test/application_manager/mock_state_controller.h
index 9f8d94599b..0165180a0a 100644
--- a/src/components/include/test/application_manager/mock_state_controller.h
+++ b/src/components/include/test/application_manager/mock_state_controller.h
@@ -51,27 +51,30 @@ class MockStateController : public am::StateController {
void(am::ApplicationSharedPtr app,
am::HmiStatePtr state,
const bool SendActivateApp));
- MOCK_METHOD4(SetRegularState,
+ MOCK_METHOD5(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool SendActivateApp));
MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const bool SendActivateApp));
- MOCK_METHOD5(SetRegularState,
+ MOCK_METHOD6(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool SendActivateApp));
MOCK_METHOD2(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level));
- MOCK_METHOD2(SetRegularState,
+ MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state));
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state));
MOCK_METHOD2(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::SystemContext::eType system_context));
@@ -84,8 +87,10 @@ class MockStateController : public am::StateController {
int64_t(am::ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority));
- MOCK_METHOD0(OnNaviStreamingStarted, void());
- MOCK_METHOD0(OnNaviStreamingStopped, void());
+ MOCK_METHOD1(OnVideoStreamingStarted,
+ void(am::ApplicationConstSharedPtr app));
+ MOCK_METHOD1(OnVideoStreamingStopped,
+ void(am::ApplicationConstSharedPtr app));
MOCK_METHOD3(OnStateChanged,
void(am::ApplicationSharedPtr app,
am::HmiStatePtr old_state,
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 931fd6cfb4..cb47147074 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
@@ -112,7 +112,7 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener));
MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener));
MOCK_CONST_METHOD0(GetStatisticManager,
- utils::SharedPtr<usage_statistics::StatisticsManager>());
+ std::shared_ptr<usage_statistics::StatisticsManager>());
MOCK_CONST_METHOD2(CheckSystemAction,
bool(mobile_apis::SystemAction::eType system_action,
const std::string& policy_app_id));
@@ -197,6 +197,18 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_CONST_METHOD2(IsRequestTypeAllowed,
bool(const std::string& policy_app_id,
mobile_apis::RequestType::eType type));
+ MOCK_CONST_METHOD2(IsRequestSubTypeAllowed,
+ bool(const std::string& policy_app_id,
+ const std::string& request_subtype));
+ MOCK_CONST_METHOD1(
+ GetAppRequestTypeState,
+ policy::RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypeState,
+ policy::RequestSubType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypes,
+ const std::vector<std::string>(const std::string& policy_app_id));
MOCK_CONST_METHOD1(
GetAppRequestTypes,
const std::vector<std::string>(const std::string& policy_app_id));
@@ -227,7 +239,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
void(const std::string& service_type,
policy::EndpointUrls& end_points));
-#ifdef SDL_REMOTE_CONTROL
MOCK_METHOD3(OnUpdateHMILevel,
void(const std::string& device_id,
const std::string& policy_app_id,
@@ -258,7 +269,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD2(OnDeviceSwitching,
void(const std::string& device_id_from,
const std::string& device_id_to));
-#endif // SDL_REMOTE_CONTROL
private:
#ifdef EXTERNAL_PROPRIETARY_MODE
diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h
index f1416c999e..2de3a0f9a7 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler.h
@@ -51,6 +51,7 @@ using connection_handler::ConnectionHandle;
using connection_handler::DeviceHandle;
using connection_handler::CloseSessionReason;
using connection_handler::DevicesDiscoveryStarter;
+using connection_handler::SessionTransports;
class MockConnectionHandler : public connection_handler::ConnectionHandler {
public:
@@ -84,13 +85,6 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
void(uint32_t connection_key, uint8_t session_id));
MOCK_METHOD2(BindProtocolVersionWithSession,
void(uint32_t connection_key, uint8_t protocol_version));
-
- // DEPRECATED
- MOCK_CONST_METHOD4(GetDataOnSessionKey,
- int32_t(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id));
MOCK_CONST_METHOD4(GetDataOnSessionKey,
int32_t(uint32_t key,
uint32_t* app_id,
@@ -103,10 +97,31 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&());
MOCK_CONST_METHOD1(GetConnectedDevicesMAC,
void(std::vector<std::string>& macs));
+ MOCK_METHOD1(
+ AddSession,
+ uint32_t(const transport_manager::ConnectionUID primary_transport_id));
+ MOCK_METHOD1(RemoveSession, bool(uint8_t session_id));
+ MOCK_METHOD0(session_connection_map,
+ DataAccessor<connection_handler::SessionConnectionMap>());
+ MOCK_METHOD2(SetSecondaryTransportID,
+ SessionTransports(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id));
+ MOCK_CONST_METHOD1(GetSessionTransports,
+ const SessionTransports(uint8_t session_id));
MOCK_METHOD3(NotifyServiceStartedResult,
void(uint32_t session_key,
bool result,
std::vector<std::string>& rejected_params));
+ MOCK_METHOD3(
+ OnSecondaryTransportStarted,
+ bool(transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id));
+ MOCK_METHOD2(
+ OnSecondaryTransportEnded,
+ void(const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle));
};
} // namespace connection_handler_test
diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
index a96498028d..a9e4349bec 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
@@ -48,11 +48,6 @@ class MockConnectionHandlerObserver
MOCK_METHOD0(OnFindNewApplicationsRequest, void());
MOCK_METHOD1(RemoveDevice,
void(const connection_handler::DeviceHandle& device_handle));
- DEPRECATED MOCK_METHOD3(
- OnServiceStartedCallback,
- bool(const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type));
MOCK_METHOD4(OnServiceStartedCallback,
void(const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
@@ -74,6 +69,11 @@ class MockConnectionHandlerObserver
const connection_handler::Device& device_to));
MOCK_METHOD1(OnDeviceSwitchingFinish, void(const std::string& device_uid));
MOCK_CONST_METHOD1(CheckAppIsNavi, bool(const uint32_t app_id));
+ MOCK_METHOD2(OnSecondaryTransportStartedCallback,
+ void(const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key));
+ MOCK_METHOD1(OnSecondaryTransportEndedCallback,
+ void(const int32_t session_key));
};
} // namespace connection_handler_test
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
index 859d164231..17ec69ccf8 100644
--- a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
@@ -45,9 +45,9 @@ class MockHMIMessageObserver : public hmi_message_handler::HMIMessageObserver,
public utils::Singleton<MockHMIMessageObserver> {
public:
MOCK_METHOD1(OnMessageReceived,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(OnErrorSending,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
virtual ~MockHMIMessageObserver() {}
};
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 5aa92446b6..a4d50d7cc2 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
@@ -106,7 +106,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
MOCK_METHOD2(Init,
bool(const std::string& file_name,
const PolicySettings* settings));
- MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
@@ -231,7 +231,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
bool(const std::string& device_id,
const std::string& policy_app_id,
policy::Permissions& permission));
- MOCK_CONST_METHOD0(GetPT, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GetPT, std::shared_ptr<policy_table::Table>());
MOCK_CONST_METHOD0(GetMetaInfo, const MetaInfo());
MOCK_CONST_METHOD0(GetCertificate, std::string());
MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
@@ -250,6 +250,13 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
MOCK_METHOD2(OnDeviceSwitching,
void(const std::string& device_id_from,
const std::string& device_id_to));
+ MOCK_CONST_METHOD2(GetAppRequestSubTypes,
+ void(const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
index ad2f1fd56c..1f570d8699 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
@@ -92,7 +92,6 @@ class MockPolicyListener : public ::policy::PolicyListener {
const std::string& hmi_level));
MOCK_CONST_METHOD1(GetRegisteredLinks,
void(std::map<std::string, std::string>&));
-#ifdef SDL_REMOTE_CONTROL
MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent));
MOCK_METHOD2(OnRemoteAppPermissionsChanged,
void(const std::string& device_id,
@@ -101,7 +100,6 @@ class MockPolicyListener : public ::policy::PolicyListener {
void(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level));
-#endif // SDL_REMOTE_CONTROL
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
index 9e487da4ba..aeabf8fdcb 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
@@ -112,7 +112,7 @@ class MockPolicyManager : public PolicyManager {
const policy::DeviceInfo& device_info));
MOCK_METHOD2(SetUserConsentForApp,
void(const policy::PermissionConsent& permissions,
- const NotificationMode mode));
+ const policy::PolicyManager::NotificationMode mode));
MOCK_CONST_METHOD2(GetDefaultHmi,
bool(const std::string& policy_app_id,
std::string* default_hmi));
@@ -148,7 +148,6 @@ class MockPolicyManager : public PolicyManager {
StatusNotifier(
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
-#ifdef SDL_REMOTE_CONTROL
MOCK_METHOD2(SetDefaultHmiTypes,
void(const std::string& application_id,
const std::vector<int>& hmi_types));
@@ -164,8 +163,7 @@ class MockPolicyManager : public PolicyManager {
bool(const std::string& policy_app_id,
std::vector<std::string>* modules));
MOCK_METHOD1(set_access_remote,
- void(utils::SharedPtr<AccessRemote> access_remote));
-#endif // SDL_REMOTE_CONTROL
+ void(std::shared_ptr<AccessRemote> access_remote));
MOCK_METHOD0(CleanupUnpairedDevices, bool());
MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
@@ -218,6 +216,13 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD2(OnDeviceSwitching,
void(const std::string& device_id_from,
const std::string& device_id_to));
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypes,
+ const std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
};
} // namespace policy_manager_test
} // namespace components
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
index eafc1df4fe..fe051aaae0 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
@@ -49,6 +49,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(open_attempt_timeout_ms, uint16_t());
MOCK_CONST_METHOD0(policies_snapshot_file_name, const std::string&());
MOCK_CONST_METHOD0(system_files_path, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
index ed3a5088c1..440000dbff 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
@@ -84,7 +84,7 @@ class MockCacheManagerInterface : public CacheManagerInterface {
MOCK_METHOD2(Init,
bool(const std::string& file_name,
const PolicySettings* settings));
- MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
@@ -202,11 +202,10 @@ class MockCacheManagerInterface : public CacheManagerInterface {
bool(const std::string& device_id,
const std::string& policy_app_id,
policy::Permissions& permission));
- MOCK_CONST_METHOD0(pt, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(pt, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(GetHMITypes,
const policy_table::AppHMITypes*(const std::string& app_id));
MOCK_CONST_METHOD0(GetCertificate, std::string());
- MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id));
MOCK_CONST_METHOD2(AppHasHMIType,
bool(const std::string& application_id,
@@ -214,6 +213,13 @@ class MockCacheManagerInterface : public CacheManagerInterface {
MOCK_METHOD2(OnDeviceSwitching,
void(const std::string& device_id_from,
const std::string& device_id_to));
+ MOCK_CONST_METHOD2(GetAppRequestSubTypes,
+ void(const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
index d98a0279d7..3b0c1a925e 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
@@ -85,7 +85,6 @@ class MockPolicyListener : public ::policy::PolicyListener {
std::vector<std::string>(const std::string& policy_app_id));
MOCK_CONST_METHOD1(GetRegisteredLinks,
void(std::map<std::string, std::string>&));
-#ifdef SDL_REMOTE_CONTROL
MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent));
MOCK_METHOD2(OnRemoteAppPermissionsChanged,
void(const std::string& device_id,
@@ -94,7 +93,6 @@ class MockPolicyListener : public ::policy::PolicyListener {
void(const std::string& device_id,
const std::string& policy_app_id,
const std::string& hmi_level));
-#endif // SDL_REMOTE_CONTROL
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
index 82012b83c7..0e06e9c1a3 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
@@ -147,7 +147,6 @@ class MockPolicyManager : public PolicyManager {
StatusNotifier(
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
-#ifdef SDL_REMOTE_CONTROL
MOCK_METHOD2(SetDefaultHmiTypes,
void(const std::string& application_id,
const std::vector<int>& hmi_types));
@@ -163,8 +162,7 @@ class MockPolicyManager : public PolicyManager {
bool(const std::string& policy_app_id,
std::vector<std::string>* modules));
MOCK_METHOD1(set_access_remote,
- void(utils::SharedPtr<AccessRemote> access_remote));
-#endif // SDL_REMOTE_CONTROL
+ void(std::shared_ptr<AccessRemote> access_remote));
MOCK_METHOD0(CleanupUnpairedDevices, bool());
MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
@@ -186,7 +184,6 @@ class MockPolicyManager : public PolicyManager {
MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
MOCK_CONST_METHOD0(HasCertificate, bool());
- MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
MOCK_METHOD0(ExceededIgnitionCycles, bool());
MOCK_METHOD0(ExceededDays, bool());
MOCK_METHOD0(StartPTExchange, void());
@@ -226,6 +223,14 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD2(OnDeviceSwitching,
void(const std::string& device_id_from,
const std::string& device_id_to));
+
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypes,
+ const std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
};
} // namespace policy_manager_test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
index 438e697c51..6e0acae33c 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
@@ -49,6 +49,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(open_attempt_timeout_ms, uint16_t());
MOCK_CONST_METHOD0(policies_snapshot_file_name, const std::string&());
MOCK_CONST_METHOD0(system_files_path, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
};
} // namespace policy_test
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h
index 79c2188cdf..f6db0c7097 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h
@@ -55,23 +55,18 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler {
void(uint32_t connection_key, int32_t number_of_frames));
MOCK_METHOD2(SendHeartBeat, void(int32_t connection_id, uint8_t session_id));
MOCK_METHOD2(SendEndSession, void(int32_t connection_id, uint8_t session_id));
- MOCK_METHOD3(SendEndService,
- void(int32_t connection_id,
+ MOCK_METHOD4(SendEndService,
+ void(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type));
MOCK_CONST_METHOD0(get_settings,
const ::protocol_handler::ProtocolHandlerSettings&());
MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&());
- DEPRECATED MOCK_METHOD6(NotifySessionStartedResult,
- void(int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params));
MOCK_METHOD2(NotifySessionStarted,
void(const ::protocol_handler::SessionContext& context,
std::vector<std::string>& rejected_params));
+ MOCK_METHOD0(NotifyOnFailedHandshake, void());
};
} // namespace protocol_handler_test
} // namespace components
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
index 8ddeded889..2ed9c47e9d 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
@@ -60,6 +60,17 @@ class MockProtocolHandlerSettings
MOCK_CONST_METHOD0(force_protected_service, const std::vector<int>&());
MOCK_CONST_METHOD0(force_unprotected_service, const std::vector<int>&());
#endif
+ MOCK_CONST_METHOD0(multiple_transports_enabled, const bool());
+ MOCK_CONST_METHOD0(secondary_transports_for_bluetooth,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(secondary_transports_for_usb,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(secondary_transports_for_wifi,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(audio_service_transports,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(video_service_transports,
+ const std::vector<std::string>&());
};
} // namespace protocol_handler_test
diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h
index ae32f35948..0d74b15f64 100644
--- a/src/components/include/test/protocol_handler/mock_session_observer.h
+++ b/src/components/include/test/protocol_handler/mock_session_observer.h
@@ -47,13 +47,6 @@ namespace protocol_handler_test {
*/
class MockSessionObserver : public ::protocol_handler::SessionObserver {
public:
- DEPRECATED MOCK_METHOD5(
- OnSessionStartedCallback,
- uint32_t(const transport_manager::ConnectionUID connection_handle,
- const uint8_t sessionId,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id));
MOCK_METHOD5(OnSessionStartedCallback,
void(const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
@@ -76,6 +69,12 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
void(const uint32_t& connection_key));
MOCK_METHOD1(OnMalformedMessageCallback,
void(const uint32_t& connection_key));
+ MOCK_CONST_METHOD1(
+ TransportTypeProfileStringFromConnHandle,
+ const std::string(transport_manager::ConnectionUID connection_handle));
+ MOCK_CONST_METHOD1(
+ TransportTypeProfileStringFromDeviceHandle,
+ const std::string(transport_manager::DeviceHandle device_handle));
MOCK_CONST_METHOD2(
KeyFromPair,
uint32_t(transport_manager::ConnectionUID connection_handle,
@@ -89,11 +88,6 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
uint32_t* app_id,
std::list<int32_t>* sessions_list,
transport_manager::DeviceHandle* device_id));
- DEPRECATED MOCK_CONST_METHOD4(GetDataOnSessionKey,
- int32_t(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id));
MOCK_CONST_METHOD5(GetDataOnDeviceID,
int32_t(transport_manager::DeviceHandle device_handle,
diff --git a/src/components/include/test/protocol_handler/mock_telemetry_observer.h b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
index 1c87de4d5a..82c42775fa 100644
--- a/src/components/include/test/protocol_handler/mock_telemetry_observer.h
+++ b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
@@ -44,8 +44,9 @@ namespace protocol_handler_test {
class MockPHTelemetryObserver : public PHTelemetryObserver {
public:
MOCK_METHOD2(StartMessageProcess,
- void(uint32_t message_id, const TimevalStruct& start_time));
- MOCK_METHOD1(EndMessageProcess, void(utils::SharedPtr<MessageMetric> m));
+ void(uint32_t message_id,
+ const date_time::TimeDuration& start_time));
+ MOCK_METHOD1(EndMessageProcess, void(std::shared_ptr<MessageMetric> m));
};
} // namespace protocol_handler_test
diff --git a/src/components/include/test/security_manager/mock_crypto_manager.h b/src/components/include/test/security_manager/mock_crypto_manager.h
index 55c364bd89..61ec5183e4 100644
--- a/src/components/include/test/security_manager/mock_crypto_manager.h
+++ b/src/components/include/test/security_manager/mock_crypto_manager.h
@@ -52,7 +52,9 @@ class MockCryptoManager : public ::security_manager::CryptoManager {
MOCK_METHOD0(CreateSSLContext, ::security_manager::SSLContext*());
MOCK_METHOD1(ReleaseSSLContext, void(::security_manager::SSLContext*));
MOCK_CONST_METHOD0(LastError, std::string());
- MOCK_CONST_METHOD0(IsCertificateUpdateRequired, bool());
+ MOCK_CONST_METHOD2(IsCertificateUpdateRequired,
+ bool(const time_t system_time,
+ const time_t certificates_time));
};
} // namespace security_manager_test
} // namespace components
diff --git a/src/components/include/test/security_manager/mock_security_manager.h b/src/components/include/test/security_manager/mock_security_manager.h
index 11890cb071..b2c2e3bf17 100644
--- a/src/components/include/test/security_manager/mock_security_manager.h
+++ b/src/components/include/test/security_manager/mock_security_manager.h
@@ -54,8 +54,9 @@ class MockSecurityManager : public ::security_manager::SecurityManager {
MOCK_METHOD4(
SendInternalError,
void(const uint32_t, const uint8_t&, const std::string&, const uint32_t));
- MOCK_METHOD1(CreateSSLContext,
- ::security_manager::SSLContext*(const uint32_t&));
+ MOCK_METHOD2(CreateSSLContext,
+ ::security_manager::SSLContext*(const uint32_t&,
+ ContextCreationStrategy));
MOCK_METHOD1(StartHandshake, void(uint32_t));
MOCK_METHOD1(AddListener, void(::security_manager::SecurityManagerListener*));
MOCK_METHOD1(RemoveListener,
@@ -65,9 +66,13 @@ class MockSecurityManager : public ::security_manager::SecurityManager {
void(const ::protocol_handler::RawMessagePtr));
MOCK_METHOD1(OnMobileMessageSent,
void(const ::protocol_handler::RawMessagePtr));
- MOCK_METHOD0(IsCertificateUpdateRequired, bool());
+ MOCK_METHOD1(IsCertificateUpdateRequired, bool(const uint32_t));
MOCK_METHOD0(NotifyOnCertificateUpdateRequired, void());
+ MOCK_METHOD0(NotifyListenersOnHandshakeFailed, void());
MOCK_METHOD0(IsPolicyCertificateDataEmpty, bool());
+ MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&));
+ MOCK_METHOD1(PostponeHandshake, void(const uint32_t));
+ MOCK_CONST_METHOD0(IsSystemTimeProviderReady, bool());
};
/*
diff --git a/src/components/include/test/security_manager/mock_security_manager_listener.h b/src/components/include/test/security_manager/mock_security_manager_listener.h
index a06762a09d..7a7714d299 100644
--- a/src/components/include/test/security_manager/mock_security_manager_listener.h
+++ b/src/components/include/test/security_manager/mock_security_manager_listener.h
@@ -49,6 +49,7 @@ class MockSecurityManagerListener
::security_manager::SSLContext::HandshakeResult result));
MOCK_METHOD0(OnCertificateUpdateRequired, void());
MOCK_CONST_METHOD1(GetPolicyCertificateData, bool(std::string& data));
+ MOCK_METHOD0(OnHandshakeFailed, bool());
};
} // namespace security_manager_test
} // namespace components
diff --git a/src/components/include/test/security_manager/mock_security_manager_settings.h b/src/components/include/test/security_manager/mock_security_manager_settings.h
index 6ac194ced4..b1c869cd1b 100644
--- a/src/components/include/test/security_manager/mock_security_manager_settings.h
+++ b/src/components/include/test/security_manager/mock_security_manager_settings.h
@@ -50,8 +50,12 @@ class MockCryptoManagerSettings
MOCK_CONST_METHOD0(certificate_data, const std::string&());
MOCK_CONST_METHOD0(ciphers_list, const std::string&());
MOCK_CONST_METHOD0(ca_cert_path, const std::string&());
+ MOCK_CONST_METHOD0(module_cert_path, const std::string&());
+ MOCK_CONST_METHOD0(module_key_path, const std::string&());
MOCK_CONST_METHOD0(update_before_hours, size_t());
MOCK_CONST_METHOD0(maximum_payload_size, size_t());
+ MOCK_CONST_METHOD0(force_protected_service, const std::vector<int>&());
+ MOCK_CONST_METHOD0(force_unprotected_service, const std::vector<int>&());
};
} // namespace security_manager_test
diff --git a/src/components/include/test/security_manager/mock_ssl_context.h b/src/components/include/test/security_manager/mock_ssl_context.h
index 6b6a26a226..02198d1d22 100644
--- a/src/components/include/test/security_manager/mock_ssl_context.h
+++ b/src/components/include/test/security_manager/mock_ssl_context.h
@@ -68,6 +68,8 @@ class MockSSLContext : public ::security_manager::SSLContext {
MOCK_CONST_METHOD0(LastError, std::string());
MOCK_METHOD0(ResetConnection, void());
MOCK_METHOD1(SetHandshakeContext, void(const HandshakeContext& hsh_ctx));
+ MOCK_CONST_METHOD0(HasCertificate, bool());
+ MOCK_CONST_METHOD1(GetCertificateDueDate, bool(time_t& due_date));
};
} // namespace security_manager_test
} // namespace components
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_listener.h b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
index f4c4fdcf68..133dabe732 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_listener.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
@@ -85,6 +85,8 @@ class MockTransportManagerListener : public TransportManagerListener {
void(const DeviceUID& device_uid_from,
const DeviceUID& device_uid_to));
MOCK_METHOD1(OnDeviceSwitchingFinish, void(const DeviceUID& device_uid));
+ MOCK_METHOD1(OnTransportConfigUpdated,
+ void(const std::map<std::string, std::string>& configs));
};
} // namespace transport_manager_test
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index 88112df003..3e7c8f36f7 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -61,6 +61,8 @@ class MockTransportManagerSettings
MOCK_CONST_METHOD0(iap_hub_connection_wait_timeout, uint32_t());
MOCK_CONST_METHOD0(app_transport_change_timer, uint32_t());
MOCK_CONST_METHOD0(app_transport_change_timer_addition, uint32_t());
+ MOCK_CONST_METHOD0(transport_manager_tcp_adapter_network_interface,
+ std::string&());
};
} // namespace transport_manager_test
diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
index c37c41d4f8..eff0abdcd3 100644
--- a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
@@ -103,6 +103,8 @@ class MockTransportAdapter
void(const ::transport_manager::DeviceUID& device_handle));
MOCK_CONST_METHOD0(GetSwitchableDevices,
transport_manager::SwitchableDevices());
+ MOCK_CONST_METHOD0(GetTransportConfiguration,
+ transport_manager::transport_adapter::TransportConfig());
#ifdef TELEMETRY_MONITOR
MOCK_METHOD0(GetTelemetryObserver,
::transport_manager::TMTelemetryObserver*());
diff --git a/src/components/include/test/utils/mock_system_time_handler.h b/src/components/include/test/utils/mock_system_time_handler.h
new file mode 100644
index 0000000000..7bb2a7f0a5
--- /dev/null
+++ b/src/components/include/test/utils/mock_system_time_handler.h
@@ -0,0 +1,69 @@
+/*
+ * 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_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H
+#define SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H
+
+#include "gmock/gmock.h"
+#include "utils/system_time_handler.h"
+
+namespace test {
+namespace components {
+namespace security_manager_test {
+
+class MockSystemTimeHandler : public ::utils::SystemTimeHandler {
+ public:
+ MockSystemTimeHandler() {}
+ MOCK_METHOD0(QuerySystemTime, void());
+ MOCK_METHOD1(SubscribeOnSystemTime,
+ void(utils::SystemTimeListener* listener));
+ MOCK_METHOD1(UnsubscribeFromSystemTime,
+ void(utils::SystemTimeListener* listener));
+ MOCK_METHOD0(GetUTCTime, time_t());
+ MOCK_CONST_METHOD0(system_time_can_be_received, bool());
+ ~MockSystemTimeHandler() {}
+
+ private:
+ void DoSubscribe(utils::SystemTimeListener*) {}
+ void DoSystemTimeQuery() {}
+ void DoUnsubscribe(utils::SystemTimeListener* listener) {}
+ bool utc_time_can_be_received() const {
+ return true;
+ }
+ time_t FetchSystemTime() {
+ return 0;
+ }
+};
+} // namespace security_manager_test
+} // namespace components
+} // namespace test
+#endif // SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H
diff --git a/src/components/include/transport_manager/error.h b/src/components/include/transport_manager/error.h
index 022ddf0e38..ba357dd54b 100644
--- a/src/components/include/transport_manager/error.h
+++ b/src/components/include/transport_manager/error.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
#include <string>
-#include <utils/shared_ptr.h>
+#include <memory>
namespace transport_manager {
@@ -79,7 +79,7 @@ class BaseError {
private:
std::string description_;
};
-typedef utils::SharedPtr<BaseError> BaseErrorPtr;
+typedef std::shared_ptr<BaseError> BaseErrorPtr;
/**
* @brief Error that originates during device search.
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index 148e715050..1ac1424477 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -35,9 +35,10 @@
#include <string>
#include <vector>
+#include <memory>
#include "transport_manager/common.h"
-#include "utils/shared_ptr.h"
+
#include "utils/macro.h"
namespace transport_manager {
@@ -160,7 +161,7 @@ class Device {
**/
bool keep_on_disconnect_;
};
-typedef utils::SharedPtr<Device> DeviceSptr;
+typedef std::shared_ptr<Device> DeviceSptr;
typedef std::vector<DeviceSptr> DeviceVector;
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
index 7f6d347535..ebbf7dae28 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -41,8 +41,6 @@
#include <list>
#include <map>
-#include "utils/shared_ptr.h"
-
#include "transport_manager/transport_adapter/device.h"
#include "transport_manager/common.h"
#include "transport_manager/error.h"
@@ -59,17 +57,16 @@ class TransportAdapterListener;
/**
* @brief The DeviceType enum defines types based on available transport
* adapters
- * @deprecated PASA_AOA, PASA_BLUETOOTH, MME
*/
enum DeviceType {
AOA,
- PASA_AOA,
BLUETOOTH,
- PASA_BLUETOOTH,
- MME,
IOS_BT,
IOS_USB,
TCP,
+ IOS_USB_HOST_MODE,
+ IOS_USB_DEVICE_MODE,
+ IOS_CARPLAY_WIRELESS, // running on iAP over Carplay wireless transport
UNKNOWN
};
@@ -86,6 +83,18 @@ typedef std::map<DeviceUID, DeviceSptr> DeviceMap;
*/
typedef std::list<TransportAdapterListener*> TransportAdapterListenerList;
+/**
+ * @brief Type definition for transport's configuration information
+ */
+typedef std::map<std::string, std::string> TransportConfig;
+
+/**
+ * @brief TransportConfig keys
+ */
+extern const char* tc_enabled;
+extern const char* tc_tcp_port;
+extern const char* tc_tcp_ip_address;
+
class TransportAdapter {
public:
/**
@@ -312,6 +321,12 @@ class TransportAdapter {
virtual void DeviceSwitched(const DeviceUID& device_handle) = 0;
virtual SwitchableDevices GetSwitchableDevices() const = 0;
+
+ /**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const = 0;
+
#ifdef TELEMETRY_MONITOR
/**
* @brief Return Time metric observer
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
index 18f4ccb2d1..fd1d693067 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
@@ -57,7 +57,8 @@ enum class EventTypeEnum {
ON_RECEIVED_FAIL,
ON_COMMUNICATION_ERROR,
ON_UNEXPECTED_DISCONNECT,
- ON_TRANSPORT_SWITCH_REQUESTED
+ ON_TRANSPORT_SWITCH_REQUESTED,
+ ON_TRANSPORT_CONFIG_UPDATED
};
class TransportAdapterEvent {
@@ -87,30 +88,6 @@ class TransportAdapterEvent {
, event_error(error) {}
/**
- * DEPRECATED
- * @brief Constructor.
- *
- * @param type Event type.
- * @param transport_adapter Transport adapter
- * @param device_handle Handle of device.
- * @param application_id Handle of application.
- * @param data Smart pointer to the raw message.
- * @param error Error class that contains details of this error situation.
- */
- TransportAdapterEvent(int type,
- transport_adapter::TransportAdapter* adapter,
- const DeviceUID& device_handle,
- const ApplicationHandle& application_id,
- ::protocol_handler::RawMessagePtr data,
- BaseErrorPtr error)
- : event_type(static_cast<EventTypeEnum>(type))
- , application_id(application_id)
- , device_uid(device_handle)
- , transport_adapter(adapter)
- , event_data(data)
- , event_error(error) {}
-
- /**
* @brief Value that describe event type.
*/
EventTypeEnum event_type;
diff --git a/src/components/include/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h
index d336eade45..6c3f6e2eaa 100644
--- a/src/components/include/transport_manager/transport_manager_listener.h
+++ b/src/components/include/transport_manager/transport_manager_listener.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
+#include <map>
#include <vector>
#include "transport_manager/common.h"
#include "transport_manager/info.h"
@@ -193,6 +194,14 @@ class TransportManagerListener {
virtual void OnTMMessageSendFailed(
const DataSendError& error,
const ::protocol_handler::RawMessagePtr message) = 0;
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ virtual void OnTransportConfigUpdated(
+ const std::map<std::string, std::string>& configs) = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
diff --git a/src/components/include/transport_manager/transport_manager_listener_empty.h b/src/components/include/transport_manager/transport_manager_listener_empty.h
index ca6c573a06..08b2b77c30 100644
--- a/src/components/include/transport_manager/transport_manager_listener_empty.h
+++ b/src/components/include/transport_manager/transport_manager_listener_empty.h
@@ -187,6 +187,14 @@ class TransportManagerListenerEmpty : public TransportManagerListener {
void OnTMMessageSendFailed(
const DataSendError& error,
const ::protocol_handler::RawMessagePtr message) OVERRIDE {}
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ void OnTransportConfigUpdated(
+ const std::map<std::string, std::string>& configs) OVERRIDE {}
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_EMPTY_H_
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index feb3fa2c02..3912bbe747 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -63,6 +63,12 @@ class TransportManagerSettings : public TransportManagerMMESettings {
* the transport change timeout value.
*/
virtual uint32_t app_transport_change_timer_addition() const = 0;
+
+ /**
+ * @brief Returns the network interface name for TCP transport adapter
+ */
+ virtual const std::string& transport_manager_tcp_adapter_network_interface()
+ const = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/include/utils/atomic_object.h b/src/components/include/utils/atomic_object.h
deleted file mode 100644
index 257fcfbe3a..0000000000
--- a/src/components/include/utils/atomic_object.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
-
-#include "utils/rwlock.h"
-#include "utils/conditional_variable.h"
-#include "utils/macro.h"
-
-namespace sync_primitives {
-
-/**
- * @brief Allows to safely change stored value from different threads.
- *
- * The usage example:
- *
- * threads::Atomic<int> i;
- *
- * i = 5; // here SDL is able to guarantee that this value will be safely
- * // assigned even in multi threaded environment.
- */
-template <typename T>
-class Atomic {
- public:
- /**
- * @brief Atomic allows to construct atomic object.
- * The operation is not atomic.
- *
- * @param value the value to initialize object with.
- */
- Atomic(const T& value) : value_(value) {}
-
- /**
- * @brief operator = thread safe setter for stored value.
- *
- * @param val value to assign.
- *
- * @return mofified value.
- */
- T& operator=(const T& val) {
- sync_primitives::AutoWriteLock lock(rw_lock_);
- value_ = val;
- return value_;
- }
-
- /**
- * @brief operator T thread safe getter
- *
- * return stored value.
- */
- operator T() const {
- sync_primitives::AutoReadLock lock(rw_lock_);
- return value_;
- }
-
- /**
- * @brief operator T thread safe getter
- *
- * return stored value.
- */
- template <typename U>
- operator U() const {
- sync_primitives::AutoReadLock lock(rw_lock_);
- return static_cast<U>(value_);
- }
-
- private:
- T value_;
- mutable sync_primitives::RWLock rw_lock_;
-};
-
-typedef Atomic<int> atomic_int;
-typedef Atomic<int32_t> atomic_int32;
-typedef Atomic<uint32_t> atomic_uint32;
-typedef Atomic<int64_t> atomic_int64;
-typedef Atomic<uint64_t> atomic_uint64;
-typedef Atomic<size_t> atomic_size_t;
-typedef Atomic<bool> atomic_bool;
-
-} // namespace sync_primitives
-
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
diff --git a/src/components/include/utils/conditional_variable.h b/src/components/include/utils/conditional_variable.h
index f54a22e993..a29f255dbf 100644
--- a/src/components/include/utils/conditional_variable.h
+++ b/src/components/include/utils/conditional_variable.h
@@ -32,24 +32,13 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
-#if defined(OS_POSIX)
-#include <pthread.h>
-#else
-#error Please implement conditional variable for your OS
-#endif
#include <stdint.h>
+#include <boost/thread/condition_variable.hpp>
+#include "utils/lock.h"
#include "utils/macro.h"
namespace sync_primitives {
-class AutoLock;
-class Lock;
-
-namespace impl {
-#if defined(OS_POSIX)
-typedef pthread_cond_t PlatformConditionalVariable;
-#endif
-} // namespace impl
/*
* Conditional variable wrapper
@@ -82,11 +71,11 @@ class ConditionalVariable {
// Wait forever or up to milliseconds time limit
bool Wait(AutoLock& auto_lock);
- bool Wait(Lock& lock);
+ bool Wait(BaseLock& lock);
WaitStatus WaitFor(AutoLock& auto_lock, uint32_t milliseconds);
private:
- impl::PlatformConditionalVariable cond_var_;
+ boost::condition_variable_any cond_var_;
private:
DISALLOW_COPY_AND_ASSIGN(ConditionalVariable);
diff --git a/src/components/include/utils/data_accessor.h b/src/components/include/utils/data_accessor.h
index 9be28a638b..1be7c3ab53 100644
--- a/src/components/include/utils/data_accessor.h
+++ b/src/components/include/utils/data_accessor.h
@@ -33,17 +33,15 @@
#define SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
-// This class is for thread-safe access to data
+// This class is for thread-safe const access to data
template <class T>
class DataAccessor {
public:
- DataAccessor(const T& data, const sync_primitives::Lock& lock)
- : data_(data)
- , lock_(const_cast<sync_primitives::Lock&>(lock))
- , counter_(new uint32_t(0)) {
- lock_.Acquire();
+ DataAccessor(const T& data,
+ const std::shared_ptr<sync_primitives::BaseLock>& lock)
+ : data_(data), lock_(lock), counter_(new uint32_t(0)) {
+ lock_->Acquire();
}
DataAccessor(const DataAccessor<T>& other)
@@ -53,7 +51,7 @@ class DataAccessor {
~DataAccessor() {
if (0 == *counter_) {
- lock_.Release();
+ lock_->Release();
} else {
--(*counter_);
}
@@ -65,8 +63,9 @@ class DataAccessor {
private:
void* operator new(size_t size);
const T& data_;
- sync_primitives::Lock& lock_;
- utils::SharedPtr<uint32_t> counter_;
+ // Require that the lock lives at least as long as the DataAccessor
+ const std::shared_ptr<sync_primitives::BaseLock> lock_;
+ std::shared_ptr<uint32_t> counter_;
};
#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_
diff --git a/src/components/include/utils/date_time.h b/src/components/include/utils/date_time.h
index f8f8e3d6ce..17b4fafe38 100644
--- a/src/components/include/utils/date_time.h
+++ b/src/components/include/utils/date_time.h
@@ -32,69 +32,70 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
-#if defined(OS_POSIX)
-#include <sys/time.h>
-typedef struct timeval TimevalStruct;
-#endif
#include <stdint.h>
+#include "boost/date_time/posix_time/posix_time_duration.hpp"
namespace date_time {
+// skip boost namespacing for all this
+// NOTE that it's called posix_time for its functionality, not for any
+// platform-dependence
+typedef boost::posix_time::time_duration TimeDuration;
+// Capture from boost's namespaces
+using boost::posix_time::microseconds;
+using boost::posix_time::milliseconds;
+using boost::posix_time::seconds;
+
enum TimeCompare { LESS, EQUAL, GREATER };
-class DateTime {
- public:
- static const int32_t MILLISECONDS_IN_SECOND = 1000;
- static const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
- static const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
- static const int32_t SECONDS_IN_HOUR = 3600;
- static const int32_t MICROSECONDS_IN_SECOND =
- MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
- static const int32_t NANOSECONDS_IN_MILLISECOND =
- MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
+// public defines for external usage
+const int32_t MILLISECONDS_IN_SECOND = 1000;
+const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
+const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
+const int32_t SECONDS_IN_HOUR = 3600;
+const int32_t MICROSECONDS_IN_SECOND =
+ MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
+const int32_t NANOSECONDS_IN_MILLISECOND =
+ MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
+
+TimeDuration getCurrentTime();
- static TimevalStruct getCurrentTime();
+// empty duration
+TimeDuration TimeDurationZero();
- // return SECONDS count
- static int64_t getSecs(const TimevalStruct& time);
+// return SECONDS count
+int64_t getSecs(const TimeDuration& t);
- // return MILLISECONDS count
- static int64_t getmSecs(const TimevalStruct& time);
- // return MICROSECONDS count
- static int64_t getuSecs(const TimevalStruct& time);
+// return MILLISECONDS count
+int64_t getmSecs(const TimeDuration& t);
+// return MICROSECONDS count
+int64_t getuSecs(const TimeDuration& t);
- // return MILLISECONDS count between sinceTime value and current time
- static int64_t calculateTimeSpan(const TimevalStruct& sinceTime);
+// get just the MILLISECONDS count (< 1000)
+int64_t get_just_mSecs(const TimeDuration& t);
- // return MILLISECONDS count between time1 and time2
- static int64_t calculateTimeDiff(const TimevalStruct& time1,
- const TimevalStruct& time2);
+// get just the MICROSECONDS count (< 1000)
+int64_t get_just_uSecs(const TimeDuration& t);
- /**
- * @brief Adds milliseconds to time struct
- * @param time contains time struct
- * @param milliseconds contains value which need to
- * add to time struct
- **/
- static void AddMilliseconds(TimevalStruct& time, uint32_t milliseconds);
+// return MILLISECONDS count between sinceTime value and current time
+int64_t calculateTimeSpan(const TimeDuration& sinceTime);
- static TimevalStruct Sub(const TimevalStruct& time1,
- const TimevalStruct& time2);
+// return MILLISECONDS count between time1 and time2
+int64_t calculateTimeDiff(const TimeDuration& time1, const TimeDuration& time2);
- static TimeCompare compareTime(const TimevalStruct& time1,
- const TimevalStruct& time2);
+/**
+ * @brief Adds milliseconds to time struct
+ * @param time contains time struct
+ * @param milliseconds contains value which need to
+ * add to time struct
+ **/
+void AddMilliseconds(TimeDuration& time, uint32_t milliseconds);
- static bool Greater(const TimevalStruct& time1, const TimevalStruct& time2);
- static bool Less(const TimevalStruct& time1, const TimevalStruct& time2);
- static bool Equal(const TimevalStruct& time1, const TimevalStruct& time2);
+TimeCompare compareTime(const TimeDuration& time1, const TimeDuration& time2);
- private:
- static TimevalStruct ConvertionUsecs(const TimevalStruct& time);
-};
+bool Greater(const TimeDuration& time1, const TimeDuration& time2);
+bool Less(const TimeDuration& time1, const TimeDuration& time2);
+bool Equal(const TimeDuration& time1, const TimeDuration& time2);
} // namespace date_time
-bool operator<(const TimevalStruct& time1, const TimevalStruct& time2);
-bool operator==(const TimevalStruct& time1, const TimevalStruct& time2);
-const TimevalStruct operator-(const TimevalStruct& time1,
- const TimevalStruct& time2);
#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
diff --git a/src/components/include/utils/lock.h b/src/components/include/utils/lock.h
index e615a58f9d..bfa1ef1770 100644
--- a/src/components/include/utils/lock.h
+++ b/src/components/include/utils/lock.h
@@ -32,24 +32,18 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
-#if defined(OS_POSIX)
-#include <pthread.h>
-#include <sched.h>
-#else
-#error Please implement lock for your OS
-#endif
#include <stdint.h>
-#include "utils/macro.h"
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
+#include <iostream>
+#include <memory>
#include "utils/atomic.h"
+#include "utils/macro.h"
#include "utils/memory_barrier.h"
-namespace sync_primitives {
+using boost::system::error_code;
-namespace impl {
-#if defined(OS_POSIX)
-typedef pthread_mutex_t PlatformMutex;
-#endif
-} // namespace impl
+namespace sync_primitives {
class SpinMutex {
public:
@@ -78,71 +72,98 @@ class SpinMutex {
volatile unsigned int state_;
};
-/* Platform-indepenednt NON-RECURSIVE lock (mutex) wrapper
- Please use AutoLock to ackquire and (automatically) release it
- It eases balancing of multple lock taking/releasing and makes it
- Impossible to forget to release the lock:
- ...
- ConcurentlyAccessedData data_;
- sync_primitives::Lock data_lock_;
- ...
- {
- sync_primitives::AutoLock auto_lock(data_lock_);
- data_.ReadOrWriteData();
- } // lock is automatically released here
-*/
-class Lock {
+/* Abstract base class that allows AutoLock to handle both recursive and
+ * non-recursive locks
+ */
+class BaseLock {
public:
- Lock();
- Lock(bool is_recursive);
- ~Lock();
-
+ BaseLock() {}
+ virtual ~BaseLock() {}
// Ackquire the lock. Must be called only once on a thread.
// Please consider using AutoLock to capture it.
- void Acquire();
+ virtual void Acquire() = 0;
// Release the lock. Must be called only once on a thread after lock.
// was acquired. Please consider using AutoLock to automatically release
// the lock
- void Release();
+ virtual void Release() = 0;
// Try if lock can be captured and lock it if it was possible.
// If it captured, lock must be manually released calling to Release
// when protected resource access was finished.
// @returns wether lock was captured.
- bool Try();
+ virtual bool Try() = 0;
- private:
- impl::PlatformMutex mutex_;
+ protected:
+ // Ensures safety in locking
+ virtual void AssertTakenAndMarkFree() = 0;
+ virtual void AssertFreeAndMarkTaken() = 0;
+
+ friend class ConditionalVariable;
+};
+
+/*
+ * Platform-indepenednt NON-RECURSIVE lock (mutex) wrapper
+ */
+class Lock : public BaseLock {
+ public:
+ Lock();
+ ~Lock();
+
+ virtual void Acquire();
+
+ virtual void Release();
-#ifndef NDEBUG
+ virtual bool Try();
+
+ private:
/**
- * @brief Basic debugging aid, a flag that signals wether this lock is
- * currently taken
- * Allows detection of abandoned and recursively captured mutexes
- */
+ * @brief Basic debugging aid, a flag that signals wether this lock is
+ * currently taken
+ * Allows detection of abandoned and recursively captured mutexes
+ */
uint32_t lock_taken_;
+ virtual void AssertTakenAndMarkFree();
+ virtual void AssertFreeAndMarkTaken();
+ boost::mutex mutex_;
+ DISALLOW_COPY_AND_ASSIGN(Lock);
+ friend class ConditionalVariable;
+};
- /**
- * @brief Describe if mutex is recurcive or not
- */
- bool is_mutex_recursive_;
+/*
+ * Platform-indepenednt RECURSIVE lock (mutex) wrapper
+ */
+class RecursiveLock : public BaseLock {
+ public:
+ RecursiveLock();
+ ~RecursiveLock();
+
+ virtual void Acquire();
- void AssertFreeAndMarkTaken();
- void AssertTakenAndMarkFree();
-#else
- void AssertFreeAndMarkTaken() {}
- void AssertTakenAndMarkFree() {}
-#endif
+ virtual void Release();
- void Init(bool is_recursive);
+ virtual bool Try();
+ private:
+ /**
+ * @brief Basic debugging aid, a flag that signals wether this lock is
+ * currently taken
+ * Allows detection of abandoned and recursively captured mutexes
+ */
+ uint32_t lock_taken_;
+ virtual void AssertTakenAndMarkFree();
+ virtual void AssertFreeAndMarkTaken();
+ boost::recursive_mutex mutex_;
+ DISALLOW_COPY_AND_ASSIGN(RecursiveLock);
friend class ConditionalVariable;
- DISALLOW_COPY_AND_ASSIGN(Lock);
};
// This class is used to automatically acquire and release the a lock
class AutoLock {
public:
- explicit AutoLock(Lock& lock) : lock_(lock) {
+ explicit AutoLock(const std::shared_ptr<BaseLock>& lock) : lock_(*lock) {
+ lock_.Acquire();
+ }
+ explicit AutoLock(BaseLock& lock) : lock_(lock) {
+ // std::cerr << "lock is at " << &lock << std::endl;
lock_.Acquire();
}
~AutoLock() {
@@ -150,21 +171,35 @@ class AutoLock {
}
private:
- Lock& GetLock() {
+ BaseLock& GetLock() {
return lock_;
}
- Lock& lock_;
+ BaseLock& lock_;
private:
friend class AutoUnlock;
friend class ConditionalVariable;
DISALLOW_COPY_AND_ASSIGN(AutoLock);
};
-
+/* Please use AutoLock to acquire and (automatically) release it
+ * It eases balancing of multple lock taking/releasing and makes it
+ * Impossible to forget to release the lock:
+ * ...
+ * ConcurentlyAccessedData data_;
+ * sync_primitives::Lock data_lock_;
+ * ...
+ * {
+ * sync_primitives::AutoLock auto_lock(data_lock_);
+ * data_.ReadOrWriteData();
+ * } // lock is automatically released here
+ */
// This class is used to temporarly unlock autolocked lock
class AutoUnlock {
public:
- explicit AutoUnlock(Lock& lock) : lock_(lock) {
+ explicit AutoUnlock(const std::shared_ptr<BaseLock>& lock) : lock_(*lock) {
+ lock_.Release();
+ }
+ explicit AutoUnlock(BaseLock& lock) : lock_(lock) {
lock_.Release();
}
explicit AutoUnlock(AutoLock& lock) : lock_(lock.GetLock()) {
@@ -175,7 +210,7 @@ class AutoUnlock {
}
private:
- Lock& lock_;
+ BaseLock& lock_;
private:
DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
diff --git a/src/components/include/utils/make_shared.h b/src/components/include/utils/make_shared.h
deleted file mode 100644
index 9d40d646a6..0000000000
--- a/src/components/include/utils/make_shared.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
-
-#include <new>
-/**
- * @brief The functions set below allows to create shared pointer in a safe way.
- * There are up to 5 parameters could be passed as the constructor parameters.
- *
- * @example
- * struct A {
- * A(int){}
- * A(int, double) {}
- * A(int, double, std::string) {}
- * }
- * SharedPtr<A> shared1(MakeShared<A>(5);
- * SharedPtr<A> shared2(MakeShared<A>(5, 5.5);
- * SharedPtr<A> shared3(MakeShared<A>(5, 5.5, std::string("MyStr"));
- *
- * The profit in using MakeShared instead of simple allocation with operator new
- *is evident.
- * Firstly it allows us to centralize allocation place, secondly it allows us to
- *use
- * safe operator new overloading (no throwable one).
- */
-namespace utils {
-template <typename T>
-class SharedPtr;
-
-namespace {
-template <typename T>
-SharedPtr<T> Initialize(T* object) {
- return object == NULL ? SharedPtr<T>() : SharedPtr<T>(object);
-}
-}
-
-template <typename T>
-SharedPtr<T> MakeShared() {
- T* t = new (std::nothrow) T;
- return Initialize(t);
-}
-
-template <typename T, typename Arg1>
-SharedPtr<T> MakeShared(Arg1& arg1) {
- T* t = new (std::nothrow) T(arg1);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2) {
- T* t = new (std::nothrow) T(arg1, arg2);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2, typename Arg3>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5>
-SharedPtr<T> MakeShared(
- Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5,
- typename Arg6>
-SharedPtr<T> MakeShared(
- Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5, Arg6& arg6) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1>
-SharedPtr<T> MakeShared(const Arg1& arg1) {
- T* t = new (std::nothrow) T(arg1);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2>
-SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2) {
- T* t = new (std::nothrow) T(arg1, arg2);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2, typename Arg3>
-SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4,
- const Arg5& arg5) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5,
- typename Arg6>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4,
- const Arg5& arg5,
- const Arg6& arg6) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6);
- return Initialize(t);
-}
-
-} // namespace utils;
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
diff --git a/src/components/include/utils/messagemeter.h b/src/components/include/utils/messagemeter.h
index 42b658ad6b..1148a65b57 100644
--- a/src/components/include/utils/messagemeter.h
+++ b/src/components/include/utils/messagemeter.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_UTILS_MESSAGEMETER_H_
#include <cstddef>
-#include <set>
#include <map>
+#include <set>
#include "utils/date_time.h"
namespace utils {
@@ -82,20 +82,19 @@ class MessageMeter {
void ClearIdentifiers();
void set_time_range(const size_t time_range_msecs);
- void set_time_range(const TimevalStruct& time_range);
- TimevalStruct time_range() const;
+ void set_time_range(const date_time::TimeDuration& time_range);
+ date_time::TimeDuration time_range() const;
private:
- TimevalStruct time_range_;
- typedef std::multiset<TimevalStruct> Timings;
+ date_time::TimeDuration time_range_;
+ typedef std::multiset<date_time::TimeDuration> Timings;
typedef std::map<Id, Timings> TimingMap;
TimingMap timing_map_;
};
template <class Id>
-MessageMeter<Id>::MessageMeter()
- : time_range_(TimevalStruct{0, 0}) {
- time_range_.tv_sec = 1;
+MessageMeter<Id>::MessageMeter() {
+ time_range_ = date_time::seconds(1);
}
template <class Id>
@@ -106,7 +105,7 @@ size_t MessageMeter<Id>::TrackMessage(const Id& id) {
template <class Id>
size_t MessageMeter<Id>::TrackMessages(const Id& id, const size_t count) {
Timings& timings = timing_map_[id];
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
for (size_t i = 0; i < count; ++i) {
// Adding to the end is amortized constant
timings.insert(timings.end(), current_time);
@@ -124,8 +123,8 @@ size_t MessageMeter<Id>::Frequency(const Id& id) {
if (timings.empty()) {
return 0u;
}
- const TimevalStruct actual_begin_time = date_time::DateTime::Sub(
- date_time::DateTime::getCurrentTime(), time_range_);
+ const date_time::TimeDuration actual_begin_time =
+ (date_time::getCurrentTime() - time_range_);
timings.erase(timings.begin(), timings.upper_bound(actual_begin_time));
return timings.size();
}
@@ -142,21 +141,15 @@ void MessageMeter<Id>::ClearIdentifiers() {
template <class Id>
void MessageMeter<Id>::set_time_range(const size_t time_range_msecs) {
- // TODO(EZamakhov): move to date_time::DateTime
- const size_t secs =
- time_range_msecs / date_time::DateTime::MILLISECONDS_IN_SECOND;
- time_range_.tv_sec = secs;
- const size_t mSecs =
- time_range_msecs % date_time::DateTime::MILLISECONDS_IN_SECOND;
- time_range_.tv_usec =
- mSecs * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ time_range_ = date_time::milliseconds(time_range_msecs);
}
template <class Id>
-void MessageMeter<Id>::set_time_range(const TimevalStruct& time_range) {
+void MessageMeter<Id>::set_time_range(
+ const date_time::TimeDuration& time_range) {
time_range_ = time_range;
}
template <class Id>
-TimevalStruct MessageMeter<Id>::time_range() const {
+date_time::TimeDuration MessageMeter<Id>::time_range() const {
return time_range_;
}
} // namespace utils
diff --git a/src/components/include/utils/semantic_version.h b/src/components/include/utils/semantic_version.h
new file mode 100644
index 0000000000..5fe7ce1deb
--- /dev/null
+++ b/src/components/include/utils/semantic_version.h
@@ -0,0 +1,125 @@
+/*
+ * 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_INCLUDE_UTILS_SEMANTIC_VERSION_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_SEMANTIC_VERSION_H_
+
+#include <string>
+namespace utils {
+
+struct SemanticVersion {
+ SemanticVersion(uint16_t major = 0, uint16_t minor = 0, uint16_t patch = 0) {
+ major_version_ = major;
+ minor_version_ = minor;
+ patch_version_ = patch;
+ }
+
+ SemanticVersion(const SemanticVersion& other) {
+ major_version_ = other.major_version_;
+ minor_version_ = other.minor_version_;
+ patch_version_ = other.patch_version_;
+ }
+
+ SemanticVersion(const std::string& versionString)
+ : major_version_(0), minor_version_(0), patch_version_(0) {
+ unsigned int major_int, minor_int, patch_int;
+ int readElements = sscanf(
+ versionString.c_str(), "%u.%u.%u", &major_int, &minor_int, &patch_int);
+ if (readElements != 3) {
+ // LOG4CXX_WARN(logger_,
+ // "Error while parsing version string: " << versionString);
+ } else {
+ major_version_ = static_cast<uint8_t>(major_int);
+ minor_version_ = static_cast<uint8_t>(minor_int);
+ patch_version_ = static_cast<uint8_t>(patch_int);
+ }
+ }
+
+ static inline int16_t cmp(const SemanticVersion& version1,
+ const SemanticVersion& version2) {
+ int16_t diff =
+ static_cast<int16_t>(version1.major_version_ - version2.major_version_);
+ if (diff == 0) {
+ diff = static_cast<int16_t>(version1.minor_version_ -
+ version2.minor_version_);
+ if (diff == 0) {
+ diff = static_cast<int16_t>(version1.patch_version_ -
+ version2.patch_version_);
+ }
+ }
+ return diff;
+ }
+
+ bool operator==(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) == 0;
+ }
+ bool operator<(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) < 0;
+ }
+ bool operator>(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) > 0;
+ }
+ bool operator<=(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) <= 0;
+ }
+ bool operator>=(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) >= 0;
+ }
+ static inline SemanticVersion* min(SemanticVersion& version1,
+ SemanticVersion& version2) {
+ return (version1 < version2) ? &version1 : &version2;
+ }
+
+ const std::string toString() const {
+ std::string result = "";
+ result += std::to_string(major_version_);
+ result += ".";
+ result += std::to_string(minor_version_);
+ result += ".";
+ result += std::to_string(patch_version_);
+ return result;
+ }
+
+ bool isValid() const {
+ return major_version_ > 0 || minor_version_ > 0 || patch_version_ > 0;
+ }
+
+ uint16_t major_version_ = 0;
+ uint16_t minor_version_ = 0;
+ uint16_t patch_version_ = 0;
+};
+
+extern const SemanticVersion base_rpc_version;
+extern const SemanticVersion rpc_version_5;
+}
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H \ No newline at end of file
diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h
deleted file mode 100644
index 064bb36b4a..0000000000
--- a/src/components/include/utils/shared_ptr.h
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdint.h>
-
-#include "utils/macro.h"
-#include "utils/atomic.h"
-
-namespace utils {
-
-/**
- * @brief Shared pointer.
- *
- * Pointer to an object with reference counting.
- * Object will be automatically deallocated when last shared
- * pointer is destroyed.
- *
- * @tparam ObjectType Type of wrapped object.
- **/
-template <typename ObjectType>
-class SharedPtr {
- static void DummyDeleter(ObjectType* object_to_delete) {
- delete object_to_delete;
- }
-
- public:
- // std smart pointer compatibility
- typedef ObjectType element_type;
- typedef void (*Deleter)(ObjectType*);
- /**
- * @brief Constructor.
- *
- * Initialize shared pointer with wrapped object.
- * Reference counter will be initialized to 1.
- *
- * @param Object Wrapped object.
- **/
- SharedPtr(ObjectType* Object);
-
- SharedPtr(ObjectType* Object, Deleter deleter)
- : mObject(Object)
- , mReferenceCounter(new uint32_t(1))
- , deleter_(deleter) {}
-
- SharedPtr();
-
- /**
- * @brief Copy constructor.
- *
- * Initialize shared pointer with another shared pointer.
- * Reference counter will be incremented.
- *
- * @param Other Other shared pointer.
- **/
- SharedPtr(const SharedPtr<ObjectType>& Other);
-
- /**
- * @brief Copy constructor.
- *
- * Initialize shared pointer with another shared pointer.
- * Reference counter will be incremented.
- *
- * @tparam OtherObjectType Type of other object pointer. This
- * allows creating a shared pointer to an
- * intstance of a base class from a shared
- * pointer to an instance of a class
- * inherited from this base class.
- * If OtherObjectType is not implicitly
- * convertible to ObjectType it will
- * cause a compile error.
- *
- * @param Other Other shared pointer.
- **/
- template <typename OtherObjectType>
- SharedPtr(const SharedPtr<OtherObjectType>& Other);
-
- /**
- * @brief Destructor.
- *
- * Decrement reference counter and destroy wrapped object
- * if reference counter reaches zero.
- **/
- ~SharedPtr();
-
- /**
- * @brief Assignment operator.
- *
- * Drop reference to currently referenced object and add
- * reference to assigned object.
- *
- * @param Other Shared pointer to an object
- * that must be referenced.
- *
- * @return Reference to this shared pointer.
- **/
- SharedPtr<ObjectType>& operator=(const SharedPtr<ObjectType>& Other);
-
- bool operator==(const SharedPtr<ObjectType>& Other) const;
-
- bool operator<(const SharedPtr<ObjectType>& other) const;
-
- /**
- * @brief Assignment operator.
- *
- * Drop reference to currently referenced object and add
- * reference to assigned object.
- *
- * @tparam OtherObjectType Type of other object pointer. This
- * allows creating a shared pointer to an
- * intstance of a base class from a shared
- * pointer to an instance of a class
- * inherited from this base class.
- * If OtherObjectType is not implicitly
- * convertible to ObjectType it will
- * cause a compile error.
- *
- * @param Other Shared pointer to an object
- * that must be referenced.
- *
- * @return Reference to this shared pointer.
- **/
- template <typename OtherObjectType>
- SharedPtr<ObjectType>& operator=(const SharedPtr<OtherObjectType>& Other);
-
- template <typename OtherObjectType>
- static SharedPtr<OtherObjectType> static_pointer_cast(
- const SharedPtr<ObjectType>& pointer);
-
- template <typename OtherObjectType>
- static SharedPtr<OtherObjectType> dynamic_pointer_cast(
- const SharedPtr<ObjectType>& pointer);
-
- /**
- * @brief Member access operator.
- *
- * @return Wrapped object.
- **/
- ObjectType* operator->() const;
-
- ObjectType& operator*() const;
- operator bool() const;
- void reset();
- void reset(ObjectType* other);
- ObjectType* get() const;
-
-#ifdef BUILD_TESTS
- inline const uint32_t* get_ReferenceCounter() const {
- return mReferenceCounter;
- }
-#endif // BUILD_TESTS
-
- /**
- * @return true if mObject not NULL
- */
- bool valid() const;
-
- private:
- void reset_impl(ObjectType* other);
-
- // TSharedPtr needs access to other TSharedPtr private members
- // for shared pointers type casts.
- template <typename OtherObjectType>
- friend class SharedPtr;
-
- /**
- * @brief Drop reference to wrapped object.
- *
- * If reference counter reaches zero object and its reference
- * counter will be deallocated.
- **/
- void dropReference();
-
- /**
- * @brief Wrapped object.
- **/
- ObjectType* mObject;
-
- /**
- * @brief Pointer to reference counter.
- **/
- uint32_t* mReferenceCounter;
-
- Deleter deleter_;
- void release();
-};
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(ObjectType* Object)
- : mObject(NULL)
- , mReferenceCounter(new uint32_t(1))
- , deleter_(DummyDeleter) {
- DCHECK(Object != NULL);
- mObject = Object;
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr()
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(
- const SharedPtr<ObjectType>& Other)
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {
- *this = Other;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(
- const SharedPtr<OtherObjectType>& Other)
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {
- *this = Other;
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::~SharedPtr() {
- dropReference();
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=(
- const SharedPtr<ObjectType>& Other) {
- return operator=<ObjectType>(Other);
-}
-
-template <typename ObjectType>
-inline bool utils::SharedPtr<ObjectType>::operator==(
- const SharedPtr<ObjectType>& Other) const {
- return (mObject == Other.mObject);
-}
-
-template <typename ObjectType>
-inline bool utils::SharedPtr<ObjectType>::operator<(
- const SharedPtr<ObjectType>& other) const {
- return (mObject < other.mObject);
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=(
- const SharedPtr<OtherObjectType>& Other) {
- dropReference();
-
- mObject = Other.mObject;
- mReferenceCounter = Other.mReferenceCounter;
-
- if (0 != mReferenceCounter) {
- atomic_post_inc(mReferenceCounter);
- }
-
- return *this;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-utils::SharedPtr<OtherObjectType> utils::SharedPtr<
- ObjectType>::static_pointer_cast(const SharedPtr<ObjectType>& pointer) {
- SharedPtr<OtherObjectType> casted_pointer;
- casted_pointer.mObject = static_cast<OtherObjectType*>(pointer.mObject);
- casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
-
- if (0 != casted_pointer.mReferenceCounter) {
- atomic_post_inc(casted_pointer.mReferenceCounter);
- }
-
- return casted_pointer;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-utils::SharedPtr<OtherObjectType> utils::SharedPtr<
- ObjectType>::dynamic_pointer_cast(const SharedPtr<ObjectType>& pointer) {
- SharedPtr<OtherObjectType> casted_pointer;
- casted_pointer.mObject = dynamic_cast<OtherObjectType*>(pointer.mObject);
- if (NULL != casted_pointer.mObject) {
- casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
-
- if (0 != casted_pointer.mReferenceCounter) {
- atomic_post_inc(casted_pointer.mReferenceCounter);
- }
- }
-
- return casted_pointer;
-}
-
-template <typename ObjectType>
-ObjectType* utils::SharedPtr<ObjectType>::operator->() const {
- DCHECK(mObject);
- return mObject;
-}
-
-template <typename ObjectType>
-ObjectType& utils::SharedPtr<ObjectType>::operator*() const {
- DCHECK(mObject);
- return *mObject;
-}
-
-template <typename ObjectType>
-utils::SharedPtr<ObjectType>::operator bool() const {
- return valid();
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset() {
- reset_impl(0);
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset(ObjectType* other) {
- DCHECK(other != NULL);
- reset_impl(other);
-}
-
-template <typename ObjectType>
-void SharedPtr<ObjectType>::release() {
- deleter_(mObject);
- mObject = 0;
-
- delete mReferenceCounter;
- mReferenceCounter = 0;
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset_impl(ObjectType* other) {
- dropReference();
- mObject = other;
- mReferenceCounter = new uint32_t(1);
-}
-
-template <typename ObjectType>
-inline void SharedPtr<ObjectType>::dropReference() {
- if (0 != mReferenceCounter) {
- if (1 == atomic_post_dec(mReferenceCounter)) {
- release();
- }
- }
-}
-
-template <typename ObjectType>
-ObjectType* SharedPtr<ObjectType>::get() const {
- return mObject;
-}
-
-template <typename ObjectType>
-inline bool SharedPtr<ObjectType>::valid() const {
- if (mReferenceCounter && (0 < *mReferenceCounter)) {
- return (mObject != NULL);
- }
- return false;
-}
-
-} // namespace utils
-
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-
-// vim: set ts=2 sw=2 et:
diff --git a/src/components/include/utils/threads/message_loop_thread.h b/src/components/include/utils/threads/message_loop_thread.h
index 15023f02dd..add7fc38b8 100644
--- a/src/components/include/utils/threads/message_loop_thread.h
+++ b/src/components/include/utils/threads/message_loop_thread.h
@@ -40,7 +40,7 @@
#include "utils/macro.h"
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
-#include "utils/shared_ptr.h"
+
#include "utils/lock.h"
namespace threads {
diff --git a/src/components/include/utils/typed_enum_print.h b/src/components/include/utils/typed_enum_print.h
new file mode 100644
index 0000000000..e2b903c948
--- /dev/null
+++ b/src/components/include/utils/typed_enum_print.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
+
+#include <type_traits>
+#include <ostream>
+
+namespace utils {
+
+// Generic overloaded operator "<<" to be able to send enum class values to
+// std::ostream
+template <typename T>
+std::ostream& operator<<(
+ typename std::enable_if<std::is_enum<T>::value, std::ostream>::type& stream,
+ const T& e) {
+ return stream << static_cast<int>(e);
+}
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt
index 1ea481f11a..3cf1082e90 100644
--- a/src/components/interfaces/CMakeLists.txt
+++ b/src/components/interfaces/CMakeLists.txt
@@ -38,37 +38,14 @@ include_directories (
${CMAKE_BINARY_DIR}
)
-generate_interface("v4_protocol_v1_2_no_extra.xml" "NsSmartDeviceLinkRPC::V1" "sdlrpcv1")
+generate_interface("v4_protocol_v1_2_no_extra.xml" "ns_smart_device_link_rpc::V1" "sdlrpcv1")
add_library(v4_protocol_v1_2_no_extra ${CMAKE_CURRENT_BINARY_DIR}/v4_protocol_v1_2_no_extra_schema.cc)
generate_interface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2")
add_library(MOBILE_API ${CMAKE_CURRENT_BINARY_DIR}/MOBILE_API_schema.cc)
-if(HMI_JSON_API)
- generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc")
- add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
-endif()
-
-if(HMI_DBUS_API)
- generate_interface("QT_HMI_API.xml" "hmi_apis" "jsonrpc")
-
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h"
- )
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h"
- )
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h")
-
- add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
-endif()
+generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc")
+add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
target_link_libraries(v4_protocol_v1_2_no_extra Utils)
target_link_libraries(MOBILE_API Utils)
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index ab3933fc0f..97df559ef5 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -4,9 +4,6 @@
* Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
@@ -37,7 +34,7 @@
<interfaces name="SmartDeviceLink HMI API">
-<interface name="Common" version="1.7.0" date="2017-10-20">
+<interface name="Common" version="2.0.0" date="2018-09-05">
<enum name="Result">
<element name="SUCCESS" value="0"/>
@@ -80,6 +77,7 @@
<enum name="ButtonName">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
<element name="OK"/>
+ <element name="PLAY_PAUSE"/>
<element name="SEEKLEFT"/>
<element name="SEEKRIGHT"/>
<element name="TUNEUP"/>
@@ -335,6 +333,20 @@
<element name="CLEAR" />
<description>Clears the media clock timer (previously done through Show->mediaClock)</description>
</enum>
+<enum name="AudioStreamingIndicator">
+ <element name="PLAY_PAUSE">
+ <description>Default playback indicator.</description>
+ </element>
+ <element name="PLAY">
+ <description>Indicates that a button press of the Play/Pause button would start the playback.</description>
+ </element>
+ <element name="PAUSE">
+ <description>Indicates that a button press of the Play/Pause button would pause the current playback.</description>
+ </element>
+ <element name="STOP">
+ <description>Indicates that a button press of the Play/Pause button would stop the current playback.</description>
+ </element>
+</enum>
<enum name="SystemContext">
<description>Enumeration that describes possible contexts the application might be in on HU.</description>
@@ -371,6 +383,7 @@
<element name="LHPLUS_PHONEMES" />
<element name="PRE_RECORDED" />
<element name="SILENCE" />
+ <element name="FILE" />
</enum>
<enum name="VrCapabilities">
@@ -624,7 +637,10 @@
<description>The image field for the app icon (set by setAppIcon)</description>
</element>
<element name="graphic">
- <description>The image field for Show</description>
+ <description>The primary image field for Show</description>
+ </element>
+ <element name="secondaryGraphic">
+ <description>The secondary image field for Show</description>
</element>
<element name="showConstantTBTIcon">
<description>The primary image field for ShowConstantTBT</description>
@@ -726,6 +742,63 @@
</enum>
<!--IVI part-->
+<enum name="ElectronicParkBrakeStatus">
+ <element name="CLOSED">
+ <description>
+ Park brake actuators have been fully applied.
+ </description>
+ </element>
+ <element name="TRANSITION">
+ <description>
+ Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ </description>
+ </element>
+ <element name="OPEN">
+ <description>
+ Park brake actuators are released.
+ </description>
+ </element>
+ <element name="DRIVE_ACTIVE">
+ <description>
+ When driver pulls the Electronic Park Brake switch while driving "at speed".
+ </description>
+ </element>
+ <element name="FAULT">
+ <description>
+ When system has a fault or is under maintenance.
+ </description>
+ </element>
+</enum>
+<enum name="FuelType">
+ <element name="GASOLINE" />
+ <element name="DIESEL" />
+ <element name="CNG">
+ <description>
+ For vehicles using compressed natural gas.
+ </description>
+ </element>
+ <element name="LPG">
+ <description>
+ For vehicles using liquefied petroleum gas.
+ </description>
+ </element>
+ <element name="HYDROGEN">
+ <description>For FCEV (fuel cell electric vehicle).</description>
+ </element>
+ <element name="BATTERY">
+ <description>For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.</description>
+ </element>
+</enum>
+
+<struct name="FuelRange">
+ <param name="type" type="Common.FuelType" mandatory="false"/>
+ <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
+ <description>
+ The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ </description>
+ </param>
+</struct>
+
<enum name="ComponentVolumeStatus">
<description>The volume status of a vehicle component.</description>
<element name="UNKNOWN" internal_name="CVS_UNKNOWN">
@@ -748,6 +821,33 @@
</element>
</enum>
+<enum name="TPMS">
+ <element name="UNKNOWN">
+ <description>If set the status of the tire is not known.</description>
+ </element>
+ <element name="SYSTEM_FAULT">
+ <description>TPMS does not function.</description>
+ </element>
+ <element name="SENSOR_FAULT">
+ <description>The sensor of the tire does not function.</description>
+ </element>
+ <element name="LOW">
+ <description>TPMS is reporting a low tire pressure for the tire.</description>
+ </element>
+ <element name="SYSTEM_ACTIVE">
+ <description>TPMS is active and the tire pressure is monitored.</description>
+ </element>
+ <element name="TRAIN">
+ <description>TPMS is reporting that the tire must be trained.</description>
+ </element>
+ <element name="TRAINING_COMPLETE">
+ <description>TPMS reports the training for the tire is completed.</description>
+ </element>
+ <element name="NOT_TRAINED">
+ <description>TPMS reports the tire is not trained.</description>
+ </element>
+</enum>
+
<enum name="PRNDL">
<description>The selected gear.</description>
<element name="PARK">
@@ -783,6 +883,8 @@
</element>
<element name="EIGHTH">
</element>
+ <element name="UNKNOWN">
+ </element>
<element name="FAULT">
</element>
</enum>
@@ -869,6 +971,8 @@
<description>Reflects the current primary audio source (if selected).</description>
<element name="NO_SOURCE_SELECTED">
</element>
+ <element name="CD">
+ </element>
<element name="USB">
</element>
<element name="USB2">
@@ -881,6 +985,14 @@
</element>
<element name="MOBILE_APP">
</element>
+ <element name="AM">
+ </element>
+ <element name="FM">
+ </element>
+ <element name="XM">
+ </element>
+ <element name="DAB">
+ </element>
</enum>
<enum name="CompassDirection">
@@ -978,6 +1090,10 @@
<element name="VEHICLEDATA_ENGINETORQUE" />
<element name="VEHICLEDATA_ACCPEDAL" />
<element name="VEHICLEDATA_STEERINGWHEEL" />
+ <element name="VEHICLEDATA_TURNSIGNAL" />
+ <element name="VEHICLEDATA_FUELRANGE" />
+ <element name="VEHICLEDATA_ENGINEOILLIFE" />
+ <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" />
</enum>
<enum name="WiperStatus">
@@ -1031,21 +1147,35 @@
<enum name="SamplingRate">
<description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="RATE_8KHZ"/>
- <element name="16KHZ" internal_name="RATE_16KHZ"/>
- <element name="22KHZ" internal_name="RATE_22KHZ"/>
- <element name="44KHZ" internal_name="RATE_44KHZ"/>
+ <element name="8KHZ" internal_name="RATE_8KHZ">
+ <description>Sampling rate of 8000 Hz.</description>
+ </element>
+ <element name="16KHZ" internal_name="RATE_16KHZ">
+ <description>Sampling rate of 16000 Hz.</description>
+ </element>
+ <element name="22KHZ" internal_name="RATE_22KHZ">
+ <description>Sampling rate of 22050 Hz.</description>
+ </element>
+ <element name="44KHZ" internal_name="RATE_44KHZ">
+ <description>Sampling rate of 44100 Hz.</description>
+ </element>
</enum>
<enum name="BitsPerSample">
<description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="RATE_8_BIT"/>
- <element name="16_BIT" internal_name="RATE_16_BIT"/>
+ <element name="8_BIT" internal_name="RATE_8_BIT">
+ <description>Audio sample is 8 bits wide, unsigned.</description>
+ </element>
+ <element name="16_BIT" internal_name="RATE_16_BIT">
+ <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
+ </element>
</enum>
<enum name="AudioType">
<description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
+ <element name="PCM">
+ <description>Linear PCM.</description>
+ </element>
</enum>
<enum name="KeyboardLayout">
@@ -1102,13 +1232,13 @@
</enum>
<enum name="RequestType">
- <description>Enumeration listing possible asynchronous requests.</description>
- <element name="HTTP" />
- <element name="FILE_RESUME" />
- <element name="AUTH_REQUEST" />
- <element name="AUTH_CHALLENGE" />
- <element name="AUTH_ACK" />
- <element name="PROPRIETARY" />
+ <description>Enumeration listing possible asynchronous requests.</description>
+ <element name="HTTP" />
+ <element name="FILE_RESUME" />
+ <element name="AUTH_REQUEST" />
+ <element name="AUTH_CHALLENGE" />
+ <element name="AUTH_ACK" />
+ <element name="PROPRIETARY" />
<element name="QUERY_APPS" />
<element name="LAUNCH_APP" />
<element name="LOCK_SCREEN_ICON_URL" />
@@ -1123,6 +1253,7 @@
<element name="EMERGENCY" />
<element name="MEDIA" />
<element name="FOTA" />
+ <element name="OEM_SPECIFIC"/>
</enum>
<enum name="ECallConfirmationStatus">
@@ -1389,21 +1520,21 @@
<element name="UPDATING" />
<element name="UPDATE_NEEDED"/>
</enum>
-
+
<enum name="SystemError">
<element name="SYNC_REBOOTED"/>
<element name="SYNC_OUT_OF_MEMMORY" />
</enum>
-
+
<enum name="StatisticsType">
<element name="iAPP_BUFFER_FULL"/>
</enum>
-
+
<enum name="ConsentSource">
<element name="GUI"/>
<element name="VUI" />
</enum>
-
+
<enum name="DeviceState">
<element name="UNKNOWN"/>
<element name="UNPAIRED"/>
@@ -1416,7 +1547,7 @@
<param name="line2" type="String" mandatory="false"/>
<param name="textBody" type="String" mandatory="false"/>
</struct>
-
+
<struct name="PermissionItem">
<param name="name" type="String" mandatory="true">
<description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
@@ -1427,7 +1558,7 @@
<param name="allowed" type="Boolean" mandatory="false">
<description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
</param>
- </struct>
+ </struct>
<struct name="ServiceInfo">
<param name="url" type="String" mandatory="true">
<description>Get URL based on service type.</description>
@@ -1459,7 +1590,136 @@
<enum name="ModuleType">
<element name="CLIMATE"/>
<element name="RADIO"/>
- </enum>
+ <element name="SEAT"/>
+ <element name="AUDIO"/>
+ <element name="LIGHT"/>
+ <element name="HMI_SETTINGS"/>
+</enum>
+
+ <enum name="MassageZone">
+ <description>List possible zones of a multi-contour massage seat.</description>
+ <element name="LUMBAR">
+ <description>The back of a multi-contour massage seat. or SEAT_BACK</description>
+ </element>
+ <element name="SEAT_CUSHION">
+ <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
+ </element>
+ </enum>
+
+ <enum name="MassageMode">
+ <description>List possible modes of a massage zone.</description>
+ <element name="OFF"/>
+ <element name="LOW"/>
+ <element name="HIGH"/>
+ </enum>
+
+ <struct name="MassageModeData">
+ <description>Specify the mode of a massage zone.</description>
+ <param name="massageZone" type="MassageZone" mandatory="true"></param>
+ <param name="massageMode" type="MassageMode" mandatory="true"></param>
+ </struct>
+
+ <enum name="MassageCushion">
+ <description>List possible cushions of a multi-contour massage seat.</description>
+ <element name="TOP_LUMBAR"/>
+ <element name="MIDDLE_LUMBAR"/>
+ <element name="BOTTOM_LUMBAR"/>
+ <element name="BACK_BOLSTERS"/>
+ <element name="SEAT_BOLSTERS"/>
+ </enum>
+
+ <struct name="MassageCushionFirmness">
+ <description>The intensity or firmness of a cushion.</description>
+ <param name="cushion" type="MassageCushion" mandatory="true"></param>
+ <param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <enum name="SeatMemoryActionType">
+ <element name="SAVE">
+ <description>Save current seat postions and settings to seat memory.</description>
+ </element>
+ <element name="RESTORE">
+ <description>Restore / apply the seat memory settings to the current seat. </description>
+ </element>
+ <element name="NONE">
+ <description>No action to be performed.</description>
+ </element>
+ </enum>
+
+ <struct name="SeatMemoryAction">
+ <param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
+ <param name="label" type="String" maxlength="100" mandatory="false"/>
+ <param name="action" type="SeatMemoryActionType" mandatory="true"/>
+ </struct>
+
+ <enum name="SupportedSeat">
+ <description>List possible seats that is a remote controllable seat.</description>
+ <element name="DRIVER"/>
+ <element name="FRONT_PASSENGER"/>
+ </enum>
+
+ <struct name="SeatControlData">
+ <description>Seat control data corresponds to "SEAT" ModuleType. </description>
+ <param name="id" type="SupportedSeat" mandatory="true"></param>
+
+ <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="massageEnabled" type="Boolean" mandatory="false"></param>
+ <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+ <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ </struct>
+
+ <struct name="SeatControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageModeAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="memoryAvailable" type="Boolean" mandatory="false">
+ </param>
+ </struct>
<enum name="RadioBand">
<element name="AM"/>
@@ -1501,6 +1761,92 @@
<element name="NOT_FOUND"/>
</enum>
+ <struct name="StationIDNumber">
+ <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
+ </param>
+ <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
+ <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
+ </param>
+ </struct>
+
+ <struct name="GPSData">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>PDOP.</description>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>HDOP.</description>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>VDOP.</description>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false">
+ <description>
+ True, if actual.
+ False, if infered.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Common.Dimension" mandatory="false">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
+ <description>The speed in KPH</description>
+ </param>
+ </struct>
+
+ <struct name="SisData">
+ <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
+ <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
+ </param>
+ <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
+ </param>
+ <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>Identifies the station call sign or other identifying information in the long format.</description>
+ </param>
+ <param name="stationLocation" type="GPSData" mandatory="false">
+ <description>Provides the 3-dimensional geographic station location.</description>
+ </param>
+ <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements. Includes a high priority delivery feature to convey emergencies that may be in the listening area.</description>
+ </param>
+ </struct>
+
<struct name="RadioControlData">
<param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
<description>The integer part of the frequency ie for 101.7 this value should be 101</description>
@@ -1512,10 +1858,13 @@
</param>
<param name="rdsData" type="Common.RdsData" mandatory="false">
</param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdRadioEnable" type="Boolean" mandatory="false">
+ <description> True if the hd radio is on, false is the radio is off</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
<description>number of HD sub-channels if available</description>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
<description>Current HD sub-channel if available</description>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
@@ -1528,6 +1877,9 @@
</param>
<param name="state" type="Common.RadioState" mandatory="false">
</param>
+ <param name="sisData" type="SisData" mandatory="false">
+ <description>Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number</description>
+ </param>
</struct>
<struct name="RadioControlCapabilities">
@@ -1589,6 +1941,24 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="sisDataAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting HD radio Station Information Service (SIS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable HD radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of sirius XM radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
<enum name="DefrostZone">
@@ -1640,6 +2010,18 @@
</param>
<param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
</param>
+ <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled/turn off, value true means enabled/turn on.</description>
+ </param>
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedRearWindowEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedMirrorsEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
</struct>
<struct name="ClimateControlCapabilities">
@@ -1717,6 +2099,285 @@
A set of all ventilation modes that are controllable.
</description>
</param>
+ <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Steering Wheel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Windshield.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Rear Window.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Mirrors.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="EqualizerSettings">
+ <description>Defines the each Equalizer channel settings.</description>
+ <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
+ <param name="channelName" type="String" mandatory="false" maxlength="50">
+ <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
+ </param>
+ <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <struct name="AudioControlData">
+ <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <description>
+ In a getter response or a notification, it is the current primary audio source of the system.
+ In a setter request, it is the target audio source that the system shall switch to.
+ If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ </description>
+ </param>
+ <param name="keepContext" type="Boolean" mandatory="false">
+ <description>
+ This parameter shall not be present in any getter responses or notifications.
+ This parameter is optional in a setter request. The default value is false.
+ If it is false, the system not only changes the audio source but also brings the default application
+ or system UI associated with the audio source to foreground.
+ If it is true, the system changes the audio source, but still keeps the current application in foreground.
+ </description>
+ </param>
+ <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
+ <description>Reflects the volume of audio, from 0%-100%.</description>
+ </param>
+ <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="sourceAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio source. </description>
+ </param>
+ <param name="keepContextAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the keepContext paramter. </description>
+ </param>
+ <param name="volumeAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio volume.</description>
+ </param>
+ <param name="equalizerAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of Equalizer Settings.</description>
+ </param>
+ <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
+ </param>
+ </struct>
+
+
+ <struct name="RGBColor">
+ <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ </struct>
+
+ <enum name="LightName">
+ <!-- Common Single Light 0~500 -->
+ <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
+ <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
+ <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
+ <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
+ <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
+ <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
+ <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
+ <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
+ <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
+ <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
+ <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
+ <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
+ <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
+ <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
+ <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
+ <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
+ <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
+ <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
+ <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
+ <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
+ <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
+
+ <!-- Exterior Lights by common function groups 501~800 -->
+ <element name="HIGH_BEAMS" value="501">
+ <description>Include all high beam lights: front_left and front_right.</description>
+ </element>
+ <element name="LOW_BEAMS" value="502">
+ <description>Include all low beam lights: front_left and front_right.</description>
+ </element>
+ <element name="FOG_LIGHTS" value="503">
+ <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="RUNNING_LIGHTS" value="504">
+ <description>Include all daytime running lights: front, left and right.</description>
+ </element>
+ <element name="PARKING_LIGHTS" value="505">
+ <description>Include all parking lights: front_left and front_right.</description>
+ </element>
+ <element name="BRAKE_LIGHTS" value="506">
+ <description>Include all brake lights: rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_REVERSING_LIGHTS" value="507"/>
+ <element name="SIDE_MARKER_LIGHTS" value="508"/>
+ <element name="LEFT_TURN_LIGHTS" value="509">
+ <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
+ </element>
+ <element name="RIGHT_TURN_LIGHTS" value="510">
+ <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
+ </element>
+ <element name="HAZARD_LIGHTS" value="511">
+ <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_CARGO_LIGHTS" value="512">
+ <description>Cargo lamps illuminate the cargo area.</description>
+ </element>
+ <element name="REAR_TRUCK_BED_LIGHTS" value="513">
+ <description>Truck bed lamps light up the bed of the truck.</description>
+ </element>
+ <element name="REAR_TRAILER_LIGHTS" value="514">
+ <description>Trailer lights are lamps mounted on a trailer hitch.</description>
+ </element>
+ <element name="LEFT_SPOT_LIGHTS" value="515">
+ <description>It is the spotlights mounted on the left side of a vehicle.</description>
+ </element>
+ <element name="RIGHT_SPOT_LIGHTS" value="516">
+ <description>It is the spotlights mounted on the right side of a vehicle.</description>
+ </element>
+ <element name="LEFT_PUDDLE_LIGHTS" value="517">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+ <element name="RIGHT_PUDDLE_LIGHTS" value="518">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+
+ <!-- Interior Lights by common function groups 801~900 -->
+ <element name="AMBIENT_LIGHTS" value="801"/>
+ <element name="OVERHEAD_LIGHTS" value="802"/>
+ <element name="READING_LIGHTS" value="803"/>
+ <element name="TRUNK_LIGHTS" value="804"/>
+
+ <!-- Lights by location 901~1000-->
+ <element name="EXTERIOR_FRONT_LIGHTS" value="901">
+ <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
+ </element>
+ <element name="EXTERIOR_REAR_LIGHTS" value="902">
+ <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights an trailer assist lights.</description>
+ </element>
+ <element name="EXTERIOR_LEFT_LIGHTS" value="903">
+ <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
+ <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_ALL_LIGHTS" value="905">
+ <description> Include all exterior lights around the vehicle.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus">
+ <element name="ON"/>
+ <element name="OFF"/>
+ <element name="RAMP_UP"/>
+ <element name="RAMP_DOWN"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+
+ <struct name="LightCapabilities">
+ <param name="name" type="LightName" mandatory="true" />
+ <param name="statusAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ </description>
+ </param>
+ <param name="densityAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's density can be set remotely (similar to a dimmer).
+ </description>
+ </param>
+ <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's color can be set remotely by using the RGB color space.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="LightControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description> An array of available light names that are controllable. </description>
+ </param>
+ </struct>
+
+ <struct name="LightState">
+ <param name="id" type="LightName" mandatory="true">
+ <description>The name of a light or a group of lights. </description>
+ </param>
+ <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
+ <param name="color" type="RGBColor" mandatory="false" />
+ </struct>
+
+ <struct name="LightControlData">
+ <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
+ </param>
+ </struct>
+
+ <enum name="DisplayMode">
+ <element name="DAY"/>
+ <element name="NIGHT"/>
+ <element name="AUTO"/>
+ </enum>
+ <enum name="DistanceUnit">
+ <element name="MILES"/>
+ <element name="KILOMETERS"/>
+ </enum>
+
+ <struct name="HMISettingsControlData">
+ <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
+ <param name="displayMode" type="DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ </struct>
+
+ <struct name="HMISettingsControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the hmi setting module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of distance unit. </description>
+ </param>
+ <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of temperature unit. </description>
+ </param>
+ <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of HMI display mode. </description>
+ </param>
</struct>
<struct name="ModuleData">
@@ -1727,13 +2388,21 @@
</param>
<param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
</param>
+ <param name="seatControlData" type="SeatControlData" mandatory="false">
+ </param>
+ <param name="audioControlData" type="AudioControlData" mandatory="false">
+ </param>
+ <param name="lightControlData" type="LightControlData" mandatory="false">
+ </param>
+ <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false">
+ </param>
</struct>
<enum name="RCAccessMode">
- <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
- <element name="AUTO_ALLOW"/>
- <element name="AUTO_DENY"/>
- <element name="ASK_DRIVER"/>
+ <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
+ <element name="AUTO_ALLOW"/>
+ <element name="AUTO_DENY"/>
+ <element name="ASK_DRIVER"/>
</enum>
<!-- End Remote Control -->
@@ -1821,6 +2490,9 @@
<param name="imageType" type="Common.ImageType" mandatory="true">
<description>Describes, whether it is a static or dynamic image.</description>
</param>
+ <param name="isTemplate" type="Boolean" mandatory="false">
+ <description>Optional value to specify whether it's a template image. A template image can be (re)colored by the HMI as needed by using an image pattern</description>
+ </param>
</struct>
<struct name="DeviceInfo">
@@ -1861,15 +2533,31 @@
</struct>
<struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to be spoken</description>
+ <description>A TTS chunk, that consists of text/phonemes to speak or the name of a file to play, and a TTS type (like text or SAPI)</description>
<param name="text" type="String" mandatory="true" maxlength="500">
- <description>The text or phonemes to be spoken.</description>
+ <description>The text or phonemes to be spoken, or the name of an audio file to play.</description>
</param>
<param name="type" type="Common.SpeechCapabilities" mandatory="true">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities.</description>
+ <description>Describes whether the TTS chunk is plain text, a specific phoneme set, or an audio file. See SpeechCapabilities.</description>
</param>
</struct>
+
+<struct name="TemplateColorScheme">
+ <description>
+ A color scheme for all display layout templates.
+ </description>
+ <param name="primaryColor" type="Common.RGBColor" mandatory="false">
+ <description>The primary "accent" color</description>
+ </param>
+ <param name="secondaryColor" type="Common.RGBColor" mandatory="false">
+ <description>The secondary "accent" color</description>
+ </param>
+ <param name="backgroundColor" type="Common.RGBColor" mandatory="false">
+ <description>The color of the background</description>
+ </param>
+</struct>
+
<struct name="HMIApplication">
<description>Data type containing information about application needed by HMI.</description>
<param name="appName" type="String" maxlength="100" mandatory="true">
@@ -1885,6 +2573,9 @@
<param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
<description>The ID, serial number, transport type the named-app's-device is connected over to HU.</description>
</param>
+ <param name="secondaryDeviceInfo" type="Common.DeviceInfo" mandatory="false">
+ <description>The ID, serial number, transport type that are acquired through Secondary Transport.</description>
+ </param>
<param name="policyAppID" type="String" maxlength="50" minlength="1" mandatory="true">
<description>Policy ID(=the appID the application registers with) of registered application.</description>
</param>
@@ -1927,6 +2618,16 @@
<description>If SDL omits this parameter - none RequestType is allowed for this app</description>
<description>(either this is a pre-registered app or such is dictated by policies).</description>
</param>
+ <param name="requestSubType" type="String" maxlength="100" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>
+ The list of SystemRequest's requestSubTypes allowed by policies for the named application.
+ If the app sends a requestSubType which is not specified in this list, then that request should be rejected.
+ An empty array signifies that any value of requestSubType is allowed for this app.
+ If this parameter is omitted, then a request with any value of requestSubType is now allowed for this app
+ </description>
+ </param>
+ <param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
</struct>
<struct name="MenuParams">
@@ -2059,6 +2760,9 @@
<param name="displayType" type="Common.DisplayType" mandatory="true">
<description>The type of the display. See DisplayType</description>
</param>
+ <param name="displayName" type="String" mandatory="false">
+ <description>The name of the display the app is connected to.</description>
+ </param>
<param name="textFields" type="Common.TextField" minsize="0" maxsize="100" array="true" mandatory="true">
<description>A set of all fields for text displaying supported by HU. See TextFieldName.</description>
<description>If there are no textfields supported, the empty array must be returned</description>
@@ -2121,6 +2825,7 @@
<description>
Describes different audio type configurations for PerformAudioPassThru.
e.g. 8kHz,8-bit,PCM
+ The audio is recorded in monaural.
</description>
<param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
<param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
@@ -2191,69 +2896,32 @@
</struct>
<!--IVI part-->
-<struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>PDOP.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>HDOP.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>VDOP.</description>
- </param>
- <param name="actual" type="Boolean" mandatory="false">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Common.Dimension" mandatory="false">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
- <description>The speed in KPH</description>
- </param>
-</struct>
+<enum name="TurnSignal">
+ <description>Enumeration that describes the status of the turn light indicator.</description>
+ <element name="OFF">
+ <description>Turn signal is OFF</description>
+ </element>
+ <element name="LEFT">
+ <description>Left turn signal is on</description>
+ </element>
+ <element name="RIGHT">
+ <description>Right turn signal is on</description>
+ </element>
+ <element name="BOTH">
+ <description>Both signals (left and right) are on.</description>
+ </element>
+</enum>
<struct name="SingleTireStatus">
<param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
<description>The status of component volume. See ComponentVolumeStatus.</description>
-</param>
+ </param>
+ <param name="tpms" type="TPMS" mandatory="false">
+ <description>The status of TPMS according to the particular tire.</description>
+ </param>
+ <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000">
+ <description>The pressure value of the particular tire in kilo pascal.</description>
+ </param>
</struct>
<struct name="DIDResult">
@@ -2495,7 +3163,7 @@
<struct name="DateTime">
<param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Milliseconds </description>
+ <description>Milliseconds </description>
</param>
<param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
<description>Seconds part of time</description>
@@ -2633,6 +3301,20 @@
<param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
<description>If included, the platform supports RC button controls with the included button names.</description >
</param>
+ <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>
+ If included, the platform supports seat controls.
+ </description >
+ </param>
+ <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description> If included, the platform supports audio controls. </description >
+ </param>
+ <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false">
+ <description> If included, the platform supports hmi setting controls. </description >
+ </param>
+ <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false">
+ <description> If included, the platform supports light controls. </description >
+ </param>
</struct>
<struct name="Rectangle">
@@ -2746,7 +3428,18 @@
</function>
</interface>
-<interface name="BasicCommunication" version="1.2.1" date="2017-08-02">
+<interface name="BasicCommunication" version="2.0.0" date="2018-09-05">
+ <function name="GetSystemTime" messagetype="request">
+ <description>Request from SDL to HMI to obtain current UTC time.</description>
+ </function>
+ <function name="GetSystemTime" messagetype="response">
+ <param name="systemTime" type="Common.DateTime" mandatory="true">
+ <description>Current UTC system time</description>
+ </param>
+ </function>
+ <function name="OnSystemTimeReady" messagetype="notification">
+ <description>HMI must notify SDL about readiness to provide system time.</description>
+ </function>
<function name="OnReady" messagetype="notification">
<description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
</function>
@@ -2790,13 +3483,6 @@
<description>ID of the application.</description>
</param>
</function>
- <function name="AllowDeviceToConnect" messagetype="request">
- <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="AllowDeviceToConnect" messagetype="response">
- <param name="allow" type="Boolean" mandatory="true"/>
- </function>
<function name="OnDeviceChosen" messagetype="notification">
<description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
<param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
@@ -2928,6 +3614,11 @@
<param name="requestType" type="Common.RequestType" mandatory="true">
<description>The type of system request.</description>
</param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
<param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
<description>Optional array of URL(s) for HTTP requests.</description>
</param>
@@ -2954,6 +3645,11 @@
<param name="requestType" type="Common.RequestType" mandatory="true">
<description>The type of system request.</description>
</param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
<param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
<description>The path to file.</description>
</param>
@@ -3226,16 +3922,16 @@
</function>
</interface>
-<interface name="TTS" version="1.1.0" date="2017-04-27">
+<interface name="TTS" version="2.0.0" date="2018-09-05">
<description>RPCs for communication between TTS and SDL.</description>
<function name="GetCapabilities" messagetype="request">
<description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
</function>
<function name="GetCapabilities" messagetype="response">
- <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="5" array="true" mandatory="true">
+ <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
<description>See SpeechCapabilities</description>
</param>
- <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="5" array="true" mandatory="true">
+ <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="true">
<description>See PrerecordedSpeech</description>
</param>
</function>
@@ -3352,7 +4048,7 @@
</function>
</interface>
-<interface name="UI" version="1.2.0" date="2017-09-05">
+<interface name="UI" version="1.3.0" date="2018-09-05">
<function name="Alert" messagetype="request">
<description>Request from SDL to show an alert message on the display.</description>
<param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
@@ -3455,6 +4151,9 @@
<param name="menuParams" type="Common.MenuParams" mandatory="true">
<description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
</param>
+ <param name="menuIcon" type="Common.Image" mandatory="false">
+ <description>The image field for AddSubMenu</description>
+ </param>
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
@@ -3525,6 +4224,9 @@
<description>The update method of the media clock.</description>
<description>In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
</param>
+ <param name="audioStreamingIndicator" type="Common.AudioStreamingIndicator" mandatory="false">
+ <description>Indicates that a button press of the Play/Pause button would play, pause or Stop the current playback.</description>
+ </param>
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
@@ -3670,6 +4372,8 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application related to this RPC.</description>
</param>
+ <param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
</function>
<function name="SetDisplayLayout" messagetype="response">
<param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
@@ -3864,7 +4568,7 @@
</function>
</interface>
-<interface name="Navigation" version="1.5.0" date="2017-08-15">
+<interface name="Navigation" version="1.5.0" date="2017-08-15">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
@@ -4090,7 +4794,7 @@
</interface>
-<interface name="VehicleInfo" version="1.1.0" date="2017-04-27">
+<interface name="VehicleInfo" version="2.0.0" date="2018-09-05">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
</function>
@@ -4195,9 +4899,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4234,6 +4944,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4271,9 +4987,15 @@
<param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
+ <param name="turnSignal" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4310,6 +5032,12 @@
<param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4353,9 +5081,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4392,6 +5126,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4429,9 +5169,15 @@
<param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4468,6 +5214,12 @@
<param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4506,9 +5258,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="Boolean" mandatory="false">
<description>Vehicle identification number</description>
</param>
@@ -4548,6 +5306,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -4583,9 +5347,15 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Common.TurnSignal" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number</description>
</param>
@@ -4625,6 +5395,12 @@
<param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Common.ElectronicParkBrakeStatus" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -4661,9 +5437,15 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Common.TurnSignal" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number.</description>
</param>
@@ -4679,6 +5461,9 @@
<param name="beltStatus" type="Common.BeltStatus" mandatory="false">
<description>The status of the seat belts</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Common.ElectronicParkBrakeStatus" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
<description>The body information including power modes</description>
</param>
@@ -4722,7 +5507,7 @@
</interface>
<!-- Policies -->
-<interface name="SDL" version="1.1.0" date="2017-04-27">
+<interface name="SDL" version="1.2.0" date="2018-09-05">
<function name="ActivateApp" messagetype="request">
<param name="appID" type="Integer" mandatory="true">
</param>
@@ -4838,6 +5623,14 @@
If SDL omits this parameter - nothing is changed for RequestType in the policies
</description>
</param>
+ <param name="requestSubType" type="String" maxlength="100" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>
+ The list of SystemRequest's requestSubTypes allowed by policies for the named application.
+ If the app sends a requestSubType which is not specified in this list, then that request should be rejected.
+ An empty array signifies that any value of requestSubType is allowed for this app.
+ If this parameter is omitted, then a request with any value of requestSubType is now allowed for this app
+ </description>
+ </param>
</function>
<function name="OnSDLConsentNeeded" messagetype="notification">
@@ -4887,7 +5680,7 @@
</function>
</interface>
-<interface name="RC" version="1.1.0" date="2017-07-18">
+<interface name="RC" version="2.0.0" date="2018-09-05">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL.</description>
</function>
@@ -4925,12 +5718,9 @@
<param name="moduleType" type="Common.ModuleType" mandatory="true" >
<description>The module data to retrieve from the vehicle for that type</description>
</param>
- <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
+ <param name="subscribe" type="Boolean" mandatory="false">
<description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
</param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Internal SDL-assigned ID of the related application</description>
- </param>
</function>
<function name="GetInteriorVehicleData" messagetype="response">
@@ -4975,5 +5765,19 @@
<description>The remote control access mode specified by the driver via HMI.</description>
</param>
</function>
+
+<function name="OnRCStatus" messagetype="notification">
+ <description>Issued by SDL to notify HMI about remote control status change on SDL</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of selected application.</description>
+ </param>
+ <param name="allocatedModules" type="Common.ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
+ </param>
+ <param name="freeModules" type="Common.ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
+ </param>
+</function>
+
</interface>
</interfaces>
diff --git a/src/components/interfaces/Json_HMI_message_specification.txt b/src/components/interfaces/Json_HMI_message_specification.txt
index 9f5b20a3c4..f464f42351 100644
--- a/src/components/interfaces/Json_HMI_message_specification.txt
+++ b/src/components/interfaces/Json_HMI_message_specification.txt
@@ -267,6 +267,13 @@ Notifications:
{
"longPressAvailable" : true,
+ "name" : "PLAY_PAUSE",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
"name" : "SEEKLEFT",
"shortPressAvailable" : true,
"upDownAvailable" : true
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index a1c64aecda..76fc6ef2d1 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-<interface name="SmartDeviceLink RAPI" version="4.5.0" date="2017-09-22">
- <enum name="Result" internal_scope="base">
+<interface name="SmartDeviceLink RAPI" version="5.0.0" minVersion="1.0" date="2018-10-03">
+ <enum name="Result" internal_scope="base" since="1.0">
<element name="SUCCESS">
<description>The request succeeded</description>
</element>
@@ -45,7 +45,7 @@
For example when trying to delete a command set that is currently involved in an interaction.
</description>
</element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE">
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" since="2.0">
<description>The requested vehicle data is not available on this vehicle or is not published.</description>
</element>
<element name="TIMED_OUT">
@@ -99,45 +99,48 @@
<element name="GENERIC_ERROR">
<description>Provided data is valid but something went wrong in the lower layers.</description>
</element>
- <element name="USER_DISALLOWED">
+ <element name="USER_DISALLOWED" since="2.0">
<description>RPC is included in a functional group explicitly blocked by the user.</description>
</element>
<element name="TRUNCATED_DATA">
<description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
</element>
- <element name="UNSUPPORTED_VERSION">
+ <element name="UNSUPPORTED_VERSION" since="2.0">
<description>Sync doesn't support the protocol that is requested by the mobile application</description>
</element>
- <element name="VEHICLE_DATA_NOT_ALLOWED">
+ <element name="VEHICLE_DATA_NOT_ALLOWED" since="2.0">
<description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
</element>
- <element name="FILE_NOT_FOUND">
+ <element name="FILE_NOT_FOUND" since="3.0">
<description>A specified file could not be found on the headunit.</description>
</element>
<element name="CANCEL_ROUTE">
<description>User selected to Cancel Route.</description>
</element>
- <element name="SAVED">
+ <element name="SAVED" since="2.0">
<description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
</element>
- <element name="INVALID_CERT">
+ <element name="INVALID_CERT" since="3.0">
<description>The certificate provided during authentication is invalid.</description>
</element>
- <element name="EXPIRED_CERT">
+ <element name="EXPIRED_CERT" since="3.0">
<description>The certificate provided during authentication is expired.</description>
</element>
- <element name="RESUME_FAILED">
+ <element name="RESUME_FAILED" since="3.0">
<description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
</element>
- <element name="DATA_NOT_AVAILABLE">
+ <element name="DATA_NOT_AVAILABLE" since="4.5">
<description>The requested information is currently not available. This is different than UNSUPPORTED_RESOURCE because it implies the data is at some point available. </description>
</element>
- <element name="READ_ONLY">
+ <element name="READ_ONLY" since="4.5">
<description>The value being set is read only</description>
</element>
+ <element name="CORRUPTED_DATA" since="5.0">
+ <description>The data sent failed to pass CRC check in receiver end</description>
+ </element>
</enum>
- <enum name="ButtonPressMode">
+ <enum name="ButtonPressMode" since="1.0">
<element name="LONG">
<description>
A button was released, after it was pressed for a long time
@@ -152,7 +155,7 @@
</element>
</enum>
- <enum name="ButtonEventMode">
+ <enum name="ButtonEventMode" since="1.0">
<element name="BUTTONUP">
<description>A button has been released up</description>
</element>
@@ -161,7 +164,7 @@
</element>
</enum>
- <enum name="Language">
+ <enum name="Language" since="1.0">
<element name="EN-US" internal_name="EN_US">
<description>English - US</description>
</element>
@@ -171,117 +174,117 @@
<element name="FR-CA" internal_name="FR_CA">
<description>French - Canada</description>
</element>
- <element name="DE-DE" internal_name="DE_DE">
+ <element name="DE-DE" internal_name="DE_DE" since="2.0">
<description>German - Germany</description>
</element>
- <element name="ES-ES" internal_name="ES_ES">
+ <element name="ES-ES" internal_name="ES_ES" since="2.0">
<description>Spanish - Spain</description>
</element>
- <element name="EN-GB" internal_name="EN_GB">
+ <element name="EN-GB" internal_name="EN_GB" since="2.0">
<description>English - GB</description>
</element>
- <element name="RU-RU" internal_name="RU_RU">
+ <element name="RU-RU" internal_name="RU_RU" since="2.0">
<description>Russian - Russia</description>
</element>
- <element name="TR-TR" internal_name="TR_TR">
+ <element name="TR-TR" internal_name="TR_TR" since="2.0">
<description>Turkish - Turkey</description>
</element>
- <element name="PL-PL" internal_name="PL_PL">
+ <element name="PL-PL" internal_name="PL_PL" since="2.0">
<description>Polish - Poland</description>
</element>
- <element name="FR-FR" internal_name="FR_FR">
+ <element name="FR-FR" internal_name="FR_FR" since="2.0">
<description>French - France</description>
</element>
- <element name="IT-IT" internal_name="IT_IT">
+ <element name="IT-IT" internal_name="IT_IT" since="2.0">
<description>Italian - Italy</description>
</element>
- <element name="SV-SE" internal_name="SV_SE">
+ <element name="SV-SE" internal_name="SV_SE" since="2.0">
<description>Swedish - Sweden</description>
</element>
- <element name="PT-PT" internal_name="PT_PT">
+ <element name="PT-PT" internal_name="PT_PT" since="2.0">
<description>Portuguese - Portugal</description>
</element>
- <element name="NL-NL" internal_name="NL_NL">
+ <element name="NL-NL" internal_name="NL_NL" since="2.0">
<description>Dutch (Standard) - Netherlands</description>
</element>
- <element name="EN-AU" internal_name="EN_AU">
+ <element name="EN-AU" internal_name="EN_AU" since="2.0">
<description>English - Australia</description>
</element>
- <element name="ZH-CN" internal_name="ZH_CN">
+ <element name="ZH-CN" internal_name="ZH_CN" since="2.0">
<description>Mandarin - China</description>
</element>
- <element name="ZH-TW" internal_name="ZH_TW">
+ <element name="ZH-TW" internal_name="ZH_TW" since="2.0">
<description>Mandarin - Taiwan</description>
</element>
- <element name="JA-JP" internal_name="JA_JP">
+ <element name="JA-JP" internal_name="JA_JP" since="2.0">
<description>Japanese - Japan</description>
</element>
- <element name="AR-SA" internal_name="AR_SA">
+ <element name="AR-SA" internal_name="AR_SA" since="2.0">
<description>Arabic - Saudi Arabia</description>
</element>
- <element name="KO-KR" internal_name="KO_KR">
+ <element name="KO-KR" internal_name="KO_KR" since="2.0">
<description>Korean - South Korea</description>
</element>
- <element name="PT-BR" internal_name="PT_BR">
+ <element name="PT-BR" internal_name="PT_BR" since="2.0">
<description>Portuguese - Brazil</description>
</element>
- <element name="CS-CZ" internal_name="CS_CZ">
+ <element name="CS-CZ" internal_name="CS_CZ" since="2.0">
<description>Czech - Czech Republic</description>
</element>
- <element name="DA-DK" internal_name="DA_DK">
+ <element name="DA-DK" internal_name="DA_DK" since="2.0">
<description>Danish - Denmark</description>
</element>
- <element name="NO-NO" internal_name="NO_NO">
+ <element name="NO-NO" internal_name="NO_NO" since="2.0">
<description>Norwegian - Norway</description>
</element>
- <element name="NL-BE" internal_name="NL_BE">
+ <element name="NL-BE" internal_name="NL_BE" since="2.0">
<description>Dutch (Flemish) - Belgium</description>
</element>
- <element name="EL-GR" internal_name="EL_GR">
+ <element name="EL-GR" internal_name="EL_GR" since="2.0">
<description>Greek - Greece</description>
</element>
- <element name="HU-HU" internal_name="HU_HU">
+ <element name="HU-HU" internal_name="HU_HU" since="2.0">
<description>Hungarian - Hungary</description>
</element>
- <element name="FI-FI" internal_name="FI_FI">
+ <element name="FI-FI" internal_name="FI_FI" since="2.0">
<description>Finnish - Finland</description>
</element>
- <element name="SK-SK" internal_name="SK_SK">
+ <element name="SK-SK" internal_name="SK_SK" since="2.0">
<description>Slovak - Slovakia</description>
</element>
- <element name="EN-IN" internal_name="EN_IN">
+ <element name="EN-IN" internal_name="EN_IN" since="4.5">
<description>English - India</description>
</element>
- <element name="TH-TH" internal_name="TH_TH">
+ <element name="TH-TH" internal_name="TH_TH" since="4.5">
<description>Thai - Thailand</description>
</element>
- <element name="EN-SA" internal_name="EN_SA">
+ <element name="EN-SA" internal_name="EN_SA" since="4.5">
<description>English - Middle East</description>
</element>
- <element name="HE-IL" internal_name="HE_IL">
+ <element name="HE-IL" internal_name="HE_IL" since="4.5">
<description>Hebrew - Israel</description>
</element>
- <element name="RO-RO" internal_name="RO_RO">
+ <element name="RO-RO" internal_name="RO_RO" since="4.5">
<description>Romanian - Romania</description>
</element>
- <element name="UK-UA" internal_name="UK_UA">
+ <element name="UK-UA" internal_name="UK_UA" since="4.5">
<description>Ukrainian - Ukraine</description>
</element>
- <element name="ID-ID" internal_name="ID_ID">
+ <element name="ID-ID" internal_name="ID_ID" since="4.5">
<description>Indonesian - Indonesia</description>
</element>
- <element name="VI-VN" internal_name="VI_VN">
+ <element name="VI-VN" internal_name="VI_VN" since="4.5">
<description>Vietnamese - Vietnam</description>
</element>
- <element name="MS-MY" internal_name="MS_MY">
+ <element name="MS-MY" internal_name="MS_MY" since="4.5">
<description>Malay - Malaysia</description>
</element>
- <element name="HI-IN" internal_name="HI_IN">
+ <element name="HI-IN" internal_name="HI_IN" since="4.5">
<description>Hindi - India</description>
</element>
</enum>
- <enum name="UpdateMode">
+ <enum name="UpdateMode" since="1.0">
<description>Describes how the media clock timer should behave on the platform</description>
<element name="COUNTUP" >
<description>Starts the media clock timer counting upwards, as in time elapsed.</description>
@@ -300,7 +303,7 @@
</element>
</enum>
- <enum name="TimerMode">
+ <enum name="TimerMode" since="1.0">
<element name="UP" >
<description>Causes the media clock timer to update from 0:00 to a specified time</description>
</element>
@@ -312,7 +315,7 @@
</element>
</enum>
- <enum name="InteractionMode">
+ <enum name="InteractionMode" since="1.0">
<description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
<element name="MANUAL_ONLY" >
<description>This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display. No Voice Interaction.</description>
@@ -325,7 +328,7 @@
</element>
</enum>
- <enum name="LayoutMode">
+ <enum name="LayoutMode" since="3.0">
<description>For touchscreen interactions, the mode of how the choices are presented.</description>
<element name="ICON_ONLY" >
<description>This mode causes the interaction to display the previous set of choices as icons.</description>
@@ -344,7 +347,7 @@
</element>
</enum>
- <enum name="HMILevel">
+ <enum name="HMILevel" since="1.0">
<description>Enumeration that describes current levels of HMI.</description>
<element name="FULL" internal_name="HMI_FULL" />
<element name="LIMITED" internal_name="HMI_LIMITED" />
@@ -352,14 +355,14 @@
<element name="NONE" internal_name="HMI_NONE" />
</enum>
- <enum name="AudioStreamingState">
+ <enum name="AudioStreamingState" since="1.0">
<description>Enumeration that describes possible states of audio streaming.</description>
<element name="AUDIBLE" />
<element name="ATTENUATED" />
<element name="NOT_AUDIBLE" />
</enum>
- <enum name="SystemAction">
+ <enum name="SystemAction" since="1.0">
<description>Enumeration that describes system actions that can be triggered.</description>
<element name="DEFAULT_ACTION">
<description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
@@ -372,7 +375,7 @@
</element>
</enum>
- <enum name="SystemContext">
+ <enum name="SystemContext" since="1.0">
<description>Enumeration that describes possible contexts an app's HMI might be in. Communicated to whichever app is in HMI FULL, except Alert.</description>
<element name="MAIN" internal_name="SYSCTXT_MAIN">
<description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
@@ -390,15 +393,21 @@
<description>Broadcast only to whichever app has an alert currently being displayed.</description>
</element>
</enum>
+
+ <enum name="VideoStreamingState" since="5.0">
+ <description>Enumeration that describes possible states of video streaming. </description>
+ <element name="STREAMABLE" />
+ <element name="NOT_STREAMABLE" />
+ </enum>
- <enum name="SoftButtonType">
+ <enum name="SoftButtonType" since="2.0">
<description>Contains information about the SoftButton capabilities.</description>
<element name="TEXT" internal_name="SBT_TEXT"/>
<element name="IMAGE" internal_name="SBT_IMAGE"/>
<element name="BOTH" internal_name="SBT_BOTH"/>
</enum>
- <enum name="AppInterfaceUnregisteredReason">
+ <enum name="AppInterfaceUnregisteredReason" since="1.0">
<description>Error code, which comes from the module side.</description>
<!-- Deprecate
<element name="USER_EXIT" />
@@ -412,40 +421,41 @@
<element name="LANGUAGE_CHANGE" />
<element name="MASTER_RESET" />
<element name="FACTORY_DEFAULTS" />
- <element name="APP_UNAUTHORIZED" />
- <element name="PROTOCOL_VIOLATION" />
- <element name="UNSUPPORTED_HMI_RESOURCE" />
+ <element name="APP_UNAUTHORIZED" since="2.0" />
+ <element name="PROTOCOL_VIOLATION" since="4.0" />
+ <element name="UNSUPPORTED_HMI_RESOURCE" since="4.1" />
</enum>
- <enum name="TriggerSource">
+ <enum name="TriggerSource" since="1.0">
<description>Indicates the source from where the command was triggered.</description>
<element name="MENU" internal_name="TS_MENU" />
<element name="VR" internal_name="TS_VR" />
- <element name="KEYBOARD" internal_name="TS_KEYBOARD" />
+ <element name="KEYBOARD" internal_name="TS_KEYBOARD" since="3.0" />
</enum>
- <enum name="HmiZoneCapabilities">
+ <enum name="HmiZoneCapabilities" since="1.0">
<description>Contains information about the HMI zone capabilities.</description>
<description>For future use.</description>
<element name="FRONT" />
<element name="BACK" />
</enum>
- <enum name="SpeechCapabilities">
+ <enum name="SpeechCapabilities" since="1.0">
<description>Contains information about the TTS capabilities.</description>
<element name="TEXT" internal_name="SC_TEXT"/>
<element name="SAPI_PHONEMES" />
<element name="LHPLUS_PHONEMES" />
<element name="PRE_RECORDED" />
<element name="SILENCE" />
+ <element name="FILE" since="5.0" />
</enum>
- <enum name="VrCapabilities">
+ <enum name="VrCapabilities" since="1.0">
<description>Contains information about the VR capabilities.</description>
<element name="TEXT" internal_name="VR_TEXT"/>
</enum>
- <enum name="PrerecordedSpeech">
+ <enum name="PrerecordedSpeech" since="1.0">
<description>Contains a list of prerecorded speech items present on the platform.</description>
<element name="HELP_JINGLE" />
<element name="INITIAL_JINGLE" />
@@ -454,36 +464,51 @@
<element name="NEGATIVE_JINGLE" />
</enum>
- <enum name="SamplingRate">
+ <enum name="SamplingRate" since="2.0">
<description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="SamplingRate_8KHZ"/>
- <element name="16KHZ" internal_name="SamplingRate_16KHZ"/>
- <element name="22KHZ" internal_name="SamplingRate_22KHZ"/>
- <element name="44KHZ" internal_name="SamplingRate_44KHZ"/>
+ <element name="8KHZ" internal_name="SamplingRate_8KHZ">
+ <description>Sampling rate of 8000 Hz.</description>
+ </element>
+ <element name="16KHZ" internal_name="SamplingRate_16KHZ">
+ <description>Sampling rate of 16000 Hz.</description>
+ </element>
+ <element name="22KHZ" internal_name="SamplingRate_22KHZ">
+ <description>Sampling rate of 22050 Hz.</description>
+ </element>
+ <element name="44KHZ" internal_name="SamplingRate_44KHZ">
+ <description>Sampling rate of 44100 Hz.</description>
+ </element>
</enum>
- <enum name="BitsPerSample">
+ <enum name="BitsPerSample" since="2.0">
<description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="BitsPerSample_8_BIT"/>
- <element name="16_BIT" internal_name="BitsPerSample_16_BIT"/>
+ <element name="8_BIT" internal_name="BitsPerSample_8_BIT">
+ <description>Audio sample is 8 bits wide, unsigned.</description>
+ </element>
+ <element name="16_BIT" internal_name="BitsPerSample_16_BIT">
+ <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
+ </element>
</enum>
- <enum name="AudioType">
+ <enum name="AudioType" since="2.0">
<description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
+ <element name="PCM">
+ <description>Linear PCM.</description>
+ </element>
</enum>
- <struct name="AudioPassThruCapabilities">
+ <struct name="AudioPassThruCapabilities" since="2.0">
<description>
Describes different audio type configurations for PerformAudioPassThru.
e.g. {8kHz,8-bit,PCM}
+ The audio is recorded in monaural.
</description>
<param name="samplingRate" type="SamplingRate" mandatory="true"/>
<param name="bitsPerSample" type="BitsPerSample" mandatory="true"/>
<param name="audioType" type="AudioType" mandatory="true"/>
</struct>
- <enum name="VehicleDataType">
+ <enum name="VehicleDataType" since="2.0">
<description>Defines the data types that can be published and subscribed to.</description>
<element name="VEHICLEDATA_GPS">
<description>Notifies GPSData may be subscribed</description>
@@ -513,11 +538,25 @@
<element name="VEHICLEDATA_ENGINETORQUE" />
<element name="VEHICLEDATA_ACCPEDAL" />
<element name="VEHICLEDATA_STEERINGWHEEL" />
+ <element name="VEHICLEDATA_TURNSIGNAL" since="5.0" />
+ <element name="VEHICLEDATA_FUELRANGE" since="5.0" />
+ <element name="VEHICLEDATA_ENGINEOILLIFE" since="5.0" />
+ <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" since="5.0" />
</enum>
- <enum name="ButtonName">
+ <enum name="ButtonName" since="1.0">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from the module</description>
<element name="OK" />
+ <element name="PLAY_PAUSE" since="5.0">
+ <description>
+ The button name for the physical Play/Pause
+ toggle that can be used by media apps.
+ </description>
+ <warning>
+ Please use the physical OK button in order to
+ use a Play/Pause toggle for versions &lt; 4.5.0.
+ </warning>
+ </element>
<element name="SEEKLEFT" />
<element name="SEEKRIGHT" />
<element name="TUNEUP" />
@@ -535,28 +574,28 @@
<element name="CUSTOM_BUTTON" />
<element name="SEARCH" />
<!-- Climate Buttons -->
- <element name="AC_MAX" />
- <element name="AC" />
- <element name="RECIRCULATE" />
- <element name="FAN_UP" />
- <element name="FAN_DOWN" />
- <element name="TEMP_UP" />
- <element name="TEMP_DOWN" />
- <element name="DEFROST_MAX" />
- <element name="DEFROST" />
- <element name="DEFROST_REAR" />
- <element name="UPPER_VENT" />
- <element name="LOWER_VENT" />
+ <element name="AC_MAX" since="4.5" />
+ <element name="AC" since="4.5" />
+ <element name="RECIRCULATE" since="4.5" />
+ <element name="FAN_UP" since="4.5" />
+ <element name="FAN_DOWN" since="4.5" />
+ <element name="TEMP_UP" since="4.5" />
+ <element name="TEMP_DOWN" since="4.5" />
+ <element name="DEFROST_MAX" since="4.5" />
+ <element name="DEFROST" since="4.5" />
+ <element name="DEFROST_REAR" since="4.5" />
+ <element name="UPPER_VENT" since="4.5" />
+ <element name="LOWER_VENT" since="4.5" />
<!-- Radio Buttons -->
- <element name="VOLUME_UP" />
- <element name="VOLUME_DOWN" />
- <element name="EJECT" />
- <element name="SOURCE" />
- <element name="SHUFFLE" />
- <element name="REPEAT" />
+ <element name="VOLUME_UP" since="4.5" />
+ <element name="VOLUME_DOWN" since="4.5" />
+ <element name="EJECT" since="4.5" />
+ <element name="SOURCE" since="4.5" />
+ <element name="SHUFFLE" since="4.5" />
+ <element name="REPEAT" since="4.5" />
</enum>
- <enum name="MediaClockFormat">
+ <enum name="MediaClockFormat" since="1.0">
<element name="CLOCK1">
<description>
minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
@@ -569,7 +608,7 @@
used for Type V headunit
</description>
</element>
- <element name="CLOCK3">
+ <element name="CLOCK3" since="2.0">
<description>
minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
used for GEN1.1 MFD3/4/5 headunits
@@ -606,7 +645,7 @@
used for Type V headunit
</description>
</element>
- <element name="CLOCKTEXT4">
+ <element name="CLOCKTEXT4" since="2.0">
<description>
6 chars possible
Format: c :|sp c c : c c
@@ -617,22 +656,25 @@
</element>
</enum>
- <enum name="DisplayType">
+ <enum name="DisplayType" deprecated="true" since="5.0">
<description>See DAES for further infos regarding the displays</description>
<element name="CID"/>
<element name="TYPE2" />
<element name="TYPE5" />
<element name="NGN" />
- <element name="GEN2_8_DMA" />
- <element name="GEN2_6_DMA" />
- <element name="MFD3" />
- <element name="MFD4" />
- <element name="MFD5" />
- <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" />
- <element name="SDL_GENERIC" />
+ <element name="GEN2_8_DMA" since="3.0" />
+ <element name="GEN2_6_DMA" since="3.0" />
+ <element name="MFD3" since="2.0" />
+ <element name="MFD4" since="2.0" />
+ <element name="MFD5" since="2.0" />
+ <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" since="3.0" />
+ <element name="SDL_GENERIC" since="4.0" />
+ <history>
+ <enum name="DisplayType" since="1.0" until="5.0"/>
+ </history>
</enum>
- <enum name="TextFieldName">
+ <enum name="TextFieldName" since="1.0">
<element name="mainField1">
<description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
</element>
@@ -665,51 +707,51 @@
<description>The first line of the alert text field; applies to "Alert"</description>
</element>
- <element name="alertText2">
+ <element name="alertText2" since="2.0">
<description>The second line of the alert text field; applies to "Alert"</description>
</element>
- <element name="alertText3">
+ <element name="alertText3" since="2.0">
<description>The third line of the alert text field; applies to "Alert"</description>
</element>
- <element name="scrollableMessageBody">
+ <element name="scrollableMessageBody" since="2.0">
<description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
</element>
- <element name="initialInteractionText">
+ <element name="initialInteractionText" since="2.0">
<description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
</element>
- <element name="navigationText1">
+ <element name="navigationText1" since="2.0">
<description> First line of navigation text</description>
</element>
- <element name="navigationText2">
+ <element name="navigationText2" since="2.0">
<description> Second line of navigation text</description>
</element>
- <element name="ETA">
+ <element name="ETA" since="2.0">
<description> Estimated Time of Arrival time for navigation</description>
</element>
- <element name="totalDistance">
+ <element name="totalDistance" since="2.0">
<description> Total distance to destination for navigation</description>
</element>
- <element name="audioPassThruDisplayText1">
+ <element name="audioPassThruDisplayText1" since="2.0">
<description> First line of text for audio pass thru</description>
</element>
- <element name="audioPassThruDisplayText2">
+ <element name="audioPassThruDisplayText2" since="2.0">
<description> Second line of text for audio pass thru</description>
</element>
- <element name="sliderHeader">
+ <element name="sliderHeader" since="2.0">
<description> Header text for slider</description>
</element>
- <element name="sliderFooter">
+ <element name="sliderFooter" since="2.0">
<description> Footer text for slider</description>
</element>
@@ -729,25 +771,25 @@
<description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
</element>
- <element name="locationName">
+ <element name="locationName" since="4.0">
<description> Optional name / title of intended location for SendLocation.</description>
</element>
- <element name="locationDescription">
+ <element name="locationDescription" since="4.0">
<description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
</element>
- <element name="addressLines">
+ <element name="addressLines" since="4.0">
<description> Optional location address (if applicable) for SendLocation.</description>
</element>
- <element name="phoneNumber">
+ <element name="phoneNumber" since="4.0">
<description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
</element>
</enum>
- <enum name="ImageFieldName">
+ <enum name="ImageFieldName" since="3.0">
<element name="softButtonImage">
<description>The image field for SoftButton</description>
</element>
@@ -781,7 +823,11 @@
</element>
<element name="graphic">
- <description>The image field for Show</description>
+ <description>The primary image field for Show</description>
+ </element>
+
+ <element name="secondaryGraphic" since="5.0">
+ <description>The secondary image field for Show</description>
</element>
<element name="showConstantTBTIcon">
@@ -792,13 +838,13 @@
<description>The secondary image field for ShowConstantTBT</description>
</element>
- <element name="locationImage">
+ <element name="locationImage" since="4.0">
<description>The optional image of a destination / location</description>
</element>
</enum>
- <enum name="CharacterSet">
+ <enum name="CharacterSet" since="1.0">
<description>The list of potential character sets</description>
<element name="TYPE2SET">
<description>See [@TODO: create file ref]</description>
@@ -814,14 +860,14 @@
</element>
</enum>
- <enum name="TextAlignment">
+ <enum name="TextAlignment" since="1.0">
<description>The list of possible alignments, left, right, or centered</description>
<element name="LEFT_ALIGNED" />
<element name="RIGHT_ALIGNED" />
<element name="CENTERED" />
</enum>
- <enum name="TBTState">
+ <enum name="TBTState" since="2.0">
<description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
<element name="ROUTE_UPDATE_REQUEST" />
<element name="ROUTE_ACCEPTED" />
@@ -835,26 +881,26 @@
<element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
</enum>
- <enum name="DriverDistractionState">
+ <enum name="DriverDistractionState" since="2.0">
<description>Enumeration that describes possible states of driver distraction.</description>
<element name="DD_ON" />
<element name="DD_OFF" />
</enum>
- <enum name="ImageType">
+ <enum name="ImageType" since="2.0">
<description>Contains information about the type of image.</description>
<element name="STATIC" />
<element name="DYNAMIC" />
</enum>
- <enum name="DeliveryMode">
+ <enum name="DeliveryMode" since="4.1">
<description>The mode in which the SendLocation request is sent</description>
<element name="PROMPT" />
<element name="DESTINATION" />
<element name="QUEUE" />
</enum>
- <enum name="VideoStreamingProtocol">
+ <enum name="VideoStreamingProtocol" since="4.5">
<description>Enum for each type of video streaming protocol type.</description>
<element name="RAW">
<description>Raw stream bytes that contains no timestamp data and is the lowest supported video streaming</description>
@@ -873,7 +919,7 @@
</element>
</enum>
- <enum name="VideoStreamingCodec">
+ <enum name="VideoStreamingCodec" since="4.5">
<description>Enum for each type of video streaming codec.</description>
<element name="H264">
<description>A block-oriented motion-compensation-based video compression standard. As of 2014 it is one of the most commonly used formats for the recording, compression, and distribution of video content.</description>
@@ -891,17 +937,41 @@
<description>Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) and also enables lossless compression.</description>
</element>
</enum>
+
+ <enum name="AudioStreamingIndicator" since="5.0">
+ <element name="PLAY_PAUSE">
+ <description>
+ Default playback indicator.
+ By default the playback indicator should be PLAY_PAUSE when:
+ - the media app is newly registered on the head unit (after RegisterAppInterface)
+ - the media app was closed by the user (App enters HMI_NONE)
+ - the app sends SetMediaClockTimer with audioStreamingIndicator not set to any value
+ </description>
+ </element>
+ <element name="PLAY">
+ <description>Indicates that a button press of the Play/Pause button starts the audio playback.</description>
+ </element>
+ <element name="PAUSE">
+ <description>Indicates that a button press of the Play/Pause button pauses the current audio playback.</description>
+ </element>
+ <element name="STOP">
+ <description>Indicates that a button press of the Play/Pause button stops the current audio playback.</description>
+ </element>
+ </enum>
- <struct name="Image">
+ <struct name="Image" since="2.0">
<param name="value" minlength="0" maxlength="65535" type="String" mandatory="true">
<description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
</param>
<param name="imageType" type="ImageType" mandatory="true">
<description>Describes, whether it is a static or dynamic image.</description>
</param>
+ <param name="isTemplate" type="Boolean" mandatory="false" since="5.0">
+ <description>If true, the image is a template image and can be recolored by the HMI</description>
+ </param>
</struct>
- <struct name="SoftButton">
+ <struct name="SoftButton" since="2.0">
<param name="type" type="SoftButtonType" mandatory="true">
<description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
</param>
@@ -925,24 +995,28 @@
</param>
</struct>
- <struct name="Choice">
+ <struct name="Choice" since="1.0">
<description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
<param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true"/>
<param name="menuName" type="String" maxlength="500" mandatory="true"/>
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true"/>
- <param name="image" type="Image" mandatory="false"/>
- <param name="secondaryText" maxlength="500" type="String" mandatory="false">
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false" since="5.0">
+ <history>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true" since="1.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="image" type="Image" mandatory="false" since="2.0" />
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false" since="3.0">
<description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
</param>
- <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false" since="3.0">
<description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
</param>
- <param name="secondaryImage" type="Image" mandatory="false">
+ <param name="secondaryImage" type="Image" mandatory="false" since="3.0">
<description>Optional secondary image struct for choice</description>
</param>
</struct>
- <struct name="VrHelpItem">
+ <struct name="VrHelpItem" since="2.0">
<param name="text" maxlength="500" type="String" mandatory="true">
<description>Text to display for VR Help item</description>
</param>
@@ -954,7 +1028,7 @@
</param>
</struct>
- <struct name="SyncMsgVersion">
+ <struct name="SyncMsgVersion" since="1.0">
<description>Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application</description>
<param name="majorVersion" type="Integer" minvalue="1" maxvalue="10" mandatory="true">
@@ -963,37 +1037,37 @@
<param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
<description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
</param>
- <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false" since="4.3">
<description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
</param>
</struct>
- <enum name="GlobalProperty">
+ <enum name="GlobalProperty" since="1.0">
<description>The different global properties.</description>
- <element name="HELPPROMPT">
+ <element name="HELPPROMPT" since="1.0">
<description>The property helpPrompt of setGlobalProperties</description>
</element>
- <element name="TIMEOUTPROMPT">
+ <element name="TIMEOUTPROMPT" since="1.0">
<description>The property timeoutPrompt of setGlobalProperties</description>
</element>
- <element name="VRHELPTITLE">
+ <element name="VRHELPTITLE" since="2.0">
<description>The property vrHelpTitle of setGlobalProperties</description>
</element>
- <element name="VRHELPITEMS">
+ <element name="VRHELPITEMS" since="2.0">
<description>The property array of vrHelp of setGlobalProperties</description>
</element>
- <element name="MENUNAME">
+ <element name="MENUNAME" since="3.0">
<description>The property in-app menu name of setGlobalProperties</description>
</element>
- <element name="MENUICON">
+ <element name="MENUICON" since="3.0">
<description>The property in-app menu icon of setGlobalProperties</description>
</element>
- <element name="KEYBOARDPROPERTIES">
+ <element name="KEYBOARDPROPERTIES" since="3.0">
<description>The on-screen keyboard configuration of setGlobalProperties</description>
</element>
</enum>
- <enum name="CompassDirection">
+ <enum name="CompassDirection" since="2.0">
<description>The list of potential compass directions</description>
<element name="NORTH">
</element>
@@ -1013,7 +1087,7 @@
</element>
</enum>
- <enum name="Dimension">
+ <enum name="Dimension" since="2.0">
<description>The supported dimensions of the GPS</description>
<element name="NO_FIX" internal_name="Dimension_NO_FIX">
<description>No GPS at all</description>
@@ -1026,7 +1100,7 @@
</element>
</enum>
- <enum name="PRNDL">
+ <enum name="PRNDL" since="2.0">
<description>The selected gear.</description>
<element name="PARK">
<description>Parking</description>
@@ -1067,7 +1141,7 @@
</element>
</enum>
- <enum name="ComponentVolumeStatus">
+ <enum name="ComponentVolumeStatus" since="2.0">
<description>The volume status of a vehicle component.</description>
<element name="UNKNOWN" internal_name="CVS_UNKNOWN">
</element>
@@ -1082,14 +1156,107 @@
<element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
</element>
</enum>
+
+ <enum name="TPMS" since="5.0">
+ <element name="UNKNOWN">
+ <description>If set the status of the tire is not known.</description>
+ </element>
+ <element name="SYSTEM_FAULT">
+ <description>TPMS does not function.</description>
+ </element>
+ <element name="SENSOR_FAULT">
+ <description>The sensor of the tire does not function.</description>
+ </element>
+ <element name="LOW">
+ <description>TPMS is reporting a low tire pressure for the tire.</description>
+ </element>
+ <element name="SYSTEM_ACTIVE">
+ <description>TPMS is active and the tire pressure is monitored.</description>
+ </element>
+ <element name="TRAIN">
+ <description>TPMS is reporting that the tire must be trained.</description>
+ </element>
+ <element name="TRAINING_COMPLETE">
+ <description>TPMS reports the training for the tire is completed.</description>
+ </element>
+ <element name="NOT_TRAINED">
+ <description>TPMS reports the tire is not trained.</description>
+ </element>
+ </enum>
+
+ <enum name="FuelType" since="5.0">
+ <element name="GASOLINE" />
+ <element name="DIESEL" />
+ <element name="CNG">
+ <description>
+ For vehicles using compressed natural gas.
+ </description>
+ </element>
+ <element name="LPG">
+ <description>
+ For vehicles using liquefied petroleum gas.
+ </description>
+ </element>
+ <element name="HYDROGEN">
+ <description>For FCEV (fuel cell electric vehicle).</description>
+ </element>
+ <element name="BATTERY">
+ <description>For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.</description>
+ </element>
+ </enum>
+
+ <struct name="FuelRange" since="5.0">
+ <param name="type" type="FuelType" mandatory="false"/>
+ <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
+ <description>
+ The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="ElectronicParkBrakeStatus" since="5.0">
+ <element name="CLOSED">
+ <description>
+ Park brake actuators have been fully applied.
+ </description>
+ </element>
+ <element name="TRANSITION">
+ <description>
+ Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ </description>
+ </element>
+ <element name="OPEN">
+ <description>
+ Park brake actuators are released.
+ </description>
+ </element>
+ <element name="DRIVE_ACTIVE">
+ <description>
+ When driver pulls the Electronic Park Brake switch while driving "at speed".
+ </description>
+ </element>
+ <element name="FAULT">
+ <description>
+ When system has a fault or is under maintenance.
+ </description>
+ </element>
+ </enum>
- <struct name="SingleTireStatus">
+ <struct name="SingleTireStatus" since="2.0">
<param name="status" type="ComponentVolumeStatus" mandatory="true">
<description>See ComponentVolumeStatus.</description>
</param>
+ <param name="tpms" type="TPMS" mandatory="false" since="5.0">
+ <description>
+ The status of TPMS according to the particular tire.
+ </description>
+ </param>
+ <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000" since="5.0">
+ <description>The pressure value of the particular tire in kilo pascal.</description>
+ </param>
</struct>
- <enum name="WarningLightStatus">
+ <enum name="WarningLightStatus" since="2.0">
<description>Reflects the status of a cluster instrument warning light.</description>
<element name="OFF" internal_name="WLS_OFF">
</element>
@@ -1101,7 +1268,7 @@
</element>
</enum>
- <enum name="VehicleDataNotificationStatus">
+ <enum name="VehicleDataNotificationStatus" since="2.0">
<description>Reflects the status of a vehicle data notification.</description>
<element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
</element>
@@ -1113,7 +1280,7 @@
</element>
</enum>
- <enum name="IgnitionStableStatus">
+ <enum name="IgnitionStableStatus" since="2.0">
<description>Reflects the ignition switch stability.</description>
<element name="IGNITION_SWITCH_NOT_STABLE">
</element>
@@ -1123,7 +1290,7 @@
</element>
</enum>
- <enum name="IgnitionStatus">
+ <enum name="IgnitionStatus" since="2.0">
<description>Reflects the status of ignition.</description>
<element name="UNKNOWN" internal_name="IS_UNKNOWN">
</element>
@@ -1139,7 +1306,7 @@
</element>
</enum>
- <enum name="VehicleDataEventStatus">
+ <enum name="VehicleDataEventStatus" since="2.0">
<description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
<element name="NO_EVENT" internal_name="VDES_NO_EVENT">
</element>
@@ -1153,7 +1320,7 @@
</element>
</enum>
- <enum name="DeviceLevelStatus">
+ <enum name="DeviceLevelStatus" since="2.0">
<description>Reflects the reported battery status of the connected device, if reported.</description>
<element name="ZERO_LEVEL_BARS">
</element>
@@ -1169,10 +1336,12 @@
</element>
</enum>
- <enum name="PrimaryAudioSource">
+ <enum name="PrimaryAudioSource" since="2.0">
<description>Reflects the current primary audio source (if selected).</description>
<element name="NO_SOURCE_SELECTED">
</element>
+ <element name="CD" since="5.0">
+ </element>
<element name="USB">
</element>
<element name="USB2">
@@ -1185,9 +1354,17 @@
</element>
<element name="MOBILE_APP">
</element>
+ <element name="AM" since="5.0">
+ </element>
+ <element name="FM" since="5.0">
+ </element>
+ <element name="XM" since="5.0">
+ </element>
+ <element name="DAB" since="5.0">
+ </element>
</enum>
- <enum name="WiperStatus">
+ <enum name="WiperStatus" since="2.0">
<description>Reflects the status of the wipers.</description>
<element name="OFF" />
<element name="AUTO_OFF" />
@@ -1206,7 +1383,7 @@
<element name="NO_DATA_EXISTS" />
</enum>
- <enum name="VehicleDataStatus">
+ <enum name="VehicleDataStatus" since="2.0">
<description>Reflects the status of a binary vehicle data item.</description>
<element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
</element>
@@ -1216,7 +1393,7 @@
</element>
</enum>
- <enum name="MaintenanceModeStatus">
+ <enum name="MaintenanceModeStatus" since="2.0">
<description>Reflects the status of a vehicle maintenance mode.</description>
<element name="NORMAL" internal_name="MMS_NORMAL">
</element>
@@ -1228,7 +1405,7 @@
</element>
</enum>
- <enum name="VehicleDataActiveStatus">
+ <enum name="VehicleDataActiveStatus" since="2.0">
<description>Reflects the status of given vehicle component.</description>
<element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
</element>
@@ -1242,7 +1419,7 @@
</element>
</enum>
- <enum name="AmbientLightStatus">
+ <enum name="AmbientLightStatus" since="2.0">
<description>Reflects the status of the ambient light sensor.</description>
<element name="NIGHT" />
<element name="TWILIGHT_1" />
@@ -1254,44 +1431,48 @@
<element name="INVALID" />
</enum>
- <enum name="ModuleType">
+ <enum name="ModuleType" since="4.5">
<element name="CLIMATE"/>
<element name="RADIO"/>
+ <element name="SEAT" since="5.0"/>
+ <element name="AUDIO" since="5.0"/>
+ <element name="LIGHT" since="5.0"/>
+ <element name="HMI_SETTINGS" since="5.0"/>
</enum>
- <enum name="DefrostZone">
+ <enum name="DefrostZone" since="4.5">
<element name="FRONT"/>
<element name="REAR"/>
<element name="ALL"/>
<element name="NONE"/>
</enum>
- <enum name="VentilationMode">
+ <enum name="VentilationMode" since="4.5">
<element name="UPPER"/>
<element name="LOWER"/>
<element name="BOTH"/>
<element name="NONE"/>
</enum>
- <enum name="RadioBand">
+ <enum name="RadioBand" since="4.5">
<element name="AM"/>
<element name="FM"/>
<element name="XM"/>
</enum>
- <enum name="RadioState">
+ <enum name="RadioState" since="4.5">
<element name="ACQUIRING"/>
<element name="ACQUIRED"/>
<element name="MULTICAST"/>
<element name="NOT_FOUND"/>
</enum>
- <enum name="TemperatureUnit">
+ <enum name="TemperatureUnit" since="4.5">
<element name="FAHRENHEIT"/>
<element name="CELSIUS"/>
</enum>
- <struct name="BeltStatus">
+ <struct name="BeltStatus" since="2.0">
<param name="driverBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
@@ -1339,7 +1520,7 @@
</param>
</struct>
- <struct name="BodyInformation">
+ <struct name="BodyInformation" since="2.0">
<param name="parkBrakeActive" type="Boolean" mandatory="true">
<description>References signal "PrkBrkActv_B_Actl".</description>
</param>
@@ -1363,7 +1544,7 @@
</param>
</struct>
- <struct name="DeviceStatus">
+ <struct name="DeviceStatus" since="2.0">
<param name="voiceRecOn" type="Boolean" mandatory="true">
<description>References signal "CPM_VoiceRec_STAT".</description>
</param>
@@ -1399,7 +1580,7 @@
</param>
</struct>
- <struct name="HeadLampStatus">
+ <struct name="HeadLampStatus" since="2.0">
<param name="lowBeamsOn" type="Boolean" mandatory="true">
<description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
</param>
@@ -1411,7 +1592,7 @@
</param>
</struct>
- <struct name="AppInfo">
+ <struct name="AppInfo" since="4.2">
<description>Contains detailed information about the registered application.</description>
<param name="appDisplayName" type="String" maxlength="100" mandatory="true">
@@ -1434,7 +1615,7 @@
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Ford Specific Data Items -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <enum name="FileType">
+ <enum name="FileType" since="2.0">
<description>Enumeration listing possible file types.</description>
<element name="GRAPHIC_BMP" />
<element name="GRAPHIC_JPEG" />
@@ -1446,7 +1627,7 @@
<element name="JSON" />
</enum>
- <enum name="FuelCutoffStatus" >
+ <enum name="FuelCutoffStatus" since="2.0">
<description>Reflects the status of the RCM fuel cutoff.</description>
<element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
</element>
@@ -1456,7 +1637,7 @@
</element>
</enum>
- <enum name="EmergencyEventType">
+ <enum name="EmergencyEventType" since="2.0">
<description>Reflects the emergency event status of the vehicle.</description>
<element name="NO_EVENT" internal_name="EET_NO_EVENT">
</element>
@@ -1474,7 +1655,7 @@
</element>
</enum>
- <enum name="ECallConfirmationStatus">
+ <enum name="ECallConfirmationStatus" since="2.0">
<description>Reflects the status of the eCall Notification.</description>
<element name="NORMAL" internal_name="ECCS_NORMAL">
</element>
@@ -1492,7 +1673,7 @@
</element>
</enum>
- <enum name="PowerModeQualificationStatus" >
+ <enum name="PowerModeQualificationStatus" since="2.0">
<description>Reflects the status of the current power mode qualification.</description>
<element name="POWER_MODE_UNDEFINED">
</element>
@@ -1504,7 +1685,7 @@
</element>
</enum>
- <enum name="PowerModeStatus">
+ <enum name="PowerModeStatus" since="2.0">
<description>Reflects the status of the current power mode.</description>
<element name="KEY_OUT">
</element>
@@ -1526,7 +1707,7 @@
</element>
</enum>
- <enum name="CarModeStatus">
+ <enum name="CarModeStatus" since="2.0">
<description>Reflects the status of the current car mode.</description>
<element name="NORMAL" internal_name="CMS_NORMAL">
</element>
@@ -1538,7 +1719,7 @@
</element>
</enum>
- <struct name="ECallInfo">
+ <struct name="ECallInfo" since="2.0">
<param name="eCallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
</param>
@@ -1550,7 +1731,7 @@
</param>
</struct>
- <struct name="AirbagStatus">
+ <struct name="AirbagStatus" since="2.0">
<param name="driverAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
@@ -1577,7 +1758,7 @@
</param>
</struct>
- <struct name="EmergencyEvent">
+ <struct name="EmergencyEvent" since="2.0">
<param name="emergencyEventType" type="EmergencyEventType" mandatory="true">
<description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
</param>
@@ -1600,7 +1781,7 @@
</param>
</struct>
- <struct name="ClusterModeStatus">
+ <struct name="ClusterModeStatus" since="2.0">
<param name="powerModeActive" type="Boolean" mandatory="true">
<description>References signal "PowerMode_UB".</description>
</param>
@@ -1615,7 +1796,7 @@
</param>
</struct>
- <struct name="MyKey">
+ <struct name="MyKey" since="2.0">
<param name="e911Override" type="VehicleDataStatus" mandatory="true">
<description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
</param>
@@ -1625,7 +1806,7 @@
<!-- / Ford Specific Data Items -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <enum name="VehicleDataResultCode">
+ <enum name="VehicleDataResultCode" since="2.0">
<description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
<element name="SUCCESS" internal_name="VDRC_SUCCESS">
<description>Individual vehicle data item / DTC / DID request or subscription successful</description>
@@ -1656,7 +1837,7 @@
</element>
</enum>
- <struct name="TireStatus">
+ <struct name="TireStatus" since="2.0">
<description>The status and pressure of the tires.</description>
<param name="pressureTelltale" type="WarningLightStatus" mandatory="true">
@@ -1682,66 +1863,130 @@
</param>
</struct>
- <struct name="GPSData">
+ <enum name="TurnSignal" since="5.0">
+ <description>Enumeration that describes the status of the turn light indicator.</description>
+ <element name="OFF">
+ <description>Turn signal is OFF</description>
+ </element>
+ <element name="LEFT">
+ <description>Left turn signal is on</description>
+ </element>
+ <element name="RIGHT">
+ <description>Right turn signal is on</description>
+ </element>
+ <element name="BOTH">
+ <description>Both signals (left and right) are on.</description>
+ </element>
+ </enum>
+
+ <struct name="GPSData" since="2.0">
<description>Struct with the GPS data.</description>
<param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
</param>
<param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
</param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true">
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false" since="5.0">
<description>The current UTC year.</description>
+ <history>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true">
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="5.0">
<description>The current UTC month.</description>
+ <history>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true">
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="5.0">
<description>The current UTC day.</description>
+ <history>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true">
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="5.0">
<description>The current UTC hour.</description>
+ <history>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
<description>The current UTC minute.</description>
+ <history>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
<description>The current UTC second.</description>
+ <history>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="compassDirection" type="CompassDirection" mandatory="true">
+ <param name="compassDirection" type="CompassDirection" mandatory="false" since="5.0">
<description>See CompassDirection.</description>
+ <history>
+ <param name="compassDirection" type="CompassDirection" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true">
+ <param name="pdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
<description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
+ <history>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true">
+ <param name="hdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
<description>HDOP. If value is unknown, value shall be set to 0.</description>
+ <history>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true">
+ <param name="vdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
<description>VDOP. If value is unknown, value shall be set to 0.</description>
+ <history>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="actual" type="Boolean" mandatory="true">
+ <param name="actual" type="Boolean" mandatory="false" since="5.0">
<description>
True, if actual.
False, if inferred.
</description>
+ <history>
+ <param name="actual" type="Boolean" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true">
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false" since="5.0">
<description>Number of satellites in view</description>
+ <history>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="dimension" type="Dimension" mandatory="true">
+ <param name="dimension" type="Dimension" mandatory="false" since="5.0">
<description>See Dimension</description>
+ <history>
+ <param name="dimension" type="Dimension" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true">
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false" since="5.0">
<description>Altitude in meters</description>
+ <history>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true">
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false" since="5.0">
<description>The heading. North is 0. Resolution is 0.01</description>
+ <history>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true">
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false" since="5.0">
<description>The speed in KPH</description>
+ <history>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
</struct>
- <struct name="VehicleDataResult">
+ <struct name="VehicleDataResult" since="2.0">
<description>Individual published data request result</description>
<param name="dataType" type="VehicleDataType" mandatory="true">
<description>Defined published data element type.</description>
@@ -1751,7 +1996,7 @@
</param>
</struct>
- <struct name="DIDResult">
+ <struct name="DIDResult" since="2.0">
<description>Individual requested DID result and data</description>
<param name="resultCode" type="VehicleDataResultCode" mandatory="true">
<description>Individual DID result code.</description>
@@ -1764,7 +2009,7 @@
</param>
</struct>
- <struct name="StartTime">
+ <struct name="StartTime" since="1.0">
<param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
<description>
The hour of the media clock.
@@ -1775,7 +2020,7 @@
<param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
</struct>
- <struct name="TextField">
+ <struct name="TextField" since="1.0">
<param name="name" type="TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
</param>
@@ -1790,7 +2035,7 @@
</param>
</struct>
- <struct name="ImageResolution">
+ <struct name="ImageResolution" since="3.0">
<param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
<description>The image resolution width.</description>
</param>
@@ -1799,7 +2044,7 @@
</param>
</struct>
- <struct name="ImageField">
+ <struct name="ImageField" since="3.0">
<param name="name" type="ImageFieldName" mandatory="true">
<description>The name that identifies the field. See ImageFieldName.</description>
</param>
@@ -1811,7 +2056,7 @@
</param>
</struct>
- <struct name="TouchCoord">
+ <struct name="TouchCoord" since="3.0">
<param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
<description>The x coordinate of the touch.</description>
</param>
@@ -1820,14 +2065,14 @@
</param>
</struct>
- <enum name="TouchType">
+ <enum name="TouchType" since="3.0">
<element name="BEGIN"/>
<element name="MOVE"/>
<element name="END"/>
- <element name="CANCEL"/>
+ <element name="CANCEL" since="4.5"/>
</enum>
- <struct name="TouchEvent">
+ <struct name="TouchEvent" since="3.0">
<param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
<description>
A touch's unique identifier. The application can track the current touch events by id.
@@ -1847,7 +2092,7 @@
</param>
</struct>
- <struct name="TouchEventCapabilities">
+ <struct name="TouchEventCapabilities" since="3.0">
<param name="pressAvailable" type="Boolean" mandatory="true">
</param>
<param name="multiTouchAvailable" type="Boolean" mandatory="true">
@@ -1856,7 +2101,7 @@
</param>
</struct>
- <struct name="ScreenParams">
+ <struct name="ScreenParams" since="3.0">
<param name="resolution" type="ImageResolution" mandatory="true">
<description>The resolution of the prescribed screen area.</description>
</param>
@@ -1865,7 +2110,7 @@
</param>
</struct>
- <enum name="PermissionStatus">
+ <enum name="PermissionStatus" since="2.0">
<description>Enumeration that describes possible permission states of a policy table entry.</description>
<element name="ALLOWED" internal_name="PS_ALLOWED"/>
<element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
@@ -1873,7 +2118,7 @@
<element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
</enum>
- <struct name="HMIPermissions">
+ <struct name="HMIPermissions" since="2.0">
<param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
<description>A set of all HMI levels that are permitted for this given RPC.</description>
</param>
@@ -1882,7 +2127,7 @@
</param>
</struct>
- <struct name="ParameterPermissions">
+ <struct name="ParameterPermissions" since="2.0">
<param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
<description>A set of all parameters that are permitted for this given RPC.</description>
</param>
@@ -1891,7 +2136,7 @@
</param>
</struct>
- <struct name="PermissionItem">
+ <struct name="PermissionItem" since="2.0">
<param name="rpcName" type="String" maxlength="100" mandatory="true">
<description>Name of the individual RPC in the policy table.</description>
</param>
@@ -1899,10 +2144,16 @@
<param name="parameterPermissions" type="ParameterPermissions" mandatory="true"/>
</struct>
- <struct name="DisplayCapabilities">
+ <struct name="DisplayCapabilities" since="1.0">
<description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType" mandatory="true">
+ <param name="displayType" type="DisplayType" mandatory="true" deprecated="true" since="5.0">
<description>The type of the display. See DisplayType</description>
+ <history>
+ <param name="displayType" type="DisplayType" mandatory="true" since="1.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="displayName" type="String" mandatory="false" since="5.0">
+ <description>The name of the display the app is connected to.</description>
</param>
<param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
<description>A set of all fields that support text data. See TextField</description>
@@ -1913,22 +2164,23 @@
<param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
<description>A set of all supported formats of the media clock. See MediaClockFormat</description>
</param>
- <param name="graphicSupported" type="Boolean" mandatory="true">
+ <param name="graphicSupported" type="Boolean" mandatory="true" since="2.0">
<description>The display's persistent screen supports referencing a static or dynamic image.</description>
</param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false">
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false" since="3.0">
<description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
</param>
- <param name="screenParams" type="ScreenParams" mandatory="false">
+ <param name="screenParams" type="ScreenParams" mandatory="false" since="3.0">
<description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
</param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false" since="3.0">
<description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
</param>
<!-- TODO: Add pixel density? -->
</struct>
- <struct name="ButtonCapabilities">
+
+ <struct name="ButtonCapabilities" since="1.0">
<description>Contains information about a button's capabilities.</description>
<param name="name" type="ButtonName" mandatory="true">
<description>The name of the button. See ButtonName.</description>
@@ -1953,7 +2205,8 @@
</description>
</param>
</struct>
- <struct name="SoftButtonCapabilities">
+
+ <struct name="SoftButtonCapabilities" since="2.0">
<description>Contains information about a SoftButton's capabilities.</description>
<param name="shortPressAvailable" type="Boolean" mandatory="true">
<description>
@@ -1978,27 +2231,30 @@
<description>The button supports referencing a static or dynamic image.</description>
</param>
</struct>
- <struct name="PresetBankCapabilities">
+
+ <struct name="PresetBankCapabilities" since="2.0">
<description>Contains information about on-screen preset capabilities.</description>
<param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
<description>Onscreen custom presets are available.</description>
</param>
</struct>
- <struct name="HMICapabilities">
+
+ <struct name="HMICapabilities" since="3.0">
<param name="navigation" type="Boolean" mandatory="false">
<description>Availability of build in Nav. True: Available, False: Not Available</description>
</param>
<param name="phoneCall" type="Boolean" mandatory="false">
<description>Availability of build in phone. True: Available, False: Not Available </description>
</param>
- <param name="videoStreaming" type="Boolean" mandatory="false">
+ <param name="videoStreaming" type="Boolean" mandatory="false" since="4.5">
<description>Availability of video streaming. </description>
</param>
- <param name="remoteControl" type="Boolean" mandatory="false">
+ <param name="remoteControl" type="Boolean" mandatory="false" since="4.5">
<description>Availability of remote control feature. True: Available, False: Not Available</description>
</param>
- </struct>
- <struct name="MenuParams">
+ </struct>
+
+ <struct name="MenuParams" since="1.0">
<param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
<description>
unique ID of the sub menu, the command will be added to.
@@ -2017,20 +2273,23 @@
<param name="menuName" type="String" maxlength="500" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
- </struct>
- <struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
+ </struct>
+
+ <struct name="TTSChunk" since="1.0">
+ <description>A TTS chunk, that consists of text/phonemes to speak or the name of a file to play, and a TTS type (like text or SAPI)</description>
<param name="text" minlength="0" maxlength="500" type="String" mandatory="true">
<description>
- The text or phonemes to speak.
+ The text or phonemes to speak, or the name of the audio file to play.
May not be empty.
</description>
</param>
+
<param name="type" type="SpeechCapabilities" mandatory="true">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
+ <description>Describes whether the TTS chunk is plain text, a specific phoneme set, or an audio file. See SpeechCapabilities</description>
</param>
</struct>
- <struct name="Turn">
+
+ <struct name="Turn" since="2.0">
<param name="navigationText" type="String" maxlength="500" mandatory="false">
<description>Individual turn text. Must provide at least text or icon for a given turn.</description>
</param>
@@ -2038,7 +2297,8 @@
<description>Individual turn icon. Must provide at least text or icon for a given turn.</description>
</param>
</struct>
- <struct name="VehicleType">
+
+ <struct name="VehicleType" since="2.0">
<param name="make" type="String" maxlength="500" mandatory="false">
<description>Make of the vehicle, e.g. Ford</description>
</param>
@@ -2051,14 +2311,16 @@
<param name="trim" type="String" maxlength="500" mandatory="false">
<description>Trim of the vehicle, e.g. SE</description>
</param>
- </struct>
- <enum name="KeyboardLayout">
+ </struct>
+
+ <enum name="KeyboardLayout" since="3.0">
<description>Enumeration listing possible keyboard layouts.</description>
<element name="QWERTY" />
<element name="QWERTZ" />
<element name="AZERTY" />
</enum>
- <enum name="KeyboardEvent" >
+
+ <enum name="KeyboardEvent" since="3.0">
<description>Enumeration listing possible keyboard events.</description>
<element name="KEYPRESS" />
<element name="ENTRY_SUBMITTED" />
@@ -2066,7 +2328,8 @@
<element name="ENTRY_CANCELLED" />
<element name="ENTRY_ABORTED" />
</enum>
- <enum name="KeypressMode">
+
+ <enum name="KeypressMode" since="3.0">
<description>Enumeration listing possible keyboard events.</description>
<element name="SINGLE_KEYPRESS">
<description>Each keypress is individually sent as the user presses the keyboard keys.</description>
@@ -2078,7 +2341,8 @@
<description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
</element>
</enum>
- <struct name="KeyboardProperties">
+
+ <struct name="KeyboardProperties" since="3.0">
<description>Configuration of on-screen keyboard (if available).</description>
<param name="language" type="Language" mandatory="false">
<description>The keyboard language.</description>
@@ -2101,7 +2365,8 @@
<description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
</param>
</struct>
- <struct name="DeviceInfo">
+
+ <struct name="DeviceInfo" since="3.0">
<description>Various information about connecting device.</description>
<param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
<description>Device model</description>
@@ -2122,7 +2387,8 @@
<description>Omitted if connected not via BT.</description>
</param>
</struct>
- <enum name="RequestType">
+
+ <enum name="RequestType" since="3.0">
<description>Enumeration listing possible asynchronous requests.</description>
<element name="HTTP" />
<element name="FILE_RESUME" />
@@ -2144,8 +2410,10 @@
<element name="EMERGENCY" />
<element name="MEDIA" />
<element name="FOTA" />
+ <element name="OEM_SPECIFIC" since="5.0" />
</enum>
- <enum name="AppHMIType">
+
+ <enum name="AppHMIType" since="2.0">
<description>Enumeration listing possible app types.</description>
<element name="DEFAULT" />
<element name="COMMUNICATION" />
@@ -2157,10 +2425,11 @@
<element name="BACKGROUND_PROCESS" />
<element name="TESTING" />
<element name="SYSTEM" />
- <element name="PROJECTION" />
- <element name="REMOTE_CONTROL" />
+ <element name="PROJECTION" since="4.5" />
+ <element name="REMOTE_CONTROL" since="4.5" />
</enum>
- <enum name="PredefinedLayout" platform="documentation">
+
+ <enum name="PredefinedLayout" platform="documentation" since="3.0">
<description>Predefined screen layout.</description>
<element name="DEFAULT" rootscreen="true">
<description>
@@ -2283,103 +2552,105 @@
</description>
</element>
</enum>
- <enum name="FunctionID" internal_scope="base">
+
+ <enum name="FunctionID" internal_scope="base" since="1.0">
<description>Enumeration linking function names with function IDs in AppLink protocol. Assumes enumeration starts at value 0.</description>
- <element name="RESERVED" value="0" />
+ <element name="RESERVED" value="0" since="1.0" />
<!--
Base Request / Response RPCs
Range = 0x 0000 0001 - 0x 0000 7FFF
-->
- <element name="RegisterAppInterfaceID" value="1" hexvalue="1" />
- <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" />
- <element name="SetGlobalPropertiesID" value="3" hexvalue="3" />
- <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" />
- <element name="AddCommandID" value="5" hexvalue="5" />
- <element name="DeleteCommandID" value="6" hexvalue="6" />
- <element name="AddSubMenuID" value="7" hexvalue="7" />
- <element name="DeleteSubMenuID" value="8" hexvalue="8" />
- <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" />
- <element name="PerformInteractionID" value="10" hexvalue="A" />
- <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" />
- <element name="AlertID" value="12" hexvalue="C" />
- <element name="ShowID" value="13" hexvalue="D" />
- <element name="SpeakID" value="14" hexvalue="E" />
- <element name="SetMediaClockTimerID" value="15" hexvalue="F" />
- <element name="PerformAudioPassThruID" value="16" hexvalue="10" />
- <element name="EndAudioPassThruID" value="17" hexvalue="11" />
- <element name="SubscribeButtonID" value="18" hexvalue="12" />
- <element name="UnsubscribeButtonID" value="19" hexvalue="13" />
- <element name="SubscribeVehicleDataID" value="20" hexvalue="14" />
- <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" />
- <element name="GetVehicleDataID" value="22" hexvalue="16" />
- <element name="ReadDIDID" value="23" hexvalue="17" />
- <element name="GetDTCsID" value="24" hexvalue="18" />
- <element name="ScrollableMessageID" value="25" hexvalue="19" />
- <element name="SliderID" value="26" hexvalue="1A" />
- <element name="ShowConstantTBTID" value="27" hexvalue="1B" />
- <element name="AlertManeuverID" value="28" hexvalue="1C" />
- <element name="UpdateTurnListID" value="29" hexvalue="1D" />
- <element name="ChangeRegistrationID" value="30" hexvalue="1E" />
- <element name="GenericResponseID" value="31" hexvalue="1F" />
- <element name="PutFileID" value="32" hexvalue="20" />
- <element name="DeleteFileID" value="33" hexvalue="21" />
- <element name="ListFilesID" value="34" hexvalue="22" />
- <element name="SetAppIconID" value="35" hexvalue="23" />
- <element name="SetDisplayLayoutID" value="36" hexvalue="24" />
- <element name="DiagnosticMessageID" value="37" hexvalue="25" />
- <element name="SystemRequestID" value="38" hexvalue="26" />
- <element name="SendLocationID" value="39" hexvalue="27" />
- <element name="DialNumberID" value="40" hexvalue="28" />
- <element name="ButtonPressID" value="41" hexvalue="29" />
- <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" />
- <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" />
- <element name="GetWayPointsID" value="45" hexvalue="2D" />
- <element name="SubscribeWayPointsID" value="46" hexvalue="2E" />
- <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" />
- <element name="GetSystemCapabilityID" value="48" hexvalue="30" />
- <element name="SendHapticDataID" value="49" hexvalue="31" />
+ <element name="RegisterAppInterfaceID" value="1" hexvalue="1" since="1.0" />
+ <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" since="1.0" />
+ <element name="SetGlobalPropertiesID" value="3" hexvalue="3" since="1.0" />
+ <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" since="1.0" />
+ <element name="AddCommandID" value="5" hexvalue="5" since="1.0" />
+ <element name="DeleteCommandID" value="6" hexvalue="6" since="1.0" />
+ <element name="AddSubMenuID" value="7" hexvalue="7" since="1.0" />
+ <element name="DeleteSubMenuID" value="8" hexvalue="8" since="1.0" />
+ <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" since="1.0" />
+ <element name="PerformInteractionID" value="10" hexvalue="A" since="1.0" />
+ <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" since="1.0" />
+ <element name="AlertID" value="12" hexvalue="C" since="1.0" />
+ <element name="ShowID" value="13" hexvalue="D" since="1.0" />
+ <element name="SpeakID" value="14" hexvalue="E" since="1.0" />
+ <element name="SetMediaClockTimerID" value="15" hexvalue="F" since="1.0" />
+ <element name="PerformAudioPassThruID" value="16" hexvalue="10" since="2.0" />
+ <element name="EndAudioPassThruID" value="17" hexvalue="11" since="2.0" />
+ <element name="SubscribeButtonID" value="18" hexvalue="12" since="1.0" />
+ <element name="UnsubscribeButtonID" value="19" hexvalue="13" since="1.0" />
+ <element name="SubscribeVehicleDataID" value="20" hexvalue="14" since="2.0" />
+ <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" since="2.0" />
+ <element name="GetVehicleDataID" value="22" hexvalue="16" since="2.0" />
+ <element name="ReadDIDID" value="23" hexvalue="17" since="2.0" />
+ <element name="GetDTCsID" value="24" hexvalue="18" since="2.0" />
+ <element name="ScrollableMessageID" value="25" hexvalue="19" since="2.0" />
+ <element name="SliderID" value="26" hexvalue="1A" since="2.0" />
+ <element name="ShowConstantTBTID" value="27" hexvalue="1B" since="2.0" />
+ <element name="AlertManeuverID" value="28" hexvalue="1C" since="2.0" />
+ <element name="UpdateTurnListID" value="29" hexvalue="1D" since="2.0" />
+ <element name="ChangeRegistrationID" value="30" hexvalue="1E" since="2.0" />
+ <element name="GenericResponseID" value="31" hexvalue="1F" since="1.0" />
+ <element name="PutFileID" value="32" hexvalue="20" since="3.0" />
+ <element name="DeleteFileID" value="33" hexvalue="21" since="3.0" />
+ <element name="ListFilesID" value="34" hexvalue="22" since="3.0" />
+ <element name="SetAppIconID" value="35" hexvalue="23" since="3.0" />
+ <element name="SetDisplayLayoutID" value="36" hexvalue="24" since="3.0" />
+ <element name="DiagnosticMessageID" value="37" hexvalue="25" since="3.0" />
+ <element name="SystemRequestID" value="38" hexvalue="26" since="3.0" />
+ <element name="SendLocationID" value="39" hexvalue="27" since="3.0" />
+ <element name="DialNumberID" value="40" hexvalue="28" since="3.0" />
+ <element name="ButtonPressID" value="41" hexvalue="29" since="4.5" />
+ <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" since="4.5" />
+ <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" since="4.5" />
+ <element name="GetWayPointsID" value="45" hexvalue="2D" since="4.1" />
+ <element name="SubscribeWayPointsID" value="46" hexvalue="2E" since="4.1" />
+ <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" since="4.1" />
+ <element name="GetSystemCapabilityID" value="48" hexvalue="30" since="4.5" />
+ <element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
<!--
Base Notifications
Range = 0x 0000 8000 - 0x 0000 FFFF
-->
- <element name="OnHMIStatusID" value="32768" hexvalue="8000" />
- <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" />
- <element name="OnButtonEventID" value="32770" hexvalue="8002" />
- <element name="OnButtonPressID" value="32771" hexvalue="8003" />
- <element name="OnVehicleDataID" value="32772" hexvalue="8004" />
- <element name="OnCommandID" value="32773" hexvalue="8005" />
- <element name="OnTBTClientStateID" value="32774" hexvalue="8006" />
- <element name="OnDriverDistractionID" value="32775" hexvalue="8007" />
- <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" />
- <element name="OnAudioPassThruID" value="32777" hexvalue="8009" />
- <element name="OnLanguageChangeID" value="32778" hexvalue="800A" />
- <element name="OnKeyboardInputID" value="32779" hexvalue="800B" />
- <element name="OnTouchEventID" value="32780" hexvalue="800C" />
- <element name="OnSystemRequestID" value="32781" hexvalue="800D" />
- <element name="OnHashChangeID" value="32782" hexvalue="800E" />
- <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" />
- <element name="OnWayPointChangeID" value="32784" hexvalue="8010" />
-
+ <element name="OnHMIStatusID" value="32768" hexvalue="8000" since="1.0" />
+ <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" since="1.0" />
+ <element name="OnButtonEventID" value="32770" hexvalue="8002" since="1.0" />
+ <element name="OnButtonPressID" value="32771" hexvalue="8003" since="1.0" />
+ <element name="OnVehicleDataID" value="32772" hexvalue="8004" since="2.0" />
+ <element name="OnCommandID" value="32773" hexvalue="8005" since="1.0" />
+ <element name="OnTBTClientStateID" value="32774" hexvalue="8006" since="1.0" />
+ <element name="OnDriverDistractionID" value="32775" hexvalue="8007" since="1.0" />
+ <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" since="2.0" />
+ <element name="OnAudioPassThruID" value="32777" hexvalue="8009" since="2.0" />
+ <element name="OnLanguageChangeID" value="32778" hexvalue="800A" since="2.0" />
+ <element name="OnKeyboardInputID" value="32779" hexvalue="800B" since="3.0" />
+ <element name="OnTouchEventID" value="32780" hexvalue="800C" since="3.0" />
+ <element name="OnSystemRequestID" value="32781" hexvalue="800D" since="3.0" />
+ <element name="OnHashChangeID" value="32782" hexvalue="800E" since="3.0" />
+ <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" since="4.5" />
+ <element name="OnWayPointChangeID" value="32784" hexvalue="8010" since="4.1" />
+ <element name="OnRCStatusID" value="32785" hexvalue="8011" since="5.0" />
+
<!--
Ford Specific Request / Response RPCs
Range = 0x 0001 0000 - 0x 0001 7FFF
-->
- <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" />
- <element name="SyncPDataID" value="65537" hexvalue="10001" />
+ <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" since="1.0" />
+ <element name="SyncPDataID" value="65537" hexvalue="10001" since="1.0" />
<!--
Ford Specific Notifications
Range = 0x 0001 8000 - 0x 0001 FFFF
-->
- <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" />
- <element name="OnSyncPDataID" value="98305" hexvalue="18001" />
+ <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" since="1.0" />
+ <element name="OnSyncPDataID" value="98305" hexvalue="18001" since="1.0" />
</enum>
- <enum name="messageType">
+ <enum name="messageType" since="1.0">
<description>
Enumeration linking message types with function types in WiPro protocol.
Assumes enumeration starts at value 0.
@@ -2389,43 +2660,67 @@
<element name="notification" value="2" />
</enum>
- <struct name="DateTime">
- <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <struct name="DateTime" since="4.1">
+ <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false" since="4.2.2">
<description>Milliseconds </description>
</param>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false" since="4.2.2">
<description>Seconds part of time</description>
+ <history>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="4.2.2">
<description>Minutes part of time</description>
+ <history>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="4.2.2">
<description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
+ <history>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="4.2.2">
<description>Day of the month</description>
+ <history>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="4.2.2">
<description>Month of the year</description>
+ <history>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="false">
+ <param name="year" type="Integer" maxvalue="4095" mandatory="false" since="4.2.2">
<description>The year in YYYY format</description>
+ <history>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false" since="4.2.2">
<description>Time zone offset in Hours wrt UTC.</description>
+ <history>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false" since="4.2.2">
<description>Time zone offset in Min wrt UTC.</description>
+ <history>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
</struct>
- <enum name="WayPointType">
+ <enum name="WayPointType" since="4.1">
<description>Describes what kind of waypoint is requested/provided.</description>
<element name="ALL" />
<element name="DESTINATION" />
</enum>
- <struct name="Coordinate">
+ <struct name="Coordinate" since="4.1">
<param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
<description>Latitude of the location.</description>
</param>
@@ -2434,7 +2729,7 @@
</param>
</struct>
- <struct name="OASISAddress">
+ <struct name="OASISAddress" since="4.1">
<param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
<description>Name of the country (localized)</description>
</param>
@@ -2464,7 +2759,7 @@
</param>
</struct>
- <struct name="LocationDetails">
+ <struct name="LocationDetails" since="4.1">
<param name="coordinate" type="Coordinate" mandatory="false">
<description>Latitude/Longitude of the location.</description>
</param>
@@ -2488,7 +2783,7 @@
</param>
</struct>
- <enum name="SystemCapabilityType">
+ <enum name="SystemCapabilityType" since="4.5">
<description>Enumerations of all available system capability types</description>
<element name="NAVIGATION"/>
<element name="PHONE_CALL"/>
@@ -2496,7 +2791,7 @@
<element name="REMOTE_CONTROL"/>
</enum>
- <struct name="NavigationCapability">
+ <struct name="NavigationCapability" since="4.5">
<description>Extended capabilities for an onboard navigation system</description>
<param name="sendLocationEnabled" type="Boolean" mandatory="false">
<description>If the module has the ability to add locations to the onboard nav</description>
@@ -2506,14 +2801,14 @@
</param>
</struct>
- <struct name="PhoneCapability">
+ <struct name="PhoneCapability" since="4.5">
<description>Extended capabilities of the module's phone feature</description>
<param name="dialNumberEnabled" type="Boolean" mandatory="false">
<description>If the module has the ability to perform dial number</description>
</param>
</struct>
- <struct name="VideoStreamingFormat">
+ <struct name="VideoStreamingFormat" since="4.5">
<description>Video streaming formats and their specifications.</description>
<param name="protocol" type="VideoStreamingProtocol" mandatory="true">
<description>Protocol type, see VideoStreamingProtocol</description>
@@ -2523,7 +2818,7 @@
</param>
</struct>
- <struct name="VideoStreamingCapability">
+ <struct name="VideoStreamingCapability" since="4.5">
<description>Contains information about this system's video streaming capabilities.</description>
<param name="preferredResolution" type="ImageResolution" mandatory="false">
<description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
@@ -2538,10 +2833,157 @@
<description>True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. </description>
</param>
</struct>
+
+ <struct name="RGBColor" since="5.0">
+ <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ </struct>
+
+ <struct name="TemplateColorScheme" since="5.0">
+ <description>
+ A color scheme for all display layout templates.
+ </description>
+ <param name="primaryColor" type="RGBColor" mandatory="false">
+ <description>The primary "accent" color</description>
+ </param>
+ <param name="secondaryColor" type="RGBColor" mandatory="false">
+ <description>The secondary "accent" color</description>
+ </param>
+ <param name="backgroundColor" type="RGBColor" mandatory="false">
+ <description>The color of the background</description>
+ </param>
+ </struct>
<!---Remote control -->
+
+ <enum name="MassageZone" since="5.0">
+ <description>List possible zones of a multi-contour massage seat.</description>
+ <element name="LUMBAR">
+ <description>The back of a multi-contour massage seat. or SEAT_BACK</description>
+ </element>
+ <element name="SEAT_CUSHION">
+ <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
+ </element>
+ </enum>
+
+ <enum name="MassageMode" since="5.0">
+ <description>List possible modes of a massage zone.</description>
+ <element name="OFF"/>
+ <element name="LOW"/>
+ <element name="HIGH"/>
+ </enum>
+
+ <struct name="MassageModeData" since="5.0">
+ <description>Specify the mode of a massage zone.</description>
+ <param name="massageZone" type="MassageZone" mandatory="true"></param>
+ <param name="massageMode" type="MassageMode" mandatory="true"></param>
+ </struct>
+
+ <enum name="MassageCushion" since="5.0">
+ <description>List possible cushions of a multi-contour massage seat.</description>
+ <element name="TOP_LUMBAR"/>
+ <element name="MIDDLE_LUMBAR"/>
+ <element name="BOTTOM_LUMBAR"/>
+ <element name="BACK_BOLSTERS"/>
+ <element name="SEAT_BOLSTERS"/>
+ </enum>
+
+ <struct name="MassageCushionFirmness" since="5.0">
+ <description>The intensity or firmness of a cushion.</description>
+ <param name="cushion" type="MassageCushion" mandatory="true"></param>
+ <param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <enum name="SeatMemoryActionType" since="5.0">
+ <element name="SAVE">
+ <description>Save current seat postions and settings to seat memory.</description>
+ </element>
+ <element name="RESTORE">
+ <description>Restore / apply the seat memory settings to the current seat. </description>
+ </element>
+ <element name="NONE">
+ <description>No action to be performed.</description>
+ </element>
+ </enum>
+
+ <struct name="SeatMemoryAction" since="5.0">
+ <param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
+ <param name="label" type="String" maxlength="100" mandatory="false"/>
+ <param name="action" type="SeatMemoryActionType" mandatory="true"/>
+ </struct>
+
+ <enum name="SupportedSeat" since="5.0">
+ <description>List possible seats that is a remote controllable seat.</description>
+ <element name="DRIVER"/>
+ <element name="FRONT_PASSENGER"/>
+ </enum>
+
+ <struct name="SeatControlData" since="5.0">
+ <description>Seat control data corresponds to "SEAT" ModuleType. </description>
+ <param name="id" type="SupportedSeat" mandatory="true"></param>
+
+ <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="massageEnabled" type="Boolean" mandatory="false"></param>
+ <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+
+ <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ </struct>
+
+ <struct name="SeatControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageModeAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="memoryAvailable" type="Boolean" mandatory="false">
+ </param>
+ </struct>
- <struct name="Temperature">
+ <struct name="Temperature" since="4.5">
<param name="unit" type="TemperatureUnit" mandatory="true">
<description>Temperature Unit</description>
</param>
@@ -2550,7 +2992,7 @@
</param>
</struct>
- <struct name="RdsData">
+ <struct name="RdsData" since="4.5">
<param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
<description>Program Service Name</description>
</param>
@@ -2576,8 +3018,35 @@
<description>Region</description>
</param>
</struct>
+
+ <struct name="StationIDNumber" since="5.0">
+ <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
+ </param>
+ <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
+ <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
+ </param>
+ </struct>
+
+ <struct name="SisData" since="5.0">
+ <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
+ <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
+ </param>
+ <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
+ </param>
+ <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>Identifies the station call sign or other identifying information in the long format.</description>
+ </param>
+ <param name="stationLocation" type="GPSData" mandatory="false">
+ <description>Provides the 3-dimensional geographic station location.</description>
+ </param>
+ <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements. Includes a high priority delivery feature to convey emergencies that may be in the listening area.</description>
+ </param>
+ </struct>
- <struct name="RadioControlData">
+ <struct name="RadioControlData" since="4.5">
<param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
<description>The integer part of the frequency ie for 101.7 this value should be 101</description>
</param>
@@ -2588,11 +3057,20 @@
</param>
<param name="rdsData" type="RdsData" mandatory="false">
</param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdRadioEnable" type="Boolean" mandatory="false" since="5.0">
+ <description> True if the hd radio is on, false if the radio is off</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
<description>number of HD sub-channels if available</description>
+ <history>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
<description>Current HD sub-channel if available</description>
+ <history>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
</param>
@@ -2600,13 +3078,16 @@
<description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
</param>
<param name="radioEnable" type="Boolean" mandatory="false">
- <description> True if the radio is on, false is the radio is off</description>
+ <description> True if the radio is on, false if the radio is off. If set to false, no other data will be included.</description>
</param>
<param name="state" type="RadioState" mandatory="false">
</param>
+ <param name="sisData" type="SisData" mandatory="false" since="5.0">
+ <description>Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number</description>
+ </param>
</struct>
- <struct name="ClimateControlData">
+ <struct name="ClimateControlData" since="4.5">
<param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
</param>
<param name="currentTemperature" type="Temperature" mandatory="false">
@@ -2627,19 +3108,21 @@
</param>
<param name="ventilationMode" type="VentilationMode" mandatory="false">
</param>
- </struct>
-
- <struct name="ModuleData">
- <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
- <param name="moduleType" type="ModuleType" mandatory="true">
+ <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled/turn off, value true means enabled/turn on.</description>
</param>
- <param name="radioControlData" type="RadioControlData" mandatory="false">
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
</param>
- <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ <param name="heatedRearWindowEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedMirrorsEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
</param>
</struct>
-
- <struct name="RadioControlCapabilities">
+
+ <struct name="RadioControlCapabilities" since="4.5">
<description>Contains information about a radio control module's capabilities.</description>
<!-- need an ID in the future -->
<param name="moduleName" type="String" maxlength="100" mandatory="true">
@@ -2702,15 +3185,39 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="sisDataAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the getting HD radio Station Information Service (SIS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control of enable/disable HD radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of sirius XM radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
- <struct name="ClimateControlCapabilities">
+ <struct name="ClimateControlCapabilities" since="4.5">
<description>Contains information about a climate control module's capabilities.</description>
<!-- need an ID in the future -->
<param name="moduleName" type="String" maxlength="100" mandatory="true">
<description>The short friendly name of the climate control module.
It should not be used to identify a module by mobile application.</description>
</param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
<param name="fanSpeedAvailable" type="Boolean" mandatory="false">
<description>
Availability of the control of fan speed.
@@ -2775,22 +3282,327 @@
A set of all ventilation modes that are controllable.
</description>
</param>
+ <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Steering Wheel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Windshield.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Rear Window.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Mirrors.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
-
- <struct name="RemoteControlCapabilities">
+
+ <struct name="EqualizerSettings" since="5.0">
+ <description>Defines the each Equalizer channel settings.</description>
+ <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
+ <param name="channelName" type="String" mandatory="false" maxlength="50">
+ <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
+ </param>
+ <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
+ <description>Reflects the setting, from 0%-100%.</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlData" since="5.0">
+ <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <description>
+ In a getter response or a notification, it is the current primary audio source of the system.
+ In a setter request, it is the target audio source that the system shall switch to.
+ If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ </description>
+ </param>
+ <param name="keepContext" type="Boolean" mandatory="false">
+ <description>
+ This parameter shall not be present in any getter responses or notifications.
+ This parameter is optional in a setter request. The default value is false if it is not included.
+ If it is false, the system not only changes the audio source but also brings the default application or
+ system UI associated with the audio source to foreground.
+ If it is true, the system only changes the audio source, but keeps the current application in foreground.
+ </description>
+ </param>
+ <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
+ <description>Reflects the volume of audio, from 0%-100%.</description>
+ </param>
+ <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="sourceAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio source. </description>
+ </param>
+ <param name="keepContextAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the keepContext parameter. </description>
+ </param>
+ <param name="volumeAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio volume.</description>
+ </param>
+ <param name="equalizerAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of Equalizer Settings.</description>
+ </param>
+ <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
+ </param>
+ </struct>
+
+ <enum name="LightName" since="5.0">
+ <!-- Common Single Light 0~500 -->
+ <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
+ <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
+ <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
+ <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
+ <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
+ <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
+ <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
+ <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
+ <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
+ <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
+ <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
+ <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
+ <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
+ <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
+ <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
+ <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
+ <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
+ <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
+ <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
+ <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
+ <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
+
+ <!-- Exterior Lights by common function groups 501~800 -->
+ <element name="HIGH_BEAMS" value="501">
+ <description>Include all high beam lights: front_left and front_right.</description>
+ </element>
+ <element name="LOW_BEAMS" value="502">
+ <description>Include all low beam lights: front_left and front_right.</description>
+ </element>
+ <element name="FOG_LIGHTS" value="503">
+ <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="RUNNING_LIGHTS" value="504">
+ <description>Include all daytime running lights: front_left and front_right.</description>
+ </element>
+ <element name="PARKING_LIGHTS" value="505">
+ <description>Include all parking lights: front_left and front_right.</description>
+ </element>
+ <element name="BRAKE_LIGHTS" value="506">
+ <description>Include all brake lights: rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_REVERSING_LIGHTS" value="507"/>
+ <element name="SIDE_MARKER_LIGHTS" value="508"/>
+ <element name="LEFT_TURN_LIGHTS" value="509">
+ <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
+ </element>
+ <element name="RIGHT_TURN_LIGHTS" value="510">
+ <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
+ </element>
+ <element name="HAZARD_LIGHTS" value="511">
+ <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_CARGO_LIGHTS" value="512">
+ <description>Cargo lamps illuminate the cargo area.</description>
+ </element>
+ <element name="REAR_TRUCK_BED_LIGHTS" value="513">
+ <description>Truck bed lamps light up the bed of the truck.</description>
+ </element>
+ <element name="REAR_TRAILER_LIGHTS" value="514">
+ <description>Trailer lights are lamps mounted on a trailer hitch.</description>
+ </element>
+ <element name="LEFT_SPOT_LIGHTS" value="515">
+ <description>It is the spotlights mounted on the left side of a vehicle.</description>
+ </element>
+ <element name="RIGHT_SPOT_LIGHTS" value="516">
+ <description>It is the spotlights mounted on the right side of a vehicle.</description>
+ </element>
+ <element name="LEFT_PUDDLE_LIGHTS" value="517">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+ <element name="RIGHT_PUDDLE_LIGHTS" value="518">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+
+ <!-- Interior Lights by common function groups 801~900 -->
+ <element name="AMBIENT_LIGHTS" value="801"/>
+ <element name="OVERHEAD_LIGHTS" value="802"/>
+ <element name="READING_LIGHTS" value="803"/>
+ <element name="TRUNK_LIGHTS" value="804"/>
+
+ <!-- Lights by location 901~1000-->
+ <element name="EXTERIOR_FRONT_LIGHTS" value="901">
+ <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
+ </element>
+ <element name="EXTERIOR_REAR_LIGHTS" value="902">
+ <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights and trailer assist lights.</description>
+ </element>
+ <element name="EXTERIOR_LEFT_LIGHTS" value="903">
+ <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
+ <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_ALL_LIGHTS" value="905">
+ <description> Include all exterior lights around the vehicle.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus" since="5.0">
+ <element name="ON"/>
+ <element name="OFF"/>
+ <element name="RAMP_UP"/>
+ <element name="RAMP_DOWN"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+
+ <struct name="LightCapabilities" since="5.0">
+ <param name="name" type="LightName" mandatory="true" />
+ <param name="statusAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ </description>
+ </param>
+ <param name="densityAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's density can be set remotely (similar to a dimmer).
+ </description>
+ </param>
+ <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's color can be set remotely by using the sRGB color space.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="LightControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description> An array of available LightCapabilities that are controllable. </description>
+ </param>
+ </struct>
+
+ <struct name="LightState" since="5.0">
+ <param name="id" type="LightName" mandatory="true">
+ <description>The name of a light or a group of lights. </description>
+ </param>
+ <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
+ <param name="color" type="RGBColor" mandatory="false" />
+ </struct>
+
+ <struct name="LightControlData" since="5.0">
+ <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
+ </param>
+ </struct>
+
+ <enum name="DisplayMode" since="5.0">
+ <element name="DAY"/>
+ <element name="NIGHT"/>
+ <element name="AUTO"/>
+ </enum>
+
+ <enum name="DistanceUnit" since="5.0">
+ <element name="MILES"/>
+ <element name="KILOMETERS"/>
+ </enum>
+
+ <struct name="HMISettingsControlData" since="5.0">
+ <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
+ <param name="displayMode" type="DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ </struct>
+
+ <struct name="HMISettingsControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the hmi setting module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of distance unit. </description>
+ </param>
+ <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of temperature unit. </description>
+ </param>
+ <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of HMI display mode. </description>
+ </param>
+ </struct>
+
+ <struct name="ModuleData" since="4.5">
+ <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ </param>
+ <param name="radioControlData" type="RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ </param>
+ <param name="seatControlData" type="SeatControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="audioControlData" type="AudioControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="lightControlData" type="LightControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false" since="5.0">
+ </param>
+ </struct>
+
+ <struct name="RemoteControlCapabilities" since="4.5">
<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 >
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description>
</param>
<param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
- <description>If included, the platform supports RC radio controls.For this baseline version, maxsize=1. i.e. only one radio control module is supported.</description >
+ <description>If included, the platform supports RC radio controls.For this baseline version, maxsize=1. i.e. only one radio control module is supported.</description>
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC button controls with the included button names.</description>
</param>
- <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
- <description>If included, the platform supports RC button controls with the included button names.</description >
+ <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
+ <description>If included, the platform supports audio controls.</description>
+ </param>
+ <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false" since="5.0">
+ <description>If included, the platform supports hmi setting controls.</description>
+ </param>
+ <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false" since="5.0">
+ <description>If included, the platform supports light controls.</description>
+ </param>
+ <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
+ <description>If included, the platform supports seat controls.</description>
</param>
</struct>
<!-- End of RC -->
- <struct name="SystemCapability">
+ <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>
@@ -2809,7 +3621,7 @@
</param>
</struct>
- <enum name="MetadataType">
+ <enum name="MetadataType" since="4.5">
<element name="mediaTitle">
<description>The data in this field contains the title of the currently playing audio track.</description>
</element>
@@ -2847,8 +3659,8 @@
<description>The data in this field describes the current humidity value.</description>
</element>
</enum>
-
- <struct name="MetadataTags">
+
+ <struct name="MetadataTags" since="4.5">
<param name="mainField1" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
<description>The type of data contained in the "mainField1" text field.</description>
</param>
@@ -2863,7 +3675,7 @@
</param>
</struct>
- <struct name="Rectangle">
+ <struct name="Rectangle" since="4.5">
<param name="x" type="Float" mandatory="true">
<description>The upper left X-coordinate of the rectangle</description>
</param>
@@ -2877,8 +3689,8 @@
<description>The height of the rectangle</description>
</param>
</struct>
-
- <struct name="HapticRect">
+
+ <struct name="HapticRect" since="4.5">
<description>Defines haptic data for each user control object for video streaming application</description>
<param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>A user control spatial identifier</description>
@@ -2890,17 +3702,17 @@
<!-- Requests/Responses -->
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request">
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request" since="1.0">
<description>
Establishes an interface with a mobile application.
Before registerAppInterface no other commands will be accepted/executed.
</description>
- <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true">
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true" since="1.0">
<description>See SyncMsgVersion</description>
</param>
- <param name="appName" type="String" maxlength="100" mandatory="true">
+ <param name="appName" type="String" maxlength="100" mandatory="true" since="1.0">
<description>
The mobile application name, e.g. "Ford Drive Green".
Needs to be unique over all applications.
@@ -2912,7 +3724,7 @@
</description>
</param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
@@ -2923,7 +3735,7 @@
</description>
</param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="1.0">
<description>
Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
If not provided, the appName is used instead (and will be truncated if too long)
@@ -2931,7 +3743,7 @@
</description>
</param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>
Defines an additional voice recognition command.
May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands)
@@ -2939,20 +3751,20 @@
</description>
</param>
- <param name="isMediaApplication" type="Boolean" mandatory="true">
+ <param name="isMediaApplication" type="Boolean" mandatory="true" since="1.0">
<description>
Indicates if the application is a media or a non-media application.
Only media applications will be able to stream audio to the module that is audible outside of the BT media source.
</description>
</param>
- <param name="languageDesired" type="Language" mandatory="true">
+ <param name="languageDesired" type="Language" mandatory="true" since="1.0">
<description>
See Language
Current app's expected VR+TTS language
If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
</description>
</param>
- <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true">
+ <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true" since="2.0">
<description>
See Language
Current app's expected display language
@@ -2960,14 +3772,14 @@
</description>
</param>
- <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
See AppHMIType
List of all applicable app HMI types stating which HMI classifications to be given to the app.
</description>
</param>
- <param name="hashID" type="String" maxlength="100" mandatory="false">
+ <param name="hashID" type="String" maxlength="100" mandatory="false" since="3.0">
<description>
ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
@@ -2975,22 +3787,27 @@
When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.).
</description>
</param>
- <param name="deviceInfo" type="DeviceInfo" mandatory="false">
+ <param name="deviceInfo" type="DeviceInfo" mandatory="false" since="3.0">
<description>
See DeviceInfo.
</description>
</param>
- <param name="appID" type="String" maxlength="100" mandatory="true">
+ <param name="appID" type="String" maxlength="100" mandatory="true" since="2.0">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ <param name="fullAppID" type="String" maxlength="100" mandatory="false" since="5.0">
<description>ID used to validate app with policy table entries</description>
</param>
- <param name="appInfo" type="AppInfo" mandatory="false">
+ <param name="appInfo" type="AppInfo" mandatory="false" since="2.0">
<description>
See AppInfo.
</description>
</param>
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
</function>
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response" since="1.0">
<description>The response to registerAppInterface</description>
<param name="success" type="Boolean" platform="documentation" mandatory="true">
@@ -3026,7 +3843,7 @@
<description>The currently active VR+TTS language on the module. See "Language" for options.</description>
</param>
- <param name="hmiDisplayLanguage" type="Language" mandatory="false">
+ <param name="hmiDisplayLanguage" type="Language" mandatory="false" since="2.0">
<description>The currently active display language on the module. See "Language" for options.</description>
</param>
@@ -3038,61 +3855,68 @@
<description>See ButtonCapabilities</description >
</param>
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
</param>
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0">
<description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
</param>
- <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>See HmiZoneCapabilities</description>
</param>
- <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>See SpeechCapabilities</description>
</param>
- <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
<description>See PrerecordedSpeech</description>
</param>
- <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>See VrCapabilities</description>
</param>
- <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>See AudioPassThruCapability</description>
</param>
- <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false">
+ <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false" since="4.1">
<description>See AudioPassThruCapability</description>
</param>
- <param name="vehicleType" type="VehicleType" mandatory="false">
+ <param name="vehicleType" type="VehicleType" mandatory="false" since="2.0">
<description>Specifies the vehicle's type. See VehicleType.</description>
</param>
- <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" >
+ <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" since="3.0">
<description>
Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
If a mode outside this list is requested, it will be rejected.
</description>
</param>
- <param name="hmiCapabilities" type="HMICapabilities" mandatory="false">
+ <param name="hmiCapabilities" type="HMICapabilities" mandatory="false" since="3.0">
<description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
</param>
- <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
+ <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
<description>The SmartDeviceLink version.</description>
</param>
- <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
+ <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
<description>The software version of the system that implements the SmartDeviceLink core.</description>
</param>
+
+ <param name="iconResumed" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Existence of apps icon at system. If true, apps icon
+ was resumed at system. If false, apps icon is not resumed at system
+ </description>
+ </param>
</function>
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request">
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request" since="1.0">
<description>
Closes an interface from a mobile application.
After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
@@ -3100,7 +3924,7 @@
</description>
</function>
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response">
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3122,10 +3946,10 @@
</function>
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request">
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request" since="1.0">
<description>Allows setting global properties.</description>
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>
The help prompt.
An array of text chunks of type TTSChunk. See TTSChunk.
@@ -3133,7 +3957,7 @@
</description>
</param>
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>
Help text for a wait timeout.
An array of text chunks of type TTSChunk. See TTSChunk.
@@ -3141,7 +3965,7 @@
</description>
</param>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false" since="2.0">
<description>
VR Help Title text.
If omitted on supported displays, the default module help title shall be used.
@@ -3149,7 +3973,7 @@
</description>
</param>
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
VR Help Items.
If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
@@ -3157,20 +3981,20 @@
If omitted and a vrHelpTitle is provided, the request will be rejected.
</description>
</param>
- <param name="menuTitle" maxlength="500" type="String" mandatory="false">
+ <param name="menuTitle" maxlength="500" type="String" mandatory="false" since="3.0">
<description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
</param>
- <param name="menuIcon" type="Image" mandatory="false">
- <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ <param name="menuIcon" type="Image" mandatory="false" since="3.0">
+ <description>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
</param>
- <param name="keyboardProperties" type="KeyboardProperties" mandatory="false">
+ <param name="keyboardProperties" type="KeyboardProperties" mandatory="false" since="3.0">
<description>On-screen keyboard configuration (if available).</description>
</param>
</function>
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response">
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3196,7 +4020,7 @@
</function>
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request">
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request" since="1.0">
<description>Allows resetting global properties.</description>
<param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" mandatory="true">
@@ -3204,7 +4028,7 @@
</param>
</function>
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response">
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3227,7 +4051,7 @@
</param>
</function>
- <function name="AddCommand" functionID="AddCommandID" messagetype="request">
+ <function name="AddCommand" functionID="AddCommandID" messagetype="request" since="1.0">
<description>
Adds a command to the in application menu.
Either menuParams or vrCommands must be provided.
@@ -3248,7 +4072,7 @@
</description>
</param>
- <param name="cmdIcon" type="Image" mandatory="false">
+ <param name="cmdIcon" type="Image" mandatory="false" since="2.0">
<description>
Image struct determining whether static or dynamic icon.
If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
@@ -3257,7 +4081,7 @@
</function>
- <function name="AddCommand" functionID="AddCommandID" messagetype="response">
+ <function name="AddCommand" functionID="AddCommandID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3285,7 +4109,7 @@
</function>
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request">
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request" since="1.0">
<description>Deletes all commands from the in-application menu with the specified command id.</description>
<param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
@@ -3294,7 +4118,7 @@
</function>
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response">
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3318,7 +4142,7 @@
</function>
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request">
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request" since="1.0">
<description>Adds a sub menu to the in-application menu.</description>
<param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
@@ -3339,9 +4163,13 @@
<param name="menuName" maxlength="500" type="String" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
+
+ <param name="menuIcon" type="Image" mandatory="false" since="5.0">
+ <description>The image field for AddSubMenu</description>
+ </param>
</function>
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3364,7 +4192,7 @@
</param>
</function>
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request">
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request" since="1.0">
<description>Deletes a submenu from the in-application menu.</description>
<param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
@@ -3373,7 +4201,7 @@
</function>
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response">
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3398,7 +4226,7 @@
</function>
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request">
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request" since="1.0">
<description>creates interaction choice set to be used later by performInteraction</description>
<param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
@@ -3408,7 +4236,7 @@
<param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
</function>
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3432,7 +4260,7 @@
</param>
</function>
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request">
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request" since="1.0">
<description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
<param name="initialText" type="String" maxlength="500" mandatory="true">
@@ -3481,21 +4309,20 @@
</description>
</param>
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
If omitted on supported displays, the default generated list of suggested choices shall be displayed.
</description>
</param>
- <param name="interactionLayout" type="LayoutMode" mandatory="false">
+ <param name="interactionLayout" type="LayoutMode" mandatory="false" since="3.0">
<description>See LayoutMode.</description>
</param>
</function>
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response">
-
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3528,7 +4355,7 @@
</description>
</param>
- <param name="manualTextEntry" type="String" maxlength="500" mandatory="false">
+ <param name="manualTextEntry" type="String" maxlength="500" mandatory="false" since="3.0">
<description>
Manually entered text selection, e.g. through keyboard
Can be returned in lieu of choiceID, depending on trigger source
@@ -3544,7 +4371,7 @@
</function>
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request">
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request" since="1.0">
<description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
<description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
@@ -3553,7 +4380,7 @@
</param>
</function>
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response">
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3576,7 +4403,7 @@
</param>
</function>
- <function name="Alert" functionID="AlertID" messagetype="request">
+ <function name="Alert" functionID="AlertID" messagetype="request" since="1.0">
<description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
<param name="alertText1" type="String" maxlength="500" mandatory="false">
@@ -3587,7 +4414,7 @@
<description>The second line of the alert text field</description>
</param>
- <param name="alertText3" type="String" maxlength="500" mandatory="false">
+ <param name="alertText3" type="String" maxlength="500" mandatory="false" since="2.0">
<description>The optional third line of the alert text field</description>
</param>
@@ -3613,13 +4440,13 @@
</description>
</param>
- <param name="progressIndicator" type="Boolean" mandatory="false">
+ <param name="progressIndicator" type="Boolean" mandatory="false" since="3.0">
<description>
If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
</description>
</param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false">
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false" since="2.0">
<description>
App defined SoftButtons.
If omitted on supported displays, the displayed alert shall not have any SoftButtons.
@@ -3628,7 +4455,7 @@
</function>
- <function name="Alert" functionID="AlertID" messagetype="response">
+ <function name="Alert" functionID="AlertID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3654,7 +4481,7 @@
<description>Provides additional human readable info regarding the result.</description>
</param>
- <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="2.0">
<description>
Amount of time (in seconds) that an app must wait before resending an alert.
If provided, another system event or overlay currently has a higher priority than this alert.
@@ -3664,10 +4491,10 @@
</function>
- <function name="Show" functionID="ShowID" messagetype="request">
+ <function name="Show" functionID="ShowID" messagetype="request" since="1.0">
<description>Updates the persistent display. Supported fields depend on display capabilities.</description>
- <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
The text that should be displayed in a single or upper display line.
If this text is not set, the text of mainField1 stays unchanged.
@@ -3675,7 +4502,7 @@
</description>
</param>
- <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
The text that should be displayed on the second display line.
If this text is not set, the text of mainField2 stays unchanged.
@@ -3683,7 +4510,7 @@
</description>
</param>
- <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
<description>
The text that should be displayed on the second "page" first display line.
If this text is not set, the text of mainField3 stays unchanged.
@@ -3691,7 +4518,7 @@
</description>
</param>
- <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
<description>
The text that should be displayed on the second "page" second display line.
If this text is not set, the text of mainField4 stays unchanged.
@@ -3699,25 +4526,25 @@
</description>
</param>
- <param name="alignment" type="TextAlignment" mandatory="false">
+ <param name="alignment" type="TextAlignment" mandatory="false" since="1.0">
<description>
Specifies how mainField1 and mainField2 texts should be aligned on display.
If omitted, texts will be centered.
</description>
</param>
- <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
</param>
- <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
Text value for MediaClock field. Has to be properly formatted by Mobile App according to the module's capabilities.
If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
</description>
</param>
- <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
The text that should be displayed in the track field.
If this text is not set, the text of mediaTrack stays unchanged.
@@ -3725,43 +4552,42 @@
</description>
</param>
- <param name="graphic" type="Image" mandatory="false">
+ <param name="graphic" type="Image" mandatory="false" since="3.0">
<description>
Image struct determining whether static or dynamic image to display in app.
If omitted on supported displays, the displayed graphic shall not change.
</description>
</param>
- <param name="secondaryGraphic" type="Image" mandatory="false">
+ <param name="secondaryGraphic" type="Image" mandatory="false" since="3.0">
<description>
Image struct determining whether static or dynamic secondary image to display in app.
If omitted on supported displays, the displayed secondary graphic shall not change.
</description>
</param>
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false" since="2.0">
<description>
App defined SoftButtons.
If omitted on supported displays, the currently displayed SoftButton values will not change.
</description>
</param>
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
+ <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false" since="3.0">
<description>
App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions).
If omitted on supported displays, the presets will be shown as not defined.
</description>
</param>
- <param name="metadataTags" type="MetadataTags" mandatory="false">
+ <param name="metadataTags" type="MetadataTags" mandatory="false" since="4.5">
<description>App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4.
If omitted on supported displays, the currently set metadata tags will not change.
If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.</description>
</param>
</function>
- <function name="Show" functionID="ShowID" messagetype="response">
+ <function name="Show" functionID="ShowID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3787,7 +4613,7 @@
</param>
</function>
- <function name="Speak" functionID="SpeakID" messagetype="request">
+ <function name="Speak" functionID="SpeakID" messagetype="request" since="1.0">
<description>Speaks a text.</description>
<param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
@@ -3799,7 +4625,7 @@
</function>
- <function name="Speak" functionID="SpeakID" messagetype="response">
+ <function name="Speak" functionID="SpeakID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3825,7 +4651,7 @@
</function>
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request">
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request" since="1.0">
<description>Sets the initial media clock value and automatic update method.</description>
<param name="startTime" type="StartTime" mandatory="false">
@@ -3837,7 +4663,7 @@
</description>
</param>
- <param name="endTime" type="StartTime" mandatory="false">
+ <param name="endTime" type="StartTime" mandatory="false" since="3.0">
<description>
See StartTime.
endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
@@ -3853,9 +4679,15 @@
In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
</description>
</param>
+
+ <param name="audioStreamingIndicator" type="AudioStreamingIndicator" mandatory="false" since="5.0">
+ <description>
+ Enumeration for the indicator icon on a play/pause button. see AudioStreamingIndicator.
+ </description>
+ </param>
</function>
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response">
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3877,7 +4709,7 @@
</param>
</function>
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request">
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request" since="2.0">
<description>Starts audio pass thru session </description>
<param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
<description>
@@ -3913,7 +4745,7 @@
</param>
</function>
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response">
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3938,11 +4770,11 @@
</param>
</function>
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request">
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request" since="2.0">
<description>When this request is invoked, the audio capture stops.</description>
</function>
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response">
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3964,7 +4796,7 @@
</param>
</function>
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request">
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request" since="1.0">
<description>
Subscribes to built-in HMI buttons.
The application will be notified by the OnButtonEvent and OnButtonPress.
@@ -3976,7 +4808,7 @@
</param>
</function>
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3999,7 +4831,7 @@
</param>
</function>
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request">
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request" since="1.0">
<description>Unsubscribes from built-in HMI buttons.</description>
<param name="buttonName" type="ButtonName" mandatory="true">
@@ -4007,7 +4839,7 @@
</param>
</function>
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -4030,7 +4862,7 @@
</param>
</function>
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request">
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request" since="2.0">
<description>
Subscribes for specific published data items.
The data will be only sent if it has changed.
@@ -4056,9 +4888,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4095,6 +4933,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -4117,7 +4961,7 @@
</function>
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response">
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4159,9 +5003,15 @@
<param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4198,6 +5048,12 @@
<param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="VehicleDataResult" mandatory="false">
@@ -4219,7 +5075,7 @@
</function>
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request">
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request" since="2.0">
<description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</description>
<param name="gps" type="Boolean" mandatory="false">
@@ -4240,9 +5096,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4279,6 +5141,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -4300,7 +5168,7 @@
</function>
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response">
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4341,9 +5209,15 @@
<param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -4380,6 +5254,12 @@
<param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="VehicleDataResult" mandatory="false">
@@ -4401,7 +5281,7 @@
</function>
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request">
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request" since="2.0">
<description>Non periodic vehicle data read request.</description>
<param name="gps" type="Boolean" mandatory="false">
@@ -4422,9 +5302,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="Boolean" mandatory="false">
<description>Vehicle identification number</description>
</param>
@@ -4464,6 +5350,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -4485,7 +5377,7 @@
</function>
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response">
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -4527,9 +5419,15 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number</description>
</param>
@@ -4569,6 +5467,12 @@
<param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="ECallInfo" mandatory="false">
@@ -4590,7 +5494,7 @@
</function>
- <function name="ReadDID" functionID="ReadDIDID" messagetype="request">
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="request" since="2.0">
<description>Non periodic vehicle data read request</description>
<param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
@@ -4601,7 +5505,7 @@
</param>
</function>
- <function name="ReadDID" functionID="ReadDIDID" messagetype="response">
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -4631,7 +5535,7 @@
</function>
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="request">
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="request" since="2.0">
<description>Vehicle module diagnostic trouble code request.</description>
<param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
@@ -4644,7 +5548,7 @@
</function>
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="response">
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -4681,7 +5585,7 @@
</function>
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request">
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request" since="3.0">
<description>Non periodic vehicle diagnostic request</description>
<param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
@@ -4699,7 +5603,7 @@
</param>
</function>
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response">
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -4731,7 +5635,7 @@
</function>
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request">
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request" since="2.0">
<description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
<param name="scrollableMessageBody" type="String" maxlength="500" mandatory="true">
<description>Body of text that can include newlines and tabs.</description>
@@ -4747,7 +5651,7 @@
</param>
</function>
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response">
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4773,7 +5677,7 @@
</function>
- <function name="Slider" functionID="SliderID" messagetype="request">
+ <function name="Slider" functionID="SliderID" messagetype="request" since="2.0">
<description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
<param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
<description>Number of selectable items on a horizontal axis</description>
@@ -4801,7 +5705,7 @@
</param>
</function>
- <function name="Slider" functionID="SliderID" messagetype="response">
+ <function name="Slider" functionID="SliderID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4834,40 +5738,40 @@
</param>
</function>
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request">
- <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false">
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request" since="2.0">
+ <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false" since="3.0">
</param>
- <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="turnIcon" type="Image" mandatory="false">
+ <param name="turnIcon" type="Image" mandatory="false" since="2.0">
</param>
- <param name="nextTurnIcon" type="Image" mandatory="false">
+ <param name="nextTurnIcon" type="Image" mandatory="false" since="3.0">
</param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
<description>
Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
Used to calculate progress bar.
</description>
</param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
+ <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
<description>
Distance till next maneuver (starting from) from previous maneuver.
Used to calculate progress bar.
</description>
</param>
- <param name="maneuverComplete" type="Boolean" mandatory="false">
+ <param name="maneuverComplete" type="Boolean" mandatory="false" since="2.0">
<description>
If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
If omitted the value will be assumed as FALSE.
</description>
</param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false" since="2.0">
<description>
Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
If omitted on supported displays, the currently displayed SoftButton values will not change.
@@ -4875,7 +5779,7 @@
</param>
</function>
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response">
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4897,7 +5801,7 @@
</param>
</function>
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request">
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request" since="2.0">
<param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
<description>An array of text chunks of type TTSChunk. See TTSChunk</description>
</param>
@@ -4906,7 +5810,7 @@
</param>
</function>
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response">
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4931,7 +5835,7 @@
</param>
</function>
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request">
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request" since="2.0">
<param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
</param>
<param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
@@ -4939,7 +5843,7 @@
</param>
</function>
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response">
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4961,32 +5865,29 @@
</param>
</function>
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request">
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request" since="2.0">
<param name="language" type="Language" mandatory="true">
<description>Requested voice engine (VR+TTS) language registration</description>
</param>
<param name="hmiDisplayLanguage" type="Language" mandatory="true">
<description>Request display language registration</description>
</param>
- <param name="appName" type="String" maxlength="100" mandatory="false">
+ <param name="appName" type="String" maxlength="100" mandatory="false" since="3.0">
<description>Request new app name registration</description>
</param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
<description>Request new ttsName registration</description>
</param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="3.0">
<description>Request new app short name registration</description>
</param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
<description>Request new VR synonyms registration</description>
</param>
</function>
-
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response">
-
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description>
true, if successful
@@ -5012,7 +5913,7 @@
</function>
- <function name="GenericResponse" functionID="GenericResponseID" messagetype="response">
+ <function name="GenericResponse" functionID="GenericResponseID" messagetype="response" since="1.0">
<description>
Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
Currently, only resultCode INVALID_DATA is used.
@@ -5031,7 +5932,7 @@
</param>
</function>
- <function name="PutFile" functionID="PutFileID" messagetype="request">
+ <function name="PutFile" functionID="PutFileID" messagetype="request" since="3.0">
<description>
Used to push a binary data onto the module from a mobile device, such as icons and album art
Not supported on first generation of SDL enabled modules.
@@ -5073,9 +5974,12 @@
If offset is set to 0, then length is the total length of the file to be downloaded
</description>
</param>
+ <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false" since="5.0">
+ <description> Additional CRC32 checksum to protect data integrity up to 512 Mbits </description>
+ </param>
</function>
- <function name="PutFile" functionID="PutFileID" messagetype="response">
+ <function name="PutFile" functionID="PutFileID" messagetype="response" since="3.0">
<description>Response is sent, when the file data was copied (success case). Or when an error occurred.</description>
<description>Not supported on first generation SDL enabled vehicles. </description>
<param name="success" type="Boolean" platform="documentation" mandatory="true">
@@ -5092,13 +5996,17 @@
<element name="GENERIC_ERROR"/>
<element name="REJECTED"/>
<element name="UNSUPPORTED_REQUEST"/>
+ <element name="CORRUPTED_DATA"/>
</param>
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
<description>
Provides the total local space available in SDL Core for the registered app.
If the transfer has systemFile enabled, then the value will be set to 0 automatically.
</description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
</param>
<param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
@@ -5106,7 +6014,7 @@
</param>
</function>
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="request">
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="request" since="3.0">
<description>
Used to delete a file resident on the module in the app's local cache.
Not supported on first generation SDL enabled vehicles.
@@ -5118,7 +6026,7 @@
</function>
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="response">
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="response" since="3.0">
<description>
Response is sent, when the file data was deleted (success case). Or when an error occurred.
Not supported on First generation SDL enabled vehicles.
@@ -5139,8 +6047,11 @@
<element name="UNSUPPORTED_REQUEST"/>
</param>
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
<description>Provides the total local space available on the module for the registered app.</description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
</param>
<param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
@@ -5148,14 +6059,14 @@
</param>
</function>
- <function name="ListFiles" functionID="ListFilesID" messagetype="request">
+ <function name="ListFiles" functionID="ListFilesID" messagetype="request" since="3.0">
<description>
Requests the current list of resident filenames for the registered app.
Not supported on first generation SDL enabled vehicles.
</description>
</function>
- <function name="ListFiles" functionID="ListFilesID" messagetype="response">
+ <function name="ListFiles" functionID="ListFilesID" messagetype="response" since="3.0">
<description>
Returns the current list of resident filenames for the registered app along with the current space available
Not supported on First generation SDL enabled vehicles.
@@ -5183,8 +6094,11 @@
</description>
</param>
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
<description>Provides the total local space available on the module for the registered app.</description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
</param>
<param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
@@ -5192,7 +6106,7 @@
</param>
</function>
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request">
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request" since="3.0">
<description>
Used to set existing local file on the module as the app's icon
Not supported on first generation SDL enabled vehicles.
@@ -5204,7 +6118,7 @@
</function>
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response">
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response" since="3.0">
<description>
Response is sent, when the file data was copied (success case). Or when an error occurred.
Not supported on First generation SDL enabled vehicles.
@@ -5232,7 +6146,7 @@
</function>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request">
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" since="3.0">
<description>
Used to set an alternate display layout.
If not sent, default screen for given platform will be shown
@@ -5244,10 +6158,13 @@
Currently only predefined screen layouts are defined.
</description>
</param>
-
+
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
</function>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response">
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -5274,11 +6191,11 @@
</param>
<param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
</param>
<param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
</param>
<param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
@@ -5287,7 +6204,7 @@
</function>
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" >
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" since="3.0">
<description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)</description>
<param name="requestType" type="RequestType" mandatory="true">
<description>
@@ -5295,6 +6212,11 @@
Note that Proprietary requests should forward the binary data to the known proprietary module on the system.
</description>
</param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
<param name="fileName" type="String" maxlength="255" mandatory="false">
<description>
Filename of HTTP data to store in predefined system staging area.
@@ -5304,7 +6226,7 @@
</param>
</function>
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" >
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5330,7 +6252,7 @@
</param>
</function>
- <function name="SendLocation" functionID="SendLocationID" messagetype="request">
+ <function name="SendLocation" functionID="SendLocationID" messagetype="request" since="3.0">
<param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
</param>
<param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
@@ -5361,21 +6283,21 @@
</description>
</param>
- <param name="timeStamp" type="DateTime" mandatory="false">
+ <param name="timeStamp" type="DateTime" mandatory="false" since="4.1">
<description>
timestamp in ISO 8601 format
</description>
</param>
- <param name="address" type="OASISAddress" mandatory="false">
+ <param name="address" type="OASISAddress" mandatory="false" since="4.1">
<description>Address to be used for setting destination</description>
</param>
- <param name="deliveryMode" type="DeliveryMode" mandatory="false">
+ <param name="deliveryMode" type="DeliveryMode" mandatory="false" since="4.1">
<description>Defines the mode of prompt for user</description>
</param>
</function>
- <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
+ <function name="SendLocation" functionID="SendLocationID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5398,7 +6320,7 @@
</param>
</function>
- <function name="DialNumber" functionID="DialNumberID" messagetype="request">
+ <function name="DialNumber" functionID="DialNumberID" messagetype="request" since="3.0">
<description>Dials a phone number and switches to phone application.</description>
<param name="number" type="String" maxlength="40" mandatory="true">
@@ -5409,7 +6331,7 @@
</param>
</function>
- <function name="DialNumber" functionID="DialNumberID" messagetype="response">
+ <function name="DialNumber" functionID="DialNumberID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
@@ -5431,7 +6353,7 @@
</param>
</function>
- <function name="ButtonPress" functionID="ButtonPressID" messagetype="request">
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="request" since="4.5">
<param name="moduleType" type="ModuleType" mandatory="true">
<description>The module where the button should be pressed</description>
</param>
@@ -5443,7 +6365,7 @@
</param>
</function>
- <function name="ButtonPress" functionID="ButtonPressID" messagetype="response">
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="response" since="4.5">
<param name="resultCode" type="Result" platform="documentation" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
@@ -5464,22 +6386,26 @@
</param>
</function>
- <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request">
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request" since="4.5">
<param name="moduleType" type="ModuleType" mandatory="true">
<description>
The type of a RC module to retrieve module data from the vehicle.
In the future, this should be the Identification of a module.
</description>
</param>
- <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
+ <param name="subscribe" type="Boolean" mandatory="false" since="4.5.1">
<description>
- If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType.
- If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType.
+ If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is not included, the subscription status of the app for the requested moduleType will remain unchanged.
</description>
+ <history>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false" since="4.5" until="4.5.1"/>
+ </history>
</param>
</function>
- <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response">
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response" since="4.5">
<param name="moduleData" type="ModuleData" mandatory="true">
</param>
<param name="resultCode" type="Result" platform="documentation" mandatory="true">
@@ -5510,13 +6436,13 @@
</param>
</function>
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request" since="4.5">
<param name="moduleData" type="ModuleData" mandatory="true">
<description>The module data to set for the requested RC module.</description>
</param>
</function>
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response">
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response" since="4.5">
<description>Used to set the values of one remote control module </description>
<param name="moduleData" type="ModuleData" mandatory="true">
</param>
@@ -5543,11 +6469,11 @@
</param>
</function>
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request">
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request" since="4.1">
<description>To subscribe in getting changes for Waypoints/destinations</description>
</function>
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response">
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response" since="4.1">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5566,14 +6492,14 @@
</param>
</function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request" since="4.1">
<description>Request for getting waypoint/destination data.</description>
<param name="wayPointType" type="WayPointType" mandatory="true">
<description>To request for either the destination only or for all waypoints including destination</description>
</param>
</function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response">
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response" since="4.1">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5597,11 +6523,11 @@
</param>
</function>
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request">
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request" since="4.1">
<description>Request to unsubscribe from WayPoints and Destination</description>
</function>
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response">
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response" since="4.1">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5623,14 +6549,14 @@
</param>
</function>
- <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request">
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request" since="4.5">
<description>Request for expanded information about a supported system/HMI capability</description>
<param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
<description>The type of system capability to get more information on</description>
</param>
</function>
- <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response">
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response" since="4.5">
<param name="systemCapability" type="SystemCapability" mandatory="true">
</param>
<param name="resultCode" type="Result" platform="documentation" mandatory="true">
@@ -5660,14 +6586,14 @@
</param>
</function>
- <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request">
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request" since="4.5">
<description>Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
<param name="hapticRectData" type="HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
<description>Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared</description>
</param>
</function>
- <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response">
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response" since="4.5">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false if failed </description>
</param>
@@ -5683,7 +6609,7 @@
<!-- Notifications -->
- <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
+ <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
<param name="hmiLevel" type="HMILevel" mandatory="true">
<description>See HMILevel</description>
</param>
@@ -5695,37 +6621,44 @@
<param name="systemContext" type="SystemContext" mandatory="true">
<description>See SystemContext</description>
</param>
+
+ <param name="videoStreamingState" type="VideoStreamingState" mandatory="false" defvalue="STREAMABLE" since="5.0">
+ <description>
+ See VideoStreamingState.
+ If it is NOT_STREAMABLE, the app must stop streaming video to SDL Core(stop service).
+ </description>
+ </param>
</function>
- <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification">
+ <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification" since="1.0">
<param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
<description>See AppInterfaceUnregisteredReason</description>
</param>
</function>
- <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification">
+ <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification" since="1.0">
<description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
<param name="buttonName" type="ButtonName" mandatory="true"/>
<param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
<description>Indicates whether this is an UP or DOWN event.</description>
</param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
<description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
</param>
</function>
- <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification">
+ <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification" since="1.0">
<description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
<param name="buttonName" type="ButtonName" mandatory="true"/>
<param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
<description>Indicates whether this is a LONG or SHORT button press event.</description>
</param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
<description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
</param>
</function>
- <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification">
+ <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification" since="2.0">
<description>Callback for the periodic and non periodic vehicle data read function.</description>
<param name="gps" type="GPSData" mandatory="false">
<description>See GPSData</description>
@@ -5745,9 +6678,15 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number.</description>
</param>
@@ -5787,6 +6726,12 @@
<param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Vehicle Data -->
<param name="eCallInfo" type="ECallInfo" mandatory="false">
@@ -5808,7 +6753,7 @@
</function>
- <function name="OnCommand" functionID="OnCommandID" messagetype="notification">
+ <function name="OnCommand" functionID="OnCommandID" messagetype="notification" since="1.0">
<param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>Command ID, which is related to a specific menu entry</description>
</param>
@@ -5818,32 +6763,32 @@
</param>
</function>
- <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" >
+ <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" since="1.0">
<description>Provides applications with notifications specific to the current TBT client status on the module</description>
<param name="state" type="TBTState" mandatory="true">
<description>Current State of TBT client</description>
</param>
</function>
- <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" >
+ <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" since="1.0">
<description>Provides driver distraction state to mobile applications</description>
<param name="state" type="DriverDistractionState" mandatory="true">
<description>Current State of Driver Distraction</description>
</param>
</function>
- <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" >
+ <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" since="2.0">
<description>Provides update to app of which policy-table-enabled functions are available</description>
<param name="permissionItem" type="PermissionItem" minsize="0" maxsize="500" array="true" mandatory="true">
<description>Change in permissions for a given set of RPCs</description>
</param>
</function>
- <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification">
+ <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification" since="2.0">
<description>Binary data is in binary part of hybrid msg</description>
</function>
- <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification">
+ <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification" since="2.0">
<param name="language" type="Language" mandatory="true">
<description>Current SDL voice engine (VR+TTS) language</description>
</param>
@@ -5852,7 +6797,7 @@
</param>
</function>
- <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" >
+ <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" since="3.0">
<description>On-screen keyboard event.</description>
<description>Can be full string or individual keypresses depending on keyboard mode.</description>
@@ -5870,7 +6815,7 @@
</function>
- <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" >
+ <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" since="3.0">
<description>Notifies about touch events on the screen's prescribed area</description>
<param name="type" type="TouchType" mandatory="true">
<description>The type of touch event.</description>
@@ -5880,7 +6825,7 @@
</param>
</function>
- <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" >
+ <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" since="3.0">
<description>
An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
@@ -5888,6 +6833,11 @@
<param name="requestType" type="RequestType" mandatory="true">
<description>The type of system request.</description>
</param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
<param name="url" type="String" maxlength="1000" mandatory="false">
<description>
Optional URL for HTTP requests.
@@ -5912,7 +6862,7 @@
</param>
</function>
- <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification">
+ <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification" since="3.0">
<description>
Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
@@ -5922,23 +6872,36 @@
</param>
</function>
- <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification">
+ <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification" since="4.1">
<description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
<param name="wayPoints" type="LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
<description>See LocationDetails</description>
</param>
</function>
- <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification">
+ <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification" since="4.5">
<param name="moduleData" type="ModuleData" mandatory="true">
</param>
</function>
+
+ <function name="OnRCStatus" functionID="OnRCStatusID" messagetype="notification" since="5.0">
+ <description>Issued by SDL to notify the application about remote control status change on SDL</description>
+ <param name="allowed" type="Boolean" mandatory="false">
+ <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
+ </param>
+ <param name="allocatedModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
+ </param>
+ <param name="freeModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
+ </param>
+ </function>
<!-- ~~~~~~~~~~~~~~~~~~ -->
<!-- Ford Specific APIs -->
<!-- ~~~~~~~~~~~~~~~~~~ -->
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" >
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" since="1.0">
<description>
Allows encoded data in the form of SyncP packets to be sent to the SYNC module.
Legacy / v1 Protocol implementation; use SyncPData instead.
@@ -5951,7 +6914,7 @@
</param>
</function>
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" >
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -6002,7 +6965,7 @@
</function>
-->
- <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" >
+ <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" since="1.0">
<description>
Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device.
Legacy / v1 Protocol implementation; responds to EncodedSyncPData.
diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml
deleted file mode 100644
index 0c86d4eea3..0000000000
--- a/src/components/interfaces/QT_HMI_API.xml
+++ /dev/null
@@ -1,5517 +0,0 @@
-<!--
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE. -->
-
-<!--
- * DEPRECATED, use HMI_API instead. This API is used with the DBus adapter,
- * which will be removed or refactored to use HMI_API in the next major release
--->
-<interfaces name="SmartDeviceLink HMI API">
- <interface name="Common" version="1.1" date="2013-10-02">
- <enum name="Result">
- <element name="SUCCESS" value="0"/>
- <element name="UNSUPPORTED_REQUEST" value="1"/>
- <element name="UNSUPPORTED_RESOURCE" value="2"/>
- <element name="DISALLOWED" value="3"/>
- <element name="REJECTED" value="4"/>
- <element name="ABORTED" value="5"/>
- <element name="IGNORED" value="6"/>
- <element name="RETRY" value="7"/>
- <element name="IN_USE" value="8"/>
- <element name="DATA_NOT_AVAILABLE" value="9"/>
- <element name="TIMED_OUT" value="10"/>
- <element name="INVALID_DATA" value="11"/>
- <element name="CHAR_LIMIT_EXCEEDED" value="12"/>
- <element name="INVALID_ID" value="13"/>
- <element name="DUPLICATE_NAME" value="14"/>
- <element name="APPLICATION_NOT_REGISTERED" value="15"/>
- <element name="WRONG_LANGUAGE" value="16"/>
- <element name="OUT_OF_MEMORY" value="17"/>
- <element name="TOO_MANY_PENDING_REQUESTS" value="18"/>
- <element name="NO_APPS_REGISTERED" value="19"/>
- <element name="NO_DEVICES_CONNECTED" value="20"/>
- <element name="WARNINGS" value="21"/>
- <element name="GENERIC_ERROR" value="22"/>
- <element name="USER_DISALLOWED" value="23"/>
- <element name="TRUNCATED_DATA" value="24"/>
- <element name="SAVED" value="25"/>
- <element name="READ_ONLY" value="26"/>
- </enum>
- <enum name="TransportType">
- <description>
- Lists of the transport types used for device connection to HU.
- </description>
- <element name="BLUETOOTH"/>
- <element name="USB_IOS"/>
- <element name="USB_AOA"/>
- <element name="WIFI"/>
- </enum>
- <enum name="ButtonName">
- <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
- <element name="OK"/>
- <element name="SEEKLEFT"/>
- <element name="SEEKRIGHT"/>
- <element name="TUNEUP"/>
- <element name="TUNEDOWN"/>
- <element name="PRESET_0"/>
- <element name="PRESET_1"/>
- <element name="PRESET_2"/>
- <element name="PRESET_3"/>
- <element name="PRESET_4"/>
- <element name="PRESET_5"/>
- <element name="PRESET_6"/>
- <element name="PRESET_7"/>
- <element name="PRESET_8"/>
- <element name="PRESET_9"/>
- <element name="CUSTOM_BUTTON"/>
- <element name="SEARCH"/>
- </enum>
- <enum name="ButtonEventMode">
- <element name="BUTTONUP">
- <description>A button has been released up</description>
- </element>
- <element name="BUTTONDOWN">
- <description>A button has been pressed down</description>
- </element>
- </enum>
- <enum name="ButtonPressMode">
- <element name="LONG">
- <description>A button was released, after it was pressed for a long time. Actual timing is defined by head unit and may vary</description>
- </element>
- <element name="SHORT">
- <description>A button was released, after it was pressed for a short time. Actual timing is defined by head unit and may vary</description>
- </element>
- </enum>
- <enum name="Language">
- <element name="EN-US" internal_name="EN_US">
- <description>English - US</description>
- </element>
- <element name="ES-MX" internal_name="ES_MX">
- <description>Spanish - Mexico</description>
- </element>
- <element name="FR-CA" internal_name="FR_CA">
- <description>French - Canada</description>
- </element>
- <element name="DE-DE" internal_name="DE_DE">
- <description>German - Germany</description>
- </element>
- <element name="ES-ES" internal_name="ES_ES">
- <description>Spanish - Spain</description>
- </element>
- <element name="EN-GB" internal_name="EN_GB">
- <description>English - GB</description>
- </element>
- <element name="RU-RU" internal_name="RU_RU">
- <description>Russian - Russia</description>
- </element>
- <element name="TR-TR" internal_name="TR_TR">
- <description>Turkish - Turkey</description>
- </element>
- <element name="PL-PL" internal_name="PL_PL">
- <description>Polish - Poland</description>
- </element>
- <element name="FR-FR" internal_name="FR_FR">
- <description>French - France</description>
- </element>
- <element name="IT-IT" internal_name="IT_IT">
- <description>Italian - Italy</description>
- </element>
- <element name="SV-SE" internal_name="SV_SE">
- <description>Swedish - Sweden</description>
- </element>
- <element name="PT-PT" internal_name="PT_PT">
- <description>Portuguese - Portugal</description>
- </element>
- <element name="NL-NL" internal_name="NL_NL">
- <description>Dutch (Standard) - Netherlands</description>
- </element>
- <element name="EN-AU" internal_name="EN_AU">
- <description>English - Australia</description>
- </element>
- <element name="ZH-CN" internal_name="ZH_CN">
- <description>Mandarin - China</description>
- </element>
- <element name="ZH-TW" internal_name="ZH_TW">
- <description>Mandarin - Taiwan</description>
- </element>
- <element name="JA-JP" internal_name="JA_JP">
- <description>Japanese - Japan</description>
- </element>
- <element name="AR-SA" internal_name="AR_SA">
- <description>Arabic - Saudi Arabia</description>
- </element>
- <element name="KO-KR" internal_name="KO_KR">
- <description>Korean - South Korea</description>
- </element>
- <element name="PT-BR" internal_name="PT_BR">
- <description>Portuguese - Brazil</description>
- </element>
- <element name="CS-CZ" internal_name="CS_CZ">
- <description>Czech - Czech Republic</description>
- </element>
- <element name="DA-DK" internal_name="DA_DK">
- <description>Danish - Denmark</description>
- </element>
- <element name="NO-NO" internal_name="NO_NO">
- <description>Norwegian - Norway</description>
- </element>
- <element name="NL-BE" internal_name="NL_BE">
- <description>Dutch (Flemish) - Belgium</description>
- </element>
- <element name="EL-GR" internal_name="EL_GR">
- <description>Greek - Greece</description>
- </element>
- <element name="HU-HU" internal_name="HU_HU">
- <description>Hungarian - Hungary</description>
- </element>
- <element name="FI-FI" internal_name="FI_FI">
- <description>Finnish - Finland</description>
- </element>
- <element name="SK-SK" internal_name="SK_SK">
- <description>Slovak - Slovakia</description>
- </element>
- <element name="EN-IN" internal_name="EN_IN">
- <description>English - India</description>
- </element>
- <element name="TH-TH" internal_name="TH_TH">
- <description>Thai - Thailand</description>
- </element>
- <element name="EN-SA" internal_name="EN_SA">
- <description>English - Middle East</description>
- </element>
- <element name="HE-IL" internal_name="HE_IL">
- <description>Hebrew - Israel</description>
- </element>
- <element name="RO-RO" internal_name="RO_RO">
- <description>Romanian - Romania</description>
- </element>
- <element name="UK-UA" internal_name="UK_UA">
- <description>Ukrainian - Ukraine</description>
- </element>
- <element name="ID-ID" internal_name="ID_ID">
- <description>Indonesian - Indonesia</description>
- </element>
- <element name="VI-VN" internal_name="VI_VN">
- <description>Vietnamese - Vietnam</description>
- </element>
- <element name="MS-MY" internal_name="MS_MY">
- <description>Malay - Malaysia</description>
- </element>
- <element name="HI-IN" internal_name="HI_IN">
- <description>Hindi - India</description>
- </element>
- </enum>
- <enum name="SoftButtonType">
- <description>Contains information about the SoftButton capabilities.</description>
- <element name="TEXT" internal_name="SBT_TEXT"/>
- <element name="IMAGE" internal_name="SBT_IMAGE"/>
- <element name="BOTH" internal_name="SBT_BOTH"/>
- </enum>
- <enum name="SystemAction">
- <description>Enumeration that describes system actions that can be triggered.</description>
- <element name="DEFAULT_ACTION">
- <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
- </element>
- <element name="STEAL_FOCUS">
- <description>The calling app's dialog or related event should clear and the app should be brought into HMI_FULL.</description>
- </element>
- <element name="KEEP_CONTEXT">
- <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
- </element>
- </enum>
- <enum name="AppHMIType">
- <description>Enumeration listing possible app types.</description>
- <element name="DEFAULT"/>
- <element name="COMMUNICATION"/>
- <element name="MEDIA"/>
- <element name="MESSAGING"/>
- <element name="NAVIGATION"/>
- <element name="INFORMATION"/>
- <element name="SOCIAL"/>
- <element name="BACKGROUND_PROCESS"/>
- <element name="TESTING"/>
- <element name="SYSTEM"/>
- </enum>
- <enum name="WayPointType">
- <description>Describes what kind of waypoint is requested/provided.</description>
- <element name="ALL" />
- <element name="DESTINATION" />
- </enum>
-
- <struct name="Coordinate">
- <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
- <description>Latitude of the location.</description>
- </param>
- <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
- <description>Longitude of the location.</description>
- </param>
- </struct>
- <enum name="LayoutMode">
- <description>For touchscreen interactions, the mode of how the choices are presented.</description>
- <element name="ICON_ONLY"/>
- <description>This mode causes the interaction to display the previous set of choices as icons.</description>
- <element name="ICON_WITH_SEARCH"/>
- <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
- <element name="LIST_ONLY"/>
- <description>This mode causes the interaction to display the previous set of choices as a list.</description>
- <element name="LIST_WITH_SEARCH"/>
- <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
- <element name="KEYBOARD"/>
- <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
- </enum>
- <enum name="DeactivateReason">
- <description>Specifies the functionality the User has switched to.</description>
- <element name="AUDIO">
- <description>Navigated to audio(radio, etc)</description>
- </element>
- <element name="PHONECALL">
- <description>Navigated to make a call.</description>
- </element>
- <element name="NAVIGATIONMAP">
- <description>Navigated to navigation screen.</description>
- </element>
- <element name="PHONEMENU">
- <description>Navigated to phone menu.</description>
- </element>
- <element name="SYNCSETTINGS">
- <description>Navigated to settings menu.</description>
- </element>
- <element name="GENERAL">
- <description>Other screens navigation apart from other mobile app.</description>
- </element>
- </enum>
- <enum name="ClockUpdateMode">
- <description>Describes how the media clock timer should behave on the platform</description>
- <element name="COUNTUP"/>
- <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
- <element name="COUNTDOWN"/>
- <description>Starts the media clock timer counting downwards, as in time remaining.</description>
- <element name="PAUSE"/>
- <description>Pauses the media clock timer</description>
- <element name="RESUME"/>
- <description>Resume the media clock timer</description>
- <element name="CLEAR"/>
- <description>Clears the media clock timer (previously done through Show-&gt;mediaClock)</description>
- </enum>
- <enum name="SystemContext">
- <description>Enumeration that describes possible contexts the application might be in on HU.</description>
- <description>Communicated to whichever app is in HMI FULL, except Alert.</description>
- <element name="MAIN" internal_name="SYSCTXT_MAIN">
- <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
- <description> There is currently no user interaction (user-initiated or app-initiated) with the head-unit</description>
- </element>
- <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
- <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
- </element>
- <element name="MENU" internal_name="SYSCTXT_MENU">
- <description>The system is currently displaying a system or in-App menu onscreen.</description>
- </element>
- <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
- <description>The app's display HMI is currently obscuring with either a system or other app's overlay (except of Alert element).</description>
- </element>
- <element name="ALERT" internal_name="SYSCTXT_ALERT">
- <description>Broadcast only to whichever app has an alert currently being displayed.</description>
- </element>
- </enum>
- <enum name="HmiZoneCapabilities">
- <description>Contains information about the HMI zone capabilities.</description>
- <description>For future use.</description>
- <element name="FRONT"/>
- <element name="BACK"/>
- </enum>
- <enum name="SpeechCapabilities">
- <description>Contains information about the TTS capabilities.</description>
- <element name="TEXT" internal_name="SC_TEXT"/>
- <element name="SAPI_PHONEMES"/>
- <element name="LHPLUS_PHONEMES"/>
- <element name="PRE_RECORDED"/>
- <element name="SILENCE"/>
- </enum>
- <enum name="VrCapabilities">
- <description>Contains information about the VR capabilities.</description>
- <element name="TEXT" internal_name="VR_TEXT"/>
- </enum>
- <enum name="PrerecordedSpeech">
- <description>Contains a list of prerecorded speech items present on the platform.</description>
- <element name="HELP_JINGLE"/>
- <element name="INITIAL_JINGLE"/>
- <element name="LISTEN_JINGLE"/>
- <element name="POSITIVE_JINGLE"/>
- <element name="NEGATIVE_JINGLE"/>
- </enum>
- <enum name="TBTState">
- <description>Enumeration that describes possible states of turn-by-turn client or SmartDeviceLink app.</description>
- <element name="ROUTE_UPDATE_REQUEST"/>
- <element name="ROUTE_ACCEPTED"/>
- <element name="ROUTE_REFUSED"/>
- <element name="ROUTE_CANCELLED"/>
- <element name="ETA_REQUEST"/>
- <element name="NEXT_TURN_REQUEST"/>
- <element name="ROUTE_STATUS_REQUEST"/>
- <element name="ROUTE_SUMMARY_REQUEST"/>
- <element name="TRIP_STATUS_REQUEST"/>
- <element name="ROUTE_UPDATE_REQUEST_TIMEOUT"/>
- </enum>
- <enum name="ApplicationsCloseReason">
- <description>Describes the reasons for exiting all of applications.</description>
- <element name="IGNITION_OFF"/>
- <element name="MASTER_RESET"/>
- <element name="FACTORY_DEFAULTS"/>
- <element name="SUSPEND"/>
- </enum>
- <enum name="DisplayType">
- <description>The possible types of HU display.</description>
- <element name="CID">
- <description> A 2-line x 20 character "dot matrix" display </description>
- </element>
- <element name="TYPE2">
- <description> 1 line older radio head unit.</description>
- </element>
- <element name="TYPE5">
- <description> Old radio head unit.</description>
- </element>
- <element name="NGN">
- <description> Next Generation Navigation display.</description>
- </element>
- <element name="GEN2_8_DMA">
- <description> GEN-2, 8 inch display.</description>
- </element>
- <element name="GEN2_6_DMA">
- <description> GEN-2, 6 inch display.</description>
- </element>
- <element name="MFD3">
- <description> 3 inch GEN1.1 display </description>
- </element>
- <element name="MFD4">
- <description> 4 inch GEN1.1 display </description>
- </element>
- <element name="MFD5">
- <description> 5 inch GEN1.1 display </description>
- </element>
- <element name="GEN3_8_INCH"/>
- </enum>
- <enum name="ImageType">
- <description>Contains information about the type of image.</description>
- <element name="STATIC"/>
- <element name="DYNAMIC"/>
- </enum>
- <enum name="ApplicationExitReason">
- <element name="DRIVER_DISTRACTION_VIOLATION">
- <description>By getting this value, SDL puts the named app to NONE HMILevel</description>
- </element>
- <element name="USER_EXIT">
- <description>By getting this value, SDL puts the named app to NONE HMILevel</description>
- </element>
- <element name="UNAUTHORIZED_TRANSPORT_REGISTRATION">
- <description>By getting this value, SDL unregisters the named application</description>
- </element>
- <element name="UNSUPPORTED_HMI_RESOURCE">
- <description>By getting this value, SDL unregisters the named application</description>
- </element>
- </enum>
- <enum name="TextFieldName">
- <element name="mainField1">
- <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="mainField2">
- <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="mainField3">
- <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
- </element>
- <element name="mainField4">
- <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="statusBar">
- <description>The status bar on NGN; applies to "Show"</description>
- </element>
- <element name="mediaClock">
- <description>Text value for MediaClock field; applies to "Show"</description>
- </element>
- <element name="mediaTrack">
- <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
- </element>
- <element name="alertText1">
- <description>The first line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="alertText2">
- <description>The second line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="alertText3">
- <description>The third line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="scrollableMessageBody">
- <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
- </element>
- <element name="initialInteractionText">
- <description> First line suggestion for a user response (in the case of VR enabled interaction</description>
- </element>
- <element name="navigationText1">
- <description> First line of navigation text</description>
- </element>
- <element name="navigationText2">
- <description> Second line of navigation text</description>
- </element>
- <element name="ETA">
- <description> Estimated Time of Arrival time for navigation</description>
- </element>
- <element name="totalDistance">
- <description> Total distance to destination for navigation</description>
- </element>
- <element name="audioPassThruDisplayText1">
- <description> First line of text for audio pass thru</description>
- </element>
- <element name="audioPassThruDisplayText2">
- <description> Second line of text for audio pass thru</description>
- </element>
- <element name="sliderHeader">
- <description> Header text for slider</description>
- </element>
- <element name="sliderFooter">
- <description> Footer text for slider</description>
- </element>
- <element name="menuName">
- <description> Primary text for Choice</description>
- </element>
- <element name="secondaryText">
- <description> Secondary text for Choice</description>
- </element>
- <element name="tertiaryText">
- <description> Tertiary text for Choice</description>
- </element>
- <element name="menuTitle">
- <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </element>
- <element name="timeToDestination"/>
- <element name="navigationText">
- <description>Navigation text for UpdateTurnList.</description>
- </element>
- <element name="notificationText">
- <description>Text of notification to be displayed on screen.</description>
- </element>
- <element name="locationName">
- <description> Optional name / title of intended location for SendLocation.</description>
- </element>
- <element name="locationDescription">
- <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
- <element name="addressLines">
- <description> Optional location address (if applicable) for SendLocation.</description>
- </element>
- <element name="phoneNumber">
- <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
- <!-- TO DO to be removed -->
- <element name="turnText"/>
- </enum>
- <enum name="MetadataType">
- <element name="mediaTitle">
- <description>The data in this field contains the title of the currently playing audio track.</description>
- </element>
- <element name="mediaArtist">
- <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
- </element>
- <element name="mediaAlbum">
- <description>The data in this field contains the album title of the currently playing audio track.</description>
- </element>
- <element name="mediaYear">
- <description>The data in this field contains the creation year of the currently playing audio track.</description>
- </element>
- <element name="mediaGenre">
- <description>The data in this field contains the genre of the currently playing audio track.</description>
- </element>
- <element name="mediaStation">
- <description>The data in this field contains the name of the current source for the media.</description>
- </element>
- <element name="rating">
- <description>The data in this field is a rating.</description>
- </element>
- <element name="currentTemperature">
- <description>The data in this field is the current temperature.</description>
- </element>
- <element name="maximumTemperature">
- <description>The data in this field is the maximum temperature for the day.</description>
- </element>
- <element name="minimumTemperature">
- <description>The data in this field is the minimum temperature for the day.</description>
- </element>
- <element name="weatherTerm">
- <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
- </element>
- <element name="humidity">
- <description>The data in this field describes the current humidity value.</description>
- </element>
- </enum>
- <enum name="ImageFieldName">
- <element name="softButtonImage">
- <description>The image field for SoftButton</description>
- </element>
- <element name="choiceImage">
- <description>The first image field for Choice</description>
- </element>
- <element name="choiceSecondaryImage">
- <description>The secondary image field for Choice</description>
- </element>
- <element name="vrHelpItem">
- <description>The image field for vrHelpItem</description>
- </element>
- <element name="turnIcon">
- <description>The image field for Turn</description>
- </element>
- <element name="menuIcon">
- <description>The image field for the menu icon in SetGlobalProperties</description>
- </element>
- <element name="cmdIcon">
- <description>The image field for AddCommand</description>
- </element>
- <element name="appIcon">
- <description>The image field for the app icon (set by setAppIcon)</description>
- </element>
- <element name="graphic">
- <description>The image field for Show</description>
- </element>
- <element name="showConstantTBTIcon">
- <description>The primary image field for ShowConstantTBT</description>
- </element>
- <element name="showConstantTBTNextTurnIcon">
- <description>The secondary image field for ShowConstantTBT</description>
- </element>
- <element name="locationImage">
- <description>The optional image of a destination / location</description>
- </element>
- </enum>
- <enum name="TextAlignment">
- <description>The list of possible alignments, left, right, or centered</description>
- <element name="LEFT_ALIGNED"/>
- <element name="RIGHT_ALIGNED"/>
- <element name="CENTERED"/>
- </enum>
- <enum name="DriverDistractionState">
- <description>Enumeration that describes possible states of driver distraction.</description>
- <element name="DD_ON"/>
- <element name="DD_OFF"/>
- </enum>
- <enum name="MediaClockFormat">
- <element name="CLOCK1">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
- Is used for Type II, NGN and CID head units.
- </description>
- </element>
- <element name="CLOCK2">
- <description>
- minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
- Is used for Type V head units.
- </description>
- </element>
- <element name="CLOCK3">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
- Is used for GEN1.1 (i.e. MFD3/4/5) head units.
- </description>
- </element>
- <element name="CLOCKTEXT1">
- <description>
- 5 characters possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for Type II head unit
- </description>
- </element>
- <element name="CLOCKTEXT2">
- <description>
- 5 chars possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for CID and NGN head unit
- </description>
- </element>
- <element name="CLOCKTEXT3">
- <description>
- 6 chars possible
- Format: 1|sp c c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for Type V head unit
- </description>
- </element>
- <element name="CLOCKTEXT4">
- <description>
- 6 chars possible
- Format: c :|sp c c : c c
- :|sp : colon or space
- c : character out of following character set: sp|0-9|[letters].
- Is used for GEN1.1 (i.e. MFD3/4/5) head units
- </description>
- </element>
- </enum>
- <enum name="VRCommandType">
- <element name="Choice">
- <description>Type that expound that current AddCommand should be pocessed as choise for initiated PerformInteraction request for current active on HMI.</description>
- </element>
- <element name="Command">
- <description>Type that expound that current AddCommand should be pocessed as common command for current application on HMI.</description>
- </element>
- </enum>
- <!--IVI part-->
- <enum name="ComponentVolumeStatus">
- <description>The volume status of a vehicle component.</description>
- <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
- <description> The data is unknown.</description>
- </element>
- <element name="NORMAL" internal_name="CVS_NORMAL">
- <description> The volume is normal.</description>
- </element>
- <element name="LOW" internal_name="CVS_LOW">
- <description> The volume is low.</description>
- </element>
- <element name="FAULT" internal_name="CVS_FAULT">
- <description> The module/sensor is currently faulted. </description>
- </element>
- <element name="ALERT" internal_name="CVS_ALERT">
- <description> The component`s volume is in critical level.</description>
- </element>
- <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
- <description> The data is not supported.</description>
- </element>
- </enum>
- <enum name="PRNDL">
- <description>The selected gear.</description>
- <element name="PARK">
- <description>Parking</description>
- </element>
- <element name="REVERSE">
- <description>Reverse gear</description>
- </element>
- <element name="NEUTRAL">
- <description>No gear</description>
- </element>
- <element name="DRIVE">
- </element>
- <element name="SPORT">
- <description>Drive Sport mode</description>
- </element>
- <element name="LOWGEAR">
- <description>1st gear hold</description>
- </element>
- <element name="FIRST">
- </element>
- <element name="SECOND">
- </element>
- <element name="THIRD">
- </element>
- <element name="FOURTH">
- </element>
- <element name="FIFTH">
- </element>
- <element name="SIXTH">
- </element>
- <element name="SEVENTH">
- </element>
- <element name="EIGHTH">
- </element>
- <element name="FAULT">
- </element>
- </enum>
- <enum name="VehicleDataEventStatus">
- <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
- <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
- <description> The system does not have the adequate information to send valid YES or NO states.</description>
- </element>
- <element name="NO" internal_name="VDES_NO">
- <description> The requested event is in NO state.</description>
- </element>
- <element name="YES" internal_name="VDES_YES">
- <description> The requested event is in YES state.</description>
- </element>
- <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
- <description> The requested data is not supported </description>
- </element>
- <element name="FAULT" internal_name="VDES_FAULT">
- <description> The module/sensor is currently faulted.</description>
- </element>
- </enum>
- <enum name="VehicleDataStatus">
- <description>Reflects the status of a binary vehicle data item.</description>
- <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
- </element>
- <element name="OFF" internal_name="VDS_OFF">
- </element>
- <element name="ON" internal_name="VDS_ON">
- </element>
- </enum>
- <enum name="IgnitionStableStatus">
- <description>Reflects the ignition switch stability.</description>
- <element name="IGNITION_SWITCH_NOT_STABLE">
- </element>
- <element name="IGNITION_SWITCH_STABLE">
- </element>
- <element name="MISSING_FROM_TRANSMITTER">
- <description> Either the data is not accessible or the sensor is broken.</description>
- </element>
- </enum>
- <enum name="IgnitionStatus">
- <description>Reflects the status of ignition.</description>
- <element name="UNKNOWN" internal_name="IS_UNKNOWN">
- <description> The information is not acceptable. </description>
- </element>
- <element name="OFF" internal_name="IS_OFF">
- <description> The ignition is off.</description>
- </element>
- <element name="ACCESSORY" internal_name="IS_ACCESSORY">
- <description> The accessories are active (power windows, audio, display, etc.).</description>
- </element>
- <element name="RUN" internal_name="IS_RUN">
- <description> Ignition is active.</description>
- </element>
- <element name="START" internal_name="IS_START">
- <description> Starter is switched.</description>
- </element>
- <element name="INVALID" internal_name="IS_INVALID">
- <description> The data is provided, but there is some sort of fault or problem.</description>
- </element>
- </enum>
- <enum name="DeviceLevelStatus">
- <description>Reflects the reported component status of the connected device, if reported.</description>
- <element name="ZERO_LEVEL_BARS">
- </element>
- <element name="ONE_LEVEL_BARS">
- </element>
- <element name="TWO_LEVEL_BARS">
- </element>
- <element name="THREE_LEVEL_BARS">
- </element>
- <element name="FOUR_LEVEL_BARS">
- </element>
- <element name="NOT_PROVIDED">
- </element>
- </enum>
- <enum name="PrimaryAudioSource">
- <description>Reflects the current primary audio source (if selected).</description>
- <element name="NO_SOURCE_SELECTED">
- </element>
- <element name="USB">
- </element>
- <element name="USB2">
- </element>
- <element name="BLUETOOTH_STEREO_BTST">
- </element>
- <element name="LINE_IN">
- </element>
- <element name="IPOD">
- </element>
- <element name="MOBILE_APP">
- </element>
- </enum>
- <enum name="CompassDirection">
- <description>The list of potential compass directions</description>
- <element name="NORTH">
- </element>
- <element name="NORTHWEST">
- </element>
- <element name="WEST">
- </element>
- <element name="SOUTHWEST">
- </element>
- <element name="SOUTH">
- </element>
- <element name="SOUTHEAST">
- </element>
- <element name="EAST">
- </element>
- <element name="NORTHEAST">
- </element>
- </enum>
- <enum name="Dimension">
- <description>The supported dimensions of the GPS</description>
- <element name="NO_FIX" internal_name="Dimension_NO_FIX">
- <description>No GPS at all</description>
- </element>
- <element name="2D" internal_name="Dimension_2D">
- <description>Longitude and lattitude</description>
- </element>
- <element name="3D" internal_name="Dimension_3D">
- <description>Longitude and lattitude and altitude</description>
- </element>
- </enum>
- <enum name="TouchType">
- <element name="BEGIN"/>
- <element name="MOVE"/>
- <element name="END"/>
- </enum>
- <enum name="WarningLightStatus">
- <description>Reflects the status of a cluster instrument warning light.</description>
- <element name="OFF" internal_name="WLS_OFF">
- </element>
- <element name="ON" internal_name="WLS_ON">
- </element>
- <element name="FLASH" internal_name="WLS_FLASH">
- </element>
- <element name="NOT_USED" internal_name="WLS_NOT_USED">
- </element>
- </enum>
- <enum name="VehicleDataResultCode">
- <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
- <element name="SUCCESS" internal_name="VDRC_SUCCESS"/>
- <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA"/>
- <element name="DISALLOWED" internal_name="VDRC_DISALLOWED"/>
- <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED"/>
- <element name="INVALID_ID" internal_name="VDRC_INVALID_ID"/>
- <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE"/>
- <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED"/>
- <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED"/>
- <element name="IGNORED" internal_name="VDRC_IGNORED"/>
- </enum>
- <enum name="VehicleDataType">
- <description>Defines the data types that can be published and subscribed to.</description>
- <element name="VEHICLEDATA_GPS">
- <description>Notifies GPSData may be subscribed</description>
- </element>
- <element name="VEHICLEDATA_SPEED"/>
- <element name="VEHICLEDATA_RPM"/>
- <element name="VEHICLEDATA_FUELLEVEL"/>
- <element name="VEHICLEDATA_FUELLEVEL_STATE"/>
- <element name="VEHICLEDATA_FUELCONSUMPTION"/>
- <element name="VEHICLEDATA_EXTERNTEMP"/>
- <element name="VEHICLEDATA_VIN"/>
- <element name="VEHICLEDATA_PRNDL"/>
- <element name="VEHICLEDATA_TIREPRESSURE"/>
- <element name="VEHICLEDATA_ODOMETER"/>
- <element name="VEHICLEDATA_BELTSTATUS"/>
- <element name="VEHICLEDATA_BODYINFO"/>
- <element name="VEHICLEDATA_DEVICESTATUS"/>
- <element name="VEHICLEDATA_ECALLINFO"/>
- <element name="VEHICLEDATA_AIRBAGSTATUS"/>
- <element name="VEHICLEDATA_EMERGENCYEVENT"/>
- <element name="VEHICLEDATA_CLUSTERMODESTATUS"/>
- <element name="VEHICLEDATA_MYKEY"/>
- <element name="VEHICLEDATA_BRAKING"/>
- <element name="VEHICLEDATA_WIPERSTATUS"/>
- <element name="VEHICLEDATA_HEADLAMPSTATUS"/>
- <element name="VEHICLEDATA_BATTVOLTAGE"/>
- <element name="VEHICLEDATA_ENGINETORQUE"/>
- <element name="VEHICLEDATA_ACCPEDAL"/>
- <element name="VEHICLEDATA_STEERINGWHEEL"/>
- </enum>
- <enum name="WiperStatus">
- <description>Reflects the status of the wipers.</description>
- <element name="OFF">
- <description> The wipers are off.</description>
- </element>
- <element name="AUTO_OFF">
- <description> The wipers are automatically off </description>
- </element>
- <element name="OFF_MOVING">
- <description> Means that though set to off, somehow the wipers have been engaged (physically moved enough to engage a wiping motion).</description>
- </element>
- <element name="MAN_INT_OFF">
- <description> The wipers are manually off after having been working.</description>
- </element>
- <element name="MAN_INT_ON">
- <description> The wipers are manually on.</description>
- </element>
- <element name="MAN_LOW">
- <description> The wipers are manually set to low speed.</description>
- </element>
- <element name="MAN_HIGH">
- <description> The wipers are manually set to high speed.</description>
- </element>
- <element name="MAN_FLICK">
- <description> The wipers are manually set for doing a flick.</description>
- </element>
- <element name="WASH">
- <description> The wipers are set to use the water from vehicle washer bottle for cleaning the windscreen.</description>
- </element>
- <element name="AUTO_LOW">
- <description> The wipers are automatically set to low speed.</description>
- </element>
- <element name="AUTO_HIGH">
- <description> The wipers are automatically set to high speed.</description>
- </element>
- <element name="COURTESYWIPE">
- <description> This is for when a user has just initiated a WASH and several seconds later a secondary wipe is automatically initiated to clear remaining fluid.</description>
- </element>
- <element name="AUTO_ADJUST">
- <description> This is set as the user moves between possible automatic wiper speeds.</description>
- </element>
- <element name="STALLED">
- <description> The wiper is stalled to its place. </description>
- </element>
- <element name="NO_DATA_EXISTS">
- <description> The sensor / module cannot provide any information for wiper.</description>
- </element>
- </enum>
- <enum name="SamplingRate">
- <description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="RATE_8KHZ"/>
- <element name="16KHZ" internal_name="RATE_16KHZ"/>
- <element name="22KHZ" internal_name="RATE_22KHZ"/>
- <element name="44KHZ" internal_name="RATE_44KHZ"/>
- </enum>
- <enum name="BitsPerSample">
- <description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="RATE_8_BIT"/>
- <element name="16_BIT" internal_name="RATE_16_BIT"/>
- </enum>
- <enum name="AudioType">
- <description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM"/>
- </enum>
- <enum name="KeyboardLayout">
- <description>Enumeration listing possible keyboard layouts.</description>
- <element name="QWERTY"/>
- <element name="QWERTZ"/>
- <element name="AZERTY"/>
- </enum>
- <enum name="KeyboardEvent">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="KEYPRESS"/>
- <element name="ENTRY_SUBMITTED"/>
- <element name="ENTRY_VOICE"/>
- <element name="ENTRY_CANCELLED"/>
- <element name="ENTRY_ABORTED"/>
- </enum>
- <enum name="KeypressMode">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="SINGLE_KEYPRESS">
- <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
- </element>
- <element name="QUEUE_KEYPRESSES">
- <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
- </element>
- <element name="RESEND_CURRENT_ENTRY">
- <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
- </element>
- </enum>
- <enum name="AmbientLightStatus">
- <description>Reflects the status of the ambient light sensor.</description>
- <element name="NIGHT"/>
- <element name="TWILIGHT_1"/>
- <element name="TWILIGHT_2"/>
- <element name="TWILIGHT_3"/>
- <element name="TWILIGHT_4"/>
- <element name="DAY"/>
- <element name="UNKNOWN"/>
- <element name="INVALID"/>
- </enum>
- <enum name="FileType">
- <description>Enumeration listing possible file types.</description>
- <element name="GRAPHIC_BMP"/>
- <element name="GRAPHIC_JPEG"/>
- <element name="GRAPHIC_PNG"/>
- <element name="AUDIO_WAVE"/>
- <element name="AUDIO_MP3"/>
- <element name="AUDIO_AAC"/>
- <element name="BINARY"/>
- <element name="JSON"/>
- </enum>
- <enum name="RequestType">
- <description>Enumeration listing possible asynchronous requests.</description>
- <element name="HTTP"/>
- <element name="FILE_RESUME"/>
- <element name="AUTH_REQUEST"/>
- <element name="AUTH_CHALLENGE"/>
- <element name="AUTH_ACK"/>
- <element name="PROPRIETARY"/>
- <element name="QUERY_APPS"/>
- <element name="LAUNCH_APP"/>
- <element name="LOCK_SCREEN_ICON_URL"/>
- <element name="TRAFFIC_MESSAGE_CHANNEL"/>
- <element name="DRIVER_PROFILE"/>
- <element name="VOICE_SEARCH"/>
- <element name="NAVIGATION"/>
- <element name="PHONE"/>
- <element name="CLIMATE"/>
- <element name="SETTINGS"/>
- <element name="VEHICLE_DIAGNOSTICS"/>
- <element name="EMERGENCY"/>
- <element name="MEDIA"/>
- <element name="FOTA"/>
- </enum>
- <enum name="ECallConfirmationStatus">
- <description>Reflects the status of the eCall Notification.</description>
- <element name="NORMAL" internal_name="ECCS_NORMAL">
- </element>
- <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
- </element>
- <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
- </element>
- <element name="CALL_COMPLETED">
- </element>
- <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
- </element>
- <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
- </element>
- <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
- </element>
- </enum>
- <enum name="VehicleDataNotificationStatus">
- <description>Reflects the status of a vehicle data notification.</description>
- <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
- </element>
- <element name="NORMAL" internal_name="VDNS_NORMAL">
- </element>
- <element name="ACTIVE" internal_name="VDNS_ACTIVE">
- </element>
- <element name="NOT_USED" internal_name="VDNS_NOT_USED">
- </element>
- </enum>
- <enum name="EmergencyEventType">
- <description>Reflects the emergency event status of the vehicle.</description>
- <element name="NO_EVENT" internal_name="EET_NO_EVENT">
- </element>
- <element name="FRONTAL" internal_name="EET_FRONTAL">
- </element>
- <element name="SIDE" internal_name="EET_SIDE">
- </element>
- <element name="REAR" internal_name="EET_REAR">
- </element>
- <element name="ROLLOVER" internal_name="EET_ROLLOVER">
- </element>
- <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="EET_FAULT">
- </element>
- </enum>
- <enum name="FuelCutoffStatus">
- <description>Reflects the status of the RCM fuel cutoff.</description>
- <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
- </element>
- <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
- </element>
- <element name="FAULT" internal_name="FCS_FAULT">
- </element>
- </enum>
- <enum name="PowerModeQualificationStatus">
- <description>Reflects the status of the current power mode qualification.</description>
- <element name="POWER_MODE_UNDEFINED">
- </element>
- <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
- </element>
- <element name="NOT_DEFINED">
- </element>
- <element name="POWER_MODE_OK">
- </element>
- </enum>
- <enum name="CarModeStatus">
- <description>Reflects the status of the current car mode.</description>
- <element name="NORMAL" internal_name="CMS_NORMAL">
- </element>
- <element name="FACTORY" internal_name="CMS_FACTORY">
- </element>
- <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
- </element>
- <element name="CRASH" internal_name="CMS_CRASH">
- </element>
- </enum>
- <enum name="PowerModeStatus">
- <description>Reflects the status of the current power mode.</description>
- <element name="KEY_OUT">
- </element>
- <element name="KEY_RECENTLY_OUT">
- </element>
- <element name="KEY_APPROVED_0">
- </element>
- <element name="POST_ACCESORY_0">
- </element>
- <element name="ACCESORY_1">
- </element>
- <element name="POST_IGNITION_1">
- </element>
- <element name="IGNITION_ON_2">
- </element>
- <element name="RUNNING_2">
- </element>
- <element name="CRANK_3">
- </element>
- </enum>
- <enum name="CharacterSet">
- <description>The list of potential character sets</description>
- <element name="TYPE2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="TYPE5SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID1SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- </enum>
- <!-- End of IVI part-->
- <enum name="AppPriority">
- <element name="EMERGENCY"/>
- <element name="NAVIGATION"/>
- <element name="VOICE_COMMUNICATION"/>
- <element name="COMMUNICATION"/>
- <element name="NORMAL"/>
- <element name="NONE"/>
- </enum>
-<enum name="MethodName">
- <description>Defines the type of the request which causes text-to-speech prompt</description>
- <element name="ALERT"/>
- <element name="SPEAK"/>
- <element name="AUDIO_PASS_THRU"/>
- <element name="ALERT_MANEUVER"/>
-</enum>
-
-<enum name="AlertType">
-<description>Defines the type of the request which causes text-to-speech prompt</description>
-<element name="UI"/>
-<element name="BOTH"/>
-</enum>
-
-<enum name="HMILevel">
- <element name="FULL"/>
- <element name="LIMITED"/>
- <element name="BACKGROUND"/>
- <element name="NONE"/>
-</enum>
-
-<enum name="EventTypes">
- <description>Reflects the current active event</description>
- <element name="AUDIO_SOURCE">
- <description>Navigated to audio(radio, etc)</description>
- </element>
- <element name="EMBEDDED_NAVI">
- <description>Navigated to navigation screen</description>
- </element>
- <element name="PHONE_CALL">
- <description>Phone call is active</description>
- </element>
- <element name="EMERGENCY_EVENT">
- <description>Active emergency event, active parking event</description>
- </element>
- <element name="DEACTIVATE_HMI">
- <description> GAL/DIO is active </description>
- </element>
-</enum>
-
-<enum name="VideoStreamingProtocol">
- <description>Enum for each type of video streaming protocol type.</description>
- <element name="RAW">
- <description>
- Raw stream bytes that contains no timestamp data and is the lowest supported video streaming
- </description>
- </element>
- <element name="RTP">
- <description>
- RTP facilitates the transfer of real-time data. Information provided by this protocol include
- timestamps (for synchronization), sequence numbers (for packet loss and reordering detection)
- and the payload format which indicates the encoded format of the data.
- </description>
- </element>
- <element name="RTSP">
- <description>
- The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the
- Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP)
- for media stream delivery. However, some vendors implement proprietary transport protocols.
- </description>
- </element>
- <element name="RTMP">
- <description>
- Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by
- Macromedia for streaming audio, video and data over the Internet, between a Flash player
- and a server. Macromedia is now owned by Adobe, which has released an incomplete version
- of the specification of the protocol for public use.
- </description>
- </element>
- <element name="WEBM">
- <description>
- The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and
- Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.
- </description>
- </element>
-</enum>
-
-<enum name="VideoStreamingCodec">
- <description>Enum for each type of video streaming codec.</description>
- <element name="H264">
- <description>
- A block-oriented motion-compensation-based video compression standard.
- As of 2014 it is one of the most commonly used formats for the recording, compression, and
- distribution of video content.
- </description>
- </element>
- <element name="H265">
- <description>
- High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video
- compression standard, one of several potential successors to the widely used AVC (H.264 or
- MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio
- at the same level of video quality, or substantially improved video quality at the same
- bit rate. It supports resolutions up to 8192x4320, including 8K UHD.
- </description>
- </element>
- <element name="Theora">
- <description>
- Theora is derived from the formerly proprietary VP3 codec, released into the public domain
- by On2 Technologies. It is broadly comparable in design and bitrate efficiency to
- MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of
- the features present in some of these other codecs. It is comparable in open standards
- philosophy to the BBC's Dirac codec.
- </description>
- </element>
- <element name="VP8">
- <description>
- VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and
- Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct
- successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for
- Open Media (AOMedia) are based on VP8.
- </description>
- </element>
- <element name="VP9">
- <description>
- Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD)
- and also enables lossless compression.
- </description>
- </element>
-</enum>
-
- <!-- Policies -->
- <enum name="UpdateResult">
- <element name="UP_TO_DATE"/>
- <element name="UPDATING"/>
- <element name="UPDATE_NEEDED"/>
- </enum>
- <enum name="SystemError">
- <element name="SYNC_REBOOTED"/>
- <element name="SYNC_OUT_OF_MEMMORY"/>
- </enum>
- <enum name="StatisticsType">
- <element name="iAPP_BUFFER_FULL"/>
- </enum>
- <enum name="ConsentSource">
- <element name="GUI"/>
- <element name="VUI"/>
- </enum>
- <enum name="DeviceState">
- <element name="UNKNOWN"/>
- <element name="UNPAIRED"/>
- </enum>
- <struct name="DeviceInfo">
- <param name="name" type="String" mandatory="true">
- <description>The name of the device connected.</description>
- </param>
- <param name="id" type="String" mandatory="true">
- <description>The ID of the device connected</description>
- </param>
- <param name="transportType" type="Common.TransportType" mandatory="false">
- <description>The transport type the named-app's-device is connected over HU(BlueTooth, USB or WiFi). It must be provided in OnAppRegistered and in UpdateDeviceList</description>
- </param>
- <param name="isSDLAllowed" type="Boolean" mandatory="false">
- <description>Sent by SDL in UpdateDeviceList. &#8217;true&#8217; &#8211; if device is allowed for PolicyTable Exchange; &#8216;false&#8217; &#8211; if device is NOT allowed for PolicyTable Exchange </description>
- </param>
- </struct>
- <struct name="UserFriendlyMessage" scope="internal">
- <param name="messageCode" type="String" mandatory="true"/>
- <param name="ttsString" type="String" mandatory="false"/>
- <param name="label" type="String" mandatory="false"/>
- <param name="line1" type="String" mandatory="false"/>
- <param name="line2" type="String" mandatory="false"/>
- <param name="textBody" type="String" mandatory="false"/>
- </struct>
- <struct name="PermissionItem">
- <param name="name" type="String" mandatory="true">
- <description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
- </param>
- <param name="id" type="Integer" mandatory="true">
- <description>Id of corresponding functional group, needed by SDL.</description>
- </param>
- <param name="allowed" type="Boolean" mandatory="false">
- <description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
- </param>
- </struct>
- <struct name="ServiceInfo">
- <param name="url" type="String" mandatory="true">
- <description>Get URL based on service type.</description>
- </param>
- <param name="policyAppId" type="String" mandatory="false">
- <description>Used if URL needed are specific for application.</description>
- </param>
- </struct>
- <!-- End of Policies -->
- <struct name="TextField">
- <param name="name" type="Common.TextFieldName" mandatory="true">
- <description>The name that identifies the field. See TextFieldName.</description>
- </param>
- <param name="characterSet" type="Common.CharacterSet" mandatory="true">
- <description>The character set that is supported in this field. See CharacterSet.</description>
- </param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
- <description>The number of characters in one row of this field.</description>
- </param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
- <description>The number of rows of this field.</description>
- </param>
- </struct>
- <struct name="ButtonCapabilities">
- <description>Contains the information about capabilities of a button.</description>
- <param name="name" type="Common.ButtonName" mandatory="true">
- <description>The name of the Button from the ButtonName enum</description>
- </param>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a short press. Whenever the button is pressed short, onButtonPressed(SHORT) should be invoked.</description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a LONG press. Whenever the button is pressed long, onButtonPressed(LONG) should be invoked.</description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent(DOWN) should be invoked. Whenever the button is released, onButtonEvent(UP) should be invoked.</description>
- </param>
- </struct>
- <struct name="VehicleDataResult">
- <description>Individual published data request result</description>
- <param name="dataType" type="Common.VehicleDataType" mandatory="true">
- <description>Defined published data element type.</description>
- </param>
- <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
- <description>Published data result code.</description>
- </param>
- </struct>
- <struct name="TouchCoord">
- <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The x coordinate of the touch.</description>
- </param>
- <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The y coordinate of the touch.</description>
- </param>
- </struct>
- <struct name="TouchEvent">
- <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
- <description>
- A touch's unique identifier. The application can track the current touch events by id.
- If a touch event has type begin, the id should be added to the set of touches.
- If a touch event has type end, the id should be removed from the set of touches.
- </description>
- </param>
- <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2147483647" minsize="1" maxsize="1000">
- <description>
- The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
- The timestamp is used to determined the rate of change of position of a touch.
- The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
- If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
- </description>
- </param>
- <param name="c" type="Common.TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
- </param>
- </struct>
- <struct name="PresetBankCapabilities">
- <description>Contains information about on-screen preset capabilities (whether the HW preset buttons could be duplicated with onscreen buttons).</description>
- <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
- <description>Must be true if onscreen custom presets are available.</description>
- </param>
- </struct>
- <struct name="Image">
- <param name="value" maxlength="65535" type="String" mandatory="true">
- <description>The path to the dynamic image stored on HU or the static binary image itself.</description>
- </param>
- <param name="imageType" type="Common.ImageType" mandatory="true">
- <description>Describes, whether it is a static or dynamic image.</description>
- </param>
- </struct>
- <struct name="SoftButton">
- <param name="type" type="Common.SoftButtonType" mandatory="true">
- <description>Describes, whether text, icon or both text and image should be displayed on the soft button. See softButtonType</description>
- </param>
- <param name="text" maxlength="500" type="String" mandatory="false">
- <description>Optional text to be displayed (if defined as TEXT or BOTH)</description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
- </param>
- <param name="isHighlighted" type="Boolean" mandatory="false">
- <description>If true, must be highlighted</description>
- <description>If false, must be not</description>
- </param>
- <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Value which must be returned via OnButtonPress / OnButtonEvent</description>
- </param>
- <param name="systemAction" type="Common.SystemAction" mandatory="true">
- <description>Parameter indicates whether clicking a SoftButton must call a specific system action. See SystemAction</description>
- </param>
- </struct>
- <struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to be spoken</description>
- <param name="text" type="String" mandatory="true" maxlength="500">
- <description>The text or phonemes to be spoken.</description>
- </param>
- <param name="type" type="Common.SpeechCapabilities" mandatory="true">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities.</description>
- </param>
- </struct>
- <struct name="HMIApplication">
- <description>Data type containing information about application needed by HMI.</description>
- <param name="appName" type="String" maxlength="100" mandatory="true">
- <description>The mobile application name, e.g. "Ford Drive Green".</description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Provides an abbreviated version of the app name (if needed), that may be displayed on the NGN media screen.</description>
- <description>If not provided, the appName should be used instead (and may be truncated if too long)</description>
- </param>
- <param name="icon" type="String" mandatory="false">
- <description>Path to application icon stored on HU.</description>
- </param>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
- <description>The ID, serial number, transport type the named-app's-device is connected over to HU.</description>
- </param>
- <param name="policyAppID" type="String" maxlength="50" minlength="1" mandatory="true">
- <description>Policy ID(=the appID the application registers with) of registered application.</description>
- </param>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- May not be empty.
- May not start with a new line character.
- Not unique value
- </description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Unique (during ignition cycle) id of the application. To be used in all RPCs sent by both HU system and SDL</description>
- </param>
- <param name="hmiDisplayLanguageDesired" type="Common.Language" mandatory="true">
- <description>The language the application intends to use on HU </description>
- </param>
- <param name="isMediaApplication" type="Boolean" mandatory="true">
- <description>Indicates whether it is a media or a non-media application.</description>
- </param>
- <param name="appType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>List of all applicable app types stating which classifications to be given to the app.</description>
- <description>e.g. for platforms like GEN2, this determines which "corner(s)" the app can populate.</description>
- </param>
- <param name="greyOut" type="Boolean" mandatory="false">
- <description>Indicates whether application should be dimmed on the screen.</description>
- <description>Applicable only for apps received through QueryApps and still not registered.</description>
- </param>
- <param name="requestType" type="Common.RequestType" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The list of SystemRequest's RequestTypes allowed by policies for the named application</description>
- <description>(the app's SystemRequest sent with RequestType out of this list will get 'disallowed' response from SDL).</description>
- <description>If SDL sends an empty array - any RequestType is allowed for this app.</description>
- <description>If SDL omits this parameter - none RequestType is allowed for this app</description>
- <description>(either this is a pre-registered app or such is dictated by policies).</description>
- </param>
- </struct>
- <struct name="MenuParams">
- <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>unique ID of the sub menu, the command must be added to.</description>
- <description>If not provided, the command must be added to the top level of the in application menu.</description>
- </param>
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
- <description>Position within the items that are at the top level of the in application menu.</description>
- <description>0 should insert at the front.</description>
- <description>1 should insert at the second position.</description>
- <description>if position is greater than or equal to the number of items on the top level, the the sub menu/command should be appended to the end.</description>
- <description>If this param is omitted the entry should be added at the end.</description>
- </param>
- <param name="menuName" type="String" maxlength="500" mandatory="true">
- <description>The name of the sub menu/command.</description>
- </param>
- </struct>
- <struct name="Choice">
- <description>A choice is an option given to the user which can be selected either by menu, or through voice recognition system.</description>
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description> The unique within the concerned application identifier for this choice </description>
- </param>
- <param name="menuName" type="String" maxlength="500" mandatory="false">
- <description> The name of the choice </description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description> The image for representing the choice </description>
- </param>
- <param name="secondaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
- </param>
- <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
- </param>
- <param name="secondaryImage" type="Image" mandatory="false">
- <description>Optional secondary image struct for choice</description>
- </param>
- </struct>
- <struct name="VrHelpItem">
- <param name="text" maxlength="500" type="String" mandatory="true">
- <description>Text to display for VR Help item</description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description>Image struct for VR Help item</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
- <description>Position to display item in VR Help list</description>
- </param>
- </struct>
- <struct name="TimeFormat">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
- <description>The hour of the media clock.</description>
- <description>Some units only support a max of 19 hours. If out of range, it should be rejected.</description>
- </param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- </struct>
- <struct name="TouchEventCapabilities">
- <param name="pressAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="multiTouchAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="doublePressAvailable" type="Boolean" mandatory="true">
- </param>
- </struct>
- <struct name="ImageResolution">
- <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution width.</description>
- </param>
- <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution height.</description>
- </param>
- </struct>
- <struct name="ScreenParams">
- <param name="resolution" type="Common.ImageResolution" mandatory="true">
- <description>The resolution of the prescribed screen area.</description>
- </param>
- <param name="touchEventAvailable" type="Common.TouchEventCapabilities" mandatory="false">
- <description>Types of screen touch events available in screen area.</description>
- </param>
- </struct>
- <struct name="ImageField">
- <param name="name" type="Common.ImageFieldName" mandatory="true">
- <description>The name that identifies the field. See ImageFieldName.</description>
- </param>
- <param name="imageTypeSupported" type="Common.FileType" maxsize="100" array="true" mandatory="false" minsize="1">
- <description>The image types that are supported in this field. See FileType.</description>
- </param>
- <param name="imageResolution" type="Common.ImageResolution" mandatory="false">
- <description>The image resolution of this field.</description>
- </param>
- </struct>
- <struct name="VideoStreamingFormat">
- <description>Video streaming formats and their specifications.</description>
- <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="true">
- <description>Protocol type, see VideoStreamingProtocol</description>
- </param>
- <param name="codec" type="Common.VideoStreamingCodec" mandatory="true">
- <description>Codec type, see VideoStreamingCodec</description>
- </param>
- </struct>
-
- <struct name="VideoConfig">
- <description>Configuration of a video stream.</description>
- <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="false">
- <description>The video protocol configuration</description>
- </param>
- <param name="codec" type="Common.VideoStreamingCodec" mandatory="false">
- <description>The video codec configuration</description>
- </param>
- <param name="width" type="Integer" mandatory="false">
- <description>Width of the video stream, in pixels.</description>
- </param>
- <param name="height" type="Integer" mandatory="false">
- <description>Height of the video stream, in pixels.</description>
- </param>
- </struct>
- <struct name="DisplayCapabilities">
- <description>Contains information about the display capabilities.</description>
- <param name="displayType" type="Common.DisplayType" mandatory="true">
- <description>The type of the display. See DisplayType</description>
- </param>
- <param name="textFields" type="Common.TextField" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all fields for text displaying supported by HU. See TextFieldName.</description>
- <description>If there are no textfields supported, the empty array must be returned</description>
- </param>
- <param name="imageFields" type="Common.ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>A set of all fields that support images. See ImageField</description>
- </param>
- <param name="mediaClockFormats" type="Common.MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
- </param>
- <param name="imageCapabilities" type="Common.ImageType" array="true" minsize="0" maxsize="2" mandatory="false">
- </param>
- <param name="graphicSupported" type="Boolean" mandatory="true">
- <description>The display's persistent screen supports referencing a static or dynamic image.</description>
- </param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="true">
- <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
- </param>
- <param name="screenParams" type="Common.ScreenParams" mandatory="false">
- <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
- </param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
- <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
- </param>
- </struct>
- <struct name="SoftButtonCapabilities">
- <description>Contains information about a SoftButton's capabilities.</description>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a short press.</description>
- <description>Whenever the button is pressed short, onButtonPressed( SHORT) must be invoked.</description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a LONG press.</description>
- <description>Whenever the button is pressed long, onButtonPressed( LONG) must be invoked.</description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>The button supports "button down" and "button up".</description>
- <description>Whenever the button is pressed, onButtonEvent( DOWN) must be invoked.</description>
- <description>Whenever the button is released, onButtonEvent( UP) must be invoked.</description>
- </param>
- <param name="imageSupported" type="Boolean" mandatory="true">
- <description>Must be true if the button supports referencing a static or dynamic image.</description>
- </param>
- </struct>
- <struct name="HMICapabilities">
- <param name="navigation" type="Boolean" mandatory="false">
- <description>Availability of build in Nav. True: Available, False: Not Available</description>
- </param>
- <param name="phoneCall" type="Boolean" mandatory="false">
- <description>Availability of build in phone. True: Available, False: Not Available</description>
- </param>
- </struct>
- <struct name="AudioPassThruCapabilities">
- <description>
- Describes different audio type configurations for PerformAudioPassThru.
- e.g. 8kHz,8-bit,PCM
- </description>
- <param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
- <param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
- <param name="audioType" type="Common.AudioType" mandatory="true"/>
- </struct>
- <struct name="TextFieldStruct">
- <param name="fieldName" type="Common.TextFieldName" mandatory="true">
- <description>The name of the field for displaying the text.</description>
- </param>
- <param name="fieldText" type="String" maxlength="500" mandatory="true">
- <description>The text itself.</description>
- </param>
- </struct>
- <struct name="KeyboardProperties">
- <description>Configuration of on-screen keyboard (if available).</description>
- <param name="language" type="Common.Language" mandatory="false">
- <description>The keyboard language.</description>
- </param>
- <param name="keyboardLayout" type="Common.KeyboardLayout" mandatory="false">
- <description>Desired keyboard layout.</description>
- </param>
- <param name="keypressMode" type="Common.KeypressMode" mandatory="false">
- <description>
- Desired keypress mode.
- If omitted, this value will be set to RESEND_CURRENT_ENTRY.
- </description>
- </param>
- <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Array of keyboard characters to enable.</description>
- <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
- <description>If omitted, the entire keyboard will be enabled.</description>
- </param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
- </param>
- </struct>
- <struct name="Turn">
- <param name="navigationText" type="Common.TextFieldStruct" mandatory="false">
- <description>Uses navigationText from TextFieldStruct.</description>
- </param>
- <param name="turnIcon" type="Common.Image" mandatory="false">
- </param>
- </struct>
- <struct name="VehicleType">
- <param name="make" type="String" maxlength="500" mandatory="false">
- <description>Make of the vehicle</description>
- <description>e.g. Ford</description>
- </param>
- <param name="model" type="String" maxlength="500" mandatory="false">
- <description>Model of the vehicle</description>
- <description>e.g. Fiesta</description>
- </param>
- <param name="modelYear" type="String" maxlength="500" mandatory="false">
- <description>Model Year of the vehicle</description>
- <description>e.g. 2013</description>
- </param>
- <param name="trim" type="String" maxlength="500" mandatory="false">
- <description>Trim of the vehicle</description>
- <description>e.g. SE</description>
- </param>
- </struct>
- <!--IVI part-->
- <struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>PDOP.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>HDOP.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>VDOP.</description>
- </param>
- <param name="actual" type="Boolean" mandatory="false">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Common.Dimension" mandatory="false">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
- <description>The speed in KPH</description>
- </param>
- </struct>
- <struct name="SingleTireStatus">
- <param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The status of component volume. See ComponentVolumeStatus.</description>
- </param>
- </struct>
- <struct name="DIDResult">
- <description>Individual requested DID result and data</description>
- <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
- <description>Individual DID result code.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Location of raw data (the address from ReadDID request)</description>
- </param>
- <param name="data" type="String" maxlength="5000" mandatory="false">
- <description>Raw DID-based data returned for requested element.</description>
- </param>
- </struct>
- <struct name="HeadLampStatus">
- <param name="lowBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the low beam lamps.</description>
- </param>
- <param name="highBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the high beam lamps.</description>
- </param>
- <param name="ambientLightSensorStatus" type="Common.AmbientLightStatus" mandatory="true">
- <description>Status of the ambient light sensor.</description>
- </param>
- </struct>
- <struct name="TireStatus">
- <description>The status and pressure of the tires.</description>
- <param name="pressureTelltale" type="Common.WarningLightStatus" mandatory="false">
- <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
- </param>
- <param name="leftFront" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the left front tire.</description>
- </param>
- <param name="rightFront" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the right front tire.</description>
- </param>
- <param name="leftRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the left rear tire.</description>
- </param>
- <param name="rightRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the right rear tire.</description>
- </param>
- <param name="innerLeftRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the inner left rear.</description>
- </param>
- <param name="innerRightRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the inner right rear.</description>
- </param>
- </struct>
- <struct name="BeltStatus">
- <param name="driverBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="driverBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerChildDetected" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="BodyInformation">
- <param name="parkBrakeActive" type="Boolean" mandatory="true">
- <description>Must be true if the park brake is active</description>
- </param>
- <param name="ignitionStableStatus" type="Common.IgnitionStableStatus" mandatory="true">
- <description>Information about the ignition switch. See IgnitionStableStatus.</description>
- </param>
- <param name="ignitionStatus" type="Common.IgnitionStatus" mandatory="true">
- <description>The status of the ignition. See IgnitionStatus.</description>
- </param>
- <param name="driverDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatDrv_B_Actl".</description>
- </param>
- <param name="passengerDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatPsngr_B_Actl".</description>
- </param>
- <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRl_B_Actl".</description>
- </param>
- <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRr_B_Actl".</description>
- </param>
- </struct>
- <struct name="DeviceStatus">
- <param name="voiceRecOn" type="Boolean" mandatory="false">
- <description>Must be true if the voice recording is on.</description>
- </param>
- <param name="btIconOn" type="Boolean" mandatory="false">
- <description>Must be true if Bluetooth icon is displayed.</description>
- </param>
- <param name="callActive" type="Boolean" mandatory="false">
- <description>Must be true if there is an active call..</description>
- </param>
- <param name="phoneRoaming" type="Boolean" mandatory="false">
- <description>Must be true if ther is a phone roaming.</description>
- </param>
- <param name="textMsgAvailable" type="Boolean" mandatory="false">
- <description>Must be true if the text message is available.</description>
- </param>
- <param name="battLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
- <description>Device battery level status. See DeviceLevelStatus.</description>
- </param>
- <param name="stereoAudioOutputMuted" type="Boolean" mandatory="false">
- <description>Must be true if stereo audio output is muted.</description>
- </param>
- <param name="monoAudioOutputMuted" type="Boolean" mandatory="false">
- <description>Must be true if mono audio output is muted.</description>
- </param>
- <param name="signalLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
- <description>Device signal level status. See DeviceLevelStatus.</description>
- </param>
- <param name="primaryAudioSource" type="Common.PrimaryAudioSource" mandatory="false">
- <description>See PrimaryAudioSource.</description>
- </param>
- <param name="eCallEventActive" type="Boolean" mandatory="false">
- <description>Must be true if emergency call event is active.</description>
- </param>
- </struct>
- <struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
- <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
- <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus" mandatory="true">
- <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
- </param>
- </struct>
- <struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="EmergencyEvent">
- <param name="emergencyEventType" type="Common.EmergencyEventType" mandatory="true">
- <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
- </param>
- <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus" mandatory="true">
- <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
- </param>
- <param name="rolloverEvent" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="multipleEvents" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean" mandatory="true">
- <description>References signal "PowerMode_UB".</description>
- </param>
- <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus" mandatory="true">
- <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
- </param>
- <param name="carModeStatus" type="Common.CarModeStatus" mandatory="true">
- <description>References signal "CarMode". See CarMode.</description>
- </param>
- <param name="powerModeStatus" type="Common.PowerModeStatus" mandatory="true">
- <description>References signal "PowerMode". See PowerMode.</description>
- </param>
- </struct>
- <struct name="MyKey">
- <param name="e911Override" type="Common.VehicleDataStatus" mandatory="true">
- <description>Indicates whether e911 override is on. See VehicleDataStatus.</description>
- </param>
- </struct>
- <!--end of IVI part-->
- <!-- Remote Control -->
- <enum name="ModuleType">
- <element name="CLIMATE"/>
- <element name="RADIO"/>
- </enum>
-
- <enum name="RadioBand">
- <element name="AM"/>
- <element name="FM"/>
- <element name="XM"/>
- </enum>
-
- <struct name="RdsData">
- <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
- <description>Program Service Name</description>
- </param>
- <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
- <description>Radio Text</description>
- </param>
- <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
- <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
- </param>
- <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
- <description>Program Identification - the call sign for the radio station</description>
- </param>
- <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>The program type - The region should be used to differentiate between EU and North America program types</description>
- </param>
- <param name="TP" type="Boolean" mandatory="false">
- <description>Traffic Program Identification - Identifies a station that offers traffic</description>
- </param>
- <param name="TA" type="Boolean" mandatory="false">
- <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
- </param>
- <param name="REG" type="String" mandatory="false">
- <description>Region</description>
- </param>
- </struct>
-
- <enum name="RadioState">
- <element name="ACQUIRING"/>
- <element name="ACQUIRED"/>
- <element name="MULTICAST"/>
- <element name="NOT_FOUND"/>
- </enum>
-
- <struct name="RadioControlData">
- <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
- <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
- </param>
- <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
- <description>The fractional part of the frequency for 101.7 is 7</description>
- </param>
- <param name="band" type="Common.RadioBand" mandatory="false">
- </param>
- <param name="rdsData" type="Common.RdsData" mandatory="false">
- </param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
- <description>number of HD sub-channels if available</description>
- </param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
- <description>Current HD sub-channel if available</description>
- </param>
- <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- </param>
- <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
- </param>
- <param name="radioEnable" type="Boolean" mandatory="false">
- <description> True if the radio is on, false is the radio is off</description>
- </param>
- <param name="state" type="Common.RadioState" mandatory="false">
- </param>
- </struct>
-
- <struct name="RadioControlCapabilities">
- <description>Contains information about a radio control module's capabilities.</description>
- <param name="moduleName" type="String" maxlength="100" mandatory="true" >
- <description>The short name or a short description of the radio control module.</description>
- </param>
- <param name="radioEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable radio.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="radioBandAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the control of radio band.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="radioFrequencyAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the control of radio frequency.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="hdChannelAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the control of HD radio channel.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="rdsDataAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting Radio Data System (RDS) data.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="availableHDsAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the number of available HD channels.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="stateAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the Radio state.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="signalStrengthAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the signal strength.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the signal Change Threshold.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- </struct>
-
- <enum name="DefrostZone">
- <element name="FRONT"/>
- <element name="REAR"/>
- <element name="ALL"/>
- <element name="NONE"/>
- </enum>
-
- <enum name="VentilationMode">
- <element name="UPPER"/>
- <element name="LOWER"/>
- <element name="BOTH"/>
- <element name="NONE"/>
- </enum>
-
- <enum name="TemperatureUnit">
- <element name="FAHRENHEIT"/>
- <element name="CELSIUS"/>
- </enum>
-
- <struct name="Temperature">
- <param name="unit" type="TemperatureUnit" mandatory="true" >
- <description>Temperature Unit</description>
- </param>
- <param name="value" type="Float" mandatory="true" >
- <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
- </param>
- </struct>
-
- <struct name="ClimateControlData">
- <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- </param>
- <param name="currentTemperature" type="Common.Temperature" mandatory="false">
- </param>
- <param name="desiredTemperature" type="Common.Temperature" mandatory="false">
- </param>
- <param name="acEnable" type="Boolean" mandatory="false">
- </param>
- <param name="circulateAirEnable" type="Boolean" mandatory="false">
- </param>
- <param name="autoModeEnable" type="Boolean" mandatory="false">
- </param>
- <param name="defrostZone" type="DefrostZone" mandatory="false">
- </param>
- <param name="dualModeEnable" type="Boolean" mandatory="false">
- </param>
- <param name="acMaxEnable" type="Boolean" mandatory="false">
- </param>
- <param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
- </param>
- </struct>
-
- <struct name="ClimateControlCapabilities">
- <description>Contains information about a climate control module's capabilities.</description>
- <param name="moduleName" type="String" maxlength="100" mandatory="true" >
- <description>The short name or a short description of the climate control module.</description>
- </param>
- <param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the reading of current temperature.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of fan speed.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of desired temperature.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="acEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of turn on/off AC.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable air conditioning is ON on the maximum level.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable circulate Air mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable auto mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable dual mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of defrost zones.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="defrostZone" type="Common.DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- A set of all defrost zones that are controllable.
- </description>
- </param>
- <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of air ventilation mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="ventilationMode" type="Common.VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- A set of all ventilation modes that are controllable.
- </description>
- </param>
- </struct>
-
- <struct name="ModuleData">
- <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
- <param name="moduleType" type="Common.ModuleType" mandatory="true" >
- </param>
- <param name="radioControlData" type="Common.RadioControlData" mandatory="false">
- </param>
- <param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
- </param>
- </struct>
-
- <enum name="RCAccessMode">
- <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
- <element name="AUTO_ALLOW"/>
- <element name="AUTO_DENY"/>
- <element name="ASK_DRIVER"/>
- </enum>
-<struct name="DateTime">
- <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Milliseconds </description>
- </param>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
- <description>Seconds part of time</description>
- </param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>Minutes part of time</description>
- </param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
- </param>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>Day of the month</description>
- </param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>Month of the year</description>
- </param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="false">
- <description>The year in YYYY format</description>
- </param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
- <description>Time zone offset in Hours wrt UTC.</description>
- </param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
- <description>Time zone offset in Min wrt UTC.</description>
- </param>
-</struct>
-
-<struct name="OASISAddress">
- <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Name of the country (localized)</description>
- </param>
- <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
- <description>Name of country (ISO 3166-2)</description>
- </param>
- <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
- <description>(PLZ, ZIP, PIN, CAP etc.)</description>
- </param>
- <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of country (e.g. state)</description>
- </param>
- <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of e.g. state (e.g. county)</description>
- </param>
- <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. city/village</description>
- </param>
- <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. district</description>
- </param>
- <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for street, road etc.</description>
- </param>
- <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of thoroughfare e.g. house number</description>
- </param>
-</struct>
-
- <struct name="LocationDetails">
- <param name="coordinate" type="Coordinate" mandatory="false">
- <description>Latitude/Longitude of the location.</description>
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>Name of location.</description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>Location address for display purposes only</description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>Description intended location / establishment (if applicable)</description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>Phone number of location / establishment.</description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>Image / icon of intended location.</description>
- </param>
- <param name="searchAddress" type="OASISAddress" mandatory="false">
- <description>Address to be used by navigation engines for search</description>
- </param>
- </struct>
-
- <struct name="NavigationCapability">
- <description>Extended capabilities for an onboard navigation system</description>
- <param name="sendLocationEnabled" type="Boolean" mandatory="false">
- <description>If the module has the ability to add locations to the onboard nav</description>
- </param>
- <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
- <description>If the module has the ability to return way points from onboard nav</description>
- </param>
- </struct>
-
- <struct name="PhoneCapability">
- <description>Extended capabilities of the module's phone feature</description>
- <param name="dialNumberEnabled" type="Boolean" mandatory="false">
- <description>If the module has the abiulity to perform dial number</description>
- </param>
- </struct>
-
- <struct name="VideoStreamingCapability">
- <description>Contains information about this system's video streaming capabilities.</description>
- <param name="preferredResolution" type="Common.ImageResolution" mandatory="false">
- <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
- </param>
- <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
- <description>The maximum bitrate of video stream that is supported, in kbps.</description>
- </param>
- <param name="supportedFormats" type="Common.VideoStreamingFormat" array="true" mandatory="false">
- <description>
- Detailed information on each format supported by this system, in its preferred order
- (i.e. the first element in the array is most preferable to the system).
- Each object will contain a VideoStreamingFormat that describes what can be expected.
- </description>
- </param>
- <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
- <description>True if the system can utilize the haptic spatial data from the source being streamed. </description>
- </param>
- </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 >
- </param>
- <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
- <description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
- </param>
- <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
- <description>If included, the platform supports RC button controls with the included button names.</description >
- </param>
- </struct>
-
- <struct name="Rectangle">
- <param name="x" type="Float" mandatory="true">
- <description>The X-coordinate of the user control</description>
- </param>
- <param name="y" type="Float" mandatory="true">
- <description>The Y-coordinate of the user control</description>
- </param>
- <param name="width" type="Float" mandatory="true">
- <description>The width of the user control's bounding rectangle</description>
- </param>
- <param name="height" type="Float" mandatory="true">
- <description>The height of the user control's bounding rectangle</description>
- </param>
- </struct>
-
- <struct name="HapticRect">
- <description>Defines haptic rectangle data for each user control object for video streaming application</description>
- <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>A user control spatial identifier</description>
- </param>
- <param name="rect" type="Common.Rectangle" mandatory="true">
- <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
- </param>
- </struct>
- </interface>
- <interface name="Buttons" version="1.0" date="2013-04-12">
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="capabilities" type="Common.ButtonCapabilities" array="true" minsize="1" maxsize="100" mandatory="true">
- <description>Response must provide the names of available buttons and their capabilities.See ButtonCapabilities</description>
- </param>
- <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
- <description>Must be returned if the platform supports custom on-screen Presets</description>
- </param>
- </function>
- <function name="OnButtonEvent" messagetype="notification" provider="hmi">
- <description>HU system must notify about every UP/DOWN event for buttons</description>
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="mode" type="Common.ButtonEventMode" mandatory="true">
- <description>Indicates whether this is an UP or DOWN event.</description>
- </param>
- <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
- <description>Must be provided if ButtonName is CUSTOM_BUTTON, this references the integer ID passed by a custom button. (e.g. softButtonName)</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>
- In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
- Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
- </description>
- </param>
- </function>
- <function name="OnButtonPress" messagetype="notification" provider="hmi">
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="mode" type="Common.ButtonPressMode" mandatory="true">
- <description>Indicates whether this is a LONG or SHORT button press event.</description>
- </param>
- <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
- <description>Must be returned if ButtonName is CUSTOM_BUTTON, this references the string passed by a custom button. (e.g. softButtonName)</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>
- In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
- Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
- </description>
- </param>
- </function>
- <function name="OnButtonSubscription" messagetype="notification">
- <description>
- Sender: SDL-&gt;HMI. Purpose: to notify about button subscription state is changed for the named application
- </description>
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="isSubscribed" type="Boolean" mandatory="true">
- <description>
- Defines whether the named button has status of 'subscribed' or 'unsubscribed':
- If "true" - the named button is subscribed.
- If "false" - the named button is unsubscribed.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>
- The ID of application that relates to this button-subscription status change.
- </description>
- </param>
- </function>
- </interface>
- <interface name="BasicCommunication" version="1.0" date="2013-04-12">
- <function name="OnReady" messagetype="notification" provider="hmi">
- <description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
- </function>
- <function name="OnStartDeviceDiscovery" messagetype="notification" provider="hmi">
- <description>Initiated by HMI user for getting the list of connected devices.</description>
- </function>
- <function name="OnUpdateDeviceList" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SDL sent when HMI requires update of device list (i.e. when user clicks 'Change Device' button)</description>
- </function>
- <function name="OnPhoneCall" messagetype="notification">
- <description>Sender: HMI-&gt;SDL. When: upon phone-call event started or ended</description>
- <param name="isActive" type="Boolean" mandatory="true">
- <description>Must be 'true' - when the phone call is started on HMI. Must be 'false' when the phone call is ended on HMI</description>
- </param>
- </function>
- <function name="OnEmergencyEvent" messagetype="notification">
- <description>
- "Sender: HMI-&gt;SDL. Conditions: when HMI enters the mode of "911 Assist", or other rear view camera,
- or something else in the future. Purpose: for SDL to change the audioStreamingState of the related apps to
- NOT_AUDIBLE when "enabled:true" and back to AUDIBLE when "enabled:false""
- </description>
- <param name="enabled" type="Boolean" mandatory="true">
- </param>
- </function>
- <function name="OnResumeAudioSource" messagetype="notification" provider="sdl">
- <description>This method must be invoked by SDL to update audio state.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>The ID of app to be resumed audio source.</description>
- </param>
- </function>
- <function name="OnSDLPersistenceComplete" messagetype="notification" provider="sdl">
- </function>
- <function name="UpdateAppList" messagetype="request" provider="hmi">
- <description>Issued by SDL to notify HMI about new applications registered.</description>
- <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="0" maxsize="100"/>
- </function>
- <function name="UpdateAppList" messagetype="response">
- </function>
- <function name="UpdateDeviceList" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change device list.</description>
- <param name="deviceList" type="Common.DeviceInfo" mandatory="true" array="true" minsize="0" maxsize="100">
- <description>The array of names/IDs of connected devices</description>
- </param>
- </function>
- <function name="UpdateDeviceList" messagetype="response">
- </function>
- <function name="OnFileRemoved" messagetype="notification" provider="sdl">
- <description>Notifies HMI in case some application file has been removed</description>
- <param name="fileName" type="String" minlength="1" maxlength="30" mandatory="true">
- <description>The name of the removed file</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>The file type. See FileType.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
- </function>
- <function name="AllowDeviceToConnect" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="AllowDeviceToConnect" messagetype="response">
- <param name="allow" type="Boolean" mandatory="true"/>
- </function>
- <function name="OnDeviceChosen" messagetype="notification" provider="hmi">
- <description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
- <description>The name and ID of the device chosen</description>
- </param>
- </function>
- <function name="OnFindApplications" messagetype="notification" provider="hmi">
- <description>This method must be invoked by HMI to get list of registered apps.</description>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="false">
- <description>The name and ID of the device the list of registered applications is required for.</description>
- </param>
- </function>
- <function name="ActivateApp" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to bring specified application to front on UI e.g make it HMI status 'FULL'.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of deactivated application.</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- <param name="level" type="Common.HMILevel" mandatory="false">
- <description>If level for application is to be changed to something else then FULL then this parameter should be used.</description>
- </param>
- </function>
- <function name="ActivateApp" messagetype="response">
- </function>
- <function name="OnAppActivated" messagetype="notification" provider="hmi">
- <description>Must be sent by HU system when the user clicks on app in the list of registered apps or on soft button with 'STEAL_FOCUS' action.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of selected application.</description>
- </param>
- </function>
- <function name="OnAppDeactivated" messagetype="notification" provider="hmi">
- <description>Must be sent by HU system when the user switches to any functionality which is not other mobile application.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of deactivated application.</description>
- </param>
- <param name="reason" type="Common.DeactivateReason" mandatory="true">
- <description>Specifies the functionality the user has switched to.</description>
- </param>
- </function>
- <function name="OnAppRegistered" messagetype="notification" provider="sdl">
- <description>Issued by SDL to notify HMI about new application registered.</description>
- <param name="application" type="Common.HMIApplication" mandatory="true">
- <description>The information about application registered. See HMIApplication. </description>
- </param>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- May not be empty.
- May not start with a new line character.
- Not unique value
- </description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="resumeVrGrammars" type="Boolean" mandatory="false">
- <description>The flag if VR grammars resume is required</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- </function>
- <function name="OnAppUnregistered" messagetype="notification" provider="sdl">
- <description>
- Issued by SDL to notify HMI about application unregistered.
- Application then to be removed from application list; all data connected with application has to be cleared up.
- </description>
- <param name="unexpectedDisconnect" type="Boolean" mandatory="true">
- <description>
- SDL sends 'true' in case the connection is unexpectedly lost.
- SDL sends 'false' in case the mobile app is unregistered gracefully (via appropriate RPC)
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application unregistered</description>
- </param>
- </function>
- <function name="OnExitApplication" messagetype="notification" provider="hmi">
- <description>Must be sent by HMI when the User chooses to exit the application..</description>
- <param name="reason" type="Common.ApplicationExitReason" mandatory="true">
- <description>Specifies reason of moving the app to NONE</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application to be exited.</description>
- </param>
- </function>
- <function name="OnExitAllApplications" messagetype="notification" provider="hmi">
- <description>Sent by HMI to SDL to close all registered applications.</description>
- <param name="reason" type="Common.ApplicationsCloseReason" mandatory="true">
- <description>Specifies reason for exiting all apllications.</description>
- </param>
- </function>
- <function name="OnAwakeSDL" messagetype="notification">
- <description>
- Sender: HMI-&gt;SDL. Must be sent to return SDL to normal operation after 'Suspend' or 'LowVoltage' events
- </description>
- </function>
- <function name="MixingAudioSupported" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to find out if the last one supports mixing audio (i.e. recording TTS command and playing audio).</description>
- </function>
- <function name="MixingAudioSupported" messagetype="response">
- <description>If no response received SDL supposes that mixing audio is not supported</description>
- <param name="attenuatedSupported" type="Boolean" mandatory="true">
- <description>Must be true if supported</description>
- </param>
- </function>
- <function name="PlayTone" messagetype="notification" provider="sdl">
- <description>Sent by SDL to HMI to notify that the tone should be played.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application that invoked this notification</description>
- </param>
- <param name="methodName" type="Common.MethodName" mandatory="true">
- <description>Defines the name of app's request that initiates playing a tone</description>
- </param>
- </function>
- <function name="DialNumber" messagetype="request">
- <description>Request from SDL to call a specific number.</description>
- <param name="number" type="String" maxlength="40" mandatory="true">
- <description>The number to dial. Only the character + and numbers are allowed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DialNumber" messagetype="response">
- </function>
- <!-- Policies -->
- <!-- SyncP RPC-->
- <function name="OnSystemRequest" messagetype="notification" provider="hmi">
- <description>
- An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
- Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
- </description>
- <param name="requestType" type="Common.RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
- <description>Optional array of URL(s) for HTTP requests.</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="false">
- <description>Optional file type (meant for HTTP file requests).</description>
- </param>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- </param>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SystemRequest" messagetype="request" provider="hmi">
- <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as Authentication requests)</description>
- <param name="requestType" type="Common.RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>The path to file.</description>
- </param>
- <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SystemRequest" messagetype="response">
- </function>
- <function name="PolicyUpdate" messagetype="request" provider="hmi">
- <description>
- From: SDL
- To: SYNCP Manager
- Asks SYNCP Manager to send given Policy Table snapshot to the backend
- </description>
- <param name="file" type="String" minlength="1" maxlength="255" mandatory="true">
- <description>
- Location of policy table snapshot
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>
- Send attempt timeout in seconds
- </description>
- </param>
- <param name="retry" type="Integer" minvalue="0" maxvalue="65535" array="true" minsize="1" maxsize="5" mandatory="true">
- <description>
- Array of delays to wait after failed atempts
- </description>
- </param>
- </function>
- <function name="PolicyUpdate" messagetype="response">
- </function>
- <!-- End of SyncP RPC-->
- <function name="OnSDLClose" messagetype="notification" provider="sdl">
- <description>SDL must notify HMI about finish working application</description>
- </function>
- <function name="OnPutFile" messagetype="notification" provider="sdl">
- <description>
- Notification, that comes to HMI when mobile sents file with systemFile flag
- </description>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Full Size of file. sends in first OnPutFile notification if file is splited
- into many PutFiles
- </description>
- </param>
- <param name="FileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
- </param>
- </function>
- <!-- Policies -->
- <function name="GetSystemInfo" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to obtain information about head unit system.</description>
- </function>
- <function name="GetSystemInfo" messagetype="response">
- <param name="ccpu_version" type="String" maxlength="500" mandatory="true">
- <description>Software version of the module</description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>ISO 639-1 combined with ISO 3166 alpha-2 country code (i.e. en-us)</description>
- </param>
- <param name="wersCountryCode" type="String" maxlength="500" mandatory="true">
- <description>Country code from the Ford system WERS (i.e.WAEGB).</description>
- </param>
- </function>
- <function name="OnSystemInfoChanged" messagetype="notification" provider="hmi">
- <description>Issued by system to SDL to notify that some system param has changed. Currently applied for Sync Language.</description>
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="OnIgnitionCycleOver" messagetype="notification" provider="hmi">
- <description>Notification from system to SDL to let it know that ignition cycle is over.</description>
- </function>
- <function name="DecryptCertificate" messagetype="request">
- <description>Sender: SDL-&gt;HMI. Purpose: to decrypt the certificate received via the Updated Policy Table. </description>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>The path to the file with the encrypted certificate from the PolicyTable.</description>
- </param>
- </function>
- <function name="DecryptCertificate" messagetype="response">
- <description>SUCCESS - in case the certificate is decrypted and placed to the same file from request.</description>
- </function>
- <function name="OnEventChanged" messagetype="notification">
- <description>Sender: HMI->SDL. When event is become active</description>
- <param name="eventName" type="Common.EventTypes" mandatory="true">
- <description>Specifies the types of active events.</description>
- </param>
- <param name="isActive" type="Boolean" mandatory="true">
- <description>Must be 'true' - when the event is started on HMI. Must be 'false' when the event is ended on HMI</description>
- </param>
- </function>
- <!-- End of Policies -->
- </interface>
- <interface name="VR" version="1.0" date="2013-04-17">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response provides information about presence of VR module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if VR is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="Started" messagetype="notification" provider="hmi">
- <description>Must be initiated by VR module to let SDL know that VR session has started.</description>
- </function>
- <function name="Stopped" messagetype="notification" provider="hmi">
- <description>Must be initiated by VR module to let SDL know that VR session has stopped.</description>
- </function>
- <function name="AddCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to add a command(string with associated id) to VR.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of a command (further to be used in OnCommand notification).</description>
- </param>
- <param name="vrCommands" type="String" mandatory="true" maxlength="99" minsize="1" maxsize="100" array="true">
- <description>List of strings to be used as VR commands.</description>
- </param>
- <param name="type" type="Common.VRCommandType" mandatory="true">
- <description>Type of added command. See VRCommandType.</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>
- ID of the specific grammar, whether top-level or choice set.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="AddCommand" messagetype="response">
- </function>
- <function name="DeleteCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a command from VR.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Id of a command (list of strings), previously sent by AddCommand.</description>
- </param>
- <param name="type" type="Common.VRCommandType" mandatory="true">
- <description>Type of added command. See VRCommandType.</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the specific grammar.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="DeleteCommand" messagetype="response">
- </function>
- <function name="PerformInteraction" messagetype="request" provider="hmi">
- <description>
- Sets some properties for the application initiated request.
- </description>
- <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- The help prompt. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="initialPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- This is the intial prompt spoken to the user at the start of an interaction. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text for a wait timeout. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="timeout" type="Integer" mandatory="true">
- <description>Timeout initiate timeoutPrompt</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- IDs of the specific compiled grammars for this voice interaction.
- </description>
- </param>
- </function>
- <function name="PerformInteraction" messagetype="response">
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- ID of the choice that was selected in response to PerformInteraction.
- </description>
- </param>
- </function>
- <function name="OnCommand" messagetype="notification" provider="hmi">
- <description>Notifies SDL about command trigerred via VR</description>
- <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
- <description>ID of of the command (list of strings)</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language of VR.</description>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Request new VR synonyms registration
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language VR has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. Response must provide the information about VR supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in VR.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active VR language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup by SDL to request information about VR capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="vrCapabilities" type="Common.VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Types of input recognized by VR module.</description>
- </param>
- </function>
- </interface>
- <interface name="TTS" version="1.0" date="2013-04-18">
- <description>RPCs for communication between TTS and SDL.</description>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="5" array="true" mandatory="true">
- <description>See SpeechCapabilities</description>
- </param>
- <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="5" array="true" mandatory="true">
- <description>See PrerecordedSpeech</description>
- </param>
- </function>
- <function name="Started" messagetype="notification" provider="hmi">
- <description>Must be initiated by TTS module to let SDL know that TTS session has started.</description>
- </function>
- <function name="Stopped" messagetype="notification" provider="hmi">
- <description>Must be initiated by TTS module to let SDL know that TTS session has stopped.</description>
- </function>
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. Response must provide the information about presence of TTS module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if TTS is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="Speak" messagetype="request" provider="hmi">
- <description>RPC from SDL to TTS for speaking the text.</description>
- <param name="ttsChunks" type="Common.TTSChunk" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of strings to be spoken.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- <param name="speakType" type="Common.MethodName" mandatory="false">
- <description>Defines the type of the request which causes text-to-speech</description>
- </param>
- </function>
- <function name="Speak" messagetype="response">
- <description>Provides information about success of operation.</description>
- </function>
- <function name="StopSpeaking" messagetype="request" provider="hmi">
- <description>Initiated by SDL to stop speaking the text.</description>
- </function>
- <function name="StopSpeaking" messagetype="response">
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language of TTS.</description>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Request new ttsName registration
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- May not be empty.
- May not start with a new line character.
- Not unique value (SDL makes all the checks)
- </description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language TTS has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up by SDL. Response must provide the information about TTS supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in TTS.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active TTS language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="SetGlobalProperties" messagetype="request" provider="hmi">
- <description>Sets some properties for the application initiated request.</description>
- <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- The help prompt.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
- <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text for a wait timeout.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetGlobalProperties" messagetype="response">
- </function>
- <function name="OnResetTimeout" messagetype="notification">
- <description>
- Sender: HMI-&gt;SDL. HMI must send this notification every 10 sec. in case the 'methodName'
- results long processing on HMI
- </description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that concerns the 'methodName'.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>The name of the method, the renew of timeout is required for</description>
- </param>
- </function>
- </interface>
- <interface name="UI" version="1.0" date="2013-04-16">
- <function name="Alert" messagetype="request" provider="hmi">
- <description>Request from SDL to show an alert message on the display.</description>
- <param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
- <description>Array of lines of alert text fields. See TextFieldStruct. Uses alertText1, alertText2, alertText3.</description>
- </param>
- <param name="duration" type="Integer" mandatory="true" minvalue="3000" maxvalue="10000">
- <description>Timeout in milliseconds.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" mandatory="false" minsize="0" maxsize="4" array="true">
- <description>App defined SoftButtons</description>
- </param>
- <param name="progressIndicator" type="Boolean" mandatory="false">
- <description>If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.</description>
- </param>
- <param name="alertType" type="Common.AlertType" mandatory="true">
- <description>Defines if only UI or BOTH portions of the Alert request are being sent to HMI Side</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="Alert" messagetype="response">
- <param name="tryAgainTime" type="Integer" mandatory="false" minvalue="0" maxvalue="2000000000">
- <description>Amount of time (in milliseconds) that SDL must wait before resending an alert. Must be provided if another system event or overlay currently has a higher priority than this alert.</description>
- </param>
- </function>
- <function name="Show" messagetype="request" provider="hmi">
- <param name="showStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="7">
- <description>Array of lines of show text fields. See TextFieldStruct. Uses mainField1, mainField2, mainField3, mainField4. If some field is not set, the corresponding text should stay unchanged. If field's text is empty "", the field must be cleared.
- mainField1: The text that should be displayed in a single or upper display line.
- mainField2: The text that should be displayed on the second display line.
- mainField3: The text that should be displayed on the second "page" first display line.
- mainField4: The text that should be displayed on the second "page" second display line.
- statusBar: statusBar.
- mediaClock: Text value for MediaClock field.
- mediaTrack: The text that should be displayed in the track field. This field is only valid for media applications on NGN type ACMs.
- </description>
- </param>
- <param name="alignment" type="Common.TextAlignment" mandatory="false">
- <description>Specifies how mainField1 and mainField2 texts should be aligned on the display.</description>
- <description>If omitted, texts must be centered</description>
- </param>
- <param name="graphic" type="Common.Image" mandatory="false">
- <description>Path to optional dynamic image or the static binary image itself. See Image. If omitted, the displayed graphic should not change.</description>
- </param>
- <param name="secondaryGraphic" type="Common.Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic secondary image to display in app.
- If omitted on supported displays, the displayed secondary graphic shall not change.
- </description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>App defined SoftButtons.</description>
- <description>If omitted, the currently displayed SoftButton values should not change.</description>
- </param>
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
- <description>App labeled on-screen presets (i.e. GEN3 media presets or dynamic search suggestions).</description>
- <description>If omitted on supported displays, the presets will be shown as not defined.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application related to this RPC.</description>
- </param>
- </function>
- <function name="Show" messagetype="response">
- </function>
- <function name="AddCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to add a command to the application menu.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the command to be added.</description>
- </param>
- <param name="menuParams" type="Common.MenuParams" mandatory="false">
- <description>Optional sub value containing parameters of the command (position, name, etc.). See MenuParams. If omitted the command should be added to the end of the list of commands.</description>
- </param>
- <param name="cmdIcon" type="Common.Image" mandatory="false">
- <description>Image to be displayed for representing the command. See Image.</description>
- <description>If omitted, no (or the default if applicable) icon should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="AddCommand" messagetype="response">
- </function>
- <function name="DeleteCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a command from the in-application menu with the specified command id.</description>
- <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
- <description>cmdId previously sent via AddCommand request - id of the command to be deleted.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DeleteCommand" messagetype="response">
- </function>
- <function name="AddSubMenu" messagetype="request" provider="hmi">
- <description>Request from SDL to add a sub menu to the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>ID of the sub menu to be added. Unique for the application.</description>
- </param>
- <param name="menuParams" type="Common.MenuParams" mandatory="true">
- <description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="AddSubMenu" messagetype="response">
- </function>
- <function name="DeleteSubMenu" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a submenu from the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>The "menuID" of the sub-menu to be deleted. (See addSubMenu.menuID)</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DeleteSubMenu" messagetype="response">
- </function>
- <function name="PerformInteraction" messagetype="request" provider="hmi">
- <description>Request from SDL for triggering an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
- <param name="initialText" type="Common.TextFieldStruct" mandatory="false">
- <description>Uses initialInteractionText. See TextFieldStruct.</description>
- </param>
- <param name="choiceSet" type="Common.Choice" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>The list of choices to be used for the interaction with the user</description>
- </param>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>VR Help Title text.</description>
- <description>If omitted on supported displays, the default HU system help title should be used.</description>
- </param>
- <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="true">
- <description>Timeout in milliseconds.</description>
- </param>
- <param name="interactionLayout" type="Common.LayoutMode" mandatory="false">
- <description>See LayoutMode.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="PerformInteraction" messagetype="response">
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>ID of the choice that was selected in response to PerformInteraction.</description>
- </param>
- <param name="manualTextEntry" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- Manually entered text selection, e.g. through keyboard
- Can be returned in lieu of choiceID, depending on trigger source
- </description>
- </param>
- </function>
- <function name="SetMediaClockTimer" messagetype="request" provider="hmi">
- <description>Sets the initial media clock value and automatic update method.</description>
- <param name="startTime" type="Common.TimeFormat" mandatory="false">
- <description>startTime should be ignored for "PAUSE", "RESUME", and "CLEAR"</description>
- </param>
- <param name="endTime" type="Common.TimeFormat" mandatory="false">
- <description>
- See TimeFormat.
- endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
- If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
- endTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
- </description>
- </param>
- <param name="updateMode" type="Common.ClockUpdateMode" mandatory="true">
- <description>The update method of the media clock.</description>
- <description>In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SetMediaClockTimer" messagetype="response">
- </function>
- <function name="SetGlobalProperties" messagetype="request" provider="hmi">
- <description>Request from SDL to set some properties for VR help.</description>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>VR Help Title text.</description>
- <description>If omitted on supported displays, the default HU system help title should be used.</description>
- </param>
- <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
- </param>
- <param name="menuTitle" maxlength="500" type="String" mandatory="false">
- <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </param>
- <param name="menuIcon" type="Common.Image" mandatory="false">
- <description>&gt;Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
- </param>
- <param name="keyboardProperties" type="Common.KeyboardProperties" mandatory="false">
- <description>On-screen keybaord configuration (if available).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="SetGlobalProperties" messagetype="response">
- </function>
- <function name="OnCommand" messagetype="notification" provider="hmi">
- <description>Notification must be initiated by HMI on user choosing menu item.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Command ID, which is related to a specific menu entry (previously sent with AddCommand).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that is related to this RPC.</description>
- </param>
- </function>
- <function name="OnSystemContext" messagetype="notification" provider="hmi">
- <description>
- Notification must be initiated by HMI when the user changes the context of application: goes to menu (in-application menu or system menu);
- switches to VR; pop-up appears on screen etc.
- </description>
- <param name="systemContext" type="Common.SystemContext" mandatory="true">
- <description>The context the application is brought into.</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>ID of application that is related to this RPC.</description>
- </param>
- </function>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup by SDL to request information about UI capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="true">
- <description>Information about the capabilities of the display: its type, text field supported, etc. See DisplayCapabilities. </description>
- </param>
- <param name="audioPassThruCapabilities" type="Common.AudioPassThruCapabilities" mandatory="true"/>
- <param name="hmiZoneCapabilities" type="Common.HmiZoneCapabilities" mandatory="true"/>
- <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Must be returned if the platform supports on-screen SoftButtons.</description>
- </param>
- <param name="hmiCapabilities" type="Common.HMICapabilities" mandatory="false">
- <description>Specifies the HMI&#8217;s capabilities. See HMICapabilities.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language for app.</description>
- <param name="appName" type="String" maxlength="100" mandatory="false">
- <description>
- Request new app name registration
- Needs to be unique over all applications.
- May not be empty. May not start with a new line character.
- May not interfere with any name or synonym of any registered applications.
- Applications with the same name will be rejected. (SDL makes all the checks)
- </description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Request new app short name registration</description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appHMIType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Sent when app's requested-during-registration AppHMIType is changed to different one due to Policies update. Contains the updated list of all allowed app's AppHMITypes.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language UI has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method should be invoked at system startup. Response provides information about UI supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in UI.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active UI language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="OnDriverDistraction" messagetype="notification" provider="hmi">
- <description>Notification must be sent from HMI to SDL when driver distraction state is changed. Driver distraction rules are defined by the platform.</description>
- <param name="state" type="Common.DriverDistractionState" mandatory="true">
- <description>See DriverDistractionState. </description>
- </param>
- </function>
- <function name="SetAppIcon" messagetype="request" provider="hmi">
- <description>Used to set existing local file on SYNC as the app's icon.</description>
- <param name="syncFileName" type="Common.Image" mandatory="true">
- <description>Either the path to the dynamic image stored on HY or the static binary image itself. See Image</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetAppIcon" messagetype="response">
- </function>
- <function name="SetDisplayLayout" messagetype="request" provider="hmi">
- <param name="displayLayout" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetDisplayLayout" messagetype="response">
- <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
- <param name="buttonCapabilities" type="Common.ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description>
- </param>
- <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
- </param>
- <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
- </param>
- </function>
- <function name="ShowCustomForm" messagetype="request" provider="hmi">
- <description>Used to show a custom form; it can be a parent or child screen. If no parent screen is designated, it is set as a parent screen.</description>
- <param name="customFormID" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined forms are defined.
- Predefined layouts include:
- "DEFAULT" - Default media / non-media screen
- "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
- "KEYBOARD_SEARCH" - Custom template containing app-configured on-screen keyboard with active search updating; user also can trigger voice search.
- "NAV_FULLSCREEN_MAP" - Custom root template screen containing full screen map with navigation controls.
- "NAV_POI_MENU" - Custom template containing app-defined POI options.
- "NAV_SEARCH_RESULTS" - Custom template containing a list of app-defined search results
- "NAV_POI_INFO" - Custom template containing app-defined POI information (and potentially map data).
- </description>
- </param>
- <param name="parentFormID" type="String" maxlength="500" defvalue="DEFAULT" mandatory="false">
- <description>
- Parent screen of predefined form to display.
- Currently only predefined forms are defined.
- If not provided, then set to "DEFAULT".
- Predefined layouts include:
- "DEFAULT" - Default media / non-media screen
- "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
- "NAV_FULLSCREEN_MAP" - Custom template containing full screen map with navigation controls.
- </description>
- </param>
- </function>
- <function name="ShowCustomForm" messagetype="response">
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
- <function name="OnKeyboardInput" messagetype="notification" provider="hmi">
- <description>On-screen keyboard event.</description>
- <description>Can be full string or individual keypresses depending on keyboard mode.</description>
- <param name="event" type="Common.KeyboardEvent" mandatory="true">
- <description>On-screen keyboard input data.</description>
- </param>
- <param name="data" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>On-screen keyboard input data.</description>
- <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
- <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
- <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
- </param>
- </function>
- <function name="OnTouchEvent" messagetype="notification" provider="hmi">
- <description>Notifies about touch events on the screen's prescribed area</description>
- <param name="type" type="Common.TouchType" mandatory="true">
- <description>The type of touch event.</description>
- </param>
- <param name="event" type="Common.TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
- <description>List of all individual touches involved in this event.</description>
- </param>
- </function>
- <function name="Slider" messagetype="request" provider="hmi">
- <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
- <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
- <description>Number of selectable items on a horizontal axis</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
- <description>Initial position of slider control (cannot exceed numTicks)</description>
- </param>
- <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
- <description>Text header to be displayed.</description>
- </param>
- <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
- <description>Text footer to be displayed (meant to display min/max threshold descriptors).</description>
- <description>For a static text footer, only one footer string shall be provided in the array.</description>
- <description>For a dynamic text footer, the number of footer text string in the array must match the numTicks value.</description>
- <description>For a dynamic text footer, text array string should correlate with potential slider position index.</description>
- <description>If omitted on supported displays, no footer text shall be displayed.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" mandatory="true">
- <description>Timeout. The slider should be displayed until the defined amount of time has elapsed. </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="Slider" messagetype="response">
- <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>Current slider position. Must be returned when the user has clicked the &#8216;Save&#8217; or &#8216;Canceled&#8217; button or by the timeout </description>
- </param>
- </function>
- <function name="ScrollableMessage" messagetype="request" provider="hmi">
- <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
- <param name="messageText" type="Common.TextFieldStruct" mandatory="true">
- <description>Body of text that can include newlines and tabs. Uses scrollableMessageBody.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Timeout in milliseconds. The message should be displayed until the time defined is up.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>App defined SoftButtons.</description>
- <description>If omitted on supported displays, only the system defined "Close" SoftButton should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ScrollableMessage" messagetype="response">
- </function>
- <function name="PerformAudioPassThru" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- <param name="audioPassThruDisplayTexts" type="Common.TextFieldStruct" mandatory="true" minsize="0" maxsize="2" array="true">
- <description>Uses
- audioPassThruDisplayText1: First line of text displayed during audio capture.
- audioPassThruDisplayText2: Second line of text displayed during audio capture.</description>
- </param>
- <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
- <description>The maximum duration of audio recording in milliseconds. If not provided, the recording should be performed until EndAudioPassThru arrives.</description>
- </param>
- <param name="muteAudio" type="Boolean" mandatory="true">
- <description>
- Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
- If omitted, the value is set to true.
- </description>
- </param>
- </function>
- <function name="PerformAudioPassThru" messagetype="response">
- </function>
- <function name="EndAudioPassThru" messagetype="request" provider="hmi">
- <description>Request is sent by SDL to stop the audio capturing.</description>
- </function>
- <function name="EndAudioPassThru" messagetype="response">
- </function>
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response provides information about presence of UI module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if UI is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="ClosePopUp" messagetype="request" provider="hmi">
- <description>Initiated by SDL to close currently active pop-up on HMI.</description>
- <param name="methodName" type="String" mandatory="false">
- <description>Method to be closed</description>
- </param>
- </function>
- <function name="ClosePopUp" messagetype="response">
- <description>Provides the result of operation.</description>
- </function>
- <function name="OnResetTimeout" messagetype="notification" provider="hmi">
- <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that invoked notifcation.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>Currently used method name on which was triggered action</description>
- </param>
- </function>
- <function name="OnRecordStart" messagetype="notification" provider="sdl">
- <description>Issued by SDL to notify HMI about capturing mic data should be started</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SendHapticData" messagetype="request">
- <description>Send the UI spatial data from MOBILE. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Internal ID of the application that requested this RPC.</description>
- </param>
- <param name="hapticRectData" type="Common.HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
- <description>
- Array of rectangle data structures that represent the locations of all user controls present on the HMI.
- This data should be updated if/when the application presents a new screen.
- When a request is sent, if successful, it will replace all rectangle data previously sent through RPC.
- Avoidance of doubt, when an empty hapticRectData, it will be clear all rectangle data previously sent through RPC.
- </description>
- </param>
- </function>
- <function name="SendHapticData" messagetype="response">
- </function>
- </interface>
- <interface name="Navigation" version="1.0" date="2013-05-22">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if Navigation is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="SendLocation" messagetype="request">
- <description>That allows the app to send a destination to the embedded nav system.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description> Name / title of intended location </description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description> Description intended location / establishment (if applicable) </description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description> Location address (if applicable) </description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description> Phone number of intended location / establishment (if applicable) </description>
- </param>
- <param name="locationImage" type="Common.Image" mandatory="false">
- <description> Image / icon of intended location (if applicable and supported) </description>
- </param>
- </function>
- <function name="SendLocation" messagetype="response">
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="request">
- <description>Dials a phone number and switches to phone application.</description>
- <param name="number" type="String" maxlength="40" mandatory="true">
- <description>Phone number is a string, which can be up to 40 chars.</description>
- </param>
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="response">
- </function>
-
- <function name="ShowConstantTBT" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to show info about navigation.</description>
- <param name="navigationTexts" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="5">
- <description>See TextFieldStruct. Uses:
- navigationText1
- navigationText2
- ETA
- totalDistance
- timeToDestination.
- </description>
- </param>
- <param name="turnIcon" type="Common.Image" mandatory="false">
- </param>
- <param name="nextTurnIcon" type="Common.Image" mandatory="false">
- </param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
- <description>Fraction of distance till next maneuver (from previous maneuver).</description>
- <description>May be used to calculate progress bar.</description>
- </param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
- <description>Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).</description>
- <description>May be used to calculate progress bar.</description>
- </param>
- <param name="maneuverComplete" type="Boolean" mandatory="false">
- <description>If and when a maneuver has completed while an AlertManeuver is active, SDL will send this value set to TRUE in order to clear the AlertManeuver overlay.</description>
- <description>If omitted the value should be assumed as FALSE.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>Three dynamic SoftButtons available</description>
- <description>If omitted on supported displays, the currently displayed SoftButton values will not change.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ShowConstantTBT" messagetype="response">
- </function>
- <function name="AlertManeuver" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to announce navigation maneuver</description>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>If omitted, only the system defined "Close" SoftButton should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application requested this RPC.</description>
- </param>
- </function>
- <function name="AlertManeuver" messagetype="response">
- </function>
- <function name="UpdateTurnList" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to update turn list.</description>
- <param name="turnList" type="Common.Turn" minsize="1" maxsize="100" array="true" mandatory="false">
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
- <description>If omitted, app-defined SoftButton should be left blank.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="UpdateTurnList" messagetype="response">
- </function>
- <function name="OnTBTClientState" messagetype="notification" provider="hmi">
- <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
- <param name="state" type="Common.TBTState" mandatory="true">
- <description>Current State of TBT client</description>
- </param>
- </function>
- <function name="SetVideoConfig" messagetype="request">
- <description>Request from SDL to HMI to ask whether HMI accepts a video stream with given configuration.</description>
- <param name="config" type="Common.VideoConfig" mandatory="true">
- <description>Configuration of a video stream.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetVideoConfig" messagetype="response">
- <description>
- Response from HMI to SDL whether the configuration is accepted.
- In a negative response, a list of rejected parameters are supplied.
- </description>
- <param name="rejectedParams" type="String" array="true" minsize="1" maxsize="1000" mandatory="false">
- <description>
- List of params of VideoConfig struct which are not accepted by HMI, e.g. "protocol" and "codec".
- This param exists only when the response is negative.
- </description>
- </param>
- </function>
- <function name="StartStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
- <description>URL that HMI start playing.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StartStream" messagetype="response">
- </function>
- <function name="StopStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to stop playing video streaming.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StopStream" messagetype="response">
- </function>
- <function name="StartAudioStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
- <description>URL that HMI start playing.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StartAudioStream" messagetype="response">
- </function>
- <function name="StopAudioStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to stop playing audio streaming.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StopAudioStream" messagetype="response">
- </function>
- <function name="OnAudioDataStreaming" messagetype="notification">
- <description>Sender: SDL-&gt;HMI. Purpose: notify about raw audio data presence over the URL provided via StartAudioStream SDL's request.</description>
- <param name="available" type="Boolean" mandatory="true">
- <description>If "true" - audio data started. If "false" - audio data stopped.</description>
- </param>
- </function>
- <function name="OnVideoDataStreaming" messagetype="notification">
- <description>Sender: SDL-&gt;HMI. Purpose: notify about raw video data presence over the URL provided via StartStream SDL's request.</description>
- <param name="available" type="Boolean" mandatory="true">
- <description>If "true" - video data started. If "false" - video data stopped.</description>
- </param>
- </function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
- <description>Request for getting waypoint/destination data.</description>
- <param name="wayPointType" type="Common.WayPointType" mandatory="true">
- <description>To request for either the destination only or for all waypoints including destination</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
- </function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
- <param name="wayPoints" type="Common.LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
- <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification">
- <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
- <param name="wayPoints" type="Common.LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request">
- <description>To subscribe in getting changes for Waypoints/destinations</description>
- </function>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response">
- </function>
-
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request">
- <description>Request to unsubscribe from WayPoints and Destination</description>
- </function>
-
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response">
- </function>
- </interface>
-
- <interface name="VehicleInfo" version="1.0" date="2013-04-21">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if vehicle data modules are present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="GetVehicleType" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to get info about the vehicle (type, model, etc.).</description>
- </function>
- <function name="GetVehicleType" messagetype="response">
- <param name="vehicleType" type="Common.VehicleType" mandatory="true"/>
- </function>
- <function name="ReadDID" messagetype="request" provider="hmi">
- <description>Request from SDL for vehicle data reading.</description>
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
- <description>Get raw data from vehicle data DID location(s).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ReadDID" messagetype="response">
- <param name="didResult" type="Common.DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>Array of requested DID results (with data if available).</description>
- </param>
- </function>
- <function name="GetDTCs" messagetype="request" provider="hmi">
- <description>Vehicle module diagnostic trouble code request.</description>
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
- <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="GetDTCs" messagetype="response">
- <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
- </param>
- <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
- <description>
- Array of all reported DTCs on module. Each DTC is represented with 4 bytes:
- 3 bytes for data
- 1 byte for status
- </description>
- </param>
- </function>
- <function name="DiagnosticMessage" messagetype="request" provider="hmi">
- <description>Non periodic vehicle diagnostic request</description>
- <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of target ECU.</description>
- </param>
- <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Length of message (in bytes).</description>
- </param>
- <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="DiagnosticMessage" messagetype="response">
- <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message result.
- </description>
- </param>
- </function>
- <function name="SubscribeVehicleData" messagetype="request">
- <description>
- Subscribes for specific published data items.
- The data will be only sent if it has changed.
- The application will be notified by the onVehicleData notification whenever new data is available.
- To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
- </description>
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="SubscribeVehicleData" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Common.VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="UnsubscribeVehicleData" messagetype="request">
- <description>
- This function is used to unsubscribe the notifications from the subscribeVehicleData function.
- </description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="UnsubscribeVehicleData" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Common.VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="GetVehicleData" messagetype="request">
- <description>Non periodic vehicle data read request.</description>
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="Boolean" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including ignition status and internal temp</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <function name="GetVehicleData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="Common.PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <function name="OnVehicleData" messagetype="notification">
- <description>Callback for the periodic and non periodic vehicle data read function.</description>
- <param name="gps" type="Common.GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number.</description>
- </param>
- <param name="prndl" type="Common.PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--Qt HMI version of GetVehicleData-->
- <function name="GetGpsData" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetGpsData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="response">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="response">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="response">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="GetVin" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="response">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="response">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="response">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="GetECallInfo" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="response">
- <param name="myKey" type="Common.MyKey" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of GetVehicleData-->
- <!--Qt HMI version of OnVehicleData-->
- <function name="OnGpsData" messagetype="notification" provider="hmi">
- <param name="gps" type="Common.GPSData" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="OnSpeed" messagetype="notification" provider="hmi">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="OnRpm" messagetype="notification" provider="hmi">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="OnFuelLevel" messagetype="notification" provider="hmi">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="OnFuelLevelState" messagetype="notification" provider="hmi">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="OnInstantFuelConsumption" messagetype="notification" provider="hmi">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="OnExternalTemperature" messagetype="notification" provider="hmi">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="OnVin" messagetype="notification" provider="hmi">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number.</description>
- </param>
- </function>
- <function name="OnPrndl" messagetype="notification" provider="hmi">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="OnTirePressure" messagetype="notification" provider="hmi">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="OnOdometer" messagetype="notification" provider="hmi">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="OnBeltStatus" messagetype="notification" provider="hmi">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="OnBodyInformation" messagetype="notification" provider="hmi">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="OnDeviceStatus" messagetype="notification" provider="hmi">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="OnDriverBraking" messagetype="notification" provider="hmi">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="OnWiperStatus" messagetype="notification" provider="hmi">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="OnHeadLampStatus" messagetype="notification" provider="hmi">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="OnEngineTorque" messagetype="notification" provider="hmi">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="OnAccPedalPosition" messagetype="notification" provider="hmi">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="OnSteeringWheelAngle" messagetype="notification" provider="hmi">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnECallInfo" messagetype="notification" provider="hmi">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnAirbagStatus" messagetype="notification" provider="hmi">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnEmergencyEvent" messagetype="notification" provider="hmi">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnClusterModeStatus" messagetype="notification" provider="hmi">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnMyKey" messagetype="notification" provider="hmi">
- <param name="myKey" type="Common.MyKey" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of OnVehicleData-->
- <!--Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- <function name="SubscribeGps" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="UnsubscribeGps" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="SubscribeSpeed" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="SubscribeRpm" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="UnsubscribeRpm" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="SubscribeFuelLevel" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="SubscribeExternalTemperature" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="SubscribePrndl" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="UnsubscribePrndl" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="SubscribeVin" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="UnsubscribeVin" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="SubscribeTirePressure" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="SubscribeOdometer" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="SubscribeBeltStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="SubscribeBodyInformation" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="SubscribeDeviceStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="SubscribeDriverBraking" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="SubscribeWiperStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="SubscribeEngineTorque" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="SubscribeECallInfo" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="SubscribeAirbagStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="SubscribeMyKey" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- </interface>
- <!-- Policies -->
- <interface name="SDL" version="1.0" date="2014-03-12">
- <function name="ActivateApp" messagetype="request" provider="sdl">
- <param name="appID" type="Integer" mandatory="true">
- </param>
- </function>
- <function name="ActivateApp" messagetype="response">
- <param name="isSDLAllowed" type="Boolean" mandatory="true" scope="internal"/>
- <param name="device" type="Common.DeviceInfo" mandatory="false" scope="internal">
- <description>If isSDLAllowed is false, consent for sending PT through specified device is required.</description>
- </param>
- <param name="isPermissionsConsentNeeded" type="Boolean" mandatory="true"/>
- <param name="isAppPermissionsRevoked" type="Boolean" mandatory="true"/>
- <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
- </param>
- <param name="isAppRevoked" type="Boolean" mandatory="true"/>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- </function>
- <function name="GetUserFriendlyMessage" messagetype="request" scope="internal" provider="sdl">
- <description>Request from HMI to SDL to get user friendly messages for UI/TTS info boxes/texts (i.e. for help/dialogs etc) from Policy Table.</description>
- <param name="messageCodes" type="String" array="true" minsize="1" maxsize="100" maxlength="500" mandatory="true">
- <description>Id of message to be received according to Policy Table i.e. StatusNeeded, Notifications, DrivingCharacteristics etc.</description>
- </param>
- <param name="language" type="Common.Language" mandatory="false">
- <description>Optional parameter if HMI wants message in some other language then its current one already known to SDL.</description>
- </param>
- </function>
- <function name="GetUserFriendlyMessage" messagetype="response">
- <param name="messages" type="Common.UserFriendlyMessage" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If no message was found in PT for specified message code and for HMI current or specified language, this parameter will be omitted.</description>
- </param>
- </function>
- <function name="OnAllowSDLFunctionality" messagetype="notification" provider="hmi">
- <description>Initiated by HMI. Notifies about user/HMI allowing SDL functionality or disallowing access to all mobile apps. Needed if HMI has additional ways of asking user about this (i.e. Settings etc)</description>
- <param name="device" type="Common.DeviceInfo" mandatory="false">
- <description>If no device is specified permission counts for SDL functionality in general.</description>
- </param>
- <param name="allowed" type="Boolean" mandatory="true">
- <description>Must be true if allowed</description>
- </param>
- <param name="source" type="Common.ConsentSource" mandatory="true"/>
- </function>
- <!-- SyncP RPC-->
- <function name="OnReceivedPolicyUpdate" messagetype="notification" provider="hmi">
- <description>
- From: SYNCP Manager
- To: SDL
- Notification sent to SDL when SYNCP Manager receives and decrypts updated policy table
- </description>
- <param name="policyfile" type="String" minlength="1" maxlength="255" mandatory="true">
- <description>Location of decrypted policy table Json file on target</description>
- </param>
- </function>
- <function name="OnPolicyUpdate" messagetype="notification" provider="hmi">
- <description>
- From: SYNCP Manager
- To: SDL
- Notifies SDL to supply a new "PolicyUpdate" request with more recent snapshot data
- </description>
- </function>
- <!-- End of SyncP RPC-->
- <function name="GetListOfPermissions" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to get list of permissions for app. If no app specified - list of permissions for all apps.</description>
- <param name="appID" type="Integer" mandatory="false"/>
- </function>
- <function name="GetListOfPermissions" messagetype="response">
- <param name="allowedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="0" maxsize="100">
- <description>If no permissions were specified for application the array will come empty.</description>
- </param>
- </function>
- <function name="OnAppPermissionConsent" messagetype="notification" provider="hmi">
- <description>Initiated by HMI for specifying the allowance for the application to perform some functionality. Duplicates functionality of the request, needed if HMI has specific ways to allow/disallow functionality (i.e.Setting Menu)</description>
- <param name="appID" type="Integer" mandatory="false">
- <description>Information about the application. See HMIApplication. If omitted - allow/disallow all applications </description>
- </param>
- <param name="consentedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="1" maxsize="100">
- </param>
- <param name="source" type="Common.ConsentSource" mandatory="true"/>
- </function>
- <function name="OnAppPermissionChanged" messagetype="notification" provider="sdl">
- <description>Notification from SDL to HMI. Occurs when app permissions were reduced. If no permission specified means that app was dissallowed and has to be unregitstered.</description>
- <param name="appID" type="Integer" mandatory="true"/>
- <param name="isAppPermissionsRevoked" type="Boolean" mandatory="false"/>
- <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
- </param>
- <param name="appRevoked" type="Boolean" mandatory="false">
- <description>If present then specified application was prohibited to used with Sync.</description>
- </param>
- <param name="appPermissionsConsentNeeded" type="Boolean" mandatory="false">
- <description>If present specifies that permissions were added to application that require User Consent, then HMI can send GetListOfPermissions request to obtain list of permissions.</description>
- </param>
- <param name="appUnauthorized" type="Boolean" mandatory="false">
- <description>When present and set to true (should be if present) then this means that application was not authorized (nickname check failed.)</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- <param name="requestType" type="Common.RequestType" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The list of SystemRequest's RequestTypes allowed by policies for the named application (the app's SystemRequest sent with RequestType out of this list will get 'disallowed' response from SDL).
- If SDL sends an empty array - any RequestType is allowed for this app.
- If SDL omits this parameter - nothing is changed for RequestType in the policies
- </description>
- </param>
- </function>
- <function name="OnSDLConsentNeeded" messagetype="notification" provider="sdl">
- <description>Send from SDL to HMI to notify that data consent is needed for device either because PT update or Retry strategy.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="UpdateSDL" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to start update of Policy Table.</description>
- </function>
- <function name="UpdateSDL" messagetype="response">
- <description>Specify result: no update needed, update was successful/unsuccessful etc</description>
- <param name="result" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="GetStatusUpdate" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to find out current status of PT exchange process.</description>
- </function>
- <function name="GetStatusUpdate" messagetype="response">
- <param name="status" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="OnStatusUpdate" messagetype="notification" provider="sdl">
- <description>Notification from SDL to HMI when current status of PT exchange changed (i.e. it Succeded or Failed etc)</description>
- <param name="status" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="OnSystemError" messagetype="notification" provider="hmi">
- <param name="error" type="Common.SystemError" mandatory="true"/>
- </function>
- <function name="AddStatisticsInfo" messagetype="notification" provider="hmi">
- <description>Sent by system to record statiscs and error counts. Increases statistics specified by statisticType by one.</description>
- <param name="statisticType" type="Common.StatisticsType" mandatory="true"/>
- </function>
- <function name="GetURLS" messagetype="request" scope="internal" provider="sdl">
- <description>Sent by system to SDL to get list of URL for specified service type and optionally policy's application id.</description>
- <param name="service" type="Integer" minvalue="0" maxvalue="100" mandatory="true"/>
- </function>
- <function name="GetURLS" messagetype="response" scope="internal">
- <param name="urls" type="Common.ServiceInfo" array="true" mandatory="false" minsize="1" maxsize="100"/>
- </function>
- <function name="OnDeviceStateChanged" messagetype="notification" scope="internal" provider="hmi">
- <param name="deviceState" type="Common.DeviceState" mandatory="true"/>
- <param name="deviceInternalId" type="String" mandatory="true" minlength="0" maxlength="500"/>
- <param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
- </function>
- </interface>
-<interface name="RC" version="1.1.0" date="2017-07-18">
- <function name="IsReady" messagetype="request">
- <description>Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if vehicle RC modules are present and ready to communicate with SDL.</description>
- </param>
- </function>
-
- <function name="GetCapabilities" messagetype="request">
- <description>Method is invoked at system startup by SDL to request information about Remote Control capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false">
- <description>See RemoteControlCapabilities, all available RC modules and buttons shall be returned.</description>
- </param>
- </function>
-
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- <description>The module type and data to set</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Internal SDL-assigned ID of the related application</description>
- </param>
- </function>
-
- <function name="SetInteriorVehicleData" messagetype="response">
- <description>Used to set the values of one zone and one data type within that zone</description>
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- </param>
- </function>
-
-<function name="GetInteriorVehicleData" messagetype="request">
- <param name="moduleType" type="Common.ModuleType" mandatory="true" >
- <description>The module data to retrieve from the vehicle for that type</description>
- </param>
- <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
- <description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Internal SDL-assigned ID of the related application</description>
- </param>
-</function>
-
-<function name="GetInteriorVehicleData" messagetype="response">
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- </param>
- <param name="isSubscribed" type="Boolean" mandatory="false" >
- <description>Is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
- if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleDescription.
- if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.</description>
- </param>
-</function>
-
-<function name="GetInteriorVehicleDataConsent" messagetype="request">
- <description>Sender: SDL->HMI. </description>
- <description>HMI is expected to display a permission prompt to the driver showing the RC module and app details (for example, app's name).
- The driver is expected to have an ability to grant or deny the permission.</description>
- <param name="moduleType" type="Common.ModuleType" mandatory="true">
- <description>The module type that the app requests to control.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application that triggers the permission prompt.</description>
- </param>
- </function>
- <function name="GetInteriorVehicleDataConsent" messagetype="response">
- <param name="allowed" type="Boolean" mandatory="true">
- <description>"true" - if the driver grants the permission for controlling to the named app;
- "false" - in case the driver denies the permission for controlling to the named app.</description>
- </param>
-</function>
-
-<function name="OnInteriorVehicleData" messagetype="notification">
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- </param>
-</function>
-
-<function name="OnRemoteControlSettings" messagetype="notification">
- <description>Sender: vehicle -> RSDL. Notification about remote-control settings changed. Sent after User`s choice through HMI.</description>
- <param name="allowed" type="Boolean" mandatory="false" >
- <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
- </param>
- <param name="accessMode" type="Common.RCAccessMode" mandatory="false" >
- <description>The remote control access mode specified by the driver via HMI.</description>
- </param>
-</function>
-</interface>
-</interfaces> \ No newline at end of file
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
index 4913102c9c..9010d15dc0 100644
--- a/src/components/media_manager/CMakeLists.txt
+++ b/src/components/media_manager/CMakeLists.txt
@@ -35,7 +35,6 @@ include_directories(
${COMPONENTS_DIR}/media_manager/include/
${COMPONENTS_DIR}/media_manager/include/audio/
${COMPONENTS_DIR}/media_manager/include/video/
- ${COMPONENTS_DIR}/remote_control/include/
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/protocol_handler/include/
${COMPONENTS_DIR}/connection_handler/include/
@@ -43,7 +42,6 @@ include_directories(
${COMPONENTS_DIR}/smart_objects/include/
${COMPONENTS_DIR}/policy/include/
${COMPONENTS_DIR}/rpc_base/include/
- ${COMPONENTS_DIR}/functional_module/include/
${COMPONENTS_DIR}/hmi_message_handler/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/config_profile/include/
diff --git a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
index 3645a9cb81..a246e468b7 100644
--- a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
+++ b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
@@ -62,6 +62,12 @@ typedef enum {
typedef enum { AT_INVALID = -1, AT_PCM = 0 } AudioType;
+// AudioPassThru
+typedef struct {
+ std::vector<uint8_t> binary_data;
+ int32_t session_key;
+} AudioData;
+
/*
* @brief AudioStreamSenderThread class used to read binary data written from
* microphone
@@ -104,6 +110,18 @@ class AudioStreamSenderThread : public threads::ThreadDelegate {
*/
bool SendEndAudioPassThru();
+ /**
+ * @brief Creates AudioPassThru data chunk and inserts it
+ * to audio_pass_thru_messages_
+ *
+ * @param session_key Id of application for which
+ * audio pass thru should be sent
+ *
+ * @param binary_data AudioPassThru data chunk
+ */
+ void SendAudioPassThroughNotification(uint32_t session_key,
+ std::vector<uint8_t>& binary_data);
+
void sendAudioChunkToMobile();
bool getShouldBeStopped();
diff --git a/src/components/media_manager/include/media_manager/media_adapter_impl.h b/src/components/media_manager/include/media_manager/media_adapter_impl.h
index 75c48c98b7..37401f9c2b 100644
--- a/src/components/media_manager/include/media_manager/media_adapter_impl.h
+++ b/src/components/media_manager/include/media_manager/media_adapter_impl.h
@@ -40,7 +40,7 @@
namespace media_manager {
-typedef utils::SharedPtr<MediaAdapterListener> MediaListenerPtr;
+typedef std::shared_ptr<MediaAdapterListener> MediaListenerPtr;
class MediaAdapterImpl : public MediaAdapter {
public:
@@ -57,7 +57,7 @@ class MediaAdapterImpl : public MediaAdapter {
DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl);
};
-typedef utils::SharedPtr<MediaAdapterImpl> MediaAdapterImplPtr;
+typedef std::shared_ptr<MediaAdapterImpl> MediaAdapterImplPtr;
} // namespace media_manager
diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h
index 7fbd4f2f6f..749356e656 100644
--- a/src/components/media_manager/include/media_manager/media_manager_impl.h
+++ b/src/components/media_manager/include/media_manager/media_manager_impl.h
@@ -86,10 +86,10 @@ class MediaManagerImpl : public MediaManager,
void set_mock_mic_listener(MediaListenerPtr media_listener);
void set_mock_mic_recorder(MediaAdapterImpl* media_adapter);
void set_mock_streamer(protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterImpl> mock_stream);
+ std::shared_ptr<MediaAdapterImpl> mock_stream);
void set_mock_streamer_listener(
protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterListener> mock_stream);
+ std::shared_ptr<MediaAdapterListener> mock_stream);
#endif // BUILD_TESTS
protected:
diff --git a/src/components/media_manager/include/media_manager/streamer_adapter.h b/src/components/media_manager/include/media_manager/streamer_adapter.h
index 5ac8e05cac..56bf941f8e 100644
--- a/src/components/media_manager/include/media_manager/streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/streamer_adapter.h
@@ -37,8 +37,7 @@
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/atomic_object.h"
-#include "utils/shared_ptr.h"
+#include <atomic>
#include "protocol/raw_message.h"
namespace media_manager {
@@ -80,7 +79,7 @@ class StreamerAdapter : public MediaAdapterImpl {
virtual bool Send(protocol_handler::RawMessagePtr msg) = 0;
private:
- sync_primitives::atomic_bool stop_flag_;
+ std::atomic_bool stop_flag_;
StreamerAdapter* adapter_;
DISALLOW_COPY_AND_ASSIGN(Streamer);
@@ -96,7 +95,7 @@ class StreamerAdapter : public MediaAdapterImpl {
DISALLOW_COPY_AND_ASSIGN(StreamerAdapter);
};
-typedef utils::SharedPtr<StreamerAdapter> StreamerAdapterPtr;
+typedef std::shared_ptr<StreamerAdapter> StreamerAdapterPtr;
} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
index 5e9d6ab0ba..91e3c5465d 100644
--- a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
+++ b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
@@ -91,19 +91,19 @@ void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
if (application_key != current_application_) {
current_application_ = application_key;
- uint32_t device_id = 0;
+ transport_manager::DeviceHandle device_id = 0;
session_observer_.GetDataOnSessionKey(application_key, 0, NULL, &device_id);
- std::string mac_adddress;
- session_observer_.GetDataOnDeviceID(device_id, NULL, NULL, &mac_adddress);
+ std::string mac_address;
+ session_observer_.GetDataOnDeviceID(device_id, NULL, NULL, &mac_address);
- // TODO(PK): Convert mac_adddress to the
+ // TODO(PK): Convert mac_address to the
// following format : "bluez_source.XX_XX_XX_XX_XX_XX" if needed
// before passing to the A2DPSourcePlayerThread constructor
A2DPSourcePlayerThread* delegate =
- new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_adddress);
+ new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_address);
threads::Thread* new_activity =
- threads::CreateThread(mac_adddress.c_str(), delegate);
+ threads::CreateThread(mac_address.c_str(), delegate);
sources_[application_key] = Pair(new_activity, delegate);
new_activity->start();
}
diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
index 9b0057dfe8..23181e7431 100644
--- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
+++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
@@ -38,8 +38,9 @@
#include <string>
#include <string.h>
#include "application_manager/application_manager.h"
-#include "application_manager/mobile_command_factory.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/commands/command.h"
#include "smart_objects/smart_object.h"
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
@@ -51,6 +52,7 @@
namespace media_manager {
using sync_primitives::AutoLock;
+namespace strings = application_manager::strings;
#ifdef EXTENDED_MEDIA_MODE
const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 50;
@@ -59,6 +61,15 @@ const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1000;
#endif
const uint32_t kMqueueMessageSize = 4095;
+// Size of RIFF header contained in a .wav file: 12 bytes for 'RIFF' chunk
+// descriptor, 24 bytes for 'fmt ' sub-chunk and 8 bytes for 'data' sub-chunk
+// header.
+// The correct format of audio stream for AudioPassThru feature is to include
+// only audio sample data. Since both pre-recorded file (audio.8bit.wav) and
+// GStreamer-generated file contain RIFF header, we will skip it when reading
+// the files.
+static const uint32_t kRIFFHeaderSize = 44;
+
CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
AudioStreamSenderThread::AudioStreamSenderThread(
@@ -67,7 +78,7 @@ AudioStreamSenderThread::AudioStreamSenderThread(
application_manager::ApplicationManager& app_mngr)
: session_key_(session_key)
, fileName_(fileName)
- , offset_(0)
+ , offset_(kRIFFHeaderSize)
, shouldBeStoped_(false)
, shouldBeStoped_lock_()
, shouldBeStoped_cv_()
@@ -80,7 +91,7 @@ AudioStreamSenderThread::~AudioStreamSenderThread() {}
void AudioStreamSenderThread::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
- offset_ = 0;
+ offset_ = kRIFFHeaderSize;
while (false == getShouldBeStopped()) {
AutoLock auto_lock(shouldBeStoped_lock_);
@@ -118,15 +129,59 @@ void AudioStreamSenderThread::sendAudioChunkToMobile() {
offset_ = offset_ + to - from;
std::vector<uint8_t> data(from, to);
- application_manager_.SendAudioPassThroughNotification(session_key_, data);
+ SendAudioPassThroughNotification(session_key_, data);
binaryData.clear();
}
#if !defined(EXTENDED_MEDIA_MODE)
// without recording stream restart reading 1-sec file
- offset_ = 0;
+ offset_ = kRIFFHeaderSize;
#endif
}
+void AudioStreamSenderThread::SendAudioPassThroughNotification(
+ uint32_t session_key, std::vector<uint8_t>& binary_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!application_manager_.is_audio_pass_thru_active()) {
+ LOG4CXX_ERROR(logger_,
+ "Trying to send PassThroughNotification"
+ " when PassThrough is not active");
+ return;
+ }
+
+ AudioData data;
+ data.session_key = session_key;
+ data.binary_data = binary_data;
+
+ smart_objects::SmartObjectSPtr on_audio_pass =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_audio_pass) {
+ LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Fill smart object");
+
+ (*on_audio_pass)[strings::params][strings::message_type] =
+ application_manager::MessageType::kNotification;
+
+ (*on_audio_pass)[strings::params][strings::connection_key] =
+ static_cast<int32_t>(data.session_key);
+ (*on_audio_pass)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnAudioPassThruID;
+
+ LOG4CXX_DEBUG(logger_, "Fill binary data");
+ // binary data
+ (*on_audio_pass)[strings::params][strings::binary_data] =
+ smart_objects::SmartObject(data.binary_data);
+
+ LOG4CXX_DEBUG(logger_, "After fill binary data");
+ LOG4CXX_DEBUG(logger_, "Send data");
+ application_manager_.GetRPCService().ManageMobileCommand(
+ on_audio_pass, application_manager::commands::Command::SOURCE_SDL);
+}
+
bool AudioStreamSenderThread::getShouldBeStopped() {
AutoLock auto_lock(shouldBeStoped_lock_);
diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
index 99548e71bd..5c12614662 100644
--- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
+++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
@@ -42,6 +42,9 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
GMainLoop* FromMicToFileRecorderThread::loop = NULL;
+// As per spec, AudioPassThru recording is in monaural
+static const int kNumAudioChannels = 1;
+
FromMicToFileRecorderThread::FromMicToFileRecorderThread(
const std::string& output_file, int32_t duration)
: threads::ThreadDelegate()
@@ -119,7 +122,8 @@ void FromMicToFileRecorderThread::threadMain() {
initArgs();
GstElement* pipeline;
- GstElement* alsasrc, *wavenc, *filesink;
+ GstElement* alsasrc, *audioconvert, *capsfilter, *wavenc, *filesink;
+ GstCaps* audiocaps;
GstBus* bus;
const gchar* device = "hw:0,0";
@@ -196,11 +200,18 @@ void FromMicToFileRecorderThread::threadMain() {
// Create all of the elements to be added to the pipeline
alsasrc = gst_element_factory_make("alsasrc", "alsasrc0");
+ audioconvert = gst_element_factory_make("audioconvert", "audioconvert0");
+ capsfilter = gst_element_factory_make("capsfilter", "filter0");
wavenc = gst_element_factory_make("wavenc", "wavenc0");
filesink = gst_element_factory_make("filesink", "filesink0");
+ // create a capability to downmix the recorded audio to monaural
+ audiocaps = gst_caps_new_simple(
+ "audio/x-raw", "channels", G_TYPE_INT, kNumAudioChannels, NULL);
+
// Assert that all the elements were created
- if (!alsasrc || !wavenc || !filesink) {
+ if (!alsasrc || !audioconvert || !capsfilter || !wavenc || !filesink ||
+ !audiocaps) {
g_error("Failed creating one or more of the pipeline elements.\n");
}
@@ -209,10 +220,21 @@ void FromMicToFileRecorderThread::threadMain() {
g_object_set(G_OBJECT(filesink), "location", outfile, NULL);
// Add the elements to the pipeline
- gst_bin_add_many(GST_BIN(pipeline), alsasrc, wavenc, filesink, NULL);
+ gst_bin_add_many(GST_BIN(pipeline),
+ alsasrc,
+ audioconvert,
+ capsfilter,
+ wavenc,
+ filesink,
+ NULL);
// Link the elements
- gst_element_link_many(alsasrc, wavenc, filesink, NULL);
+ gst_element_link_many(
+ alsasrc, audioconvert, capsfilter, wavenc, filesink, NULL);
+
+ // set the capability
+ g_object_set(G_OBJECT(capsfilter), "caps", audiocaps, NULL);
+ gst_caps_unref(audiocaps);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index 6a9ded9029..ec88e910d3 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -98,13 +98,13 @@ void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) {
void MediaManagerImpl::set_mock_streamer(
protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterImpl> mock_stream) {
+ std::shared_ptr<MediaAdapterImpl> mock_stream) {
streamer_[stype] = mock_stream;
}
void MediaManagerImpl::set_mock_streamer_listener(
protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterListener> mock_stream) {
+ std::shared_ptr<MediaAdapterListener> mock_stream) {
streamer_listener_[stype] = mock_stream;
}
@@ -120,29 +120,36 @@ void MediaManagerImpl::Init() {
#endif
if ("socket" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new SocketVideoStreamerAdapter(
- settings().server_address(), settings().video_streaming_port());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<SocketVideoStreamerAdapter>(
+ settings().server_address(), settings().video_streaming_port());
} else if ("pipe" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new PipeVideoStreamerAdapter(
- settings().named_video_pipe_path(), settings().app_storage_folder());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<PipeVideoStreamerAdapter>(
+ settings().named_video_pipe_path(),
+ settings().app_storage_folder());
} else if ("file" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new FileVideoStreamerAdapter(
- settings().video_stream_file(), settings().app_storage_folder());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<FileVideoStreamerAdapter>(
+ settings().video_stream_file(), settings().app_storage_folder());
}
if ("socket" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new SocketAudioStreamerAdapter(
- settings().server_address(), settings().audio_streaming_port());
+ streamer_[ServiceType::kAudio] =
+ std::make_shared<SocketAudioStreamerAdapter>(
+ settings().server_address(), settings().audio_streaming_port());
} else if ("pipe" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new PipeAudioStreamerAdapter(
+ streamer_[ServiceType::kAudio] = std::make_shared<PipeAudioStreamerAdapter>(
settings().named_audio_pipe_path(), settings().app_storage_folder());
} else if ("file" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new FileAudioStreamerAdapter(
+ streamer_[ServiceType::kAudio] = std::make_shared<FileAudioStreamerAdapter>(
settings().audio_stream_file(), settings().app_storage_folder());
}
- streamer_listener_[ServiceType::kMobileNav] = new StreamerListener(*this);
- streamer_listener_[ServiceType::kAudio] = new StreamerListener(*this);
+ streamer_listener_[ServiceType::kMobileNav] =
+ std::make_shared<StreamerListener>(*this);
+ streamer_listener_[ServiceType::kAudio] =
+ std::make_shared<StreamerListener>(*this);
if (streamer_[ServiceType::kMobileNav]) {
streamer_[ServiceType::kMobileNav]->AddListener(
@@ -187,8 +194,8 @@ void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key,
std::string file_path = settings().app_storage_folder();
file_path += "/";
file_path += output_file;
- from_mic_listener_ =
- new FromMicRecorderListener(file_path, application_manager_);
+ from_mic_listener_ = std::make_shared<FromMicRecorderListener>(
+ file_path, application_manager_);
#ifdef EXTENDED_MEDIA_MODE
if (from_mic_recorder_) {
from_mic_recorder_->AddListener(from_mic_listener_);
diff --git a/src/components/media_manager/src/streamer_adapter.cc b/src/components/media_manager/src/streamer_adapter.cc
index 90a40b1add..37cb1426dc 100644
--- a/src/components/media_manager/src/streamer_adapter.cc
+++ b/src/components/media_manager/src/streamer_adapter.cc
@@ -48,8 +48,8 @@ StreamerAdapter::~StreamerAdapter() {
streamer_->Close();
}
thread_->join();
- threads::DeleteThread(thread_);
delete streamer_;
+ threads::DeleteThread(thread_);
}
void StreamerAdapter::StartActivity(int32_t application_key) {
diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
index 80b2ee3377..96499d9358 100644
--- a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
+++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
@@ -44,10 +44,9 @@ using namespace media_manager;
class MockMediaAdapterImpl : public ::media_manager::MediaAdapterImpl {
public:
- MOCK_METHOD1(AddListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
+ MOCK_METHOD1(AddListener, void(const std::shared_ptr<MediaAdapterListener>&));
MOCK_METHOD1(RemoveListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
+ void(const std::shared_ptr<MediaAdapterListener>&));
MOCK_METHOD2(SendData,
void(int32_t application_key,
const ::protocol_handler::RawMessagePtr message));
diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc
index a9dc27d7a3..c77c984a75 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -44,8 +44,7 @@
#include "application_manager/state_controller.h"
#include "protocol_handler/mock_protocol_handler.h"
#include "protocol/common.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
+
#include "utils/file_system.h"
#include "utils/scope_guard.h"
@@ -58,7 +57,7 @@ using namespace ::media_manager;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::utils::SharedPtr;
+
using ::utils::ScopeGuard;
using ::utils::MakeGuard;
using ::testing::NiceMock;
@@ -99,20 +98,18 @@ void dealloc_file(std::ofstream* test_file) {
} // namespace
typedef NiceMock<application_manager_test::MockApplication> MockApp;
-typedef SharedPtr<MockApp> MockAppPtr;
-typedef SharedPtr<MockMediaAdapterImpl> MockMediaAdapterImplPtr;
+typedef std::shared_ptr<MockApp> MockAppPtr;
+typedef std::shared_ptr<MockMediaAdapterImpl> MockMediaAdapterImplPtr;
class MediaManagerImplTest : public ::testing::Test {
public:
- // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
- MediaManagerImplTest() : media_adapter_mock_(new MockMediaAdapter()) {
- media_adapter_listener_mock_ =
- utils::MakeShared<MockMediaAdapterListener>();
+ MediaManagerImplTest() {
+ media_adapter_listener_mock_ = std::make_shared<MockMediaAdapterListener>();
ON_CALL(mock_media_manager_settings_, video_server_type())
.WillByDefault(ReturnRef(kDefaultValue));
ON_CALL(mock_media_manager_settings_, audio_server_type())
.WillByDefault(ReturnRef(kDefaultValue));
- mock_app_ = ::utils::MakeShared<MockApp>();
+ mock_app_ = std::make_shared<MockApp>();
media_manager_impl_.reset(
new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
}
@@ -181,7 +178,7 @@ class MediaManagerImplTest : public ::testing::Test {
.WillOnce(Return(mock_app_));
EXPECT_CALL(*mock_app_, WakeUpStreaming(service_type));
MockMediaAdapterImplPtr mock_media_streamer =
- utils::MakeShared<MockMediaAdapterImpl>();
+ std::make_shared<MockMediaAdapterImpl>();
media_manager_impl_->set_mock_streamer(service_type, mock_media_streamer);
media_manager_impl_->set_mock_streamer_listener(
service_type, media_adapter_listener_mock_);
@@ -204,11 +201,10 @@ class MediaManagerImplTest : public ::testing::Test {
application_manager_test::MockApplicationManager app_mngr_;
MockAppPtr mock_app_;
- SharedPtr<MockMediaAdapterListener> media_adapter_listener_mock_;
- MockMediaAdapter* media_adapter_mock_;
+ std::shared_ptr<MockMediaAdapterListener> media_adapter_listener_mock_;
const ::testing::NiceMock<MockMediaManagerSettings>
mock_media_manager_settings_;
- SharedPtr<MediaManagerImpl> media_manager_impl_;
+ std::shared_ptr<MediaManagerImpl> media_manager_impl_;
};
TEST_F(MediaManagerImplTest,
@@ -277,14 +273,17 @@ TEST_F(MediaManagerImplTest, Init_Settings_ExpectFileValue) {
}
TEST_F(MediaManagerImplTest, PlayA2DPSource_WithCorrectA2DP_SUCCESS) {
- media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
- EXPECT_CALL(*media_adapter_mock_, StartActivity(kApplicationKey));
+ // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
+ MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
+ EXPECT_CALL(*media_adapter_mock, StartActivity(kApplicationKey));
media_manager_impl_->PlayA2DPSource(kApplicationKey);
}
TEST_F(MediaManagerImplTest, StopA2DPSource_WithCorrectA2DP_SUCCESS) {
- media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
- EXPECT_CALL(*media_adapter_mock_, StopActivity(kApplicationKey));
+ MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
+ EXPECT_CALL(*media_adapter_mock, StopActivity(kApplicationKey));
media_manager_impl_->StopA2DPSource(kApplicationKey);
}
@@ -375,11 +374,11 @@ TEST_F(MediaManagerImplTest, StopMicrophoneRecording_SUCCESS) {
TEST_F(MediaManagerImplTest,
StartStopStreaming_AudioAndVideoServiceType_SUCCESS) {
MockMediaAdapterImplPtr mock_audio_media_streamer =
- utils::MakeShared<MockMediaAdapterImpl>();
+ std::make_shared<MockMediaAdapterImpl>();
media_manager_impl_->set_mock_streamer(ServiceType::kAudio,
mock_audio_media_streamer);
MockMediaAdapterImplPtr mock_nav_media_streamer =
- utils::MakeShared<MockMediaAdapterImpl>();
+ std::make_shared<MockMediaAdapterImpl>();
media_manager_impl_->set_mock_streamer(ServiceType::kMobileNav,
mock_nav_media_streamer);
diff --git a/src/components/policy/policy_external/.gitignore b/src/components/policy/policy_external/.gitignore
index d67909069a..d6052d61da 100644
--- a/src/components/policy/policy_external/.gitignore
+++ b/src/components/policy/policy_external/.gitignore
@@ -29,8 +29,6 @@ src/appMain/hmi_link
src/appMain/smartDeviceLinkCore
test/components/application_manager/policies_manager/test_policies_table
test/components/application_manager/test_formatters_commands
-test/components/dbus/test_DBusAdapter
-test/components/dbus/test_DBusSchema
test/components/protocol_handler/test_ProtocolHandler
test/components/request_watchdog/test_RequestWatchdog
test/components/smart_objects/SchemaItem/test_SmartObject_AlwaysFalseSchemaItemTest
diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt
index 8d04f20470..c66313240f 100644
--- a/src/components/policy/policy_external/CMakeLists.txt
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -55,13 +55,10 @@ set(SOURCES
${POLICY_PATH}/src/update_status_manager.cc
${POLICY_PATH}/src/status.cc
${POLICY_PATH}/src/cache_manager.cc
+ ${POLICY_PATH}/src/access_remote_impl.cc
${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
)
-if (REMOTE_CONTROL)
- list(APPEND SOURCES ${POLICY_PATH}/src/access_remote_impl.cc)
-endif()
-
list(APPEND SOURCES
${POLICY_PATH}/src/sql_pt_ext_queries.cc
${POLICY_PATH}/src/sql_pt_ext_representation.cc
diff --git a/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
index 9854b88d5f..0144efaf7f 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
@@ -1,9 +1,9 @@
-/*! \page components_jsonhandler_formatters Smart Objects Formatters
+/*! \page components_jsonhandler_formatters Smart Objects formatters
In order to create JSON string representation from Smart Object or create Smart Object data structure from JSON string representation JSON Handler component has special classes called formatters.
-The interface of formatter is quite simple and defined by NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class. Actually it has two methods - NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
+The interface of formatter is quite simple and defined by ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class. Actually it has two methods - ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
-Current implementation has two different implementations of NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class: NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
+Current implementation has two different implementations of ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class: ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
index 6505ae6f43..2c23555902 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
@@ -1,11 +1,11 @@
/*! \page components_smartobjects_types_repr Type value representation methods for SmartObjects
-As alternative to the type casts NsSmartDeviceLink::NsSmartObjects::CSmartObject class defines set of usable methods that allow to represent object values as desired type. Use of these methods may change code style and readability but functionally it completely similar to the type casts of Smart Objects.
+As alternative to the type casts ns_smart_device_link::ns_smart_objects::CSmartObject class defines set of usable methods that allow to represent object values as desired type. Use of these methods may change code style and readability but functionally it completely similar to the type casts of Smart Objects.
Example:
<pre>
-NsSmartDeviceLink::NsSmartObjects::CSmartObject obj;
+ns_smart_device_link::ns_smart_objects::CSmartObject obj;
obj[0] = 1;
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
index 2e611f74b9..a031e9fd86 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
@@ -1,25 +1,25 @@
/*! \page components_smartobjects_validation_items Schema structure: Schema Items
-In order to create new Schema (new object of class NsSmartDeviceLink::NsSmartObjects::CSmartSchema) client first must define all required Schema Items. Actually every Schema is a tree of respective Schema Items. Each node and leaf of that tree defines structural rules for some Smart Object data structure.
+In order to create new Schema (new object of class ns_smart_device_link::ns_smart_objects::CSmartSchema) client first must define all required Schema Items. Actually every Schema is a tree of respective Schema Items. Each node and leaf of that tree defines structural rules for some Smart Object data structure.
-Schema Items are represented as class hierarchy. The base class for all schema items is a NsSmartDeviceLink::NsSmartObjects::ISchemaItem class. This base class defines generic validation interface for Schema Items.
+Schema Items are represented as class hierarchy. The base class for all schema items is a ns_smart_device_link::ns_smart_objects::ISchemaItem class. This base class defines generic validation interface for Schema Items.
-To define special elements with always successful or always failing validation there are two special Schema Items: NsSmartDeviceLink::NsSmartObjects::CAlwaysTrueSchemaItem and NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem.
+To define special elements with always successful or always failing validation there are two special Schema Items: ns_smart_device_link::ns_smart_objects::CAlwaysTrueSchemaItem and ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem.
-NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem is used for boolean values and has no parameters (only verifies that respective Smart Object is really has boolean value).
+ns_smart_device_link::ns_smart_objects::CBoolSchemaItem is used for boolean values and has no parameters (only verifies that respective Smart Object is really has boolean value).
-NsSmartDeviceLink::NsSmartObjects::TNumberSchemaItem is template Schema Item that can be used for both integer and floating point values. In addition to the regular type verification it is possible to set min and max value range (these values are optional).
+ns_smart_device_link::ns_smart_objects::TNumberSchemaItem is template Schema Item that can be used for both integer and floating point values. In addition to the regular type verification it is possible to set min and max value range (these values are optional).
-NsSmartDeviceLink::NsSmartObjects::TEnumSchemaItem is used to verify any custom client-defined enum.
+ns_smart_device_link::ns_smart_objects::TEnumSchemaItem is used to verify any custom client-defined enum.
-NsSmartDeviceLink::NsSmartObjects::CStringSchemaItem is used to verify a string values. As optional parameter max length of the string could be set.
+ns_smart_device_link::ns_smart_objects::CStringSchemaItem is used to verify a string values. As optional parameter max length of the string could be set.
-NsSmartDeviceLink::NsSmartObjects::CArraySchemaItem provides validation for array. Can be used to verify special type and array size.
+ns_smart_device_link::ns_smart_objects::CArraySchemaItem provides validation for array. Can be used to verify special type and array size.
-NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem used in case when Schema Item includes another Schema Item. Actually this is only way to create tree node of new Schema. All other Schema Items will be used only to become leafs of validation tree.
+ns_smart_device_link::ns_smart_objects::CObjectSchemaItem used in case when Schema Item includes another Schema Item. Actually this is only way to create tree node of new Schema. All other Schema Items will be used only to become leafs of validation tree.
After creation of all required Schema Items (which is actually bind in the tree) it is possible to create Schema.
-Schema can be initialized not only by raw root Schema Item, but also by special abstraction called Member (defined by NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem::SMember class). So every root item (NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem) firstly should be wrapped as Member. This wrapping process also allows to set "is mandatory" status for every Member.
+Schema can be initialized not only by raw root Schema Item, but also by special abstraction called Member (defined by ns_smart_device_link::ns_smart_objects::CObjectSchemaItem::SMember class). So every root item (ns_smart_device_link::ns_smart_objects::CObjectSchemaItem) firstly should be wrapped as Member. This wrapping process also allows to set "is mandatory" status for every Member.
and pass root Schema Item as initial parameter to the new Schema.
@@ -77,21 +77,21 @@ schemaMembersMap["info"] = CObjectSchemaItem::SMember(info_SchemaItem, false);
std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(FunctionIDItems), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(FunctionIDItems), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(MessageTypeItems), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(MessageTypeItems), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(1, 2), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(1, 2), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
-rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap), true);
+rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap), true);
-rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap), true);
+rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap), true);
CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
index a02f0be4bd..c651af5294 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
@@ -1,9 +1,9 @@
/*! \page components_smartobjects_validation_use Using Schema for validation
-The main purpose of Schema is validation of existing Smart Object. This process includes type and value validation. The client can use results of validation to determine if given Smart Object is valid or not. Validation of specific Smart Object can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::validate method. Internally Schema triggers respective validate method of every Schema Item in order to perform validation.
+The main purpose of Schema is validation of existing Smart Object. This process includes type and value validation. The client can use results of validation to determine if given Smart Object is valid or not. Validation of specific Smart Object can be triggered by using ns_smart_device_link::ns_smart_objects::CSmartSchema::validate method. Internally Schema triggers respective validate method of every Schema Item in order to perform validation.
-Another feature of Schema is capability to be applied to the Smart Object. Applying means that Schema tries to modify object to "normalize" data. Currently this "normalization" effects on string representation of enums. Applying of the Schema can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::applySchema method. Internally Schema triggers respective apply method of every Schema Item and at the moment only enum Schema Items try to covert string representation to enum values.
+Another feature of Schema is capability to be applied to the Smart Object. Applying means that Schema tries to modify object to "normalize" data. Currently this "normalization" effects on string representation of enums. Applying of the Schema can be triggered by using ns_smart_device_link::ns_smart_objects::CSmartSchema::applySchema method. Internally Schema triggers respective apply method of every Schema Item and at the moment only enum Schema Items try to covert string representation to enum values.
-To "unapply" modifications done by apply feature Schema has NsSmartDeviceLink::NsSmartObjects::CSmartSchema::unapplySchema method. It can be used to make string representations of enums.
+To "unapply" modifications done by apply feature Schema has ns_smart_device_link::ns_smart_objects::CSmartSchema::unapplySchema method. It can be used to make string representations of enums.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
index 2ba273e9d4..dab3df104d 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_connection_management Connection Management
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
- * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDeviceListener()
* in order to receive notifications.
- * To connect remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::connectDevice(). It will initiate connections to all
+ * To connect remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::connectDevice(). It will initiate connections to all
* applications running on remove device. For TCP device this call has no effect as TCP connections are initiated by remote devices.
- * Client will be notified about each connected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationConnected().
- * To disconnect all applications running on remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::disconnectDevice().
- * Client will be notified about each disconnected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationDisconnected().
+ * Client will be notified about each connected application with ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onApplicationConnected().
+ * To disconnect all applications running on remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::disconnectDevice().
+ * Client will be notified about each disconnected application with ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onApplicationDisconnected().
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
index 98dd7426be..831a0c7818 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_data_transfer Data Transfer
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener
- * interface and add itself as a data listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDataListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener
+ * interface and add itself as a data listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDataListener()
* in order to receive notifications.
- * To send frame to remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::sendFrame() poviding connection handle,
+ * To send frame to remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::sendFrame() poviding connection handle,
* frame data, data size and user data. User data is an integer that is assigned to a frame and will be sent back to client when sending of frame
* will be completed. Client may use this data to identify frame when send result will be reported. When sending of frame is completed
- * client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameSendCompleted(). When frame is received from a remote
- * device client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameReceived().
+ * client is notified via ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener::onFrameSendCompleted(). When frame is received from a remote
+ * device client is notified via ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener::onFrameReceived().
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
index eb5f3e477e..4b5b63bf87 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_device_management Device Management
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
- * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDeviceListener()
* in order to receive notifications.
- * Client of TransportManager may use NsSmartDeviceLink::NsTransportManager::ITransportManager::scanForNewDevices()
+ * Client of TransportManager may use ns_smart_device_link::ns_transport_manager::ITransportManager::scanForNewDevices()
* to initiate device scan on all device adapters that support this feature. In order to get list of available
- * devices client must override NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onDeviceListUpdated().
+ * devices client must override ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onDeviceListUpdated().
* Each device adapter will perform scan independently from other device adapters and device list might be updated
* several times (after each adapter that supports scanning finishes scanning operation). Device list might also be
* updated without device scan request, e.g. if new client connects via TCP this device will be added to device list
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
index 8916dbeb55..d4d0efeb7b 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
@@ -3,12 +3,12 @@
This chapter describes details of correct use of Transport Manager on the client side. In other words this chapter can be called "How to create effective and safe client of Transport Manager".
Transport Manager defines set of asynchronous requests (means that operations are non-blocking in the calling thread) and provides two different interfaces to monitor asynchronous responses and notifications about data update.
-Clients of Transport Manager should use NsSmartDeviceLink::NsTransportManager::ITransportManager interface to initiate any request to the component.
+Clients of Transport Manager should use ns_smart_device_link::ns_transport_manager::ITransportManager interface to initiate any request to the component.
Also Transport Manager provides two different interfaces:
-1) NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener. Client can implement this interface if it needs information about data frame send/receive.
+1) ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener. Client can implement this interface if it needs information about data frame send/receive.
-2) NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener. Client can implement this interface if it needs information about updates of devices available for communication and current client applications status.
+2) ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener. Client can implement this interface if it needs information about updates of devices available for communication and current client applications status.
For more information about typical use of Transport Manager please read the following topics:
- \subpage components_transportmanager_client_device_management "Device Management"
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
index 970aeffd83..eb5de23e35 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
@@ -1,18 +1,18 @@
/** @page components_transportmanager_internal_design_transport_adapters_bluetooth_adapter Bluetooth Adapter
*
* Bluetooth adapter handles communication with external devices via bluetooth. It is implemented in
- * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter.
+ * ns_smart_device_link::ns_transport_manager::CBluetoothAdapter.
*
* @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_discovery Device discovery
*
- * When requested by a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::scanForNewDevices() bluetooth adapter
+ * When requested by a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::scanForNewDevices() bluetooth adapter
* searches for bluetooth devices. For each found device it runs SDP query for service with SmartDeviceLink UUID
* (936DA01F-9ABD-4D9D-80C7-02AF85C822A8). Devices that support this service are added to bluetooth adapter device list.
* Bluetooth device scans are performed only when explicitly requested.
*
* @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_connecting_devices Connecting devices
*
- * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter::createConnectionsListForDevice() runs SDP query for specified device
+ * ns_smart_device_link::ns_transport_manager::CBluetoothAdapter::createConnectionsListForDevice() runs SDP query for specified device
* and fills connection list with connections to all RFCOMM channels on remote device where SmartDeviceLink service has been discovered.
*
* @see @ref components_transportmanager_internal_design_transport_adapters_common_connecting_devices
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
index d81b70dfe8..2fbd835ec9 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_internal_design_transport_adapters_tcp_adapter TCP Adapter
*
* TCP adapter handles communication with remote devices via TCP/IP socket. It is implemented in
- * NsSmartDeviceLink::NsTransportManager::CTCPAdapter.
+ * ns_smart_device_link::ns_transport_manager::CTCPAdapter.
*
* @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_listen Listening for connections
*
- * TCP adapter creates listening TCP socket (TCP port is specified in NsSmartDeviceLink::NsTransportManager::CTCPAdapter::cTCPAdapterPort)
+ * TCP adapter creates listening TCP socket (TCP port is specified in ns_smart_device_link::ns_transport_manager::CTCPAdapter::cTCPAdapterPort)
* and listens for incoming connections. Devices are identified by their IP address.
*
* @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_accept Accepting connection
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
index 3a5d0f0e91..015978b773 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
@@ -4,80 +4,80 @@
*
* @section components_transportmanager_internal_design_transport_adapters_common Common logic
*
- * Logic common to all device adapters is implemented in class NsSmartDeviceLink::NsTransportManager::CTransportAdapter.
+ * Logic common to all device adapters is implemented in class ns_smart_device_link::ns_transport_manager::CTransportAdapter.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_devices_map Devices map
*
- * Devices map is a map of device handle to internal device structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SDevice.
- * Devices map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevices. Any access to this map must be performed
- * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevicesMutex locked.
+ * Devices map is a map of device handle to internal device structure ns_smart_device_link::ns_transport_manager::CTransportAdapter::SDevice.
+ * Devices map is stored in ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDevices. Any access to this map must be performed
+ * with ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDevicesMutex locked.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connections_map Connections map
*
- * Connections map is a map of connection handle to internal connection structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection.
- * Connections map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnections. Any access to this map must be performed
- * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnectionsMutex locked.
+ * Connections map is a map of connection handle to internal connection structure ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection.
+ * Connections map is stored in ns_smart_device_link::ns_transport_manager::CTransportAdapter::mConnections. Any access to this map must be performed
+ * with ns_smart_device_link::ns_transport_manager::CTransportAdapter::mConnectionsMutex locked.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_main_thread Device adapter main thread
*
- * Device adapter main thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::run().
- * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mainThread()
+ * Device adapter main thread is started in ns_smart_device_link::ns_transport_manager::CTransportAdapter::run().
+ * Specific device adapter must implement virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::mainThread()
* and implement its specific main thread logic there.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connection_thread Device adapter connection thread
*
- * Device adapter connection thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection().
- * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectionThread()
+ * Device adapter connection thread is started in ns_smart_device_link::ns_transport_manager::CTransportAdapter::startConnection().
+ * Specific device adapter must implement virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::connectionThread()
* and implement its specific connection thread logic there. When connection is established and socket file descriptor is set
- * in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mConnectionSocket specific device adapter may call
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() to handle all communication through this socket
+ * in ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mConnectionSocket specific device adapter may call
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::handleCommunication() to handle all communication through this socket
* until connection is terminated.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_threads_termination Termination of device adapter threads
*
- * Specific device adapter implementation must call in its destructor NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForThreadsTermination()
+ * Specific device adapter implementation must call in its destructor ns_smart_device_link::ns_transport_manager::CTransportAdapter::waitForThreadsTermination()
* to wait for termination of all threads (main thread and connection threads). Device adapter threads must be terminated before specific
* device adapter class is destructed, so it can't be called in the destructor of base class and must be called explicitly from the inherited
* class's destructor.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_device_scan Requesting scan for new devices
*
- * Device scan is requested by setting flag NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequested
- * and signaling conditional variable NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequestedCond, which may be monitored
+ * Device scan is requested by setting flag ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDeviceScanRequested
+ * and signaling conditional variable ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDeviceScanRequestedCond, which may be monitored
* by specific device adapter if it supports device scanning. Specific device adaptere may call for this purpose
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForDeviceScanRequest() which will wait on this conditional variable
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::waitForDeviceScanRequest() which will wait on this conditional variable
* until it's signaled or specified timeout expires.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connecting_devices Connecting devices
*
- * Device connection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectDevice().
- * This method calls virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::createConnectionsListForDevice()
+ * Device connection is initiated with a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::connectDevice().
+ * This method calls virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::createConnectionsListForDevice()
* which may be implemented by specific device adapter to create a list of connections that must be established for the device.
- * For each connection created by device adapter it calls NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection()
+ * For each connection created by device adapter it calls ns_smart_device_link::ns_transport_manager::CTransportAdapter::startConnection()
* which adds connection to connections map and starts connection thread.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_disconnecting_devices Disconnecting devices
*
- * Device disconnection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::disconnectDevice().
+ * Device disconnection is initiated with a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::disconnectDevice().
* This method finds all connections in connections map that corresponds to specified device and calls
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::stopConnection() for each of them.
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::stopConnection() for each of them.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_handling_communication Handling communication
*
- * All frames requested to be sent via NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() are stored in
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mFramesToSend. Pipe
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mNotificationPipeFds is used by
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() to notify connection thread that data is available
- * to be sent. NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() writes one byte to the write end of this pipe.
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() uses poll() to wait for
+ * All frames requested to be sent via ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() are stored in
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mFramesToSend. Pipe
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mNotificationPipeFds is used by
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() to notify connection thread that data is available
+ * to be sent. ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() writes one byte to the write end of this pipe.
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::handleCommunication() uses poll() to wait for
* incoming data using connection socket file descriptor and outgoing data using file descriptor of the read end of this pipe.
* When either of them become available for reading or some error occurs (e.g. socket gets disconnected) connection thread
* wakes up and handles this event. Notification pipe is also used to notify connection thread that connection has to be
- * terminated using NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mTerminateFlag.
+ * terminated using ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mTerminateFlag.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_update_client_device_list Updating client device list.
*
- * Specific device adapter may call NsSmartDeviceLink::NsTransportManager::CTransportAdapter::updateClientDeviceList() when its internal
+ * Specific device adapter may call ns_smart_device_link::ns_transport_manager::CTransportAdapter::updateClientDeviceList() when its internal
* knowledge about available devices is updated to notify device adapter client (TransportManager) about this update.
*
* @section components_transportmanager_internal_design_transport_adapters_common_specific Specific device adapters
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
index 6c35f0962f..3d2fcb5094 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
@@ -2,8 +2,8 @@
Internally Transport Manager uses different threads for different operations. This design solution was used to provide efficient asynchronous communication with clients and underlying Device Adapters.
-Transport Manager uses one thread to operate with all device-related callbacks. In other word all callbacks declared in NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener will be called from that thread.
+Transport Manager uses one thread to operate with all device-related callbacks. In other word all callbacks declared in ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener will be called from that thread.
-For every active connection one service thread will be created. This thread will be used for all connection-related callbacks. Therefore every implementation of NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener will be called in separated thread that allows client to support multiple connection simultaneously.
+For every active connection one service thread will be created. This thread will be used for all connection-related callbacks. Therefore every implementation of ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener will be called in separated thread that allows client to support multiple connection simultaneously.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
index c96fd46a22..164fad9140 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
@@ -2,13 +2,13 @@
Actually Transport Manager component is implemented as classical manager component. It manages connections and abstract devices and provides unified information for the clients.
-Connection-related information encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SConnectionInfo. Transport Manager manages these structures to store information about every active connection.
+Connection-related information encapsulated in structure ns_smart_device_link::ns_transport_manager::CTransportManager::SConnectionInfo. Transport Manager manages these structures to store information about every active connection.
-Frame processing encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SFrameDataForConnection. Transport Manager manages these structures to store information related to data for specific connection.
+Frame processing encapsulated in structure ns_smart_device_link::ns_transport_manager::CTransportManager::SFrameDataForConnection. Transport Manager manages these structures to store information related to data for specific connection.
Callback information between transport manager threads passed in form of special structures:
-NsSmartDeviceLink::NsTransportManager::CTransportManager::SDeviceListenerCallback.
-NsSmartDeviceLink::NsTransportManager::CTransportManager::SDataListenerCallback.
+ns_smart_device_link::ns_transport_manager::CTransportManager::SDeviceListenerCallback.
+ns_smart_device_link::ns_transport_manager::CTransportManager::SDataListenerCallback.
Client calls to TM guarded by separate mutex. This allows use component from different threads without any risk.
diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h
index 0fa53b0237..cee2a8774f 100644
--- a/src/components/policy/policy_external/include/policy/access_remote_impl.h
+++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h
@@ -35,7 +35,7 @@
#include <map>
#include "policy/policy_table/types.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "policy/access_remote.h"
#include "policy/cache_manager.h"
@@ -46,7 +46,7 @@ namespace policy {
class AccessRemoteImpl : public AccessRemote {
public:
AccessRemoteImpl();
- explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
+ explicit AccessRemoteImpl(std::shared_ptr<CacheManager> cache);
/**
* @brief CheckModuleType check if module type is allowed for application
* @param app_id application id
@@ -144,7 +144,7 @@ class AccessRemoteImpl : public AccessRemote {
/**
* @brief cache_ contains pointer to cache manager instance
*/
- utils::SharedPtr<CacheManager> cache_;
+ std::shared_ptr<CacheManager> cache_;
/**
* @brief hmi_types_ contains list of default HMI types for applications
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 bda456c90a..d30e7cea24 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -35,7 +35,6 @@
#include <map>
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
@@ -84,6 +83,22 @@ class CacheManager : public CacheManagerInterface {
CheckPermissionResult& result);
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Returns true if Policy Table was not updated yet
* from preloaded pt file.
*/
@@ -216,7 +231,7 @@ class CacheManager : public CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot();
/**
* Applies policy table to the current table
@@ -642,8 +657,18 @@ class CacheManager : public CacheManagerInterface {
* @param policy_app_id Unique application id
* @param request_types Request types of application
*/
- void GetAppRequestTypes(const std::string& policy_app_id,
- std::vector<std::string>& request_types) const;
+ void GetAppRequestTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const OVERRIDE;
+
+ /**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const OVERRIDE;
virtual const MetaInfo GetMetaInfo() const OVERRIDE;
@@ -694,7 +719,7 @@ class CacheManager : public CacheManagerInterface {
void SetExternalConsentForApp(const PermissionConsent& permissions) OVERRIDE;
#ifdef BUILD_TESTS
- utils::SharedPtr<policy_table::Table> GetPT() const {
+ std::shared_ptr<policy_table::Table> GetPT() const {
return pt_;
}
#endif
@@ -756,15 +781,15 @@ class CacheManager : public CacheManagerInterface {
policy::Permissions& permission);
private:
- utils::SharedPtr<policy_table::Table> pt_;
- utils::SharedPtr<policy_table::Table> snapshot_;
- utils::SharedPtr<PTRepresentation> backup_;
- utils::SharedPtr<PTExtRepresentation> ex_backup_;
+ std::shared_ptr<policy_table::Table> pt_;
+ std::shared_ptr<policy_table::Table> snapshot_;
+ std::shared_ptr<PTRepresentation> backup_;
+ std::shared_ptr<PTExtRepresentation> ex_backup_;
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- mutable sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;
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 b9e9f73646..bb9ce14c7f 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
@@ -38,7 +38,7 @@
#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
-#include "utils/shared_ptr.h"
+
#include "policy/usage_statistics/counter.h"
#include "policy/policy_types.h"
#include "policy/policy_settings.h"
@@ -47,6 +47,16 @@ namespace policy_table = rpc::policy_table_interface_base;
namespace policy {
+namespace RequestType {
+// Describes available RequestType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestType
+
+namespace RequestSubType {
+// Describes available RequestSubType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestSubType
+
class CacheManagerInterface {
public:
virtual ~CacheManagerInterface() {}
@@ -79,6 +89,21 @@ class CacheManagerInterface {
const PTString& hmi_level,
const PTString& rpc,
CheckPermissionResult& result) = 0;
+ /**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
/**
* @brief Returns true if Policy Table was not updated yet
@@ -212,7 +237,7 @@ class CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() = 0;
/**
* Applies policy table to the current table
@@ -706,6 +731,15 @@ class CacheManagerInterface {
std::vector<std::string>& request_types) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ virtual void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const = 0;
+
+ /**
* @brief Gets meta information
* @return meta information
*/
@@ -789,16 +823,16 @@ class CacheManagerInterface {
#ifdef BUILD_TESTS
/**
- * @brief GetPT allows to obtain SharedPtr to PT.
+ * @brief GetPT allows to obtain std::shared_ptr to PT.
* Used ONLY in Unit tests
- * @return SharedPTR to PT
+ * @return std::shared_ptr to PT
*
*/
- virtual utils::SharedPtr<policy_table::Table> GetPT() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GetPT() const = 0;
#endif
};
-typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+typedef std::shared_ptr<CacheManagerInterface> CacheManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h
index 6945f45b45..e3cb509c15 100644
--- a/src/components/policy/policy_external/include/policy/policy_helper.h
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_
#include "policy/policy_table/functions.h"
-#include "utils/shared_ptr.h"
+
#include "policy/policy_types.h"
namespace policy {
@@ -85,8 +85,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
*/
struct CheckAppPolicy {
CheckAppPolicy(PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot,
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot,
CheckAppPolicyResults& out_results);
bool operator()(const AppPoliciesValueType& app_policy);
@@ -100,7 +100,8 @@ struct CheckAppPolicy {
* @param result Result of check of updated policy
*/
void SetPendingPermissions(const AppPoliciesValueType& app_policy,
- PermissionsCheckResult result) const;
+ PermissionsCheckResult result,
+ AppPermissions& permissions_diff) const;
/**
* @brief Analyzes updated application policy whether any changes received. If
* yes - provides appropriate result code
@@ -192,10 +193,30 @@ struct CheckAppPolicy {
*/
bool IsRequestTypeChanged(const AppPoliciesValueType& app_policy) const;
+ /**
+ * @brief Checks whether App RequestSubTypes have been changed by
+ * udpated
+ * @param app_policy Reference to updated application policy
+ * @return True if changed, otherwise - false
+ */
+ bool IsRequestSubTypeChanged(const AppPoliciesValueType& app_policy) const;
+
+ /**
+ * @brief Helper function that inserts permissions into app_permissions_diff_
+ * map.
+ * udpated
+ * @param app_policy Reference to updated application policy
+ * @param permissions_diff Reference to app permissions to be inserted into
+ * map.
+ * @return void
+ */
+ void InsertPermission(const std::string& app_id,
+ const AppPermissions& permissions_diff);
+
private:
PolicyManagerImpl* pm_;
- const utils::SharedPtr<policy_table::Table> update_;
- const utils::SharedPtr<policy_table::Table> snapshot_;
+ const std::shared_ptr<policy_table::Table> update_;
+ const std::shared_ptr<policy_table::Table> snapshot_;
CheckAppPolicyResults& out_results_;
};
@@ -247,8 +268,26 @@ struct FillNotificationData {
const std::set<Parameter>& target);
void InitRpcKeys(const std::string& rpc_name);
bool RpcParametersEmpty(RpcPermissions& rpc);
- bool IsSectionEmpty(ParameterPermissions& permissions,
- const std::string& section);
+
+ /**
+ * @brief Checks if specific section in specified permissions is empty
+ * @param permissions reference to the permissions structure
+ * @param section reference to the section name
+ * @return true if specified section in permissions is empty otherwise returns
+ * false
+ */
+ bool IsSectionEmpty(const ParameterPermissions& permissions,
+ const std::string& section) const;
+
+ /**
+ * @brief Checks if at least one parameter is allowed for the specified
+ * permissions
+ * @param permissions reference to the permissions structure
+ * @return true if at least one parameter is allowed for the specified
+ * permissions otherwise returns false
+ */
+ bool IsSomeParameterAllowed(const ParameterPermissions& permissions) const;
+
std::string current_key_;
Permissions& data_;
const bool does_require_user_consent_;
diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
index 97a2e60055..3837dda1fa 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
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
#include <list>
-#include "utils/shared_ptr.h"
+
#include "utils/lock.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
@@ -42,11 +42,8 @@
#include "policy/update_status_manager.h"
#include "policy/policy_table/functions.h"
#include "policy/usage_statistics/statistics_manager.h"
-
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
namespace policy_table = rpc::policy_table_interface_base;
@@ -454,7 +451,6 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Assigns new HMI types for specified application
* @param application_id Unique application id
@@ -476,7 +472,7 @@ class PolicyManagerImpl : public PolicyManager {
* @brief Setter for access_remote instance
* @param access_remote pointer to new access_remote instance
*/
- void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+ void set_access_remote(std::shared_ptr<AccessRemote> access_remote) OVERRIDE;
/**
* @brief Sends notification about application HMI level changed
@@ -489,7 +485,6 @@ class PolicyManagerImpl : public PolicyManager {
* @param application_id Unique id of application
*/
void OnPrimaryGroupsChanged(const std::string& application_id);
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Removes consent for application functional group
@@ -538,6 +533,22 @@ class PolicyManagerImpl : public PolicyManager {
void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Gets request types for application
* @param policy_app_id Unique application id
* @return request types of application
@@ -546,6 +557,14 @@ class PolicyManagerImpl : public PolicyManager {
const std::string policy_app_id) const OVERRIDE;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Get information about vehicle
* @return vehicle information
*/
@@ -698,7 +717,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param pt_content binary content of PT
* @return pointer to converted PT
*/
- virtual utils::SharedPtr<policy_table::Table> Parse(
+ virtual std::shared_ptr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
private:
@@ -717,8 +736,8 @@ class PolicyManagerImpl : public PolicyManager {
* @return Collection per-application results
*/
CheckAppPolicyResults CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
/**
* @brief Processes results from policy table update analysis done by
@@ -841,10 +860,9 @@ class PolicyManagerImpl : public PolicyManager {
* @param type policy table type
* @return true if policy table valid, otherwise false
*/
- bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
+ bool IsPTValid(std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Get resulting RPCs permissions for application which started on
* specific device
@@ -881,7 +899,6 @@ class PolicyManagerImpl : public PolicyManager {
*/
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Notify application about its permissions changes by preparing and
@@ -997,12 +1014,10 @@ class PolicyManagerImpl : public PolicyManager {
* @brief pointer to CacheManagerInterface instance for getting policy data
*/
CacheManagerInterfaceSPtr cache_;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief pointer to AccessRemote instance for working with RC applications
*/
- utils::SharedPtr<AccessRemote> access_remote_;
-#endif
+ std::shared_ptr<AccessRemote> access_remote_;
/**
* @brief lock guard for protecting applications list access
diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h
index ecbd56c2e4..fe27f1cb57 100644
--- a/src/components/policy/policy_external/include/policy/policy_table.h
+++ b/src/components/policy/policy_external/include/policy/policy_table.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
@@ -42,7 +41,7 @@ namespace policy {
class PolicyTable {
public:
PolicyTable();
- explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ explicit PolicyTable(std::shared_ptr<PTRepresentation> pt_data);
virtual ~PolicyTable();
/**
@@ -50,12 +49,12 @@ class PolicyTable {
* actual class storing policy table.
* @return PTRepresentation* Policy Table Content Handler
*/
- utils::SharedPtr<PTRepresentation> pt_data() const {
+ std::shared_ptr<PTRepresentation> pt_data() const {
return pt_data_;
}
private:
- utils::SharedPtr<PTRepresentation> pt_data_;
+ std::shared_ptr<PTRepresentation> pt_data_;
};
} // namespace policy
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
index 4f8ae5c98d..34864c5602 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
@@ -44,6 +44,7 @@ enum Priority {
P_VOICECOM,
P_COMMUNICATION,
P_NORMAL,
+ P_PROJECTION,
P_NONE,
};
@@ -66,20 +67,24 @@ enum Parameter {
P_SPEED,
P_ENGINETORQUE,
P_EXTERNALTEMPERATURE,
+ P_TURNSIGNAL,
P_FUELLEVEL,
P_FUELLEVEL_STATE,
P_HEADLAMPSTATUS,
P_INSTANTFUELCONSUMPTION,
+ P_FUELRANGE,
P_ODOMETER,
P_TIREPRESSURE,
P_WIPERSTATUS,
P_VIN,
P_ACCPEDALPOSITION,
P_BELTSTATUS,
+ P_ELECTRONICPARKBRAKESTATUS,
P_DRIVERBRAKING,
P_PRNDL,
P_RPM,
P_STEERINGWHEELANGLE,
+ P_ENGINEOILLIFE,
P_MYKEY,
P_AIRBAGSTATUS,
P_BODYINFORMATION,
@@ -88,7 +93,6 @@ enum Parameter {
P_EMERGENCYEVENT,
P_ECALLINFO,
P_ABS_STATE,
- P_TURN_SIGNAL,
P_FUEL_RANGE,
P_TIRE_PRESSURE_VALUE,
P_TPMS,
@@ -147,7 +151,9 @@ enum RequestType {
RT_VEHICLE_DIAGNOSTICS,
RT_EMERGENCY,
RT_MEDIA,
- RT_FOTA
+ RT_FOTA,
+ RT_OEM_SPECIFIC,
+ RT_EMPTY // Added to allow empty Request Types handling
};
bool IsValidEnum(RequestType val);
@@ -165,11 +171,382 @@ bool EnumFromJsonString(const std::string& literal, Input* result);
enum ModuleType {
MT_CLIMATE,
MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS,
+ MT_EMPTY
};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+/**
+ * @brief Enumeration FunctionID.
+ *
+ * Enumeration linking function names with function IDs in AppLink protocol.
+ * Assumes enumeration starts at value 0.
+ */
+enum FunctionID {
+ /**
+ * @brief RESERVED.
+ */
+ RESERVED = 0,
+
+ /**
+ * @brief RegisterAppInterfaceID.
+ */
+ RegisterAppInterfaceID = 1,
+
+ /**
+ * @brief UnregisterAppInterfaceID.
+ */
+ UnregisterAppInterfaceID = 2,
+
+ /**
+ * @brief SetGlobalPropertiesID.
+ */
+ SetGlobalPropertiesID = 3,
+
+ /**
+ * @brief ResetGlobalPropertiesID.
+ */
+ ResetGlobalPropertiesID = 4,
+
+ /**
+ * @brief AddCommandID.
+ */
+ AddCommandID = 5,
+
+ /**
+ * @brief DeleteCommandID.
+ */
+ DeleteCommandID = 6,
+
+ /**
+ * @brief AddSubMenuID.
+ */
+ AddSubMenuID = 7,
+
+ /**
+ * @brief DeleteSubMenuID.
+ */
+ DeleteSubMenuID = 8,
+
+ /**
+ * @brief CreateInteractionChoiceSetID.
+ */
+ CreateInteractionChoiceSetID = 9,
+
+ /**
+ * @brief PerformInteractionID.
+ */
+ PerformInteractionID = 10,
+
+ /**
+ * @brief DeleteInteractionChoiceSetID.
+ */
+ DeleteInteractionChoiceSetID = 11,
+
+ /**
+ * @brief AlertID.
+ */
+ AlertID = 12,
+
+ /**
+ * @brief ShowID.
+ */
+ ShowID = 13,
+
+ /**
+ * @brief SpeakID.
+ */
+ SpeakID = 14,
+
+ /**
+ * @brief SetMediaClockTimerID.
+ */
+ SetMediaClockTimerID = 15,
+
+ /**
+ * @brief PerformAudioPassThruID.
+ */
+ PerformAudioPassThruID = 16,
+
+ /**
+ * @brief EndAudioPassThruID.
+ */
+ EndAudioPassThruID = 17,
+
+ /**
+ * @brief SubscribeButtonID.
+ */
+ SubscribeButtonID = 18,
+
+ /**
+ * @brief UnsubscribeButtonID.
+ */
+ UnsubscribeButtonID = 19,
+
+ /**
+ * @brief SubscribeVehicleDataID.
+ */
+ SubscribeVehicleDataID = 20,
+
+ /**
+ * @brief UnsubscribeVehicleDataID.
+ */
+ UnsubscribeVehicleDataID = 21,
+
+ /**
+ * @brief GetVehicleDataID.
+ */
+ GetVehicleDataID = 22,
+
+ /**
+ * @brief ReadDIDID.
+ */
+ ReadDIDID = 23,
+
+ /**
+ * @brief GetDTCsID.
+ */
+ GetDTCsID = 24,
+
+ /**
+ * @brief ScrollableMessageID.
+ */
+ ScrollableMessageID = 25,
+
+ /**
+ * @brief SliderID.
+ */
+ SliderID = 26,
+
+ /**
+ * @brief ShowConstantTBTID.
+ */
+ ShowConstantTBTID = 27,
+
+ /**
+ * @brief AlertManeuverID.
+ */
+ AlertManeuverID = 28,
+
+ /**
+ * @brief UpdateTurnListID.
+ */
+ UpdateTurnListID = 29,
+
+ /**
+ * @brief ChangeRegistrationID.
+ */
+ ChangeRegistrationID = 30,
+
+ /**
+ * @brief GenericResponseID.
+ */
+ GenericResponseID = 31,
+
+ /**
+ * @brief PutFileID.
+ */
+ PutFileID = 32,
+
+ /**
+ * @brief DeleteFileID.
+ */
+ DeleteFileID = 33,
+
+ /**
+ * @brief ListFilesID.
+ */
+ ListFilesID = 34,
+
+ /**
+ * @brief SetAppIconID.
+ */
+ SetAppIconID = 35,
+
+ /**
+ * @brief SetDisplayLayoutID.
+ */
+ SetDisplayLayoutID = 36,
+
+ /**
+ * @brief DiagnosticMessageID.
+ */
+ DiagnosticMessageID = 37,
+
+ /**
+ * @brief SystemRequestID.
+ */
+ SystemRequestID = 38,
+
+ /**
+ * @brief SendLocationID.
+ */
+ SendLocationID = 39,
+
+ /**
+ * @brief DialNumberID.
+ */
+ DialNumberID = 40,
+
+ /**
+ * @brief ButtonPressID.
+ */
+ ButtonPressID = 41,
+
+ /**
+ * @brief GetInteriorVehicleDataID.
+ */
+ GetInteriorVehicleDataID = 43,
+
+ /**
+ * @brief SetInteriorVehicleDataID.
+ */
+ SetInteriorVehicleDataID = 44,
+
+ /**
+ * @brief GetWayPointsID.
+ */
+ GetWayPointsID = 45,
+
+ /**
+ * @brief SubscribeWayPointsID.
+ */
+ SubscribeWayPointsID = 46,
+
+ /**
+ * @brief UnsubscribeWayPointsID.
+ */
+ UnsubscribeWayPointsID = 47,
+
+ /**
+ * @brief GetSystemCapabilityID.
+ */
+ GetSystemCapabilityID = 48,
+
+ /**
+ * @brief SendHapticDataID.
+ */
+ SendHapticDataID = 49,
+
+ /**
+ * @brief OnHMIStatusID.
+ */
+ OnHMIStatusID = 32768,
+
+ /**
+ * @brief OnAppInterfaceUnregisteredID.
+ */
+ OnAppInterfaceUnregisteredID = 32769,
+
+ /**
+ * @brief OnButtonEventID.
+ */
+ OnButtonEventID = 32770,
+
+ /**
+ * @brief OnButtonPressID.
+ */
+ OnButtonPressID = 32771,
+
+ /**
+ * @brief OnVehicleDataID.
+ */
+ OnVehicleDataID = 32772,
+
+ /**
+ * @brief OnCommandID.
+ */
+ OnCommandID = 32773,
+
+ /**
+ * @brief OnTBTClientStateID.
+ */
+ OnTBTClientStateID = 32774,
+
+ /**
+ * @brief OnDriverDistractionID.
+ */
+ OnDriverDistractionID = 32775,
+
+ /**
+ * @brief OnPermissionsChangeID.
+ */
+ OnPermissionsChangeID = 32776,
+
+ /**
+ * @brief OnAudioPassThruID.
+ */
+ OnAudioPassThruID = 32777,
+
+ /**
+ * @brief OnLanguageChangeID.
+ */
+ OnLanguageChangeID = 32778,
+
+ /**
+ * @brief OnKeyboardInputID.
+ */
+ OnKeyboardInputID = 32779,
+
+ /**
+ * @brief OnTouchEventID.
+ */
+ OnTouchEventID = 32780,
+
+ /**
+ * @brief OnSystemRequestID.
+ */
+ OnSystemRequestID = 32781,
+
+ /**
+ * @brief OnHashChangeID.
+ */
+ OnHashChangeID = 32782,
+
+ /**
+ * @brief OnInteriorVehicleDataID.
+ */
+ OnInteriorVehicleDataID = 32783,
+
+ /**
+ * @brief OnWayPointChangeID.
+ */
+ OnWayPointChangeID = 32784,
+
+ /**
+ * @brief OnRCStatusID.
+ */
+ OnRCStatusID = 32785,
+
+ /**
+ * @brief EncodedSyncPDataID.
+ */
+ EncodedSyncPDataID = 65536,
+
+ /**
+ * @brief SyncPDataID.
+ */
+ SyncPDataID = 65537,
+
+ /**
+ * @brief OnEncodedSyncPDataID.
+ */
+ OnEncodedSyncPDataID = 98304,
+
+ /**
+ * @brief OnSyncPDataID.
+ */
+ OnSyncPDataID = 98305
+};
+bool IsValidEnum(FunctionID val);
+const char* EnumToJsonString(FunctionID val);
+bool EnumFromJsonString(const std::string& literal, FunctionID* result);
+
extern const std::string kDefaultApp;
extern const std::string kPreDataConsentApp;
extern const std::string kDeviceApp;
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 53f5a35b99..68e29a97ee 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
@@ -78,7 +78,7 @@ typedef Map<URL, 1, 255> URLList;
typedef Map<URLList, 1, 255> ServiceEndpoints;
typedef uint8_t NumberOfNotificationsType;
-typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 6>
+typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 7>
NumberOfNotificationsPerMinute;
typedef Array<Integer<uint16_t, 1, 1000>, 0, 5> SecondsBetweenRetries;
@@ -102,11 +102,11 @@ typedef Map<DeviceParams, 0, 255> DeviceData;
typedef Array<Enum<RequestType>, 0, 255> RequestsTypeArray;
-#ifdef SDL_REMOTE_CONTROL
+typedef Strings RequestSubTypes;
+
typedef Map<Strings, 0, 255> RemoteRpcs;
typedef Map<RemoteRpcs, 0, 255> AccessModules;
typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
-#endif // SDL_REMOTE_CONTROL
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
@@ -173,11 +173,10 @@ struct ApplicationParams : PolicyBase {
Optional<Strings> nicknames;
Optional<AppHMITypes> AppHMIType;
Optional<RequestTypes> RequestType;
+ Optional<RequestSubTypes> RequestSubType;
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
-#ifdef SDL_REMOTE_CONTROL
mutable Optional<ModuleTypes> moduleType;
-#endif // SDL_REMOTE_CONTROL
public:
ApplicationParams();
@@ -197,9 +196,7 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
-#ifdef SDL_REMOTE_CONTROL
bool ValidateModuleTypes() const;
-#endif // SDL_REMOTE_CONTROL
};
struct ApplicationPoliciesSection : CompositeType {
@@ -306,6 +303,7 @@ struct ModuleConfig : CompositeType {
Optional<String<0, 10> > preloaded_date;
Optional<String<0, 65535> > certificate;
Optional<Boolean> preloaded_pt;
+ Optional<Boolean> full_app_id_supported;
public:
ModuleConfig();
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 91518f8f6e..26af165506 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
@@ -26,20 +26,24 @@
<element name="speed" />
<element name="engineTorque" />
<element name="externalTemperature" />
+ <element name="turnSignal" />
<element name="fuelLevel" />
<element name="fuelLevel_State" />
<element name="headLampStatus" />
<element name="instantFuelConsumption" />
+ <element name="fuelRange" />
<element name="odometer" />
<element name="tirePressure" />
<element name="wiperStatus" />
<element name="vin" />
<element name="accPedalPosition" />
<element name="beltStatus" />
+ <element name="electronicParkBrakeStatus" />
<element name="driverBraking" />
<element name="prndl" />
<element name="rpm" />
<element name="steeringWheelAngle" />
+ <element name="engineOilLife" />
<element name="myKey" />
<element name="airbagStatus" />
<element name="bodyInformation" />
@@ -94,8 +98,7 @@
<typedef name="HmiLevels" type="HmiLevel" array="true"
maxsize="4" />
- <typedef name="Parameters" type="Parameter" array="true"
- maxsize="24" />
+ <typedef name="Parameters" type="Parameter" array="true"/>
<struct name="RpcParameters">
<!-- maxsizes are equal to number of currently known elements of
@@ -128,7 +131,7 @@
minsize="1" maxsize="255" />
<typedef name="NumberOfNotificationsPerMinute" type="Integer"
- map="true" maxsize="6" minvalue="0" maxvalue="255" />
+ map="true" maxsize="7" minvalue="0" maxvalue="255" />
<typedef name="SecondsBetweenRetries" type="Integer" array="true"
maxsize="10" minvalue="1" maxvalue="1000" />
@@ -136,6 +139,7 @@
<struct name="ModuleConfig">
<param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
<param name="preloaded_pt" type="Boolean" mandatory="false" />
+ <param name="full_app_id_supported" type="Boolean" mandatory="false" />
<param name="exchange_after_x_ignition_cycles" type="Integer"
maxvalue="255" />
<param name="exchange_after_x_kilometers" type="Integer"
diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h
index 232191cfea..84d9376a93 100644
--- a/src/components/policy/policy_external/include/policy/policy_types.h
+++ b/src/components/policy/policy_external/include/policy/policy_types.h
@@ -39,7 +39,8 @@
#include <map>
#include <set>
#include <utility>
-#include "utils/shared_ptr.h"
+#include <memory>
+
#include "utils/helpers.h"
#include "transport_manager/common.h"
@@ -79,7 +80,7 @@ enum PolicyTableStatus {
// Code generator uses String class name, so this typedef was renamed to PTSring
typedef std::string PTString;
typedef std::vector<uint8_t> BinaryMessage;
-typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
+typedef std::shared_ptr<BinaryMessage> BinaryMessageSptr;
typedef std::string HMILevel;
typedef std::string Parameter;
@@ -267,7 +268,8 @@ struct AppPermissions {
, appRevoked(false)
, appPermissionsConsentNeeded(false)
, appUnauthorized(false)
- , requestTypeChanged(false) {}
+ , requestTypeChanged(false)
+ , requestSubTypeChanged(false) {}
std::string application_id;
bool isAppPermissionsRevoked;
@@ -280,6 +282,8 @@ struct AppPermissions {
DeviceParams deviceInfo;
bool requestTypeChanged;
std::vector<std::string> requestType;
+ bool requestSubTypeChanged;
+ std::vector<std::string> requestSubType;
};
/**
@@ -503,7 +507,8 @@ enum PermissionsCheckResult {
RESULT_CONSENT_NEEDED,
RESULT_CONSENT_NOT_REQIURED,
RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED,
- RESULT_REQUEST_TYPE_CHANGED
+ RESULT_REQUEST_TYPE_CHANGED,
+ RESULT_REQUEST_SUBTYPE_CHANGED
};
/**
diff --git a/src/components/policy/policy_external/include/policy/pt_representation.h b/src/components/policy/policy_external/include/policy/pt_representation.h
index 66a9218771..f25fcc6cab 100644
--- a/src/components/policy/policy_external/include/policy/pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/pt_representation.h
@@ -213,7 +213,7 @@ class PTRepresentation {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const = 0;
virtual bool Save(const policy_table::Table& table) = 0;
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 a69df20cfc..dd9e0204e7 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
@@ -65,6 +65,7 @@ extern const std::string kSelectAppGroups;
extern const std::string kSelectNicknames;
extern const std::string kSelectAppTypes;
extern const std::string kSelectRequestTypes;
+extern const std::string kSelectRequestSubTypes;
extern const std::string kSelectSecondsBetweenRetries;
extern const std::string kSelectIgnitionCycles;
extern const std::string kSelectKilometers;
@@ -78,6 +79,7 @@ extern const std::string kInsertAppGroup;
extern const std::string kInsertNickname;
extern const std::string kInsertAppType;
extern const std::string kInsertRequestType;
+extern const std::string kInsertRequestSubType;
extern const std::string kInsertMessageType;
extern const std::string kInsertLanguage;
extern const std::string kInsertMessageString;
@@ -98,6 +100,7 @@ extern const std::string kDeleteExternalConsentEntities;
extern const std::string kDeleteAppGroup;
extern const std::string kDeleteApplication;
extern const std::string kDeleteRequestType;
+extern const std::string kDeleteRequestSubType;
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 54dfb9f0b7..13816eb6c5 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
@@ -85,7 +85,7 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool Clear();
bool Drop();
virtual void WriteDb();
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const;
virtual bool Save(const policy_table::Table& table);
bool GetInitialAppData(const std::string& app_id,
StringArray* nicknames = NULL,
@@ -98,7 +98,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
-#ifdef SDL_REMOTE_CONTROL
enum TypeAccess { kAllowed, kManual };
bool GatherModuleType(const std::string& app_id,
policy_table::ModuleTypes* module_types) const;
@@ -113,7 +112,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool SaveAccessModule(TypeAccess access,
const policy_table::AccessModules& modules);
bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
-#endif // SDL_REMOTE_CONTROL
virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
@@ -133,6 +131,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
policy_table::AppHMITypes* app_types) const;
bool GatherRequestType(const std::string& app_id,
policy_table::RequestTypes* request_types) const;
+ bool GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const;
bool GatherNickName(const std::string& app_id,
policy_table::Strings* nicknames) const;
@@ -168,6 +169,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
const policy_table::AppHMITypes& types);
bool SaveRequestType(const std::string& app_id,
const policy_table::RequestTypes& types);
+ bool SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes);
public:
virtual std::string GetLockScreenIconUrl() const;
diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h
index b663610a5b..3a9e13b83f 100644
--- a/src/components/policy/policy_external/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_external/include/policy/update_status_manager.h
@@ -66,14 +66,14 @@ class UpdateStatusManager {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- void SetNextStatus(utils::SharedPtr<Status> status);
+ void SetNextStatus(std::shared_ptr<Status> status);
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- void SetPostponedStatus(utils::SharedPtr<Status> status);
+ void SetPostponedStatus(std::shared_ptr<Status> status);
/**
* @brief Sets listener pointer
@@ -114,15 +114,15 @@ class UpdateStatusManager {
void OnResetRetrySequence();
/**
- * @brief Update status handler on new application registering
+ * @brief Update status handler on existed application registering
+ * @param is_update_required Update necessity flag
*/
- void OnNewApplicationAdded(const DeviceConsent consent);
+ void OnExistedApplicationAdded(const bool is_update_required);
/**
- * @brief Update status handler for policy initialization
- * @param is_update_required Update necessity flag
+ * @brief Update status handler on new application registering
*/
- void OnPolicyInit(bool is_update_required);
+ void OnNewApplicationAdded(const DeviceConsent consent);
/**
* @brief In case application from non-consented device has been registered
@@ -199,17 +199,17 @@ class UpdateStatusManager {
/**
* @brief Current update status
*/
- utils::SharedPtr<Status> current_status_;
+ std::shared_ptr<Status> current_status_;
/**
* @brief Next status after current to be set
*/
- utils::SharedPtr<Status> next_status_;
+ std::shared_ptr<Status> next_status_;
/**
* @brief Status to be set after 'next' status
*/
- utils::SharedPtr<Status> postponed_status_;
+ std::shared_ptr<Status> postponed_status_;
sync_primitives::Lock status_lock_;
UpdateEvent last_processed_event_;
@@ -227,7 +227,7 @@ class UpdateStatusManager {
volatile uint32_t timeout_;
volatile bool stop_flag_;
- sync_primitives::Lock state_lock_;
+ sync_primitives::RecursiveLock state_lock_;
sync_primitives::ConditionalVariable termination_condition_;
UpdateStatusManager* update_status_manager_;
};
diff --git a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
index adaef0eb28..c145bb432b 100644
--- a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
@@ -36,7 +36,7 @@
#include <ctime>
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
-#include "utils/shared_ptr.h"
+
#include "utils/timer.h"
#include "utils/macro.h"
@@ -46,18 +46,18 @@ using timer::Timer;
class GlobalCounter {
public:
- GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounter(std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type);
void operator++() const;
private:
GlobalCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppCounter {
public:
- AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type);
void operator++() const;
@@ -65,12 +65,12 @@ class AppCounter {
private:
std::string app_id_;
AppCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppInfo {
public:
- AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type);
void Update(const std::string& new_info) const;
@@ -78,14 +78,14 @@ class AppInfo {
private:
std::string app_id_;
AppInfoId info_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppStopwatchImpl : public AppStopwatch {
public:
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id);
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
std::uint32_t timeout);
~AppStopwatchImpl();
@@ -97,7 +97,7 @@ class AppStopwatchImpl : public AppStopwatch {
// Fields
std::string app_id_;
AppStopwatchId stopwatch_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
timer::Timer timer_;
const std::uint32_t time_out_;
DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc
index d042d8c402..26c8c5e38e 100644
--- a/src/components/policy/policy_external/src/access_remote_impl.cc
+++ b/src/components/policy/policy_external/src/access_remote_impl.cc
@@ -89,7 +89,7 @@ struct ToModuleType {
AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
-AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr<CacheManager> cache)
: cache_(cache) {}
bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index 5aa39cb2f4..c2c2e91257 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -41,6 +41,7 @@
#include <vector>
#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "json/reader.h"
#include "json/features.h"
#include "json/writer.h"
@@ -206,6 +207,21 @@ struct ExternalConsentConsentGroupAppender
}
};
+struct DefaultPolicyUpdater {
+ DefaultPolicyUpdater(const policy_table::ApplicationParams& default_params)
+ : default_params_(default_params) {}
+
+ void operator()(policy_table::ApplicationPolicies::value_type& pt_value) {
+ if (policy::kDefaultId == pt_value.second.get_string()) {
+ pt_value.second = default_params_;
+ pt_value.second.set_to_string(policy::kDefaultId);
+ }
+ }
+
+ private:
+ const policy_table::ApplicationParams& default_params_;
+};
+
} // namespace
namespace policy {
@@ -252,8 +268,7 @@ CacheManager::CacheManager()
: CacheManagerInterface()
, pt_(new policy_table::Table)
, backup_(new SQLPTExtRepresentation())
- , update_required(false)
- , cache_lock_(true) {
+ , update_required(false) {
InitBackupThread();
}
@@ -261,8 +276,7 @@ CacheManager::CacheManager(bool in_memory)
: CacheManagerInterface()
, pt_(new policy_table::Table)
, backup_(new SQLPTExtRepresentation(in_memory))
- , update_required(false)
- , cache_lock_(true) {
+ , update_required(false) {
InitBackupThread();
}
@@ -638,13 +652,11 @@ void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
}
}
-using rpc::policy_table_interface_base::RequestTypes;
-using rpc::policy_table_interface_base::RequestType;
-
void CacheManager::ProcessUpdate(
const policy_table::ApplicationPolicies::const_iterator
initial_policy_iter) {
using namespace policy;
+ using rpc::policy_table_interface_base::RequestTypes;
const RequestTypes& new_request_types =
*(initial_policy_iter->second.RequestType);
@@ -684,6 +696,13 @@ void CacheManager::ProcessUpdate(
initial_policy_iter->second;
*(pt_->policy_table.app_policies_section.apps[app_id].RequestType) =
merged_pt_request_types;
+
+ if (app_id == kDefaultId) {
+ std::for_each(pt_->policy_table.app_policies_section.apps.begin(),
+ pt_->policy_table.app_policies_section.apps.end(),
+ DefaultPolicyUpdater(
+ pt_->policy_table.app_policies_section.apps[app_id]));
+ }
}
bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
@@ -1120,8 +1139,8 @@ bool CacheManager::SetUserPermissionsForApp(
it_group->second != is_allowed) {
*out_app_permissions_changed = true;
- const TimevalStruct tm = date_time::DateTime::getCurrentTime();
- int64_t current_time_msec = date_time::DateTime::getmSecs(tm);
+ const date_time::TimeDuration tm = date_time::getCurrentTime();
+ int64_t current_time_msec = date_time::getmSecs(tm);
ucr.consent_last_updated = current_time_msec;
LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
}
@@ -1334,7 +1353,7 @@ int CacheManager::TimeoutResponse() {
CACHE_MANAGER_CHECK(0);
sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.module_config.timeout_after_x_seconds *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
}
bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
@@ -1520,6 +1539,9 @@ void CacheManager::CheckSnapshotInitialization() {
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
+ *(snapshot_->policy_table.module_config.full_app_id_supported) =
+ settings_->use_full_app_id();
+
// SDL must not send certificate in snapshot
snapshot_->policy_table.module_config.certificate =
rpc::Optional<rpc::String<0, 65535> >();
@@ -1628,8 +1650,8 @@ void CacheManager::CheckSnapshotInitialization() {
void CacheManager::PersistData() {
LOG4CXX_AUTO_TRACE(logger_);
- if (backup_.valid()) {
- if (pt_.valid()) {
+ if (backup_.use_count() != 0) {
+ if (pt_.use_count() != 0) {
// Comma expression is used to hold the lock only during the constructor
// call
policy_table::Table copy_pt(
@@ -1671,7 +1693,7 @@ void CacheManager::PersistData() {
}
// In case of extended policy the meta info should be backuped as well.
- if (ex_backup_.valid()) {
+ if (ex_backup_.use_count() != 0) {
ex_backup_->SetMetaInfo(
*(*copy_pt.policy_table.module_meta).ccpu_version,
*(*copy_pt.policy_table.module_meta).wers_country_code,
@@ -1751,9 +1773,9 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id,
return false;
}
-utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+std::shared_ptr<policy_table::Table> CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- snapshot_ = new policy_table::Table();
+ snapshot_ = std::make_shared<policy_table::Table>();
sync_primitives::AutoLock auto_lock(cache_lock_);
snapshot_->policy_table = pt_->policy_table;
@@ -2238,8 +2260,7 @@ bool CacheManager::Init(const std::string& file_name,
LOG4CXX_AUTO_TRACE(logger_);
settings_ = settings;
InitResult init_result = backup_->Init(settings);
- ex_backup_ = utils::SharedPtr<PTRepresentation>::dynamic_pointer_cast<
- PTExtRepresentation>(backup_);
+ ex_backup_ = std::dynamic_pointer_cast<PTExtRepresentation>(backup_);
bool result = true;
switch (init_result) {
@@ -2262,7 +2283,7 @@ bool CacheManager::Init(const std::string& file_name,
case InitResult::SUCCESS: {
LOG4CXX_INFO(logger_, "Policy Table was inited successfully");
result = LoadFromFile(file_name, *pt_);
- utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = GenerateSnapshot();
result &= snapshot->is_valid();
LOG4CXX_DEBUG(logger_,
@@ -2392,6 +2413,32 @@ bool CacheManager::ResetPT(const std::string& file_name) {
return result;
}
+policy::RequestType::State CacheManager::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request types for app_id " << policy_app_id);
+ return policy::RequestType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestTypes& request_types =
+ *app_policies_iter->second.RequestType;
+ if (!request_types.is_initialized()) {
+ LOG4CXX_TRACE(logger_,
+ "Request types for " << policy_app_id << " are OMITTED");
+ return RequestType::State::OMITTED;
+ }
+ if (request_types.empty()) {
+ LOG4CXX_TRACE(logger_,
+ "Request types for " << policy_app_id << " are EMPTY");
+ return policy::RequestType::State::EMPTY;
+ }
+ return policy::RequestType::State::AVAILABLE;
+}
+
void CacheManager::GetAppRequestTypes(
const std::string& policy_app_id,
std::vector<std::string>& request_types) const {
@@ -2411,16 +2458,64 @@ void CacheManager::GetAppRequestTypes(
return;
}
if (policy_iter->second.RequestType.is_initialized()) {
- policy_table::RequestTypes::iterator it_request_type =
- policy_iter->second.RequestType->begin();
- for (; it_request_type != policy_iter->second.RequestType->end();
- ++it_request_type) {
- request_types.push_back(EnumToJsonString(*it_request_type));
+ for (const auto& request_type : *policy_iter->second.RequestType) {
+ request_types.push_back(EnumToJsonString(request_type));
}
}
return;
}
+RequestSubType::State CacheManager::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return RequestSubType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestSubTypes& request_subtypes =
+ *app_policies_iter->second.RequestSubType;
+ if (!request_subtypes.is_initialized()) {
+ LOG4CXX_TRACE(logger_,
+ "Request subtypes for " << policy_app_id << " are OMITTED");
+ return RequestSubType::State::OMITTED;
+ }
+ if (request_subtypes.empty()) {
+ LOG4CXX_TRACE(logger_,
+ "Request subtypes for " << policy_app_id << " are EMPTY");
+ return RequestSubType::State::EMPTY;
+ }
+ return RequestSubType::State::AVAILABLE;
+}
+
+void CacheManager::GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ if (kDeviceId == policy_app_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes not applicable for app_id " << kDeviceId);
+ return;
+ }
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == policy_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return;
+ }
+
+ for (const auto& request_subtype : *policy_iter->second.RequestSubType) {
+ request_subtypes.push_back(request_subtype);
+ }
+ return;
+}
+
const MetaInfo CacheManager::GetMetaInfo() const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(cache_lock_);
@@ -2578,8 +2673,8 @@ void CacheManager::SetExternalConsentForApp(
(*(*pt_->policy_table.device_data)[permissions.device_id]
.user_consent_records)[permissions.policy_app_id];
- const TimevalStruct tm = date_time::DateTime::getCurrentTime();
- int64_t current_time_msec = date_time::DateTime::getmSecs(tm);
+ const date_time::TimeDuration tm = date_time::getCurrentTime();
+ int64_t current_time_msec = date_time::getmSecs(tm);
app_consent_records.ext_consent_last_updated = current_time_msec;
LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
index 8be0372c03..c9df969bd1 100644
--- a/src/components/policy/policy_external/src/policy_helper.cc
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -122,8 +122,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
CheckAppPolicy::CheckAppPolicy(
PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot,
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot,
CheckAppPolicyResults& out_results)
: pm_(pm)
, update_(update)
@@ -299,9 +299,20 @@ void CheckAppPolicy::AddResult(const std::string& app_id,
out_results_.insert(std::make_pair(app_id, result));
}
+void CheckAppPolicy::InsertPermission(const std::string& app_id,
+ const AppPermissions& permissions_diff) {
+ pm_->app_permissions_diff_lock_.Acquire();
+ auto result = pm_->app_permissions_diff_.insert(
+ std::make_pair(app_id, permissions_diff));
+ if (!result.second) {
+ LOG4CXX_ERROR(logger_, "App ID: " << app_id << " already exists in map.");
+ }
+ pm_->app_permissions_diff_lock_.Release();
+}
+
bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
const std::string app_id = app_policy.first;
-
+ AppPermissions permissions_diff(app_id);
if (!IsKnownAppication(app_id)) {
LOG4CXX_WARN(logger_,
"Application:" << app_id << " is not present in snapshot.");
@@ -309,22 +320,43 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
}
if (!IsPredefinedApp(app_policy) && IsAppRevoked(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_APP_REVOKED);
+ SetPendingPermissions(app_policy, RESULT_APP_REVOKED, permissions_diff);
AddResult(app_id, RESULT_APP_REVOKED);
+ InsertPermission(app_id, permissions_diff);
return true;
}
if (!IsPredefinedApp(app_policy) && !NicknamesMatch(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_NICKNAME_MISMATCH);
+ SetPendingPermissions(
+ app_policy, RESULT_NICKNAME_MISMATCH, permissions_diff);
AddResult(app_id, RESULT_NICKNAME_MISMATCH);
+ InsertPermission(app_id, permissions_diff);
return true;
}
PermissionsCheckResult result = CheckPermissionsChanges(app_policy);
- if (!IsPredefinedApp(app_policy) && IsRequestTypeChanged(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
- AddResult(app_id, RESULT_REQUEST_TYPE_CHANGED);
+ if (!IsPredefinedApp(app_policy)) {
+ const bool is_request_type_changed = IsRequestTypeChanged(app_policy);
+ const bool is_request_subtype_changed = IsRequestSubTypeChanged(app_policy);
+ if (is_request_type_changed) {
+ LOG4CXX_TRACE(logger_,
+ "Request types were changed for application: " << app_id);
+ SetPendingPermissions(
+ app_policy, RESULT_REQUEST_TYPE_CHANGED, permissions_diff);
+ AddResult(app_id, RESULT_REQUEST_TYPE_CHANGED);
+ result =
+ (RESULT_NO_CHANGES == result) ? RESULT_REQUEST_TYPE_CHANGED : result;
+ }
+ if (is_request_subtype_changed) {
+ LOG4CXX_TRACE(
+ logger_, "Request subtypes were changed for application: " << app_id);
+ SetPendingPermissions(
+ app_policy, RESULT_REQUEST_SUBTYPE_CHANGED, permissions_diff);
+ AddResult(app_id, RESULT_REQUEST_SUBTYPE_CHANGED);
+ result = (RESULT_NO_CHANGES == result) ? RESULT_REQUEST_SUBTYPE_CHANGED
+ : result;
+ }
}
if (RESULT_NO_CHANGES == result) {
@@ -340,19 +372,20 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
<< " have been changed.");
if (!IsPredefinedApp(app_policy)) {
- SetPendingPermissions(app_policy, result);
+ SetPendingPermissions(app_policy, result, permissions_diff);
AddResult(app_id, result);
}
+ InsertPermission(app_id, permissions_diff);
return true;
}
void policy::CheckAppPolicy::SetPendingPermissions(
const AppPoliciesValueType& app_policy,
- PermissionsCheckResult result) const {
+ PermissionsCheckResult result,
+ AppPermissions& permissions_diff) const {
using namespace rpc::policy_table_interface_base;
const std::string app_id = app_policy.first;
- AppPermissions permissions_diff(app_id);
const std::string priority =
policy_table::EnumToJsonString(app_policy.second.priority);
@@ -389,17 +422,18 @@ void policy::CheckAppPolicy::SetPendingPermissions(
break;
case RESULT_REQUEST_TYPE_CHANGED:
permissions_diff.requestTypeChanged = true;
- {
- // Getting RequestTypes from PTU (not from cache)
- policy_table::RequestTypes::const_iterator it_request_type =
- app_policy.second.RequestType->begin();
- for (; app_policy.second.RequestType->end() != it_request_type;
- ++it_request_type) {
- permissions_diff.requestType.push_back(
- EnumToJsonString(*it_request_type));
- }
- }
+ // Getting Request Types from PTU (not from cache)
+ for (const auto& request_type : *app_policy.second.RequestType) {
+ permissions_diff.requestType.push_back(EnumToJsonString(request_type));
+ }
+ break;
+ case RESULT_REQUEST_SUBTYPE_CHANGED:
+ permissions_diff.requestSubTypeChanged = true;
+ // Getting Request SubTypes from PTU (not from cache)
+ for (const auto& request_subtype : *app_policy.second.RequestSubType) {
+ permissions_diff.requestSubType.push_back(request_subtype);
+ }
break;
default:
return;
@@ -408,10 +442,6 @@ void policy::CheckAppPolicy::SetPendingPermissions(
if (need_send_priority) {
permissions_diff.priority = priority;
}
-
- pm_->app_permissions_diff_lock_.Acquire();
- pm_->app_permissions_diff_.insert(std::make_pair(app_id, permissions_diff));
- pm_->app_permissions_diff_lock_.Release();
}
PermissionsCheckResult CheckAppPolicy::CheckPermissionsChanges(
@@ -484,6 +514,32 @@ bool CheckAppPolicy::IsRequestTypeChanged(
return diff.size();
}
+bool CheckAppPolicy::IsRequestSubTypeChanged(
+ const AppPoliciesValueType& app_policy) const {
+ policy::AppPoliciesConstItr it =
+ snapshot_->policy_table.app_policies_section.apps.find(app_policy.first);
+
+ if (it == snapshot_->policy_table.app_policies_section.apps.end()) {
+ if (!app_policy.second.RequestSubType->empty()) {
+ return true;
+ }
+ return false;
+ }
+
+ if (it->second.RequestSubType->size() !=
+ app_policy.second.RequestSubType->size()) {
+ return true;
+ }
+
+ policy_table::RequestSubTypes diff;
+ std::set_difference(it->second.RequestSubType->begin(),
+ it->second.RequestSubType->end(),
+ app_policy.second.RequestSubType->begin(),
+ app_policy.second.RequestSubType->end(),
+ std::back_inserter(diff));
+ return diff.size();
+}
+
void FillActionsForAppPolicies::operator()(
const policy::CheckAppPolicyResults::value_type& value) {
const std::string app_id = value.first;
@@ -510,6 +566,7 @@ void FillActionsForAppPolicies::operator()(
case RESULT_CONSENT_NOT_REQIURED:
case RESULT_PERMISSIONS_REVOKED:
case RESULT_REQUEST_TYPE_CHANGED:
+ case RESULT_REQUEST_SUBTYPE_CHANGED:
break;
case RESULT_NO_CHANGES:
default:
@@ -580,7 +637,16 @@ void FillNotificationData::UpdateParameters(
ParametersConstItr it_parameters = in_parameters.begin();
ParametersConstItr it_parameters_end = in_parameters.end();
- // Due to APPLINK-24201 SDL must consider cases when 'parameters' section is
+ // To determine consent for a particular RPC in a particular HMI level with
+ // particular parameters (if applicable), the system shall find all of the
+ // functional groups the RPC is included in. If user consent is needed as
+ // listed within the functional group in the policy table, the system shall
+ // use a logical AND: backend permissions AND User permissions. If the RPC is
+ // listed under more than one group, the system shall perform a logical OR
+ // amongst all of the possible allowed permissions scenarios for the RPC (and
+ // parameter/or HMI level) defined by each of the functional groups.
+
+ // Due to requirements SDL must consider cases when 'parameters' section is
// not present for RPC or present, but is empty.
// If 'parameters' section is like: 'parameters' : []
@@ -595,10 +661,8 @@ void FillNotificationData::UpdateParameters(
// If 'parameters' section is omitted
if (!in_parameters.is_initialized()) {
- if (!does_require_user_consent_) {
- out_parameter.any_parameter_allowed = true;
- }
- if (does_require_user_consent_ && kAllowedKey == current_key_) {
+ if (!does_require_user_consent_ ||
+ (does_require_user_consent_ && kAllowedKey == current_key_)) {
out_parameter.any_parameter_allowed = true;
}
}
@@ -607,6 +671,13 @@ void FillNotificationData::UpdateParameters(
out_parameter[current_key_].insert(
policy_table::EnumToJsonString(*it_parameters));
}
+
+ // We should reset ALL DISALLOWED flags if at least one parameter is allowed
+ // due to a logical OR permissions check
+ if (IsSomeParameterAllowed(out_parameter)) {
+ out_parameter.any_parameter_disallowed_by_policy = false;
+ out_parameter.any_parameter_disallowed_by_user = false;
+ }
}
void FillNotificationData::ExcludeSame(RpcPermissions& rpc) {
@@ -729,16 +800,24 @@ bool FillNotificationData::RpcParametersEmpty(RpcPermissions& rpc) {
no_user_disallowed_parameters;
}
-bool FillNotificationData::IsSectionEmpty(ParameterPermissions& permissions,
- const std::string& section) {
+bool FillNotificationData::IsSectionEmpty(
+ const ParameterPermissions& permissions, const std::string& section) const {
ParameterPermissions::const_iterator it_section = permissions.find(section);
ParameterPermissions::const_iterator end = permissions.end();
if (end != it_section) {
- return permissions[section].empty();
+ return it_section->second.empty();
}
return true;
}
+bool FillNotificationData::IsSomeParameterAllowed(
+ const ParameterPermissions& permissions) const {
+ const bool are_any_consented_parameters_allowed =
+ kAllowedKey == current_key_ && !IsSectionEmpty(permissions, current_key_);
+ return permissions.any_parameter_allowed ||
+ are_any_consented_parameters_allowed;
+}
+
ProcessFunctionalGroup::ProcessFunctionalGroup(
const policy_table::FunctionalGroupings& fg,
const std::vector<FunctionalGroupPermission>& group_permissions,
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 433a7a6bca..a603f122e2 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -49,12 +49,9 @@
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
#include "config_profile/profile.h"
-#include "utils/make_shared.h"
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
@@ -216,47 +213,41 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
-#ifdef SDL_REMOTE_CONTROL
- , access_remote_(new AccessRemoteImpl(
- CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
-#endif // SDL_REMOTE_CONTROL
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
- , retry_sequence_url_(0, 0, "") {
-}
+ , retry_sequence_url_(0, 0, "") {}
PolicyManagerImpl::PolicyManagerImpl(bool in_memory)
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager(in_memory))
-#ifdef SDL_REMOTE_CONTROL
- , access_remote_(new AccessRemoteImpl(
- CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
-#endif // SDL_REMOTE_CONTROL
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
, retry_sequence_url_(0, 0, "")
, wrong_ptu_update_received_(false)
, send_on_update_sent_out_(false)
- , trigger_ptu_(false) {
-}
+ , trigger_ptu_(false) {}
void PolicyManagerImpl::set_listener(PolicyListener* listener) {
listener_ = listener;
update_status_manager_.set_listener(listener);
}
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
Json::Reader reader;
if (reader.parse(json.c_str(), value)) {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::make_shared<policy_table::Table>();
}
}
@@ -280,6 +271,154 @@ std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
return cache_->GetLockScreenIconUrl();
}
+/**
+ * @brief FilterInvalidFunctions filter functions that are absent in schema
+ * @param rpcs list of functions to filter
+ */
+void FilterInvalidFunctions(policy_table::Rpc& rpcs) {
+ policy_table::Rpc valid_rpcs;
+ for (const auto& rpc : rpcs) {
+ const std::string& rpc_name = rpc.first;
+ policy_table::FunctionID function_id;
+ if (policy_table::EnumFromJsonString(rpc_name, &function_id)) {
+ valid_rpcs.insert(rpc);
+ }
+ }
+ rpcs.swap(valid_rpcs);
+}
+
+/**
+ * @brief FilterInvalidRPCParameters filter parameters that not present in
+ * schema
+ * @param rpc_parameters parameters to filter
+ */
+void FilterInvalidRPCParameters(policy_table::RpcParameters& rpc_parameters) {
+ policy_table::HmiLevels valid_hmi_levels;
+ for (const auto& hmi_level : rpc_parameters.hmi_levels) {
+ if (hmi_level.is_valid()) {
+ valid_hmi_levels.push_back(hmi_level);
+ }
+ }
+ rpc_parameters.hmi_levels.swap(valid_hmi_levels);
+
+ policy_table::Parameters valid_params;
+ const policy_table::Parameters& params = *(rpc_parameters.parameters);
+ for (const auto& param : params) {
+ if (param.is_valid()) {
+ valid_params.push_back(param);
+ }
+ }
+ rpc_parameters.parameters->swap(valid_params);
+}
+
+/**
+ * @brief FilterInvalidPriorityValues filter notification priorities that are
+ * not present in schema
+ * @param notifications priorities to filter
+ */
+void FilterInvalidPriorityValues(
+ policy_table::NumberOfNotificationsPerMinute& notifications) {
+ policy_table::NumberOfNotificationsPerMinute valid_notifications;
+ for (const auto& notification : notifications) {
+ policy_table::Priority priority;
+ if (policy_table::EnumFromJsonString(notification.first, &priority)) {
+ valid_notifications.insert(notification);
+ }
+ }
+ notifications.swap(valid_notifications);
+}
+
+/**
+ * @brief FilterInvalidApplicationParameters filter app params that are not
+ * present in schema
+ * @param app_params object of app policy params to filter
+ */
+void FilterInvalidApplicationParameters(
+ policy_table::ApplicationParams& app_params) {
+ // Filter AppHMIType array
+ policy_table::AppHMITypes valid_app_hmi_types;
+ const policy_table::AppHMITypes& app_hmi_types = *(app_params.AppHMIType);
+ for (const auto& app_hmi_type : app_hmi_types) {
+ if (app_hmi_type.is_valid()) {
+ valid_app_hmi_types.push_back(app_hmi_type);
+ }
+ }
+ app_params.AppHMIType->swap(valid_app_hmi_types);
+
+ // Filter RquestTypes array
+ policy_table::RequestTypes valid_request_types;
+ const policy_table::RequestTypes& request_types = *(app_params.RequestType);
+ for (const auto& request_type : request_types) {
+ if (request_type.is_valid()) {
+ valid_request_types.push_back(request_type);
+ }
+ }
+ if (valid_request_types.empty() && !request_types.empty()) {
+ // An empty RequestType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.RequestType) = policy_table::RequestTypes();
+ } else {
+ app_params.RequestType->swap(valid_request_types);
+ }
+
+ // Filter moduleType array
+ policy_table::ModuleTypes valid_module_types;
+ const policy_table::ModuleTypes& module_types = *(app_params.moduleType);
+ for (const auto& module_type : module_types) {
+ if (module_type.is_valid()) {
+ valid_module_types.push_back(module_type);
+ }
+ }
+ if (valid_module_types.empty() && !module_types.empty()) {
+ // An empty moduleType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.moduleType) = policy_table::ModuleTypes();
+ } else {
+ app_params.moduleType->swap(valid_module_types);
+ }
+
+ // Filter default_hmi
+ if (!app_params.default_hmi.is_valid()) {
+ app_params.default_hmi = policy_table::HmiLevel();
+ }
+
+ // Filter priority
+ if (!app_params.priority.is_valid()) {
+ app_params.priority = policy_table::Priority();
+ }
+}
+
+/**
+ * @brief FilterPolicyTable filter values that not present in schema
+ * @param pt policy table to filter
+ */
+void FilterPolicyTable(policy_table::PolicyTable& pt) {
+ policy_table::ModuleConfig& module_config = pt.module_config;
+ if (module_config.is_initialized() &&
+ module_config.notifications_per_minute_by_priority.is_initialized()) {
+ FilterInvalidPriorityValues(
+ module_config.notifications_per_minute_by_priority);
+ }
+
+ if (pt.app_policies_section.is_initialized()) {
+ policy_table::ApplicationPolicies& apps = pt.app_policies_section.apps;
+ for (auto& app_policy : apps) {
+ FilterInvalidApplicationParameters(app_policy.second);
+ }
+ }
+
+ for (auto& group : pt.functional_groupings) {
+ policy_table::Rpc& rpcs = group.second.rpcs;
+ FilterInvalidFunctions(rpcs);
+
+ for (auto& func : rpcs) {
+ FilterInvalidRPCParameters(func.second);
+ }
+ }
+}
+
bool PolicyManagerImpl::LoadPT(const std::string& file,
const BinaryMessage& pt_content) {
LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
@@ -288,7 +427,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
"PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
// Parse message into table struct
- utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = Parse(pt_content);
if (!pt_update) {
LOG4CXX_WARN(logger_, "Parsed table pointer is NULL.");
update_status_manager_.OnWrongUpdateReceived();
@@ -296,7 +435,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
}
file_system::DeleteFile(file);
-
+ FilterPolicyTable(pt_update->policy_table);
if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
wrong_ptu_update_received_ = true;
update_status_manager_.OnWrongUpdateReceived();
@@ -310,7 +449,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
sync_primitives::AutoLock lock(apps_registration_lock_);
// Get current DB data, since it could be updated during awaiting of PTU
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(
@@ -372,8 +511,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
}
CheckAppPolicyResults PolicyManagerImpl::CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> pt_update,
- const utils::SharedPtr<policy_table::Table> snapshot) {
+ const std::shared_ptr<policy_table::Table> pt_update,
+ const std::shared_ptr<policy_table::Table> snapshot) {
LOG4CXX_INFO(logger_, "Checking incoming permissions.");
// Replace predefined policies with its actual setting, e.g. "123":"default"
@@ -477,7 +616,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
void PolicyManagerImpl::RequestPTUpdate() {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
@@ -563,6 +702,25 @@ const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
return request_types;
}
+RequestType::State PolicyManagerImpl::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestTypesState(policy_app_id);
+}
+
+RequestSubType::State PolicyManagerImpl::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestSubTypesState(policy_app_id);
+}
+
+const std::vector<std::string> PolicyManagerImpl::GetAppRequestSubTypes(
+ const std::string& policy_app_id) const {
+ std::vector<std::string> request_subtypes;
+ cache_->GetAppRequestSubTypes(policy_app_id, request_subtypes);
+ return request_subtypes;
+}
+
const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
return cache_->GetVehicleInfo();
}
@@ -773,13 +931,11 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
LOG4CXX_INFO(logger_,
"Send notification for application_id:" << application_id);
-#ifdef SDL_REMOTE_CONTROL
const ApplicationOnDevice who = {device_id, application_id};
if (access_remote_->IsAppRemoteControl(who)) {
listener()->OnPermissionsUpdated(application_id, notification_data);
return;
}
-#endif // SDL_REMOTE_CONTROL
std::string default_hmi;
GetDefaultHmi(application_id, &default_hmi);
@@ -1090,10 +1246,6 @@ void PolicyManagerImpl::GetUserConsentForApp(
FunctionalGroupIDs preconsented_groups = group_types[kTypePreconsented];
FunctionalGroupIDs consent_allowed_groups = group_types[kTypeAllowed];
FunctionalGroupIDs consent_disallowed_groups = group_types[kTypeDisallowed];
- FunctionalGroupIDs default_groups = group_types[kTypeDefault];
- FunctionalGroupIDs predataconsented_groups =
- group_types[kTypePreDataConsented];
- FunctionalGroupIDs device_groups = group_types[kTypeDevice];
// Sorting groups by consent
FunctionalGroupIDs preconsented_wo_auto =
@@ -1105,15 +1257,8 @@ void PolicyManagerImpl::GetUserConsentForApp(
FunctionalGroupIDs allowed_groups =
Merge(consent_allowed_groups, preconsented_wo_disallowed_auto);
- FunctionalGroupIDs merged_stage_1 =
- Merge(default_groups, predataconsented_groups);
-
- FunctionalGroupIDs merged_stage_2 = Merge(merged_stage_1, device_groups);
-
- FunctionalGroupIDs merged_stage_3 =
- Merge(merged_stage_2, auto_allowed_groups);
-
- FunctionalGroupIDs excluded_stage_1 = ExcludeSame(all_groups, merged_stage_3);
+ FunctionalGroupIDs excluded_stage_1 =
+ ExcludeSame(all_groups, auto_allowed_groups);
FunctionalGroupIDs excluded_stage_2 =
ExcludeSame(excluded_stage_1, consent_disallowed_groups);
@@ -1268,7 +1413,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() {
}
bool PolicyManagerImpl::IsPTValid(
- utils::SharedPtr<policy_table::Table> policy_table,
+ std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const {
policy_table->SetPolicyTableType(type);
if (!policy_table->is_valid()) {
@@ -1359,7 +1504,7 @@ void PolicyManagerImpl::SendPermissionsToApp(
Permissions notification_data;
// Need to get rid of this call
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
PrepareNotificationData(
@@ -1488,9 +1633,9 @@ void PolicyManagerImpl::CalculateGroupsConsentFromExternalConsent(
bool PolicyManagerImpl::ExceededDays() {
LOG4CXX_AUTO_TRACE(logger_);
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days = current_time.tv_sec / kSecondsInDay;
+ const int days = date_time::getSecs(current_time) / kSecondsInDay;
DCHECK(std::numeric_limits<uint16_t>::max() >= days);
@@ -1766,18 +1911,15 @@ StatusNotifier PolicyManagerImpl::AddApplication(
DeviceConsent device_consent = GetUserConsentForDevice(device_id);
sync_primitives::AutoLock lock(apps_registration_lock_);
if (IsNewApplication(application_id)) {
+ LOG4CXX_DEBUG(logger_, "Adding new application");
AddNewApplication(application_id, device_consent);
- return utils::MakeShared<CallStatusChange>(update_status_manager_,
- device_consent);
- } else {
- PromoteExistedApplication(application_id, device_consent);
- if (helpers::in_range(hmi_types, policy_table::AHT_NAVIGATION) &&
- !HasCertificate()) {
- LOG4CXX_DEBUG(logger_, "Certificate does not exist, scheduling update.");
- update_status_manager_.ScheduleUpdate();
- }
- return utils::MakeShared<utils::CallNothing>();
+ return std::make_shared<CallStatusChange>(update_status_manager_,
+ device_consent);
}
+ LOG4CXX_DEBUG(logger_, "Promote existed application");
+ PromoteExistedApplication(application_id, device_consent);
+ update_status_manager_.OnExistedApplicationAdded(cache_->UpdateRequired());
+ return std::make_shared<utils::CallNothing>();
}
void PolicyManagerImpl::RemoveAppConsentForGroup(
@@ -1891,7 +2033,6 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
const bool ret = cache_->Init(file_name, settings);
if (ret) {
RefreshRetrySequence();
- update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
}
return ret;
}
@@ -1906,7 +2047,7 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) {
void PolicyManagerImpl::set_cache_manager(
CacheManagerInterface* cache_manager) {
- cache_ = cache_manager;
+ cache_ = std::shared_ptr<CacheManagerInterface>(cache_manager);
}
std::ostream& operator<<(std::ostream& output,
@@ -1919,7 +2060,6 @@ std::ostream& operator<<(std::ostream& output,
return output;
}
-#ifdef SDL_REMOTE_CONTROL
void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
const std::vector<int>& hmi_types) {
LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
@@ -2022,9 +2162,8 @@ bool PolicyManagerImpl::GetModuleTypes(
}
void PolicyManagerImpl::set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) {
+ std::shared_ptr<AccessRemote> access_remote) {
access_remote_ = access_remote;
}
-#endif // SDL_REMOTE_CONTROL
} // namespace policy
diff --git a/src/components/policy/policy_external/src/policy_table.cc b/src/components/policy/policy_external/src/policy_table.cc
index 7a63fac50d..8ca6b698d1 100644
--- a/src/components/policy/policy_external/src/policy_table.cc
+++ b/src/components/policy/policy_external/src/policy_table.cc
@@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
PolicyTable::PolicyTable() : pt_data_(new SQLPTExtRepresentation()) {}
-PolicyTable::PolicyTable(utils::SharedPtr<PTRepresentation> pt_data)
+PolicyTable::PolicyTable(std::shared_ptr<PTRepresentation> pt_data)
: pt_data_(pt_data) {}
PolicyTable::~PolicyTable() {
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 168ff86b27..27db505e3f 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -14,6 +14,8 @@ bool IsValidEnum(Priority val) {
return true;
case P_NORMAL:
return true;
+ case P_PROJECTION:
+ return true;
case P_NONE:
return true;
default:
@@ -32,6 +34,8 @@ const char* EnumToJsonString(Priority val) {
return "COMMUNICATION";
case P_NORMAL:
return "NORMAL";
+ case P_PROJECTION:
+ return "PROJECTION";
case P_NONE:
return "NONE";
default:
@@ -54,6 +58,9 @@ bool EnumFromJsonString(const std::string& literal, Priority* result) {
} else if ("NORMAL" == literal) {
*result = P_NORMAL;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = P_PROJECTION;
+ return true;
} else if ("NONE" == literal) {
*result = P_NONE;
return true;
@@ -118,6 +125,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_EXTERNALTEMPERATURE:
return true;
+ case P_TURNSIGNAL:
+ return true;
case P_FUELLEVEL:
return true;
case P_FUELLEVEL_STATE:
@@ -126,6 +135,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_INSTANTFUELCONSUMPTION:
return true;
+ case P_FUELRANGE:
+ return true;
case P_ODOMETER:
return true;
case P_TIREPRESSURE:
@@ -138,6 +149,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_BELTSTATUS:
return true;
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return true;
case P_DRIVERBRAKING:
return true;
case P_PRNDL:
@@ -146,6 +159,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_STEERINGWHEELANGLE:
return true;
+ case P_ENGINEOILLIFE:
+ return true;
case P_MYKEY:
return true;
case P_AIRBAGSTATUS:
@@ -162,8 +177,6 @@ bool IsValidEnum(Parameter val) {
return true;
case P_ABS_STATE:
return true;
- case P_TURN_SIGNAL:
- return true;
case P_FUEL_RANGE:
return true;
case P_TIRE_PRESSURE_VALUE:
@@ -207,6 +220,8 @@ const char* EnumToJsonString(Parameter val) {
return "engineTorque";
case P_EXTERNALTEMPERATURE:
return "externalTemperature";
+ case P_TURNSIGNAL:
+ return "turnSignal";
case P_FUELLEVEL:
return "fuelLevel";
case P_FUELLEVEL_STATE:
@@ -215,6 +230,8 @@ const char* EnumToJsonString(Parameter val) {
return "headLampStatus";
case P_INSTANTFUELCONSUMPTION:
return "instantFuelConsumption";
+ case P_FUELRANGE:
+ return "fuelRange";
case P_ODOMETER:
return "odometer";
case P_TIREPRESSURE:
@@ -227,6 +244,8 @@ const char* EnumToJsonString(Parameter val) {
return "accPedalPosition";
case P_BELTSTATUS:
return "beltStatus";
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return "electronicParkBrakeStatus";
case P_DRIVERBRAKING:
return "driverBraking";
case P_PRNDL:
@@ -235,6 +254,8 @@ const char* EnumToJsonString(Parameter val) {
return "rpm";
case P_STEERINGWHEELANGLE:
return "steeringWheelAngle";
+ case P_ENGINEOILLIFE:
+ return "engineOilLife";
case P_MYKEY:
return "myKey";
case P_AIRBAGSTATUS:
@@ -251,8 +272,6 @@ const char* EnumToJsonString(Parameter val) {
return "eCallInfo";
case P_ABS_STATE:
return "abs_State";
- case P_TURN_SIGNAL:
- return "turnSignal";
case P_FUEL_RANGE:
return "fuelRange";
case P_TIRE_PRESSURE_VALUE:
@@ -299,6 +318,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("externalTemperature" == literal) {
*result = P_EXTERNALTEMPERATURE;
return true;
+ } else if ("turnSignal" == literal) {
+ *result = P_TURNSIGNAL;
+ return true;
} else if ("fuelLevel" == literal) {
*result = P_FUELLEVEL;
return true;
@@ -311,6 +333,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("instantFuelConsumption" == literal) {
*result = P_INSTANTFUELCONSUMPTION;
return true;
+ } else if ("fuelRange" == literal) {
+ *result = P_FUELRANGE;
+ return true;
} else if ("odometer" == literal) {
*result = P_ODOMETER;
return true;
@@ -329,6 +354,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("beltStatus" == literal) {
*result = P_BELTSTATUS;
return true;
+ } else if ("electronicParkBrakeStatus" == literal) {
+ *result = P_ELECTRONICPARKBRAKESTATUS;
+ return true;
} else if ("driverBraking" == literal) {
*result = P_DRIVERBRAKING;
return true;
@@ -341,6 +369,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("steeringWheelAngle" == literal) {
*result = P_STEERINGWHEELANGLE;
return true;
+ } else if ("engineOilLife" == literal) {
+ *result = P_ENGINEOILLIFE;
+ return true;
} else if ("myKey" == literal) {
*result = P_MYKEY;
return true;
@@ -365,9 +396,6 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("abs_State" == literal) {
*result = P_ABS_STATE;
return true;
- } else if ("turnSignal" == literal) {
- *result = P_TURN_SIGNAL;
- return true;
} else if ("fuelRange" == literal) {
*result = P_FUEL_RANGE;
return true;
@@ -591,6 +619,10 @@ bool IsValidEnum(RequestType val) {
return true;
case RT_FOTA:
return true;
+ case RT_OEM_SPECIFIC:
+ return true;
+ case RT_EMPTY:
+ return true;
default:
return false;
}
@@ -638,6 +670,10 @@ const char* EnumToJsonString(RequestType val) {
return "MEDIA";
case RT_FOTA:
return "FOTA";
+ case RT_OEM_SPECIFIC:
+ return "OEM_SPECIFIC";
+ case RT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -723,18 +759,35 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) {
if ("FOTA" == literal) {
*result = RT_FOTA;
return true;
+ }
+ if ("OEM_SPECIFIC" == literal) {
+ *result = RT_OEM_SPECIFIC;
+ return true;
+ }
+ if ("EMPTY" == literal) {
+ *result = RT_EMPTY;
+ return true;
} else {
return false;
}
}
-#ifdef SDL_REMOTE_CONTROL
bool IsValidEnum(ModuleType val) {
switch (val) {
case MT_CLIMATE:
return true;
case MT_RADIO:
return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
+ case MT_SEAT:
+ return true;
+ case MT_EMPTY:
+ return true;
default:
return false;
}
@@ -745,6 +798,16 @@ const char* EnumToJsonString(ModuleType val) {
return "CLIMATE";
case MT_RADIO:
return "RADIO";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
+ case MT_SEAT:
+ return "SEAT";
+ case MT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -757,11 +820,378 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("RADIO" == literal) {
*result = MT_RADIO;
return true;
+ } else if ("SEAT" == literal) {
+ *result = MT_SEAT;
+ return true;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
+ } else if ("EMPTY" == literal) {
+ *result = MT_EMPTY;
+ return true;
} else {
return false;
}
}
-#endif // SDL_REMOTE_CONTROL
+
+bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
+ if ("RegisterAppInterface" == literal) {
+ *result = RegisterAppInterfaceID;
+ return true;
+ }
+
+ if ("UnregisterAppInterface" == literal) {
+ *result = UnregisterAppInterfaceID;
+ return true;
+ }
+
+ if ("SetGlobalProperties" == literal) {
+ *result = SetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("ResetGlobalProperties" == literal) {
+ *result = ResetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("AddCommand" == literal) {
+ *result = AddCommandID;
+ return true;
+ }
+
+ if ("DeleteCommand" == literal) {
+ *result = DeleteCommandID;
+ return true;
+ }
+
+ if ("AddSubMenu" == literal) {
+ *result = AddSubMenuID;
+ return true;
+ }
+
+ if ("DeleteSubMenu" == literal) {
+ *result = DeleteSubMenuID;
+ return true;
+ }
+
+ if ("CreateInteractionChoiceSet" == literal) {
+ *result = CreateInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("PerformInteraction" == literal) {
+ *result = PerformInteractionID;
+ return true;
+ }
+
+ if ("DeleteInteractionChoiceSet" == literal) {
+ *result = DeleteInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("Alert" == literal) {
+ *result = AlertID;
+ return true;
+ }
+
+ if ("Show" == literal) {
+ *result = ShowID;
+ return true;
+ }
+
+ if ("Speak" == literal) {
+ *result = SpeakID;
+ return true;
+ }
+
+ if ("SetMediaClockTimer" == literal) {
+ *result = SetMediaClockTimerID;
+ return true;
+ }
+
+ if ("PerformAudioPassThru" == literal) {
+ *result = PerformAudioPassThruID;
+ return true;
+ }
+
+ if ("EndAudioPassThru" == literal) {
+ *result = EndAudioPassThruID;
+ return true;
+ }
+
+ if ("SubscribeButton" == literal) {
+ *result = SubscribeButtonID;
+ return true;
+ }
+
+ if ("UnsubscribeButton" == literal) {
+ *result = UnsubscribeButtonID;
+ return true;
+ }
+
+ if ("SubscribeVehicleData" == literal) {
+ *result = SubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("UnsubscribeVehicleData" == literal) {
+ *result = UnsubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("GetVehicleData" == literal) {
+ *result = GetVehicleDataID;
+ return true;
+ }
+
+ if ("ReadDID" == literal) {
+ *result = ReadDIDID;
+ return true;
+ }
+
+ if ("GetDTCs" == literal) {
+ *result = GetDTCsID;
+ return true;
+ }
+
+ if ("ScrollableMessage" == literal) {
+ *result = ScrollableMessageID;
+ return true;
+ }
+
+ if ("Slider" == literal) {
+ *result = SliderID;
+ return true;
+ }
+
+ if ("ShowConstantTBT" == literal) {
+ *result = ShowConstantTBTID;
+ return true;
+ }
+
+ if ("AlertManeuver" == literal) {
+ *result = AlertManeuverID;
+ return true;
+ }
+
+ if ("UpdateTurnList" == literal) {
+ *result = UpdateTurnListID;
+ return true;
+ }
+
+ if ("ChangeRegistration" == literal) {
+ *result = ChangeRegistrationID;
+ return true;
+ }
+
+ if ("GenericResponse" == literal) {
+ *result = GenericResponseID;
+ return true;
+ }
+
+ if ("PutFile" == literal) {
+ *result = PutFileID;
+ return true;
+ }
+
+ if ("DeleteFile" == literal) {
+ *result = DeleteFileID;
+ return true;
+ }
+
+ if ("ListFiles" == literal) {
+ *result = ListFilesID;
+ return true;
+ }
+
+ if ("SetAppIcon" == literal) {
+ *result = SetAppIconID;
+ return true;
+ }
+
+ if ("SetDisplayLayout" == literal) {
+ *result = SetDisplayLayoutID;
+ return true;
+ }
+
+ if ("DiagnosticMessage" == literal) {
+ *result = DiagnosticMessageID;
+ return true;
+ }
+
+ if ("SystemRequest" == literal) {
+ *result = SystemRequestID;
+ return true;
+ }
+
+ if ("SendLocation" == literal) {
+ *result = SendLocationID;
+ return true;
+ }
+
+ if ("DialNumber" == literal) {
+ *result = DialNumberID;
+ return true;
+ }
+
+ if ("ButtonPress" == literal) {
+ *result = ButtonPressID;
+ return true;
+ }
+
+ if ("GetInteriorVehicleData" == literal) {
+ *result = GetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("SetInteriorVehicleData" == literal) {
+ *result = SetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("GetWayPoints" == literal) {
+ *result = GetWayPointsID;
+ return true;
+ }
+
+ if ("SubscribeWayPoints" == literal) {
+ *result = SubscribeWayPointsID;
+ return true;
+ }
+
+ if ("UnsubscribeWayPoints" == literal) {
+ *result = UnsubscribeWayPointsID;
+ return true;
+ }
+
+ if ("GetSystemCapability" == literal) {
+ *result = GetSystemCapabilityID;
+ return true;
+ }
+
+ if ("SendHapticData" == literal) {
+ *result = SendHapticDataID;
+ return true;
+ }
+
+ if ("OnHMIStatus" == literal) {
+ *result = OnHMIStatusID;
+ return true;
+ }
+
+ if ("OnAppInterfaceUnregistered" == literal) {
+ *result = OnAppInterfaceUnregisteredID;
+ return true;
+ }
+
+ if ("OnButtonEvent" == literal) {
+ *result = OnButtonEventID;
+ return true;
+ }
+
+ if ("OnButtonPress" == literal) {
+ *result = OnButtonPressID;
+ return true;
+ }
+
+ if ("OnVehicleData" == literal) {
+ *result = OnVehicleDataID;
+ return true;
+ }
+
+ if ("OnCommand" == literal) {
+ *result = OnCommandID;
+ return true;
+ }
+
+ if ("OnTBTClientState" == literal) {
+ *result = OnTBTClientStateID;
+ return true;
+ }
+
+ if ("OnDriverDistraction" == literal) {
+ *result = OnDriverDistractionID;
+ return true;
+ }
+
+ if ("OnPermissionsChange" == literal) {
+ *result = OnPermissionsChangeID;
+ return true;
+ }
+
+ if ("OnAudioPassThru" == literal) {
+ *result = OnAudioPassThruID;
+ return true;
+ }
+
+ if ("OnLanguageChange" == literal) {
+ *result = OnLanguageChangeID;
+ return true;
+ }
+
+ if ("OnKeyboardInput" == literal) {
+ *result = OnKeyboardInputID;
+ return true;
+ }
+
+ if ("OnTouchEvent" == literal) {
+ *result = OnTouchEventID;
+ return true;
+ }
+
+ if ("OnSystemRequest" == literal) {
+ *result = OnSystemRequestID;
+ return true;
+ }
+
+ if ("OnHashChange" == literal) {
+ *result = OnHashChangeID;
+ return true;
+ }
+
+ if ("OnInteriorVehicleData" == literal) {
+ *result = OnInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("OnWayPointChange" == literal) {
+ *result = OnWayPointChangeID;
+ return true;
+ }
+
+ if ("OnRCStatus" == literal) {
+ *result = OnRCStatusID;
+ return true;
+ }
+
+ if ("EncodedSyncPData" == literal) {
+ *result = EncodedSyncPDataID;
+ return true;
+ }
+
+ if ("SyncPData" == literal) {
+ *result = SyncPDataID;
+ return true;
+ }
+
+ if ("OnEncodedSyncPData" == literal) {
+ *result = OnEncodedSyncPDataID;
+ return true;
+ }
+
+ if ("OnSyncPData" == literal) {
+ *result = OnSyncPDataID;
+ return true;
+ }
+ return false;
+};
const std::string kDefaultApp = "default";
const std::string kPreDataConsentApp = "pre_DataConsent";
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 da83626448..5922a020e6 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -238,25 +238,21 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, nicknames(impl::ValueMember(value__, "nicknames"))
, AppHMIType(impl::ValueMember(value__, "AppHMIType"))
, RequestType(impl::ValueMember(value__, "RequestType"))
+ , RequestSubType(impl::ValueMember(value__, "RequestSubType"))
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
, heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
-#ifdef SDL_REMOTE_CONTROL
- , moduleType(impl::ValueMember(value__, "moduleType"))
-#endif // SDL_REMOTE_CONTROL
-{
-}
+ , moduleType(impl::ValueMember(value__, "moduleType")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
impl::WriteJsonField("nicknames", nicknames, &result__);
impl::WriteJsonField("AppHMIType", AppHMIType, &result__);
impl::WriteJsonField("RequestType", RequestType, &result__);
+ impl::WriteJsonField("RequestSubType", RequestSubType, &result__);
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
-#ifdef SDL_REMOTE_CONTROL
impl::WriteJsonField("moduleType", moduleType, &result__);
-#endif // SDL_REMOTE_CONTROL
return result__;
}
@@ -278,11 +274,9 @@ bool ApplicationParams::is_valid() const {
if (!heart_beat_timeout_ms.is_valid()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return Validate();
}
@@ -303,17 +297,18 @@ bool ApplicationParams::struct_empty() const {
if (RequestType.is_initialized()) {
return false;
}
+ if (RequestSubType.is_initialized()) {
+ return false;
+ }
if (memory_kb.is_initialized()) {
return false;
}
if (heart_beat_timeout_ms.is_initialized()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (moduleType.is_initialized()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return true;
}
@@ -337,6 +332,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!RequestType.is_valid()) {
RequestType.ReportErrors(&report__->ReportSubobject("RequestType"));
}
+ if (!RequestSubType.is_valid()) {
+ RequestSubType.ReportErrors(&report__->ReportSubobject("RequestSubType"));
+ }
if (!priority.is_valid()) {
priority.ReportErrors(&report__->ReportSubobject("priority"));
}
@@ -356,23 +354,19 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
heart_beat_timeout_ms.ReportErrors(
&report__->ReportSubobject("heart_beat_timeout_ms"));
}
-
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
}
-#endif // SDL_REMOTE_CONTROL
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
PolicyBase::SetPolicyTableType(pt_type);
AppHMIType.SetPolicyTableType(pt_type);
RequestType.SetPolicyTableType(pt_type);
+ RequestSubType.SetPolicyTableType(pt_type);
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
-#ifdef SDL_REMOTE_CONTROL
moduleType.SetPolicyTableType(pt_type);
-#endif // SDL_REMOTE_CONTROL
}
// RpcParameters methods
@@ -575,7 +569,9 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
, vehicle_year(impl::ValueMember(value__, "vehicle_year"))
, preloaded_date(impl::ValueMember(value__, "preloaded_date"))
, certificate(impl::ValueMember(value__, "certificate"))
- , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) {}
+ , preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
+ , full_app_id_supported(
+ impl::ValueMember(value__, "full_app_id_supported")) {}
void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
exchange_after_x_days = from.exchange_after_x_days;
@@ -598,6 +594,8 @@ Json::Value ModuleConfig::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("certificate", certificate, &result__);
impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField(
+ "full_app_id_supported", full_app_id_supported, &result__);
impl::WriteJsonField("exchange_after_x_ignition_cycles",
exchange_after_x_ignition_cycles,
&result__);
@@ -628,6 +626,9 @@ bool ModuleConfig::is_valid() const {
if (!preloaded_pt.is_valid()) {
return false;
}
+ if (!full_app_id_supported.is_valid()) {
+ return false;
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
return false;
}
@@ -678,6 +679,9 @@ bool ModuleConfig::struct_empty() const {
if (preloaded_pt.is_initialized()) {
return false;
}
+ if (full_app_id_supported.is_initialized()) {
+ return false;
+ }
if (exchange_after_x_ignition_cycles.is_initialized()) {
return false;
@@ -726,6 +730,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (!preloaded_pt.is_valid()) {
preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
}
+ if (!full_app_id_supported.is_valid()) {
+ full_app_id_supported.ReportErrors(
+ &report__->ReportSubobject("full_app_id_supported"));
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
exchange_after_x_ignition_cycles.ReportErrors(
&report__->ReportSubobject("exchange_after_x_ignition_cycles"));
@@ -803,6 +811,7 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
CompositeType::SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
preloaded_pt.SetPolicyTableType(pt_type);
+ full_app_id_supported.SetPolicyTableType(pt_type);
exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
exchange_after_x_kilometers.SetPolicyTableType(pt_type);
exchange_after_x_days.SetPolicyTableType(pt_type);
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 48a8578855..9b227615d8 100644
--- a/src/components/policy/policy_external/src/policy_table/validation.cc
+++ b/src/components/policy/policy_external/src/policy_table/validation.cc
@@ -89,6 +89,7 @@ bool ApplicationPoliciesSection::Validate() const {
continue;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request Types...");
RequestTypes& app_request_types = *iter->second.RequestType;
if (app_request_types.is_omitted()) {
@@ -133,10 +134,36 @@ bool ApplicationPoliciesSection::Validate() const {
++iter;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request SubTypes...");
+ iter = apps.begin();
+ while (iter != end_iter) {
+ if (it_default_policy == iter || it_pre_data_policy == iter) {
+ ++iter;
+ continue;
+ }
+ ApplicationParams& app_params = (*iter).second;
+ const bool is_request_subtype_omitted =
+ !app_params.RequestSubType.is_initialized();
+
+ if (is_request_subtype_omitted) {
+ LOG4CXX_WARN(logger_,
+ "App policy RequestSubTypes omitted."
+ " Will be replaced with default.");
+ app_params.RequestSubType = apps[kDefaultApp].RequestSubType;
+ ++iter;
+ continue;
+ }
+
+ const bool is_request_subtype_empty = app_params.RequestSubType->empty();
+ if (is_request_subtype_empty) {
+ LOG4CXX_WARN(logger_, "App policy RequestSubTypes empty.");
+ }
+ ++iter;
+ }
+
return true;
}
-#ifdef SDL_REMOTE_CONTROL
bool ApplicationParams::ValidateModuleTypes() const {
// moduleType is optional so see Optional<T>::is_valid()
bool is_initialized = moduleType->is_initialized();
@@ -166,7 +193,6 @@ bool ApplicationParams::ValidateModuleTypes() const {
}
return true;
}
-#endif // SDL_REMOTE_CONTROL
bool ApplicationParams::Validate() const {
if (is_initialized()) {
@@ -178,11 +204,7 @@ bool ApplicationParams::Validate() const {
}
}
}
-#ifdef SDL_REMOTE_CONTROL
return ValidateModuleTypes();
-#else // SDL_REMOTE_CONTROL
- return true;
-#endif // SDL_REMOTE_CONTROL
}
bool RpcParameters::Validate() const {
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 f58a7f0b82..a43b22a3b8 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
@@ -670,6 +670,11 @@ bool SQLPTExtRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request subtype.");
+ 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
@@ -713,18 +718,17 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
if (!SetDefaultPolicy(app.first)) {
return false;
}
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
} else if (kPreDataConsentId.compare(app.second.get_string()) == 0) {
if (!SetPredataPolicy(app.first)) {
return false;
}
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
}
-
+ if (!SaveRequestType(app.first, *app.second.RequestType)) {
+ return false;
+ }
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
// Stop saving other params, since predefined permissions already set
return true;
}
@@ -757,6 +761,13 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
+
+ bool denied = !app.second.moduleType->is_initialized();
+ if (!SaveRemoteControlDenied(app.first, denied) ||
+ !SaveModuleType(app.first, *app.second.moduleType)) {
+ return false;
+ }
+
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
}
@@ -771,6 +782,10 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
+
return true;
}
@@ -859,19 +874,39 @@ bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
*params.memory_kb = query.GetInteger(5);
*params.heart_beat_timeout_ms = query.GetUInteger(6);
- if (!GatherAppGroup(app_id, &params.groups)) {
+ const auto& gather_app_id = ((*policies).apps[app_id].is_string())
+ ? (*policies).apps[app_id].get_string()
+ : app_id;
+ // Data should be gathered from db by "default" key if application has
+ // default policies
+
+ if (!GatherAppGroup(gather_app_id, &params.groups)) {
+ return false;
+ }
+
+ bool denied = false;
+ if (!GatherRemoteControlDenied(gather_app_id, &denied)) {
+ return false;
+ }
+ if (!denied) {
+ if (!GatherModuleType(gather_app_id, &*params.moduleType)) {
+ return false;
+ }
+ }
+
+ if (!GatherNickName(gather_app_id, &*params.nicknames)) {
return false;
}
- if (!GatherNickName(app_id, &*params.nicknames)) {
+ if (!GatherAppType(gather_app_id, &*params.AppHMIType)) {
return false;
}
- if (!GatherAppType(app_id, &*params.AppHMIType)) {
+ if (!GatherRequestType(gather_app_id, &*params.RequestType)) {
return false;
}
- if (!GatherRequestType(app_id, &*params.RequestType)) {
+ if (!GatherRequestSubType(gather_app_id, &*params.RequestSubType)) {
return false;
}
- GatherPreconsentedGroup(app_id, &*params.preconsented_groups);
+ GatherPreconsentedGroup(gather_app_id, &*params.preconsented_groups);
(*policies).apps[app_id] = params;
}
return true;
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 9702c315b0..97d75731ea 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -271,13 +271,21 @@ const std::string kCreateSchema =
" REFERENCES `application`(`id`) "
"); "
"CREATE TABLE IF NOT EXISTS `request_type`( "
- " `request_type` VARCHAR(50) NOT NULL, "
+ " `request_type` VARCHAR(50), "
" `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`request_type`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `request_subtype`( "
+ " `request_subtype` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`request_subtype`,`application_id`), "
+ " CONSTRAINT `fk_request_subtype_app_id` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`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`( "
@@ -482,6 +490,7 @@ const std::string kDropSchema =
"DROP INDEX IF EXISTS `app_type.fk_app_type_application1_idx`; "
"DROP TABLE IF EXISTS `app_type`; "
"DROP TABLE IF EXISTS `request_type`; "
+ "DROP TABLE IF EXISTS `request_subtype`; "
"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`; "
@@ -636,6 +645,11 @@ const std::string kInsertRequestType =
"INSERT OR IGNORE INTO `request_type` (`application_id`, `request_type`) "
"VALUES (?, ?)";
+const std::string kInsertRequestSubType =
+ "INSERT INTO `request_subtype` (`application_id`, "
+ "`request_subtype`) "
+ "VALUES (?, ?)";
+
const std::string kUpdateVersion = "UPDATE `version` SET `number`= ?";
const std::string kInsertMessageType =
@@ -760,6 +774,11 @@ const std::string kSelectRequestTypes =
"SELECT DISTINCT `request_type` FROM `request_type` WHERE `application_id` "
"= ?";
+const std::string kSelectRequestSubTypes =
+ "SELECT DISTINCT `request_subtype` FROM `request_subtype` WHERE "
+ "`application_id` "
+ "= ?";
+
const std::string kSelectSecondsBetweenRetries =
"SELECT `value` FROM `seconds_between_retry` ORDER BY `index`";
@@ -805,6 +824,8 @@ const std::string kDeleteApplication = "DELETE FROM `application`";
const std::string kDeleteRequestType = "DELETE FROM `request_type`";
+const std::string kDeleteRequestSubType = "DELETE FROM `request_subtype`";
+
const std::string kSelectApplicationRevoked =
"SELECT `is_revoked` FROM `application` WHERE `id` = ?";
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index 4315d99b3a..c8b367c8ec 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -235,10 +235,10 @@ int SQLPTRepresentation::TimeoutResponse() {
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
- const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ const int defaultTimeout = 30 * date_time::MILLISECONDS_IN_SECOND;
return defaultTimeout;
}
- return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return query.GetInteger(0) * date_time::MILLISECONDS_IN_SECOND;
}
bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
@@ -513,10 +513,10 @@ bool SQLPTRepresentation::RefreshDB() {
return true;
}
-utils::SharedPtr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
+std::shared_ptr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
const {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ auto table = std::make_shared<policy_table::Table>();
GatherModuleMeta(&*table->policy_table.module_meta);
GatherModuleConfig(&table->policy_table.module_config);
GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
@@ -761,29 +761,36 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
*params.memory_kb = query.GetInteger(2);
*params.heart_beat_timeout_ms = query.GetUInteger(3);
- if (!GatherAppGroup(app_id, &params.groups)) {
+ const auto& gather_app_id = ((*policies).apps[app_id].is_string())
+ ? (*policies).apps[app_id].get_string()
+ : app_id;
+ // Data should be gathered from db by "default" key if application has
+ // default policies
+
+ if (!GatherAppGroup(gather_app_id, &params.groups)) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
bool denied = false;
- if (!GatherRemoteControlDenied(app_id, &denied)) {
+ if (!GatherRemoteControlDenied(gather_app_id, &denied)) {
return false;
}
if (!denied) {
- if (!GatherModuleType(app_id, &*params.moduleType)) {
+ if (!GatherModuleType(gather_app_id, &*params.moduleType)) {
return false;
}
}
-#endif // SDL_REMOTE_CONTROL
- if (!GatherNickName(app_id, &*params.nicknames)) {
+ if (!GatherNickName(gather_app_id, &*params.nicknames)) {
+ return false;
+ }
+ if (!GatherAppType(gather_app_id, &*params.AppHMIType)) {
return false;
}
- if (!GatherAppType(app_id, &*params.AppHMIType)) {
+ if (!GatherRequestType(gather_app_id, &*params.RequestType)) {
return false;
}
- if (!GatherRequestType(app_id, &*params.RequestType)) {
+ if (!GatherRequestSubType(gather_app_id, &*params.RequestSubType)) {
return false;
}
@@ -1048,14 +1055,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
return false;
}
-#ifdef SDL_REMOTE_CONTROL
-
bool denied = !app.second.moduleType->is_initialized();
if (!SaveRemoteControlDenied(app.first, denied) ||
!SaveModuleType(app.first, *app.second.moduleType)) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
@@ -1175,15 +1179,59 @@ bool SQLPTRepresentation::SaveRequestType(
}
policy_table::RequestTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ LOG4CXX_WARN(logger_, "Request types not empty.");
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request types empty.");
query.Bind(0, app_id);
- query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::RequestType::RT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
return false;
}
}
+ return true;
+}
+bool SQLPTRepresentation::SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for request subtypes.");
+ return false;
+ }
+
+ policy_table::Strings::const_iterator it;
+ if (!request_subtypes.empty()) {
+ LOG4CXX_TRACE(logger_, "Request subtypes are not empty.");
+ for (it = request_subtypes.begin(); it != request_subtypes.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
+ } else if (request_subtypes.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request subtypes empty.");
+ query.Bind(0, app_id);
+ query.Bind(1, std::string("EMPTY"));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
return true;
}
@@ -1583,11 +1631,36 @@ bool SQLPTRepresentation::GatherRequestType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::RequestType::RT_EMPTY == type) {
+ request_types->mark_initialized();
+ continue;
+ }
request_types->push_back(type);
}
return true;
}
+bool SQLPTRepresentation::GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRequestSubTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from request subtypes.");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ const std::string request_subtype = query.GetString(0);
+ if ("EMPTY" == request_subtype) {
+ request_subtypes->mark_initialized();
+ continue;
+ }
+ request_subtypes->push_back(request_subtype);
+ }
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -1618,8 +1691,6 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
-#ifdef SDL_REMOTE_CONTROL
-
bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
bool* denied) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1651,6 +1722,10 @@ bool SQLPTRepresentation::GatherModuleType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::ModuleType::MT_EMPTY == type) {
+ app_types->mark_initialized();
+ continue;
+ }
app_types->push_back(type);
}
return true;
@@ -1683,18 +1758,30 @@ bool SQLPTRepresentation::SaveModuleType(
}
policy_table::ModuleTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
query.Bind(0, app_id);
- std::string module(policy_table::EnumToJsonString(*it));
- query.Bind(1, module);
- LOG4CXX_DEBUG(logger_,
- "Module(app: " << app_id << ", type: " << module << ")");
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::ModuleType::MT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ LOG4CXX_WARN(logger_, "Incorrect insert into module types.");
return false;
}
+ } else {
+ LOG4CXX_WARN(logger_, "Module Type omitted.");
}
-
return true;
}
@@ -1809,7 +1896,6 @@ bool SQLPTRepresentation::GatherRemoteRpc(
}
return true;
}
-#endif // SDL_REMOTE_CONTROL
bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
bool is_revoked,
@@ -1907,6 +1993,13 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
!SaveRequestType(app_id, request_types)) {
return false;
}
+
+ policy_table::Strings request_subtypes;
+ if (!GatherRequestSubType(kDefaultId, &request_subtypes) ||
+ !SaveRequestSubType(app_id, request_subtypes)) {
+ return false;
+ }
+
policy_table::AppHMITypes app_types;
if (!GatherAppType(kDefaultId, &app_types) ||
!SaveAppType(app_id, app_types)) {
diff --git a/src/components/policy/policy_external/src/status.cc b/src/components/policy/policy_external/src/status.cc
index 31fc7f110b..c2ee4e4bbc 100644
--- a/src/components/policy/policy_external/src/status.cc
+++ b/src/components/policy/policy_external/src/status.cc
@@ -32,7 +32,6 @@
#include "policy/status.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
policy::UpToDateStatus::UpToDateStatus()
: Status(kUpToDate, policy::PolicyTableStatus::StatusUpToDate) {}
@@ -45,7 +44,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManager* manager,
case kScheduleUpdate:
case kScheduleManualUpdate:
case kOnResetRetrySequence:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -59,14 +58,14 @@ void policy::UpdateNeededStatus::ProcessEvent(
policy::UpdateStatusManager* manager, policy::UpdateEvent event) {
switch (event) {
case kOnUpdateSentOut:
- manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ manager->SetNextStatus(std::make_shared<UpdatingStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
default:
break;
@@ -85,23 +84,23 @@ void policy::UpdatingStatus::ProcessEvent(policy::UpdateStatusManager* manager,
switch (event) {
case kOnValidUpdateReceived:
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnWrongUpdateReceived:
case kOnUpdateTimeout:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kScheduleUpdate:
case kScheduleManualUpdate:
case kOnResetRetrySequence:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc
index 087db1149b..b352b5ea39 100644
--- a/src/components/policy/policy_external/src/update_status_manager.cc
+++ b/src/components/policy/policy_external/src/update_status_manager.cc
@@ -33,7 +33,6 @@
#include "policy/update_status_manager.h"
#include "policy/policy_listener.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace policy {
@@ -41,7 +40,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
UpdateStatusManager::UpdateStatusManager()
: listener_(NULL)
- , current_status_(utils::MakeShared<UpToDateStatus>())
+ , current_status_(std::make_shared<UpToDateStatus>())
, last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
, app_registered_from_non_consented_device_(true) {
@@ -67,11 +66,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
DoTransition();
}
-void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) {
next_status_ = status;
}
-void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetPostponedStatus(std::shared_ptr<Status> status) {
postponed_status_ = status;
}
@@ -119,24 +118,27 @@ void UpdateStatusManager::OnResetRetrySequence() {
ProcessEvent(kOnResetRetrySequence);
}
+void UpdateStatusManager::OnExistedApplicationAdded(
+ const bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ current_status_.reset(new UpToDateStatus());
+ ProcessEvent(kScheduleUpdate);
+ }
+}
+
void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
LOG4CXX_AUTO_TRACE(logger_);
if (kDeviceAllowed != consent) {
+ LOG4CXX_DEBUG(logger_, "Application registered from non-consented device");
app_registered_from_non_consented_device_ = true;
return;
}
+ LOG4CXX_DEBUG(logger_, "Application registered from consented device");
app_registered_from_non_consented_device_ = false;
ProcessEvent(kOnNewAppRegistered);
}
-void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (is_update_required) {
- current_status_.reset(new UpToDateStatus());
- ProcessEvent(kScheduleUpdate);
- }
-}
-
void UpdateStatusManager::OnDeviceConsented() {
LOG4CXX_AUTO_TRACE(logger_);
if (app_registered_from_non_consented_device_) {
@@ -210,7 +212,6 @@ UpdateStatusManager::UpdateThreadDelegate::UpdateThreadDelegate(
UpdateStatusManager* update_status_manager)
: timeout_(0)
, stop_flag_(false)
- , state_lock_(true)
, update_status_manager_(update_status_manager) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Create UpdateThreadDelegate");
diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc
index 661ea29704..d46f6a315a 100644
--- a/src/components/policy/policy_external/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc
@@ -36,13 +36,13 @@
#include <cassert>
#include "policy/usage_statistics/counter.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace usage_statistics {
GlobalCounter::GlobalCounter(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
GlobalCounterId counter_type)
: counter_type_(counter_type), statistics_manager_(statistics_manager) {}
@@ -53,7 +53,7 @@ void GlobalCounter::operator++() const {
}
AppCounter::AppCounter(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type)
: app_id_(app_id)
@@ -67,7 +67,7 @@ void AppCounter::operator++() const {
}
AppInfo::AppInfo(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type)
: app_id_(app_id)
@@ -81,7 +81,7 @@ void AppInfo::Update(const std::string& new_info) const {
}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id)
: app_id_(app_id)
, stopwatch_type_(SECONDS_HMI_NONE)
@@ -92,7 +92,7 @@ AppStopwatchImpl::AppStopwatchImpl(
, time_out_(60) {}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
uint32_t timeout)
: app_id_(app_id)
@@ -107,8 +107,7 @@ AppStopwatchImpl::~AppStopwatchImpl() {}
void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND,
- timer::kPeriodic);
+ timer_.Start(time_out_ * date_time::MILLISECONDS_IN_SECOND, timer::kPeriodic);
}
void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {
diff --git a/src/components/policy/policy_external/test/CMakeLists.txt b/src/components/policy/policy_external/test/CMakeLists.txt
index a455d43b91..8b77c90dd2 100644
--- a/src/components/policy/policy_external/test/CMakeLists.txt
+++ b/src/components/policy/policy_external/test/CMakeLists.txt
@@ -55,12 +55,6 @@ file (GLOB POLICY_TEST_SOURCES
list (REMOVE_ITEM POLICY_TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/policy_manager_impl_stress_test.cc)
-if (REMOTE_CONTROL)
- list (APPEND testSources
- access_remote_impl_test.cc
- )
-endif ()
-
create_test("policy_test" "${POLICY_TEST_SOURCES}" "${testLibraries}")
#Additional test files (json)
diff --git a/src/components/policy/policy_external/test/counter_test.cc b/src/components/policy/policy_external/test/counter_test.cc
index 90f247de31..22b19c878e 100644
--- a/src/components/policy/policy_external/test/counter_test.cc
+++ b/src/components/policy/policy_external/test/counter_test.cc
@@ -28,6 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "gtest/gtest.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/counter.h"
@@ -45,7 +46,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -59,7 +60,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -74,7 +75,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -88,7 +89,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -102,7 +103,7 @@ TEST(
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -115,7 +116,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -130,7 +131,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
@@ -145,7 +146,7 @@ TEST(StatisticsManagerAddMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
@@ -161,7 +162,7 @@ TEST(
StatisticsManagerAddMethod,
AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
index 995c63ed20..3870e4ece1 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
@@ -78,7 +78,7 @@ class MockPTRepresentation : virtual public ::policy::PTRepresentation {
MOCK_METHOD0(Close, bool());
MOCK_METHOD0(Clear, bool());
MOCK_METHOD0(Drop, bool());
- MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
MOCK_METHOD1(SaveUpdateRequired, void(bool value));
diff --git a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
index a1c808d23a..662632fc59 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
+++ b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
@@ -33,7 +33,6 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_UPDATE_STATUS_MANAGER_H_
#include "gmock/gmock.h"
-
#include "policy/update_status_manager.h"
namespace test {
@@ -49,8 +48,8 @@ class MockUpdateStatusManager : public ::policy::UpdateStatusManager {
MOCK_METHOD0(OnWrongUpdateReceived, void());
MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required));
MOCK_METHOD0(OnResetRetrySequence, void());
+ MOCK_METHOD1(OnExistedApplicationAdded, void(const bool is_update_required));
MOCK_METHOD1(OnNewApplicationAdded, void(const DeviceConsent));
- MOCK_METHOD1(OnPolicyInit, void(bool is_update_required));
MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus());
};
diff --git a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
index e753751308..23701e86de 100644
--- a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
+++ b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
@@ -54,7 +54,7 @@ using ::policy::PolicyManagerImpl;
typedef std::multimap<std::string, policy_table::Rpcs&>
UserConsentPromptToRpcsConnections;
-typedef utils::SharedPtr<policy_table::Table> PolicyTableSPtr;
+typedef std::shared_ptr<policy_table::Table> PolicyTableSPtr;
namespace {
const std::string kSdlPreloadedPtJson = "json/sdl_preloaded_pt.json";
@@ -203,7 +203,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
void EmulatePTAppRevoked(const std::string& ptu_name);
- utils::SharedPtr<policy_table::Table> PreconditionForBasicValidateSnapshot();
+ std::shared_ptr<policy_table::Table> PreconditionForBasicValidateSnapshot();
template <typename ParentType, typename Value>
bool IsKeyExisted(const ParentType& parent, const Value& value) const {
@@ -236,7 +236,7 @@ class PolicyManagerImplTest_RequestTypes : public ::testing::Test {
const std::string app_storage_folder_;
const std::string preloaded_pt_filename_;
- utils::SharedPtr<PolicyManagerImpl> policy_manager_impl_sptr_;
+ std::shared_ptr<PolicyManagerImpl> policy_manager_impl_sptr_;
NiceMock<MockPolicyListener> listener_;
NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json
index 7316c7539d..4cd71d6004 100644
--- a/src/components/policy/policy_external/test/json/PTU.json
+++ b/src/components/policy/policy_external/test/json/PTU.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -472,12 +476,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -493,12 +500,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -514,12 +524,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -534,12 +547,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json
index c1a6bccb68..9c9436144e 100644
--- a/src/components/policy/policy_external/test/json/PTU2.json
+++ b/src/components/policy/policy_external/test/json/PTU2.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -472,12 +476,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -493,12 +500,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -514,12 +524,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -534,12 +547,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json
index 56939a789a..279051e7bf 100644
--- a/src/components/policy/policy_external/test/json/PTU3.json
+++ b/src/components/policy/policy_external/test/json/PTU3.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -472,12 +476,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -493,12 +500,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -514,12 +524,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -534,12 +547,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app.json b/src/components/policy/policy_external/test/json/PTU_default_app.json
index 833d46316a..b036d96b50 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -295,7 +295,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
index 1e5b1c46a4..49ed46f16c 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -293,7 +293,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
index 76365ee4bb..66af76309a 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -290,7 +290,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
index b380fa2de5..0a7c059097 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -289,7 +289,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
index b8793b6cdc..08f12a21c8 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -296,7 +296,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
index 833d46316a..b036d96b50 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -295,7 +295,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
index 8a183b45d5..6aeb637503 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -290,7 +290,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
index 6ffc42c3e4..8c68aaeb89 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -291,7 +291,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
index 24d0871d18..0ae0761f27 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -283,7 +283,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
index b674913268..6b170089fe 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -296,7 +296,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
index 7e0836a805..08027f2786 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1438,6 +1438,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1450,6 +1451,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1462,6 +1464,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1474,6 +1477,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1592,12 +1596,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1607,12 +1614,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1622,12 +1632,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1636,12 +1649,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1703,7 +1719,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
index a056c3ce9c..a88bcfbd08 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1441,6 +1441,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1453,6 +1454,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1465,6 +1467,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1477,6 +1480,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1595,12 +1599,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1610,12 +1617,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1625,12 +1635,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1639,12 +1652,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1706,7 +1722,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
index c7e0a727fe..250bfb21f2 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1438,6 +1438,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1450,6 +1451,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1462,6 +1464,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1474,6 +1477,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1592,12 +1596,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1607,12 +1614,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1622,12 +1632,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1636,12 +1649,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1703,7 +1719,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
index a96ef74bd1..85910c098c 100644
--- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
+++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1437,6 +1437,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1449,6 +1450,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1461,6 +1463,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1473,6 +1476,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1591,12 +1595,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1606,12 +1613,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1621,12 +1631,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1635,12 +1648,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1702,7 +1718,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
index 4c1bf19005..1c1b04ca2b 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
index 02801cc976..51690d7b8e 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
index a9abeea5a2..cfa6c4010c 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json
index 899e58a68d..d7177f2251 100644
--- a/src/components/policy/policy_external/test/json/ptu2_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json
@@ -16,12 +16,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -415,6 +415,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -431,6 +432,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -447,6 +449,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -463,6 +466,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -484,12 +488,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -505,12 +512,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -526,12 +536,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -546,12 +559,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2594,7 +2610,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context" : false,
"steal_focus" : false,
"priority"
diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json
index a1f085ac74..6a531dd2ad 100644
--- a/src/components/policy/policy_external/test/json/ptu_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu_requestType.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2553,7 +2569,7 @@
}
},
"app_policies": {
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
index d6f34c12fc..59e3f947c3 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
@@ -14,12 +14,13 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"COMMUNICATION": 6,
"NORMAL": 4,
"NONE": 0
@@ -296,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +354,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +374,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +394,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +413,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
index 78c5f873d9..a4491fd449 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
@@ -2051,6 +2051,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2065,6 +2066,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2079,6 +2081,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2093,6 +2096,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2308,12 +2312,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -2327,12 +2334,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -2346,12 +2356,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2364,12 +2377,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2385,11 +2401,11 @@
{
"0x04" :
{
- "default" : [ "http://ivsu.software.ford.com/api/getsoftwareupdates" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/softwareUpdate" ]
},
"0x07" :
{
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 20,
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
index 49f9a1da3a..83c4ccf15c 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
@@ -16,12 +16,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -415,6 +415,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -431,6 +432,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -447,6 +449,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -463,6 +466,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -484,12 +488,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -505,12 +512,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -526,12 +536,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -546,12 +559,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
index e6817da0d3..7b882c6ceb 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
index d5f5f480f3..7d90275328 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json
index 5047d832dd..807b0eb312 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1593,12 +1597,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1608,12 +1615,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1623,12 +1633,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1637,12 +1650,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1704,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
index 18b0a09040..3d0a004dbe 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
index 3530c01388..6a36f1f9c5 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
index e169aea24a..3303d56844 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
index df45a0be61..e7a33ba2c0 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
index c471d6ec97..08739f9d6a 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
index 29781d211c..21396b8cac 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
index 91be06a561..5aa467a23c 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
index 56c728f104..5827ab287a 100644
--- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1585,12 +1589,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1600,12 +1607,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1615,12 +1625,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1629,12 +1642,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1696,7 +1712,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
index da0cd913b6..93d4e19751 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -113,27 +113,27 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
- std::string priority = "emergency";
+ std::string priority = "EMERGENCY";
uint32_t notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "navigation";
+ priority = "NAVIGATION";
notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(2u, notif_number);
- priority = "emergency";
+ priority = "EMERGENCY";
notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "VOICECOMM";
+ priority = "VOICECOM";
notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(3u, notif_number);
- priority = "normal";
+ priority = "NORMAL";
notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(5u, notif_number);
- priority = "none";
+ priority = "NONE";
notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(6u, notif_number);
}
@@ -574,8 +574,7 @@ TEST_F(PolicyManagerImplTest2, GetUpdateUrl) {
CreateLocalPT(preloaded_pt_filename_);
GetPTU(kValidSdlPtUpdateJson);
// Check expectations
- const std::string update_url(
- "http://policies.telematics.ford.com/api/policies");
+ const std::string update_url("http://x.x.x.x:3000/api/1/policies");
EXPECT_EQ(update_url, policy_manager_->GetUpdateUrl(7));
EXPECT_EQ("", policy_manager_->GetUpdateUrl(4));
}
@@ -758,18 +757,18 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in LIMITED level
policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in BACKGROUND level
@@ -779,9 +778,9 @@ TEST_F(PolicyManagerImplTest2,
input_params,
output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
// Reset output
ResetOutputList(output);
@@ -846,17 +845,17 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in LIMITED level
policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in BACKGROUND level
@@ -865,9 +864,9 @@ TEST_F(PolicyManagerImplTest2,
"SendLocation",
input_params,
output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
// Reset output
ResetOutputList(output);
@@ -925,9 +924,9 @@ TEST_F(
}
uint32_t GetCurrentDaysCount() {
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const uint32_t kSecondsInDay = 60 * 60 * 24;
- return current_time.tv_sec / kSecondsInDay;
+ return date_time::getSecs(current_time) / kSecondsInDay;
}
TEST_F(PolicyManagerImplTest2,
@@ -1093,7 +1092,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT(preloaded_pt_filename_);
GetPTU(kValidSdlPtUpdateJson);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
::policy::VehicleInfo vehicle_info = policy_manager_->GetVehicleInfo();
@@ -1203,7 +1202,7 @@ TEST_F(
HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
::policy_table::PolicyTableType type1 =
::policy_table::PolicyTableType::PT_PRELOADED;
@@ -1303,7 +1302,7 @@ TEST_F(PolicyManagerImplTest2,
actual_groups_permissions[index].group_name);
EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
uint32_t ucr_size = 0;
::policy_table::DeviceData& device_data = *pt->policy_table.device_data;
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
index e666ac82de..c1ff31f748 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
@@ -84,7 +84,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
EXPECT_TRUE(cache->IsPTPreloaded());
// Arrange
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Get FunctionalGroupings
policy_table::FunctionalGroupings& fc =
table->policy_table.functional_groupings;
@@ -119,7 +119,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT(preloaded_pt_filename_);
policy_manager_->SetSystemLanguage("it-it");
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ("it-it", static_cast<std::string>(*(ModuleMeta.language)));
@@ -130,7 +130,7 @@ TEST_F(PolicyManagerImplTest2, SetVINValue_ExpectVINSetSuccessfully) {
CreateLocalPT(preloaded_pt_filename_);
std::string vin_code("1FAPP6242VH100001");
policy_manager_->SetVINValue(vin_code);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ(vin_code, static_cast<std::string>(*(ModuleMeta.vin)));
@@ -141,7 +141,7 @@ TEST_F(PolicyManagerImplTest2, SetSystemInfo_ExpectSystemInfoSetSuccessfully) {
CreateLocalPT(preloaded_pt_filename_);
policy_manager_->SetSystemInfo("4.1.3.B_EB355B", "WAEGB", "ru-ru");
policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
- utils::SharedPtr<policy_table::Table> pt = cache->GetPT();
+ std::shared_ptr<policy_table::Table> pt = cache->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ("ru-ru", static_cast<std::string>(*(ModuleMeta.language)));
EXPECT_EQ("4.1.3.B_EB355B",
@@ -189,7 +189,7 @@ TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
policy_manager_->AddDevice("AAA123456789RRR", "Bluetooth");
policy_manager_->SetDeviceInfo("AAA123456789RRR", dev_info3);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
// Try to find first device in PT
policy_table::DeviceData::const_iterator iter =
@@ -316,7 +316,7 @@ TEST_F(PolicyManagerImplTest2, AddDevice_RegisterDevice_TRUE) {
const bool result =
(policy_manager_->GetCache())->AddDevice(device_id_1_, connection_type);
// Get Policy table
- const utils::SharedPtr<policy_table::Table> policy_table =
+ const std::shared_ptr<policy_table::Table> policy_table =
policy_manager_->GetCache()->GetPT();
// Get preloaded_pt flag from Policy table
const bool is_preloaded_pt =
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
index f4e922e647..6521db7c36 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
@@ -37,8 +37,6 @@
#include <utility>
#include "policy/policy_manager_impl_test_base.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
using ::testing::_;
using ::testing::Return;
@@ -148,8 +146,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
std::string json = table.toStyledString();
::policy::BinaryMessage msg(json.begin(), json.end());
- utils::SharedPtr<policy_table::Table> snapshot =
- new policy_table::Table(update.policy_table);
+ std::shared_ptr<policy_table::Table> snapshot =
+ std::make_shared<policy_table::Table>(update.policy_table);
// Assert
EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(snapshot));
EXPECT_CALL(*cache_manager_, ApplyUpdate(_)).WillOnce(Return(true));
@@ -236,9 +234,9 @@ TEST_F(PolicyManagerImplTest2, TimeOutExchange) {
TEST_F(PolicyManagerImplTest,
RequestPTUpdate_SetPT_GeneratedSnapshotAndPTUpdate) {
Json::Value table = createPTforLoad();
- utils::SharedPtr<policy_table::Table> p_table =
- utils::MakeShared<policy_table::Table>(&table);
- ASSERT_TRUE(p_table);
+ std::shared_ptr<policy_table::Table> p_table =
+ std::make_shared<policy_table::Table>(&table);
+ ASSERT_TRUE(p_table.get());
p_table->SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
EXPECT_TRUE(IsValid(*p_table));
@@ -249,9 +247,9 @@ TEST_F(PolicyManagerImplTest,
}
TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) {
- utils::SharedPtr<policy_table::Table> p_table =
- utils::MakeShared<policy_table::Table>();
- ASSERT_TRUE(p_table);
+ std::shared_ptr<policy_table::Table> p_table =
+ std::make_shared<policy_table::Table>();
+ ASSERT_TRUE(p_table.get());
EXPECT_FALSE(IsValid(*p_table));
EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
@@ -261,7 +259,7 @@ TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) {
}
TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidSnapshot_PTUpdateFail) {
- utils::SharedPtr<policy_table::Table> p_table;
+ std::shared_ptr<policy_table::Table> p_table;
EXPECT_FALSE(p_table);
EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
@@ -355,7 +353,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Checking groups consents before setting ExternalConsent status
@@ -420,7 +418,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Checking ExternalConsent consents before setting new ExternalConsent status
@@ -484,7 +482,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppPolicy();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -552,7 +550,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppPolicy();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -634,7 +632,7 @@ TEST_F(
HmiTypes(policy_table::AHT_DEFAULT));
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -724,7 +722,7 @@ TEST_F(
HmiTypes(policy_table::AHT_DEFAULT));
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -818,7 +816,7 @@ TEST_F(PolicyManagerImplTest_ExternalConsent,
policy_manager_->AddApplication(app_id_1_,
HmiTypes(policy_table::AHT_DEFAULT));
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Check ExternalConsent consents for application
@@ -943,7 +941,7 @@ TEST_F(PolicyManagerImplTest_ExternalConsent,
policy_manager_->AddApplication(app_id_1_,
HmiTypes(policy_table::AHT_DEFAULT));
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Check ExternalConsent consents for application
@@ -1046,7 +1044,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Checking ExternalConsent consents before setting new ExternalConsent status
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
index 0608799535..13efa39805 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -38,7 +38,7 @@
#include "policy/policy_manager_impl_test_base.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
+
#include "utils/gen_hash.h"
#include "json/reader.h"
@@ -105,12 +105,12 @@ Json::Value createPTforLoad() {
"}"
"},"
"\"notifications_per_minute_by_priority\": {"
- "\"emergency\": 1,"
- "\"navigation\": 2,"
- "\"VOICECOMM\": 3,"
- "\"communication\": 4,"
- "\"normal\": 5,"
- "\"none\": 6"
+ "\"EMERGENCY\": 1,"
+ "\"NAVIGATION\": 2,"
+ "\"VOICECOM\": 3,"
+ "\"COMMUNICATION\": 4,"
+ "\"NORMAL\": 5,"
+ "\"NONE\": 6"
"},"
"\"vehicle_make\" : \"MakeT\","
"\"vehicle_model\" : \"ModelT\","
@@ -238,8 +238,8 @@ void PolicyManagerImplTest::TearDown() {
// PolicyManagerImplTest2 class methods
PolicyManagerImplTest2::PolicyManagerImplTest2()
: app_id_1_("123456789")
- , app_id_2_("1766825573")
- , app_id_3_("584421907")
+ , app_id_2_("1010101010")
+ , app_id_3_("123454321")
, device_id_1_("XXX123456789ZZZ")
, device_id_2_("08-00-27-CE-76-FE")
, application_id_("1234")
@@ -414,7 +414,7 @@ void PolicyManagerImplTest2::GetFunctionalGroupingsFromManager(
// Get cache
::policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
// Get table_snapshot
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Set functional groupings from policy table
input_functional_groupings = table->policy_table.functional_groupings;
}
@@ -629,7 +629,7 @@ PolicyManagerImplTest_RequestTypes::PolicyManagerImplTest_RequestTypes()
"PTU_pre_data_consent_app_one_invalid_value_RequestType_"
"array."
"json"}
- , kAppId("1766825573")
+ , kAppId("1010101010")
, kDefaultAppId(policy::kDefaultId)
, app_storage_folder_("storage3")
, preloaded_pt_filename_(kSdlPreloadedPtJson) {}
@@ -639,7 +639,7 @@ void PolicyManagerImplTest_RequestTypes::SetUp() {
file_system::CreateDirectory(app_storage_folder_);
const bool in_memory = true;
- policy_manager_impl_sptr_ = utils::MakeShared<PolicyManagerImpl>(in_memory);
+ policy_manager_impl_sptr_ = std::make_shared<PolicyManagerImpl>(in_memory);
policy_manager_impl_sptr_->set_listener(&listener_);
}
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
index 2f2162494f..93cfa36277 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -69,9 +69,9 @@ TEST_F(
// To set UP_TO_DATE before registration
GetPTU(kValidSdlPtUpdateJson);
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+ const int days_after_epoch = date_time::getSecs(current_time) / kSecondsInDay;
policy_manager_->PTUpdatedAt(DAYS_AFTER_EPOCH, days_after_epoch);
policy_manager_->PTUpdatedAt(KILOMETERS, 1000);
@@ -395,7 +395,7 @@ TEST_F(PolicyManagerImplTest2,
uint32_t size = result.size();
EXPECT_GT(size, 0u);
std::vector< ::policy::UserFriendlyMessage>::iterator result_iter;
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
policy_table::ConsumerFriendlyMessages& consumer_friendly_messages =
@@ -456,7 +456,7 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) {
// Arrange
::policy::DeviceInfo dev_info;
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
dev_info.hardware = "hardware IPX";
dev_info.firmware_rev = "v.8.0.1";
diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
index 92525c646d..b87598b986 100644
--- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
@@ -44,8 +44,6 @@
#include "rpc_base/rpc_base.h"
#include "policy/policy_table/types.h"
#include "policy/mock_policy_settings.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using namespace ::policy;
namespace policy_table = rpc::policy_table_interface_base;
@@ -393,7 +391,7 @@ TEST_F(SQLPTExtRepresentationTest,
ASSERT_TRUE(reps_->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps_->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps_->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
policy_table["module_meta"] = Json::Value(Json::objectValue);
@@ -1506,7 +1504,7 @@ TEST_F(SQLPTExtRepresentationTest, SaveUserConsentRecords_ExpectedSaved) {
// Act
EXPECT_TRUE(reps_->Save(original_table));
- utils::SharedPtr<Table> loaded_table = reps_->GenerateSnapshot();
+ std::shared_ptr<Table> loaded_table = reps_->GenerateSnapshot();
// GetData/GetKeyData methods do internal existence check - no need to do it
// separately. In case of data is missing expectations will be violated.
@@ -1591,7 +1589,7 @@ TEST_F(SQLPTExtRepresentationTest, SaveFunctionalGroupings_ExpectedSaved) {
// Act
EXPECT_TRUE(reps_->Save(original_table));
- utils::SharedPtr<Table> loaded_table = reps_->GenerateSnapshot();
+ std::shared_ptr<Table> loaded_table = reps_->GenerateSnapshot();
FunctionalGroupings loaded_groupings =
GetData<Table, FunctionalGroupings>(*loaded_table);
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 a657a01145..b0f340b0f2 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
@@ -49,7 +49,6 @@
#include "policy/policy_table/enums.h"
#include "rpc_base/rpc_base.h"
#include "policy/mock_policy_settings.h"
-#include "utils/shared_ptr.h"
namespace policy_table = rpc::policy_table_interface_base;
using policy::SQLPTRepresentation;
@@ -81,14 +80,14 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
static const std::string kDatabaseName;
static utils::dbms::SQLQuery* query_wrapper_;
// Gtest can show message that this object doesn't destroyed
- static std::auto_ptr<policy_handler_test::MockPolicySettings>
+ static std::unique_ptr<policy_handler_test::MockPolicySettings>
policy_settings_;
static void SetUpTestCase() {
const std::string kAppStorageFolder = "storage_SQLPTRepresentationTest";
reps = new SQLPTRepresentation(in_memory_);
ASSERT_TRUE(reps != NULL);
- policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>(
+ policy_settings_ = std::unique_ptr<policy_handler_test::MockPolicySettings>(
new policy_handler_test::MockPolicySettings());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
@@ -348,7 +347,7 @@ SQLPTRepresentation* SQLPTRepresentationTest::reps = 0;
utils::dbms::SQLQuery* SQLPTRepresentationTest::query_wrapper_ = 0;
const std::string SQLPTRepresentationTest::kDatabaseName = ":memory:";
const bool SQLPTRepresentationTest::in_memory_ = true;
-std::auto_ptr<policy_handler_test::MockPolicySettings>
+std::unique_ptr<policy_handler_test::MockPolicySettings>
SQLPTRepresentationTest::policy_settings_;
class SQLPTRepresentationTest2 : public ::testing::Test {
@@ -407,7 +406,8 @@ TEST_F(SQLPTRepresentationTest,
query.Prepare(query_select);
query.Next();
- const int policy_tables_number = 32;
+ // 33 - is current total tables number created by schema
+ const int policy_tables_number = 33;
ASSERT_EQ(policy_tables_number, query.GetInteger(0));
const std::string query_select_count_of_iap_buffer_full =
@@ -1584,7 +1584,7 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
// Remove fields which must be absent in snapshot
table["policy_table"]["consumer_friendly_messages"].removeMember("messages");
diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc
index 5546984ff4..bf443bb201 100644
--- a/src/components/policy/policy_external/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_external/test/update_status_manager_test.cc
@@ -34,7 +34,7 @@
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
+
#include "utils/conditional_variable.h"
namespace test {
@@ -48,7 +48,7 @@ using testing::NiceMock;
class UpdateStatusManagerTest : public ::testing::Test {
protected:
- utils::SharedPtr<UpdateStatusManager> manager_;
+ std::shared_ptr<UpdateStatusManager> manager_;
PolicyTableStatus status_;
const uint32_t k_timeout_;
NiceMock<MockPolicyListener> listener_;
@@ -58,7 +58,7 @@ class UpdateStatusManagerTest : public ::testing::Test {
public:
UpdateStatusManagerTest()
- : manager_(utils::MakeShared<UpdateStatusManager>())
+ : manager_(std::make_shared<UpdateStatusManager>())
, k_timeout_(1000)
, listener_()
, up_to_date_status_("UP_TO_DATE")
@@ -287,42 +287,6 @@ TEST_F(UpdateStatusManagerTest, ScheduleUpdate_ExpectStatusUpdateNeeded) {
}
TEST_F(UpdateStatusManagerTest,
- OnPolicyInit_SetUpdateRequired_ExpectStatusUpdateNeeded) {
- // Arrange
- manager_->OnPolicyInit(true);
- status_ = manager_->GetLastUpdateStatus();
- // Checks
- EXPECT_EQ(StatusUpdateRequired, status_);
- EXPECT_FALSE(manager_->IsUpdatePending());
- EXPECT_TRUE(manager_->IsUpdateRequired());
-}
-
-TEST_F(UpdateStatusManagerTest,
- OnPolicyInit_SetUpdateNotRequired_ExpectStatusUpToDate) {
- // Arrange
- manager_->OnPolicyInit(false);
- status_ = manager_->GetLastUpdateStatus();
- // Checks
- EXPECT_EQ(StatusUpToDate, status_);
- EXPECT_FALSE(manager_->IsUpdatePending());
- EXPECT_FALSE(manager_->IsUpdateRequired());
-}
-
-TEST_F(UpdateStatusManagerTest,
- StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) {
- // Arrange
- manager_->OnPolicyInit(false);
- // Check
- EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus());
- manager_->OnPolicyInit(true);
- // Check
- EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus());
- manager_->OnUpdateSentOut(k_timeout_);
- // Check
- EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus());
-}
-
-TEST_F(UpdateStatusManagerTest,
OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) {
// Arrange
manager_->OnAppsSearchStarted();
diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt
index c7b9c068b9..a5533302a5 100644
--- a/src/components/policy/policy_regular/CMakeLists.txt
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -60,8 +60,6 @@ target_link_libraries(UsageStatistics Utils)
set(EXCLUDE_PATHS
${POLICY_TABLE_PATHS}
${USAGE_STATISTICS_PATHS}
- sql_pt_ext_queries.cc
- sql_pt_ext_representation.cc
)
set(PATHS
@@ -71,11 +69,6 @@ set(PATHS
)
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
-if (NOT REMOTE_CONTROL)
- list(REMOVE_ITEM SOURCES
- ${CMAKE_CURRENT_SOURCE_DIR}/src/access_remote_impl.cc)
-endif()
-
set(LIBRARIES
ConfigProfile
policy_struct
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
index 9854b88d5f..0144efaf7f 100644
--- a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
+++ b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
@@ -1,9 +1,9 @@
-/*! \page components_jsonhandler_formatters Smart Objects Formatters
+/*! \page components_jsonhandler_formatters Smart Objects formatters
In order to create JSON string representation from Smart Object or create Smart Object data structure from JSON string representation JSON Handler component has special classes called formatters.
-The interface of formatter is quite simple and defined by NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class. Actually it has two methods - NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
+The interface of formatter is quite simple and defined by ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class. Actually it has two methods - ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
-Current implementation has two different implementations of NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class: NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
+Current implementation has two different implementations of ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class: ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
*/
diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
index 933690dc49..dbe317667a 100644
--- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h
+++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
@@ -35,7 +35,7 @@
#include <map>
#include "policy/policy_table/types.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "policy/access_remote.h"
#include "policy/cache_manager.h"
@@ -46,7 +46,7 @@ namespace policy {
class AccessRemoteImpl : public AccessRemote {
public:
AccessRemoteImpl();
- explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
+ explicit AccessRemoteImpl(std::shared_ptr<CacheManager> cache);
/**
* @brief CheckModuleType check if module type is allowed for application
* @param app_id application id
@@ -139,7 +139,7 @@ class AccessRemoteImpl : public AccessRemote {
/**
* @brief cache_ contains pointer to cache manager instance
*/
- utils::SharedPtr<CacheManager> cache_;
+ std::shared_ptr<CacheManager> cache_;
/**
* @brief hmi_types_ contains list of default HMI types for applications
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 8c0acd44d2..48e00f7049 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -35,9 +35,7 @@
#include <map>
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
-#include "policy/pt_ext_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/cache_manager_interface.h"
#include "utils/threads/thread.h"
@@ -73,6 +71,22 @@ class CacheManager : public CacheManagerInterface {
CheckPermissionResult& result);
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Returns true if Policy Table was not updated yet
* from preloaded pt file.
*/
@@ -200,7 +214,7 @@ class CacheManager : public CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot();
/**
* Applies policy table to the current table
@@ -597,8 +611,18 @@ class CacheManager : public CacheManagerInterface {
* @param policy_app_id Unique application id
* @param request_types Request types of application
*/
- void GetAppRequestTypes(const std::string& policy_app_id,
- std::vector<std::string>& request_types) const;
+ void GetAppRequestTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const OVERRIDE;
+
+ /**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const OVERRIDE;
/**
* @brief GetCertificate allows to obtain certificate in order to
@@ -697,7 +721,7 @@ class CacheManager : public CacheManagerInterface {
const PolicySettings& get_settings() const;
- utils::SharedPtr<policy_table::Table> pt() const {
+ std::shared_ptr<policy_table::Table> pt() const {
return pt_;
}
@@ -749,14 +773,14 @@ class CacheManager : public CacheManagerInterface {
policy::Permissions& permission);
private:
- utils::SharedPtr<policy_table::Table> pt_;
- utils::SharedPtr<policy_table::Table> snapshot_;
- utils::SharedPtr<PTRepresentation> backup_;
+ std::shared_ptr<policy_table::Table> pt_;
+ std::shared_ptr<policy_table::Table> snapshot_;
+ std::shared_ptr<PTRepresentation> backup_;
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- mutable sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;
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 9f7c7318db..10a6ea7f89 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -36,7 +36,6 @@
#include <string>
#include <vector>
-#include "utils/shared_ptr.h"
#include "policy/usage_statistics/counter.h"
#include "policy/policy_types.h"
#include "policy/policy_settings.h"
@@ -46,6 +45,16 @@ namespace policy_table = rpc::policy_table_interface_base;
namespace policy {
+namespace RequestType {
+// Describes available RequestType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestType
+
+namespace RequestSubType {
+// Describes available RequestSubType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestSubType
+
class CacheManagerInterface {
public:
virtual ~CacheManagerInterface() {}
@@ -67,6 +76,22 @@ class CacheManagerInterface {
CheckPermissionResult& result) = 0;
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Returns true if Policy Table was not updated yet
* from preloaded pt file.
*/
@@ -196,7 +221,7 @@ class CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() = 0;
/**
* Applies policy table to the current table
@@ -627,6 +652,15 @@ class CacheManagerInterface {
std::vector<std::string>& request_types) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ virtual void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const = 0;
+
+ /**
* @brief GetCertificate allows to obtain certificate in order to
* make secure connection
*
@@ -635,12 +669,12 @@ class CacheManagerInterface {
virtual std::string GetCertificate() const = 0;
/**
- * @brief pt allows to obtain SharedPtr to PT.
+ * @brief pt allows to obtain std::shared_ptr to PT.
* Used ONLY in Unit tests
- * @return SharedPTR to PT
+ * @return std::shared_ptr to PT
*
*/
- virtual utils::SharedPtr<policy_table::Table> pt() const = 0;
+ virtual std::shared_ptr<policy_table::Table> pt() const = 0;
/**
* @brief OnDeviceSwitching Processes existing policy permissions for devices
@@ -652,7 +686,7 @@ class CacheManagerInterface {
const std::string& device_id_to) = 0;
};
-typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+typedef std::shared_ptr<CacheManagerInterface> CacheManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h
index 8a60801dd4..3ca0f93ebd 100644
--- a/src/components/policy/policy_regular/include/policy/policy_helper.h
+++ b/src/components/policy/policy_regular/include/policy/policy_helper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
#include "policy/policy_table/functions.h"
-#include "utils/shared_ptr.h"
+
#include "policy/policy_types.h"
namespace policy {
@@ -82,8 +82,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
*/
struct CheckAppPolicy {
CheckAppPolicy(PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
bool operator()(const AppPoliciesValueType& app_policy);
private:
@@ -95,7 +95,8 @@ struct CheckAppPolicy {
RESULT_CONSENT_NEEDED,
RESULT_CONSENT_NOT_REQIURED,
RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED,
- RESULT_REQUEST_TYPE_CHANGED
+ RESULT_REQUEST_TYPE_CHANGED,
+ RESULT_REQUEST_SUBTYPE_CHANGED
};
void SetPendingPermissions(const AppPoliciesValueType& app_policy,
@@ -126,11 +127,12 @@ struct CheckAppPolicy {
bool IsConsentRequired(const std::string& app_id,
const std::string& group_name) const;
bool IsRequestTypeChanged(const AppPoliciesValueType& app_policy) const;
+ bool IsRequestSubTypeChanged(const AppPoliciesValueType& app_policy) const;
private:
PolicyManagerImpl* pm_;
- const utils::SharedPtr<policy_table::Table> update_;
- const utils::SharedPtr<policy_table::Table> snapshot_;
+ const std::shared_ptr<policy_table::Table> update_;
+ const std::shared_ptr<policy_table::Table> snapshot_;
};
/*
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 941db1a67f..51d4ee88aa 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
@@ -37,7 +37,6 @@
#include <list>
#include <cstdint>
-#include "utils/shared_ptr.h"
#include "utils/lock.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
@@ -47,10 +46,8 @@
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/policy_helper.h"
#include "utils/timer.h"
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
namespace policy_table = rpc::policy_table_interface_base;
@@ -448,7 +445,6 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Assigns new HMI types for specified application
* @param application_id Unique application id
@@ -470,7 +466,7 @@ class PolicyManagerImpl : public PolicyManager {
* @brief Setter for access_remote instance
* @param access_remote pointer to new access_remote instance
*/
- void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+ void set_access_remote(std::shared_ptr<AccessRemote> access_remote) OVERRIDE;
/**
* @brief Sends notification about application HMI level changed
@@ -483,7 +479,6 @@ class PolicyManagerImpl : public PolicyManager {
* @param application_id Unique id of application
*/
void OnPrimaryGroupsChanged(const std::string& application_id);
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Removes consent for application functional group
@@ -532,6 +527,22 @@ class PolicyManagerImpl : public PolicyManager {
void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Gets request types for application
* @param policy_app_id Unique application id
* @return request types of application
@@ -540,6 +551,14 @@ class PolicyManagerImpl : public PolicyManager {
const std::string policy_app_id) const OVERRIDE;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Get information about vehicle
* @return vehicle information
*/
@@ -651,7 +670,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param pt_content binary content of PT
* @return pointer to converted PT
*/
- virtual utils::SharedPtr<policy_table::Table> Parse(
+ virtual std::shared_ptr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
#else
/**
@@ -659,7 +678,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param pt_content binary content of PT
* @return pointer to converted PT
*/
- virtual utils::SharedPtr<policy_table::Table> ParseArray(
+ virtual std::shared_ptr<policy_table::Table> ParseArray(
const BinaryMessage& pt_content);
#endif
@@ -685,8 +704,8 @@ class PolicyManagerImpl : public PolicyManager {
* @return Collection per-application results
*/
void CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
/**
* @brief Fill structure to be sent with OnPermissionsChanged notification
@@ -783,7 +802,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param type policy table type
* @return true if policy table valid, otherwise false
*/
- bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
+ bool IsPTValid(std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
/**
@@ -792,7 +811,6 @@ class PolicyManagerImpl : public PolicyManager {
void RetrySequence();
private:
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Get resulting RPCs permissions for application which started on
* specific device
@@ -829,10 +847,10 @@ class PolicyManagerImpl : public PolicyManager {
*/
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
- /**
- * @brief pointer to policy table listener for callbacks
- */
+
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
PolicyListener* listener_;
/**
@@ -844,12 +862,11 @@ class PolicyManagerImpl : public PolicyManager {
* @brief pointer to CacheManagerInterface instance for getting policy data
*/
CacheManagerInterfaceSPtr cache_;
-#ifdef SDL_REMOTE_CONTROL
+
/**
* @brief pointer to AccessRemote instance for working with RC applications
*/
- utils::SharedPtr<AccessRemote> access_remote_;
-#endif
+ std::shared_ptr<AccessRemote> access_remote_;
/**
* @brief lock guard for protecting applications list access
diff --git a/src/components/policy/policy_regular/include/policy/policy_table.h b/src/components/policy/policy_regular/include/policy/policy_table.h
index afee8a34e4..8ef3cd7fc8 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table.h
@@ -33,16 +33,14 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
-#include "policy/pt_ext_representation.h"
namespace policy {
class PolicyTable {
public:
PolicyTable();
- explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ explicit PolicyTable(std::shared_ptr<PTRepresentation> pt_data);
virtual ~PolicyTable();
/**
@@ -50,12 +48,12 @@ class PolicyTable {
* actual class storing policy table.
* @return PTRepresentation* Policy Table Content Handler
*/
- utils::SharedPtr<PTRepresentation> pt_data() const {
+ std::shared_ptr<PTRepresentation> pt_data() const {
return pt_data_;
}
private:
- utils::SharedPtr<PTRepresentation> pt_data_;
+ std::shared_ptr<PTRepresentation> pt_data_;
};
} // namespace policy
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 4eb35d2aa4..1f10db9f6f 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
@@ -44,6 +44,7 @@ enum Priority {
P_VOICECOM,
P_COMMUNICATION,
P_NORMAL,
+ P_PROJECTION,
P_NONE,
};
@@ -66,20 +67,24 @@ enum Parameter {
P_SPEED,
P_ENGINETORQUE,
P_EXTERNALTEMPERATURE,
+ P_TURNSIGNAL,
P_FUELLEVEL,
P_FUELLEVEL_STATE,
P_HEADLAMPSTATUS,
P_INSTANTFUELCONSUMPTION,
+ P_FUELRANGE,
P_ODOMETER,
P_TIREPRESSURE,
P_WIPERSTATUS,
P_VIN,
P_ACCPEDALPOSITION,
P_BELTSTATUS,
+ P_ELECTRONICPARKBRAKESTATUS,
P_DRIVERBRAKING,
P_PRNDL,
P_RPM,
P_STEERINGWHEELANGLE,
+ P_ENGINEOILLIFE,
P_MYKEY,
P_AIRBAGSTATUS,
P_BODYINFORMATION,
@@ -132,7 +137,9 @@ enum RequestType {
RT_VEHICLE_DIAGNOSTICS,
RT_EMERGENCY,
RT_MEDIA,
- RT_FOTA
+ RT_FOTA,
+ RT_OEM_SPECIFIC,
+ RT_EMPTY // Added to allow empty Request Types handling
};
bool IsValidEnum(RequestType val);
@@ -150,11 +157,382 @@ bool EnumFromJsonString(const std::string& literal, Input* result);
enum ModuleType {
MT_CLIMATE,
MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS,
+ MT_EMPTY
};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+/**
+ * @brief Enumeration FunctionID.
+ *
+ * Enumeration linking function names with function IDs in AppLink protocol.
+ * Assumes enumeration starts at value 0.
+ */
+enum FunctionID {
+ /**
+ * @brief RESERVED.
+ */
+ RESERVED = 0,
+
+ /**
+ * @brief RegisterAppInterfaceID.
+ */
+ RegisterAppInterfaceID = 1,
+
+ /**
+ * @brief UnregisterAppInterfaceID.
+ */
+ UnregisterAppInterfaceID = 2,
+
+ /**
+ * @brief SetGlobalPropertiesID.
+ */
+ SetGlobalPropertiesID = 3,
+
+ /**
+ * @brief ResetGlobalPropertiesID.
+ */
+ ResetGlobalPropertiesID = 4,
+
+ /**
+ * @brief AddCommandID.
+ */
+ AddCommandID = 5,
+
+ /**
+ * @brief DeleteCommandID.
+ */
+ DeleteCommandID = 6,
+
+ /**
+ * @brief AddSubMenuID.
+ */
+ AddSubMenuID = 7,
+
+ /**
+ * @brief DeleteSubMenuID.
+ */
+ DeleteSubMenuID = 8,
+
+ /**
+ * @brief CreateInteractionChoiceSetID.
+ */
+ CreateInteractionChoiceSetID = 9,
+
+ /**
+ * @brief PerformInteractionID.
+ */
+ PerformInteractionID = 10,
+
+ /**
+ * @brief DeleteInteractionChoiceSetID.
+ */
+ DeleteInteractionChoiceSetID = 11,
+
+ /**
+ * @brief AlertID.
+ */
+ AlertID = 12,
+
+ /**
+ * @brief ShowID.
+ */
+ ShowID = 13,
+
+ /**
+ * @brief SpeakID.
+ */
+ SpeakID = 14,
+
+ /**
+ * @brief SetMediaClockTimerID.
+ */
+ SetMediaClockTimerID = 15,
+
+ /**
+ * @brief PerformAudioPassThruID.
+ */
+ PerformAudioPassThruID = 16,
+
+ /**
+ * @brief EndAudioPassThruID.
+ */
+ EndAudioPassThruID = 17,
+
+ /**
+ * @brief SubscribeButtonID.
+ */
+ SubscribeButtonID = 18,
+
+ /**
+ * @brief UnsubscribeButtonID.
+ */
+ UnsubscribeButtonID = 19,
+
+ /**
+ * @brief SubscribeVehicleDataID.
+ */
+ SubscribeVehicleDataID = 20,
+
+ /**
+ * @brief UnsubscribeVehicleDataID.
+ */
+ UnsubscribeVehicleDataID = 21,
+
+ /**
+ * @brief GetVehicleDataID.
+ */
+ GetVehicleDataID = 22,
+
+ /**
+ * @brief ReadDIDID.
+ */
+ ReadDIDID = 23,
+
+ /**
+ * @brief GetDTCsID.
+ */
+ GetDTCsID = 24,
+
+ /**
+ * @brief ScrollableMessageID.
+ */
+ ScrollableMessageID = 25,
+
+ /**
+ * @brief SliderID.
+ */
+ SliderID = 26,
+
+ /**
+ * @brief ShowConstantTBTID.
+ */
+ ShowConstantTBTID = 27,
+
+ /**
+ * @brief AlertManeuverID.
+ */
+ AlertManeuverID = 28,
+
+ /**
+ * @brief UpdateTurnListID.
+ */
+ UpdateTurnListID = 29,
+
+ /**
+ * @brief ChangeRegistrationID.
+ */
+ ChangeRegistrationID = 30,
+
+ /**
+ * @brief GenericResponseID.
+ */
+ GenericResponseID = 31,
+
+ /**
+ * @brief PutFileID.
+ */
+ PutFileID = 32,
+
+ /**
+ * @brief DeleteFileID.
+ */
+ DeleteFileID = 33,
+
+ /**
+ * @brief ListFilesID.
+ */
+ ListFilesID = 34,
+
+ /**
+ * @brief SetAppIconID.
+ */
+ SetAppIconID = 35,
+
+ /**
+ * @brief SetDisplayLayoutID.
+ */
+ SetDisplayLayoutID = 36,
+
+ /**
+ * @brief DiagnosticMessageID.
+ */
+ DiagnosticMessageID = 37,
+
+ /**
+ * @brief SystemRequestID.
+ */
+ SystemRequestID = 38,
+
+ /**
+ * @brief SendLocationID.
+ */
+ SendLocationID = 39,
+
+ /**
+ * @brief DialNumberID.
+ */
+ DialNumberID = 40,
+
+ /**
+ * @brief ButtonPressID.
+ */
+ ButtonPressID = 41,
+
+ /**
+ * @brief GetInteriorVehicleDataID.
+ */
+ GetInteriorVehicleDataID = 43,
+
+ /**
+ * @brief SetInteriorVehicleDataID.
+ */
+ SetInteriorVehicleDataID = 44,
+
+ /**
+ * @brief GetWayPointsID.
+ */
+ GetWayPointsID = 45,
+
+ /**
+ * @brief SubscribeWayPointsID.
+ */
+ SubscribeWayPointsID = 46,
+
+ /**
+ * @brief UnsubscribeWayPointsID.
+ */
+ UnsubscribeWayPointsID = 47,
+
+ /**
+ * @brief GetSystemCapabilityID.
+ */
+ GetSystemCapabilityID = 48,
+
+ /**
+ * @brief SendHapticDataID.
+ */
+ SendHapticDataID = 49,
+
+ /**
+ * @brief OnHMIStatusID.
+ */
+ OnHMIStatusID = 32768,
+
+ /**
+ * @brief OnAppInterfaceUnregisteredID.
+ */
+ OnAppInterfaceUnregisteredID = 32769,
+
+ /**
+ * @brief OnButtonEventID.
+ */
+ OnButtonEventID = 32770,
+
+ /**
+ * @brief OnButtonPressID.
+ */
+ OnButtonPressID = 32771,
+
+ /**
+ * @brief OnVehicleDataID.
+ */
+ OnVehicleDataID = 32772,
+
+ /**
+ * @brief OnCommandID.
+ */
+ OnCommandID = 32773,
+
+ /**
+ * @brief OnTBTClientStateID.
+ */
+ OnTBTClientStateID = 32774,
+
+ /**
+ * @brief OnDriverDistractionID.
+ */
+ OnDriverDistractionID = 32775,
+
+ /**
+ * @brief OnPermissionsChangeID.
+ */
+ OnPermissionsChangeID = 32776,
+
+ /**
+ * @brief OnAudioPassThruID.
+ */
+ OnAudioPassThruID = 32777,
+
+ /**
+ * @brief OnLanguageChangeID.
+ */
+ OnLanguageChangeID = 32778,
+
+ /**
+ * @brief OnKeyboardInputID.
+ */
+ OnKeyboardInputID = 32779,
+
+ /**
+ * @brief OnTouchEventID.
+ */
+ OnTouchEventID = 32780,
+
+ /**
+ * @brief OnSystemRequestID.
+ */
+ OnSystemRequestID = 32781,
+
+ /**
+ * @brief OnHashChangeID.
+ */
+ OnHashChangeID = 32782,
+
+ /**
+ * @brief OnInteriorVehicleDataID.
+ */
+ OnInteriorVehicleDataID = 32783,
+
+ /**
+ * @brief OnWayPointChangeID.
+ */
+ OnWayPointChangeID = 32784,
+
+ /**
+ * @brief OnRCStatusID.
+ */
+ OnRCStatusID = 32785,
+
+ /**
+ * @brief EncodedSyncPDataID.
+ */
+ EncodedSyncPDataID = 65536,
+
+ /**
+ * @brief SyncPDataID.
+ */
+ SyncPDataID = 65537,
+
+ /**
+ * @brief OnEncodedSyncPDataID.
+ */
+ OnEncodedSyncPDataID = 98304,
+
+ /**
+ * @brief OnSyncPDataID.
+ */
+ OnSyncPDataID = 98305
+};
+bool IsValidEnum(FunctionID val);
+const char* EnumToJsonString(FunctionID val);
+bool EnumFromJsonString(const std::string& literal, FunctionID* result);
+
extern const std::string kDefaultApp;
extern const std::string kPreDataConsentApp;
extern const std::string kDeviceApp;
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 61585776f2..e201251745 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
@@ -65,7 +65,7 @@ typedef Array<Enum<AppHMIType>, 0, 255> AppHMITypes;
typedef Array<Enum<HmiLevel>, 0, 4> HmiLevels;
-typedef Array<Enum<Parameter>, 0, 24> Parameters;
+typedef Array<Enum<Parameter>, 0, 255> Parameters;
typedef Map<RpcParameters, 0, UINT_MAX> Rpc;
@@ -76,7 +76,7 @@ typedef Map<URL, 1, 255> URLList;
typedef Map<URLList, 1, 255> ServiceEndpoints;
typedef uint8_t NumberOfNotificationsType;
-typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 6>
+typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 7>
NumberOfNotificationsPerMinute;
typedef Array<Integer<uint16_t, 1, 1000>, 0, 5> SecondsBetweenRetries;
@@ -96,11 +96,11 @@ typedef Map<DeviceParams, 0, 255> DeviceData;
typedef Array<Enum<RequestType>, 0, 255> RequestTypes;
-#ifdef SDL_REMOTE_CONTROL
+typedef Strings RequestSubTypes;
+
typedef Map<Strings, 0, 255> RemoteRpcs;
typedef Map<RemoteRpcs, 0, 255> AccessModules;
typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
-#endif // SDL_REMOTE_CONTROL
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
@@ -139,12 +139,11 @@ struct ApplicationParams : PolicyBase {
Optional<Strings> nicknames;
Optional<AppHMITypes> AppHMIType;
Optional<RequestTypes> RequestType;
+ Optional<RequestSubTypes> RequestSubType;
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
Optional<String<0, 255> > certificate;
-#ifdef SDL_REMOTE_CONTROL
mutable Optional<ModuleTypes> moduleType;
-#endif // SDL_REMOTE_CONTROL
public:
ApplicationParams();
@@ -160,9 +159,7 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
-#ifdef SDL_REMOTE_CONTROL
bool ValidateModuleTypes() const;
-#endif // SDL_REMOTE_CONTROL
};
struct ApplicationPoliciesSection : CompositeType {
@@ -233,6 +230,7 @@ struct ModuleConfig : CompositeType {
public:
Optional<Map<String<0, 100>, 0, 255> > device_certificates;
Optional<Boolean> preloaded_pt;
+ Optional<Boolean> full_app_id_supported;
Integer<uint8_t, 0, 255> exchange_after_x_ignition_cycles;
Integer<int64_t, 0, 4294967296ll> exchange_after_x_kilometers;
Integer<uint8_t, 0, 255> exchange_after_x_days;
diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h
index af1d119e7a..276a0a5dca 100644
--- a/src/components/policy/policy_regular/include/policy/policy_types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_types.h
@@ -39,7 +39,8 @@
#include <map>
#include <set>
#include <utility>
-#include "utils/shared_ptr.h"
+#include <memory>
+
#include "utils/helpers.h"
#include "transport_manager/common.h"
@@ -79,7 +80,7 @@ enum PolicyTableStatus {
// Code generator uses String class name, so this typedef was renamed to PTSring
typedef std::string PTString;
typedef std::vector<uint8_t> BinaryMessage;
-typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
+typedef std::shared_ptr<BinaryMessage> BinaryMessageSptr;
typedef std::string HMILevel;
typedef std::string Parameter;
@@ -267,7 +268,8 @@ struct AppPermissions {
, appRevoked(false)
, appPermissionsConsentNeeded(false)
, appUnauthorized(false)
- , requestTypeChanged(false) {}
+ , requestTypeChanged(false)
+ , requestSubTypeChanged(false) {}
std::string application_id;
bool isAppPermissionsRevoked;
@@ -280,6 +282,8 @@ struct AppPermissions {
DeviceParams deviceInfo;
bool requestTypeChanged;
std::vector<std::string> requestType;
+ bool requestSubTypeChanged;
+ std::vector<std::string> requestSubType;
};
/**
@@ -471,7 +475,8 @@ enum PermissionsCheckResult {
RESULT_CONSENT_NEEDED,
RESULT_CONSENT_NOT_REQIURED,
RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED,
- RESULT_REQUEST_TYPE_CHANGED
+ RESULT_REQUEST_TYPE_CHANGED,
+ RESULT_REQUEST_SUBTYPE_CHANGED
};
/**
diff --git a/src/components/policy/policy_regular/include/policy/pt_ext_representation.h b/src/components/policy/policy_regular/include/policy/pt_ext_representation.h
deleted file mode 100644
index f70946d1f5..0000000000
--- a/src/components/policy/policy_regular/include/policy/pt_ext_representation.h
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
-
-#include "policy/pt_representation.h"
-
-namespace policy {
-
-enum StatisticsType {
- S_NONE = 0,
- S_IAP_BUFFER_FULL,
- S_SYNC_OUT_OF_MEMORY,
- S_SYNC_REBOOTS,
- S_MINS_HMI_FULL,
- S_MINS_HMI_LIMITED,
- S_MINS_HMI_BACKGROUND,
- S_MINS_HMI_NONE,
- S_RFCOM_LIMIT_REACHED,
- S_USER_SELECTIONS,
- S_REJECTIONS_SYNC_OUT_OF_MEMORY,
- S_REJECTIONS_NICKNAME_MISMATCH,
- S_REJECTIONS_DUPLICATE_NAME,
- S_REJECTED_RPC_CALLS,
- S_RPCS_IN_HMI_NONE,
- S_REMOVALS_MISBEHAVED,
- S_RUN_ATTEMPTS_WHILE_REVOKED
-};
-
-enum LanguageType { L_NONE = 0, L_GUI, L_VUI };
-
-class PTExtRepresentation : public virtual PTRepresentation {
- public:
- virtual ~PTExtRepresentation() {}
-
- /**
- * @brief Is application allowed to send notifications while in
- * Backgound or limited mode.
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- virtual bool CanAppKeepContext(const std::string& app_id) = 0;
-
- /**
- * @brief Is application allowed to move foreground at will?
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- virtual bool CanAppStealFocus(const std::string& app_id) = 0;
-
- /**
- * @brief Get default_hmi for given application
- * @param policy_app_id Unique application id
- * @param default_hmi Default HMI level for application or empty, if value was
- * not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetDefaultHMI(const std::string& policy_app_id,
- std::string* default_hmi) = 0;
-
- /**
- * @brief Reset user consent for device data and applications permissions
- * @return
- */
- virtual bool ResetUserConsent() = 0;
-
- /**
- * @brief Reset user consent for device data
- * @return
- */
- virtual bool ResetDeviceConsents() = 0;
-
- /**
- * @brief Reset user consent for applications permissions
- * @return
- */
- virtual bool ResetAppConsents() = 0;
-
- /**
- * @brief Get user permissions for device data usage
- * @param device_id Generated or obtained id of device
- * @param consented_groups Groups consented by user
- * @param disallowed_groups Groups not consented by user
- * @return true, if query was successfull, otherwise - false
- */
- virtual bool GetUserPermissionsForDevice(
- const std::string& device_id,
- StringArray* consented_groups = NULL,
- StringArray* disallowed_groups = NULL) = 0;
-
- /**
- * @brief Gets list of groups permissions from policy table
- * @param device_id Unique device id, which hosts specific application
- * @param policy_app_id Unique application id
- * @param group_types Group list sorted by permission status
- * @return true, if query was successfull, otherwise - false
- */
- virtual bool GetPermissionsForApp(const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalIdType* group_types) = 0;
-
- /**
- * @brief Get device groups and preconsented groups from policies section
- * @param groups List of groups to be consented for device usage
- * @param preconsented_groups List of preconsented groups for device usage
- * @return true, if query was successful, otherwise - false
- */
- virtual bool GetDeviceGroupsFromPolicies(
- policy_table::Strings* groups = NULL,
- policy_table::Strings* preconsented_groups = NULL) = 0;
-
- /**
- * @brief Record information about mobile device in Policy Table.
- * @param device_id Generated or obtained id of device
- * @return bool Success of operation
- */
- virtual bool SetDeviceData(const std::string& device_id,
- const std::string& hardware = "",
- const std::string& firmware = "",
- const std::string& os = "",
- const std::string& os_version = "",
- const std::string& carrier = "",
- const uint32_t number_of_ports = 0,
- const std::string& connection_type = "") = 0;
-
- /**
- * @brief Sets user consent for particular mobile device,
- * i.e. to use device for exchanging of Policy Table.
- * @return bool Success of operation
- */
- virtual bool SetUserPermissionsForDevice(
- const std::string& device_id,
- const StringArray& consented_groups = StringArray(),
- const StringArray& disallowed_gropus = StringArray()) = 0;
-
- /**
- * @brief Update Application Policies as reaction
- * on User allowing/disallowing device this app is running on.
- */
- virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
- bool is_device_allowed) = 0;
-
- /**
- * @brief Set user consent on functional groups
- * @param permissions User consent on functional group
- * @return true, if operation succedeed, otherwise - false
- */
- virtual bool SetUserPermissionsForApp(
- const PermissionConsent& permissions) = 0;
-
- /**
- * @brief Counter for statistics information: adds 1 to existing number.
- * @param type Type of statistics (errors, mins in mode etc)
- * @return bool Success of operation
- */
- virtual bool IncreaseStatisticsData(StatisticsType type) = 0;
-
- /**
- * @brief Records information about what language
- * application tried to register with.
- * @param app_id Id of application
- * @param type - language for UI/VR
- * @param language Language
- * @return bool Success of operation
- */
- virtual bool SetAppRegistrationLanguage(const std::string& app_id,
- LanguageType type,
- const std::string& language) = 0;
-
- /**
- * @brief Records information about head unit system to PT
- * @return bool Success of operation
- */
- virtual bool SetMetaInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language) = 0;
-
- /**
- * @brief Checks, if specific head unit is present in PT
- * @return boot Suceess, if present, otherwise - false
- */
- virtual bool IsMetaInfoPresent() = 0;
-
- /**
- * @brief Kms pass since last successfull PT update
- */
- virtual int GetKmFromSuccessfulExchange() = 0;
-
- /**
- * @brief Days pass since last successfull PT update
- */
- virtual int GetDayFromScsExchange() = 0;
-
- /**
- * @brief Ignition cycles pass since last successfull PT update
- */
- virtual int GetIgnitionsFromScsExchange() = 0;
-
- /**
- * @brief Set current system language
- * @param language System language
- * @return true, if succedeed, otherwise - false
- */
- virtual bool SetSystemLanguage(const std::string& language) = 0;
-
- /**
- * Increments global counter
- * @param type type of counter
- */
- virtual void Increment(const std::string& type) const = 0;
-
- /**
- * Increments counter of application
- * @param app_id id application
- * @param type type of counter
- */
- virtual void Increment(const std::string& app_id,
- const std::string& type) const = 0;
-
- /**
- * Sets value of application information
- * @param app_id id application
- * @param type type of information
- * @param value value of information
- */
- virtual void Set(const std::string& app_id,
- const std::string& type,
- const std::string& value) const = 0;
-
- /**
- * Adds value to stopwatch of application
- * @param app_id id application
- * @param type type of stopwatch
- * @param seconds value for adding in seconds
- */
- virtual void Add(const std::string& app_id,
- const std::string& type,
- int seconds) const = 0;
-
- virtual bool CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- int* result) const = 0;
-
- /**
- * @brief Gets functional group names and user_consent_prompts, if any
- * @param Array to be filled with group ids, names and functional prompts
- * @return true, if succeeded, otherwise - false
- */
- // TODO(AOleynik): Possibly, we can get rid of this method. Check this.
- virtual bool GetFunctionalGroupNames(policy::FunctionalGroupNames& names) = 0;
-
- /**
- * @brief Set app policy to pre_DataConsented policy
- * @param app_id Policy ID of application to be changed
- * @return true, if succeeded, otherwise - false
- */
- virtual bool SetPredataPolicy(const std::string& app_id) = 0;
-
- /**
- * @brief Updates application policy to either pre_DataConsented or not
- * @param app_id Policy Id of application to be checked
- * @param is_pre_data True of False to setting app policy to be
- * pre_DataConsented
- * @return true, if succeeded, otherwise - false
- */
- virtual bool SetIsPredata(const std::string& app_id, bool is_pre_data) = 0;
-
- /**
- * @brief Removes unpaired devices
- * @return true if success
- */
- virtual bool CleanupUnpairedDevices(const DeviceIds& device_ids) const = 0;
-
- /**
- * Sets flag of unpaired device
- * @param device_id Unique device id
- * @param unpaired True, if unpaired, otherwise - false
- * @return true if success
- */
- virtual bool SetUnpairedDevice(const std::string& device_id,
- bool unpaired) const = 0;
-
- /**
- * Gets list of unpaired devices
- * @param device_ids output list
- * @return true if success
- */
- virtual bool UnpairedDevicesList(DeviceIds* device_ids) const = 0;
-
- /**
- * @brief Remove application consent for particular group
- * @param policy_app_id Unique application id
- * @param functional_group_name Functional group name, which consents should
- * be removed
- * @return true, in case of success, otherwise - false
- */
- virtual bool RemoveAppConsentForGroup(
- const std::string& policy_app_id,
- const std::string& functional_group_name) const = 0;
- virtual bool SaveExternalConsentStatus(
- const ExternalConsentStatus& status) const = 0;
- virtual ExternalConsentStatus GetExternalConsentStatus() const = 0;
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h
index 08bd6d4923..378a294532 100644
--- a/src/components/policy/policy_regular/include/policy/pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/pt_representation.h
@@ -35,9 +35,11 @@
#include <vector>
#include <string>
+#include <memory>
#include "policy/policy_types.h"
#include "policy/policy_table/types.h"
#include "policy/policy_settings.h"
+#include "utils/macro.h"
namespace policy {
namespace policy_table = rpc::policy_table_interface_base;
@@ -208,7 +210,7 @@ class PTRepresentation {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const = 0;
virtual bool Save(const policy_table::Table& table) = 0;
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h
deleted file mode 100644
index 727c0b165d..0000000000
--- a/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Copyright (c) 2013, " Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, " with or without
- modification, " are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, " this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice, "
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
- CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
- CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
-#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
-
-#include <string>
-
-namespace policy {
-namespace sql_pt_ext {
-
-extern const std::string kSelectKeepContext;
-extern const std::string kSelectStealFocus;
-extern const std::string kResetDeviceConsents;
-extern const std::string kResetAppConsents;
-extern const std::string kCountDeviceConsentGroup;
-extern const std::string kCountDevice;
-extern const std::string kSelectDeviceConsentedGroup;
-extern const std::string kUpdateDeviceConsentedGroup;
-extern const std::string kUpdateDevice;
-extern const std::string kInsertDeviceConsentedGroup;
-extern const std::string kInsertDevice;
-extern const std::string kSelectDeviceData;
-extern const std::string kSelectConsentGroup;
-extern const std::string kInsertPreconsentedGroups;
-extern const std::string kSelectPreconsentedGroups;
-extern const std::string kDeletePreconsentedGroups;
-extern const std::string kSelectUsageAndErrorCount;
-extern const std::string kSelectAppLevels;
-extern const std::string kUpdateGlobalCounters;
-extern const std::string kInsertDeviceData;
-extern const std::string kDeleteDeviceData;
-extern const std::string kInsertConsentGroups;
-extern const std::string kCountUnconsentedGroups;
-extern const std::string kSelectModuleMeta;
-extern const std::string kUpdateMetaParams;
-extern const std::string kUpdateModuleMetaVinParam;
-extern const std::string kSaveModuleMeta;
-extern const std::string kSelectMetaParams;
-extern const std::string kCountAppLevel;
-extern const std::string kUpdateGroupPermissions;
-extern const std::string kSelectDefaultHmi;
-extern const std::string kInsertApplication;
-extern const std::string kSelectFriendlyMsg;
-extern const std::string kCollectFriendlyMsg;
-extern const std::string kSelectAppGroupsId;
-extern const std::string kSelectConsentedGroupsId;
-extern const std::string kCountAppConsents;
-extern const std::string kSelectPreconsentedGroupsId;
-extern const std::string kSelectFunctionalGroupNames;
-extern const std::string kSelectAppPolicies;
-extern const std::string kUpdateMetaLanguage;
-extern const std::string kDeleteDeviceConsent;
-extern const std::string kDeleteAppGroupConsent;
-extern const std::string kSelectGroupId;
-extern const std::string kSelectApplicationIsPreData;
-extern const std::string kUpdateIsPredata;
-extern const std::string kHasAppPreloadedGroups;
-extern const std::string kUpdateUnpairedDevice;
-extern const std::string kSelectUnpairedDevices;
-extern const std::string kHasMsgLanguageCode;
-extern const std::string kDeletePreconsentedGroupsByApplicationId;
-extern const std::string kDeleteAppConsent;
-extern const std::string kSelectExternalConsentStatus;
-} // namespace sql_pt_ext
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h
deleted file mode 100644
index 0958bad5e1..0000000000
--- a/src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
-
-#include <string>
-#include "policy/sql_pt_representation.h"
-#include "policy/pt_ext_representation.h"
-
-namespace policy {
-
-class SQLPTExtRepresentation : public SQLPTRepresentation,
- public PTExtRepresentation {
- public:
- bool CanAppKeepContext(const std::string& app_id);
- bool CanAppStealFocus(const std::string& app_id);
- bool GetDefaultHMI(const std::string& policy_app_id,
- std::string* default_hmi);
- bool ResetUserConsent();
- bool ResetDeviceConsents();
- bool ResetAppConsents();
- bool GetUserPermissionsForDevice(const std::string& device_id,
- StringArray* consented_groups = NULL,
- StringArray* disallowed_groups = NULL);
-
- bool GetPermissionsForApp(const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalIdType* group_types);
-
- bool GetDeviceGroupsFromPolicies(
- policy_table::Strings* groups = NULL,
- policy_table::Strings* preconsented_groups = NULL);
- bool SetDeviceData(const std::string& device_id,
- const std::string& hardware = "",
- const std::string& firmware = "",
- const std::string& os = "",
- const std::string& os_version = "",
- const std::string& carrier = "",
- const uint32_t number_of_ports = 0,
- const std::string& connection_type = "");
- bool SetUserPermissionsForDevice(
- const std::string& device_id,
- const StringArray& consented_groups = StringArray(),
- const StringArray& disallowed_groups = StringArray());
-
- bool ReactOnUserDevConsentForApp(const std::string& app_id,
- bool is_device_allowed);
-
- bool SetUserPermissionsForApp(const PermissionConsent& permissions);
-
- std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language);
-
- bool IncreaseStatisticsData(StatisticsType type) {
- return true;
- }
- bool SetAppRegistrationLanguage(const std::string& app_id,
- LanguageType type,
- const std::string& language) {
- return true;
- }
-
- bool SetMetaInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
-
- bool IsMetaInfoPresent();
-
- bool SetSystemLanguage(const std::string& language);
-
- int GetKmFromSuccessfulExchange() {
- return true;
- }
- int GetDayFromScsExchange() {
- return true;
- }
- int GetIgnitionsFromScsExchange() {
- return true;
- }
-
- bool GetFunctionalGroupNames(FunctionalGroupNames& names);
- bool CleanupUnpairedDevices(const DeviceIds& device_ids) const;
-
- void Increment(const std::string& type) const;
- void Increment(const std::string& app_id, const std::string& type) const;
- void Set(const std::string& app_id,
- const std::string& type,
- const std::string& value) const;
- void Add(const std::string& app_id,
- const std::string& type,
- int seconds) const;
- bool SetDefaultPolicy(const std::string& app_id);
- bool SetPredataPolicy(const std::string& app_id);
- bool SetIsPredata(const std::string& app_id, bool is_pre_data);
- bool IsPredataPolicy(const std::string& app_id) const;
- bool SetUnpairedDevice(const std::string& device_id, bool unpaired) const;
- bool UnpairedDevicesList(DeviceIds* device_ids) const;
- bool RemoveAppConsentForGroup(const std::string& policy_app_id,
- const std::string& functional_group_name) const;
-
- virtual bool SetVINValue(const std::string& value);
- bool SaveExternalConsentStatus(const ExternalConsentStatus& status) const;
- ExternalConsentStatus GetExternalConsentStatus() const;
-
- private:
- void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
- void GatherPreconsentedGroup(const std::string& app_id,
- policy_table::Strings* groups) const;
- bool GatherUsageAndErrorCounts(
- policy_table::UsageAndErrorCounts* counts) const;
- bool GatherAppLevels(policy_table::AppLevels* apps) const;
- void GatherDeviceData(policy_table::DeviceData* data) const;
- void GatherConsentGroup(const std::string& device_id,
- policy_table::UserConsentRecords* records) const;
- bool GatherApplicationPoliciesSection(
- policy_table::ApplicationPoliciesSection* policies) const;
- bool SaveDeviceData(const policy_table::DeviceData& devices);
- bool GatherConsumerFriendlyMessages(
- policy_table::ConsumerFriendlyMessages* messages) const;
- bool SaveConsentGroup(const std::string& device_id,
- const policy_table::UserConsentRecords& records);
- bool SaveApplicationPoliciesSection(
- const policy_table::ApplicationPoliciesSection& policies);
- bool SaveSpecificAppPolicy(
- const policy_table::ApplicationPolicies::value_type& app);
- bool SaveDevicePolicy(const policy_table::DevicePolicy& device);
- bool SavePreconsentedGroup(const std::string& app_id,
- const policy_table::Strings& groups);
- bool SaveMessageString(const std::string& type,
- const std::string& lang,
- const policy_table::MessageString& strings);
-
- virtual bool SaveUsageAndErrorCounts(
- const policy_table::UsageAndErrorCounts& counts);
-
- virtual bool SaveModuleMeta(const policy_table::ModuleMeta& meta);
-
- bool SaveAppCounters(const policy_table::AppLevels& app_levels);
-
- bool SaveGlobalCounters(const policy_table::UsageAndErrorCounts& counts);
-
- bool IsExistAppLevel(const std::string& app_id) const;
-
- bool GetAllAppGroups(const std::string& policy_app_id,
- FunctionalGroupIDs& all_groups);
-
- bool GetConsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- FunctionalGroupIDs& allowed_groups,
- FunctionalGroupIDs& disallowed_groups);
-
- bool GetPreconsentedGroups(const std::string& policy_app_id,
- FunctionalGroupIDs& preconsented_groups);
-
- void FillFunctionalGroupPermissions(
- FunctionalGroupIDs& ids,
- FunctionalGroupNames& names,
- GroupConsent state,
- std::vector<FunctionalGroupPermission>& permissions);
- bool CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- int* result) const;
-
- /**
- * @brief Checks, if there is message present with requested language in PT
- * @param message Message name
- * @param language Required message language
- * @return True, if message with requested language is present, otherwise -
- * false
- */
- bool IsMsgLanguagePresent(const std::string& message,
- const std::string& language);
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
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 2ded25e456..191873efe0 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
@@ -65,6 +65,7 @@ extern const std::string kSelectAppGroups;
extern const std::string kSelectNicknames;
extern const std::string kSelectAppTypes;
extern const std::string kSelectRequestTypes;
+extern const std::string kSelectRequestSubTypes;
extern const std::string kSelectSecondsBetweenRetries;
extern const std::string kSelectIgnitionCycles;
extern const std::string kSelectKilometers;
@@ -78,6 +79,7 @@ extern const std::string kInsertAppGroup;
extern const std::string kInsertNickname;
extern const std::string kInsertAppType;
extern const std::string kInsertRequestType;
+extern const std::string kInsertRequestSubType;
extern const std::string kInsertMessageType;
extern const std::string kInsertLanguage;
extern const std::string kInsertMessageString;
@@ -97,6 +99,7 @@ extern const std::string kDeleteRpc;
extern const std::string kDeleteAppGroup;
extern const std::string kDeleteApplication;
extern const std::string kDeleteRequestType;
+extern const std::string kDeleteRequestSubType;
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 6b5d6111f1..0e9302dfac 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
@@ -84,7 +84,7 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool Clear();
bool Drop();
virtual void WriteDb();
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const;
virtual bool Save(const policy_table::Table& table);
bool GetInitialAppData(const std::string& app_id,
StringArray* nicknames = NULL,
@@ -97,7 +97,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
-#ifdef SDL_REMOTE_CONTROL
enum TypeAccess { kAllowed, kManual };
bool GatherModuleType(const std::string& app_id,
policy_table::ModuleTypes* module_types) const;
@@ -112,7 +111,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool SaveAccessModule(TypeAccess access,
const policy_table::AccessModules& modules);
bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
-#endif // SDL_REMOTE_CONTROL
virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
@@ -132,6 +130,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
policy_table::AppHMITypes* app_types) const;
bool GatherRequestType(const std::string& app_id,
policy_table::RequestTypes* request_types) const;
+ bool GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const;
bool GatherNickName(const std::string& app_id,
policy_table::Strings* nicknames) const;
@@ -167,6 +168,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
const policy_table::AppHMITypes& types);
bool SaveRequestType(const std::string& app_id,
const policy_table::RequestTypes& types);
+ bool SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes);
public:
bool UpdateRequired() const;
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h
index a68d986d10..c90acd4957 100644
--- a/src/components/policy/policy_regular/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h
@@ -66,14 +66,14 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- void SetNextStatus(utils::SharedPtr<Status> status);
+ void SetNextStatus(std::shared_ptr<Status> status);
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- void SetPostponedStatus(utils::SharedPtr<Status> status);
+ void SetPostponedStatus(std::shared_ptr<Status> status);
/**
* @brief Sets listener pointer
@@ -118,10 +118,10 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
void OnNewApplicationAdded(const DeviceConsent consent);
/**
- * @brief Update status handler for policy initialization
+ * @brief Update status handler on existed application registering
* @param is_update_required Update necessity flag
*/
- void OnPolicyInit(bool is_update_required);
+ void OnExistedApplicationAdded(const bool is_update_required);
/**
* @brief In case application from non-consented device has been registered
@@ -198,17 +198,17 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
/**
* @brief Current update status
*/
- utils::SharedPtr<Status> current_status_;
+ std::shared_ptr<Status> current_status_;
/**
* @brief Next status after current to be set
*/
- utils::SharedPtr<Status> next_status_;
+ std::shared_ptr<Status> next_status_;
/**
* @brief Status to be set after 'next' status
*/
- utils::SharedPtr<Status> postponed_status_;
+ std::shared_ptr<Status> postponed_status_;
sync_primitives::Lock status_lock_;
UpdateEvent last_processed_event_;
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
index e118f9974f..4763ff2eb5 100644
--- a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
-#include "utils/shared_ptr.h"
#include "policy/policy_types.h"
#include "policy/status.h"
@@ -55,14 +54,14 @@ class UpdateStatusManagerInterface {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- virtual void SetNextStatus(utils::SharedPtr<Status> status) = 0;
+ virtual void SetNextStatus(std::shared_ptr<Status> status) = 0;
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- virtual void SetPostponedStatus(utils::SharedPtr<Status> status) = 0;
+ virtual void SetPostponedStatus(std::shared_ptr<Status> status) = 0;
/**
* @brief Sets listener pointer
* @param listener Pointer to policy listener implementation
@@ -106,13 +105,13 @@ class UpdateStatusManagerInterface {
virtual void OnNewApplicationAdded(DeviceConsent device_consent) = 0;
/**
- * @brief Update status handler for policy initialization
+ * @brief Update status handler on existed application registering
* @param is_update_required Update necessity flag
*/
- virtual void OnPolicyInit(bool is_update_required) = 0;
+ virtual void OnExistedApplicationAdded(const bool is_update_required) = 0;
};
-typedef utils::SharedPtr<UpdateStatusManagerInterface>
+typedef std::shared_ptr<UpdateStatusManagerInterface>
UpdateStatusManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
index 1e263ec9df..72ae5fd9e0 100644
--- a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
@@ -36,7 +36,7 @@
#include <ctime>
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
-#include "utils/shared_ptr.h"
+
#include "utils/timer.h"
#include "utils/macro.h"
@@ -46,18 +46,18 @@ using timer::Timer;
class GlobalCounter {
public:
- GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounter(std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type);
void operator++() const;
private:
GlobalCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppCounter {
public:
- AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type);
void operator++() const;
@@ -65,12 +65,12 @@ class AppCounter {
private:
std::string app_id_;
AppCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppInfo {
public:
- AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type);
void Update(const std::string& new_info) const;
@@ -78,14 +78,14 @@ class AppInfo {
private:
std::string app_id_;
AppInfoId info_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppStopwatchImpl : public AppStopwatch {
public:
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id);
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
std::uint32_t timeout);
void Start(AppStopwatchId stopwatch_type) OVERRIDE;
@@ -96,7 +96,7 @@ class AppStopwatchImpl : public AppStopwatch {
// Fields
std::string app_id_;
AppStopwatchId stopwatch_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
timer::Timer timer_;
const std::uint32_t time_out_;
DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
diff --git a/src/components/policy/policy_regular/policy_table_interface_ext.xml b/src/components/policy/policy_regular/policy_table_interface_ext.xml
deleted file mode 100644
index 468eec2b0b..0000000000
--- a/src/components/policy/policy_regular/policy_table_interface_ext.xml
+++ /dev/null
@@ -1,279 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="policy table interface base" version="0.0"
- date="2014-01-23">
-
- <!-- Common parameters start -->
- <enum name="Priority">
- <element name="EMERGENCY" />
- <element name="NAVIGATION" />
- <element name="VOICECOM" />
- <element name="COMMUNICATION" />
- <element name="NORMAL" />
- <element name="NONE" />
- </enum>
-
- <enum name="HmiLevel">
- <element name="BACKGROUND" />
- <element name="FULL" />
- <element name="LIMITED" />
- <element name="NONE" />
- </enum>
-
- <enum name="Parameter">
- <element name="gps" />
- <element name="speed" />
- <element name="engineTorque" />
- <element name="externalTemperature" />
- <element name="fuelLevel" />
- <element name="fuelLevel_State" />
- <element name="headLampStatus" />
- <element name="instantFuelConsumption" />
- <element name="odometer" />
- <element name="tirePressure" />
- <element name="wiperStatus" />
- <element name="vin" />
- <element name="accPedalPosition" />
- <element name="beltStatus" />
- <element name="driverBraking" />
- <element name="prndl" />
- <element name="rpm" />
- <element name="steeringWheelAngle" />
- <element name="myKey" />
- <element name="airbagStatus" />
- <element name="bodyInformation" />
- <element name="clusterModeStatus" />
- <element name="deviceStatus" />
- <element name="emergencyEvent" />
- <element name="eCallInfo" />
- </enum>
-
- <enum name="AppHMIType">
- <element name="DEFAULT" />
- <element name="COMMUNICATION" />
- <element name="MEDIA" />
- <element name="MESSAGING" />
- <element name="NAVIGATION" />
- <element name="INFORMATION" />
- <element name="SOCIAL" />
- <element name="BACKGROUND_PROCESS" />
- <element name="TESTING" />
- <element name="SYSTEM" />
- </enum>
- <!-- Common parameters end -->
-
- <!-- app_policies section start -->
-
- <typedef name="Strings" type="String" maxlength="255" array="true"
- maxsize="255" />
-
- <typedef name="AppHMITypes" type="AppHMIType" array="true"
- maxsize="255" />
-
- <struct name="ApplicationParams">
- <param name="groups" type="Strings" />
- <param name="nicknames" type="Strings" mandatory="false" />
- <param name="preconsented_groups" type="Strings" mandatory="false" />
- <param name="AppHMIType" type="AppHMITypes" mandatory="false" />
- <param name="priority" type="Priority" />
- <param name="default_hmi" type="HmiLevel" />
- <param name="keep_context" type="Boolean" />
- <param name="steal_focus" type="Boolean" />
- <param name="memory_kb" type="Integer" minvalue="1" maxvalue="65225" mandatory="false"/>
- <param name="watchdog_timer_ms" type="Integer" minvalue="1"
- maxvalue="65225" mandatory="false"/>
- <param name="certificate" type="String" minlength="0" maxlength="255"
- mandatory="false" />
- </struct>
-
- <typedef name="HmiLevels" type="HmiLevel" array="true"
- maxsize="4" />
- <typedef name="Parameters" type="Parameter" array="true"
- maxsize="24" />
-
- <struct name="RpcParameters">
- <!-- maxsizes are equal to number of currently known elements of
- given type -->
- <param name="hmi_levels" type="HmiLevels" />
- <param name="parameters" type="Parameters" mandatory="false" />
- </struct>
-
- <!-- maxsizes are equal to number of currently known elements of given
- type -->
- <typedef name="Rpc" type="RpcParameters" map="true" maxsize="50" null_values_allowed="true" />
-
- <struct name="Rpcs">
- <param name="user_consent_prompt" type="String" minlegth="1"
- maxlength="255" mandatory="false"/>
- <param name="rpcs" type="Rpc" null_values_allowed="true"/>
- </struct>
- <!-- app_policies section end -->
-
- <!-- module_config section start -->
- <!-- minlenght="10" since minimum expected is "http://a.b" -->
- <typedef name="URL" type="String" minlength="10" maxlength="255"
- array="true" minsize="1" maxsize="255" />
-
- <typedef name="URLList" type="URL" map="true" minsize="1"
- maxsize="255" />
-
- <!-- max number of services is limited to 255 according to protocol specification -->
- <typedef name="ServiceEndpoints" type="URLList" map="true"
- minsize="1" maxsize="255" />
-
- <typedef name="NumberOfNotificationsPerMinute" type="Integer"
- map="true" maxsize="6" minvalue="0" maxvalue="255" />
-
- <typedef name="SecondsBetweenRetries" type="Integer" array="true"
- maxsize="10" minvalue="1" maxvalue="1000" />
-
- <struct name="ModuleConfig">
- <param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
- <param name="preloaded_pt" type="Boolean" mandatory="false" />
- <param name="exchange_after_x_ignition_cycles" type="Integer"
- maxvalue="255" />
- <param name="exchange_after_x_kilometers" type="Integer"
- maxvalue="4294967296" />
- <param name="exchange_after_x_days" type="Integer"
- maxvalue="255" />
- <param name="timeout_after_x_seconds" type="Integer"
- maxvalue="65535" />
- <param name="seconds_between_retries" type="SecondsBetweenRetries" />
- <param name="endpoints" type="ServiceEndpoints" />
- <param name="notifications_per_minute_by_priority" type="NumberOfNotificationsPerMinute" />
- <param name="vehicle_make" type="String" maxlength="100"
- mandatory="false" />
- <param name="vehicle_model" type="String" maxlength="100"
- mandatory="false" />
- <param name="vehicle_year" type="String" minlength="4" maxlength="4"
- mandatory="false" />
- </struct>
- <!-- module_config section end -->
-
- <!-- consumer_friendly_messages section start -->
- <struct name="MessageString">
- <param name="line1" type="String" maxlength="255"
- mandatory="false" />
- <param name="line2" type="String" maxlength="255"
- mandatory="false" />
- <param name="tts" type="String" maxlength="65535" mandatory="false" />
- <param name="label" type="String" maxlength="255"
- mandatory="false" />
- <param name="textBody" type="String" maxlength="500"
- mandatory="false" />
- </struct>
-
- <typedef name="Languages" map="true" type="MessageString"
- maxsize="500" mandatory="false" />
-
- <struct name="MessageLanguages">
- <param name="languages" type="Languages" />
- </struct>
-
- <typedef name="Messages" map="true" type="MessageLanguages"
- maxsize="255" />
-
- <struct name="ConsumerFriendlyMessages">
- <param name="version" type="String" maxlength="100" />
- <param name="messages" type="Messages" mandatory="false" />
- </struct>
- <!-- consumer_friendly_messages section end -->
-
- <!-- module_meta section start -->
- <struct name="ModuleMeta">
- <param name="ccpu_version" type="String" maxlength="250" mandatory="false"/>
- <param name="language" type="String" maxlength="250" mandatory="false"/>
- <param name="wers_country_code" type="String" maxlength="250" mandatory="false"/>
- <param name="pt_exchanged_at_odometer_x" type="Integer" minvalue="0" maxvalue="65535" mandatory="false"/>
- <param name="pt_exchanged_x_days_after_epoch" type="Integer" minvalue="0" maxvalue="65535" mandatory="false"/>
- <param name="ignition_cycles_since_last_exchange" type="Integer" minvalue="0" maxvalue="65535" mandatory="false"/>
- <param name="vin" type="String" maxlength="250" mandatory="false"/>
- </struct>
- <!-- module_meta section end -->
-
- <!-- usage_and_error_counts section start -->
- <struct name="AppLevel">
- <param name="minutes_in_hmi_full" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="app_registration_language_gui" type="String" minlength="1" maxlength="10" />
- <param name="app_registration_language_vui" type="String" minlength="1" maxlength="10" />
- <param name="count_of_rfcom_limit_reached" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="minutes_in_hmi_limited" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="minutes_in_hmi_background" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="minutes_in_hmi_none" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_user_selections" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_rejections_sync_out_of_memory" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_rejections_nickname_mismatch" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_rejections_duplicate_name" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_rejected_rpc_calls" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_rpcs_sent_in_hmi_none" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_removals_for_bad_behavior" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="count_of_run_attempts_while_revoked" type="Integer" minvalue="0" maxvalue="65535" />
- </struct>
-
- <typedef name="AppLevels" type="AppLevel" map="true"
- maxsize="255" />
-
- <struct name="UsageAndErrorCounts">
- <param name="count_of_iap_buffer_full" type="Integer" minvalue="0" maxvalue="65535" mandatory="false" />
- <param name="count_sync_out_of_memory" type="Integer" minvalue="0" maxvalue="65535" mandatory="false" />
- <param name="count_of_sync_reboots" type="Integer" minvalue="0" maxvalue="65535" mandatory="false" />
- <param name="app_level" type="AppLevels" mandatory="false" />
- </struct>
- <!-- usage_and_error_counts section end -->
-
- <!-- device_data section start -->
- <enum name="Input" scope="internal">
- <element name="GUI" />
- <element name="VUI" />
- </enum>
-
- <typedef name="ConsentGroups" scope="internal" type="Boolean" map="true" maxsize="255" mandatory="false"/>
-
- <struct name="ConsentRecords" scope="internal">
- <param name="consent_groups" type="ConsentGroups" mandatory="false"/>
- <param name="input" type="Input" mandatory="false" />
- <param name="time_stamp" type="String" maxlength="255" mandatory="false" />
- </struct>
-
- <typedef name="UserConsentRecords" scope="internal" map="true" type="ConsentRecords" minsize="0" maxsize="1000"/>
-
- <struct name="DeviceParams" scope="internal">
- <param name="hardware" type="String" maxlength="255" mandatory="false"/>
- <param name="firmware_rev" type="String" maxlength="255" nullable="true" mandatory="false"/>
- <param name="os" type="String" maxlength="255" mandatory="false"/>
- <param name="os_version" type="String" maxlength="255" mandatory="false"/>
- <param name="carrier" type="String" maxlength="255" nullable="true" mandatory="false"/>
- <param name="user_consent_records" type="UserConsentRecords" mandatory="false"/>
- <param name="max_number_rfcom_ports" type="Integer" maxvalue="255" mandatory="false"/>
- </struct>
- <!-- device_data section end -->
-
- <!-- policy_table section start -->
- <typedef name="ApplicationPolicies" map="true" type="ApplicationParams"
- null_values_allowed="true" minsize="1" maxsize="1000" />
-
- <typedef name="FunctionalGroupings" map="true" type="Rpcs"
- minsize="1" maxsize="255" />
-
- <typedef name="DeviceData" map="true" type="DeviceParams"
- maxsize="255" />
-
- <struct name="PolicyTable">
- <!-- maxsize for app_policies can be changed, if necessary -->
- <param name="app_policies" type="ApplicationPolicies" />
- <param name="functional_groupings" type="FunctionalGroupings" />
- <param name="consumer_friendly_messages" type="ConsumerFriendlyMessages" />
- <param name="module_config" type="ModuleConfig" />
- <param name="module_meta" type="ModuleMeta" mandatory="false"/>
- <param name="usage_and_error_counts" type="UsageAndErrorCounts" mandatory="false" />
- <param name="device_data" type="DeviceData" mandatory="false" />
- </struct>
- <!-- policy_table section end -->
-
- <!-- Root element -->
- <struct name="Table">
- <param name="policy_table" type="PolicyTable" />
- </struct>
-
-</interface>
diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc
index f99b226f2e..f743a4d56e 100644
--- a/src/components/policy/policy_regular/src/access_remote_impl.cc
+++ b/src/components/policy/policy_regular/src/access_remote_impl.cc
@@ -89,7 +89,7 @@ struct ToModuleType {
AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
-AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr<CacheManager> cache)
: cache_(cache) {}
bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 6a142374d5..bd95fc8e7c 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -39,6 +39,7 @@
#include <sstream>
#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "json/reader.h"
#include "json/features.h"
#include "json/writer.h"
@@ -103,7 +104,7 @@ CacheManager::CacheManager()
, pt_(new policy_table::Table)
, backup_(new SQLPTRepresentation())
, update_required(false)
- , cache_lock_(true) {
+ , settings_(nullptr) {
LOG4CXX_AUTO_TRACE(logger_);
backuper_ = new BackgroundBackuper(this);
backup_thread_ = threads::CreateThread("Backup thread", backuper_);
@@ -645,7 +646,7 @@ int CacheManager::TimeoutResponse() {
CACHE_MANAGER_CHECK(0);
sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.module_config.timeout_after_x_seconds *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
}
bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
@@ -825,6 +826,9 @@ void CacheManager::CheckSnapshotInitialization() {
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
+ *(snapshot_->policy_table.module_config.full_app_id_supported) =
+ get_settings().use_full_app_id();
+
// SDL must not send certificate in snapshot
snapshot_->policy_table.module_config.certificate =
rpc::Optional<rpc::String<0, 65535> >();
@@ -933,8 +937,8 @@ void CacheManager::CheckSnapshotInitialization() {
void CacheManager::PersistData() {
LOG4CXX_AUTO_TRACE(logger_);
- if (backup_.valid()) {
- if (pt_.valid()) {
+ if (backup_.use_count() != 0) {
+ if (pt_.use_count() != 0) {
// Comma expression is used to hold the lock only during the constructor
// call
policy_table::Table copy_pt(
@@ -1028,10 +1032,10 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id,
return false;
}
-utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+std::shared_ptr<policy_table::Table> CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- snapshot_ = new policy_table::Table();
+ snapshot_ = std::make_shared<policy_table::Table>();
// Copy all members of policy table except messages in consumer friendly
// messages
@@ -1425,7 +1429,7 @@ bool CacheManager::Init(const std::string& file_name,
result = LoadFromFile(file_name, *pt_);
- utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = GenerateSnapshot();
result &= snapshot->is_valid();
LOG4CXX_DEBUG(logger_,
"Check if snapshot is valid: " << std::boolalpha << result);
@@ -1450,10 +1454,13 @@ bool CacheManager::Init(const std::string& file_name,
void CacheManager::FillDeviceSpecificData() {}
bool CacheManager::LoadFromBackup() {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(cache_lock_);
pt_ = backup_->GenerateSnapshot();
update_required = backup_->UpdateRequired();
-
+ LOG4CXX_DEBUG(logger_,
+ "Update required flag from backup: " << std::boolalpha
+ << update_required);
FillDeviceSpecificData();
return true;
@@ -1550,6 +1557,32 @@ int32_t CacheManager::GenerateHash(const std::string& str_to_hash) {
return result;
}
+RequestType::State CacheManager::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request types for app_id " << policy_app_id);
+ return RequestType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestTypes& request_types =
+ *app_policies_iter->second.RequestType;
+ if (!request_types.is_initialized()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request types for " << policy_app_id << " are OMITTED");
+ return RequestType::State::OMITTED;
+ }
+ if (request_types.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request types for " << policy_app_id << " are EMPTY");
+ return RequestType::State::EMPTY;
+ }
+ return RequestType::State::AVAILABLE;
+}
+
void CacheManager::GetAppRequestTypes(
const std::string& policy_app_id,
std::vector<std::string>& request_types) const {
@@ -1568,11 +1601,60 @@ void CacheManager::GetAppRequestTypes(
"Can't find request types for app_id " << policy_app_id);
return;
}
- policy_table::RequestTypes::iterator it_request_type =
- policy_iter->second.RequestType->begin();
- for (; it_request_type != policy_iter->second.RequestType->end();
- ++it_request_type) {
- request_types.push_back(EnumToJsonString(*it_request_type));
+
+ for (const auto& request_type : *policy_iter->second.RequestType) {
+ request_types.push_back(EnumToJsonString(request_type));
+ }
+ return;
+}
+
+RequestSubType::State CacheManager::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return RequestSubType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestSubTypes& request_subtypes =
+ *app_policies_iter->second.RequestSubType;
+ if (!request_subtypes.is_initialized()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes for " << policy_app_id << " are OMITTED");
+ return RequestSubType::State::OMITTED;
+ }
+ if (request_subtypes.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes for " << policy_app_id << " are EMPTY");
+ return RequestSubType::State::EMPTY;
+ }
+ return RequestSubType::State::AVAILABLE;
+}
+
+void CacheManager::GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (kDeviceId == policy_app_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes not applicable for app_id " << kDeviceId);
+ return;
+ }
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == policy_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return;
+ }
+
+ for (const auto& request_subtype : *policy_iter->second.RequestSubType) {
+ request_types.push_back(request_subtype);
}
return;
}
diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
index 95f275769c..bae9fceb49 100644
--- a/src/components/policy/policy_regular/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -121,8 +121,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
CheckAppPolicy::CheckAppPolicy(
PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot)
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot)
: pm_(pm), update_(update), snapshot_(snapshot) {}
bool policy::CheckAppPolicy::HasRevokedGroups(
@@ -339,9 +339,20 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
}
PermissionsCheckResult result = CheckPermissionsChanges(app_policy);
- if (!IsPredefinedApp(app_policy) && IsRequestTypeChanged(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
- NotifySystem(app_policy);
+ if (!IsPredefinedApp(app_policy)) {
+ const bool is_request_type_changed = IsRequestTypeChanged(app_policy);
+ const bool is_request_subtype_changed = IsRequestSubTypeChanged(app_policy);
+
+ if (is_request_type_changed) {
+ SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
+ }
+ if (is_request_subtype_changed) {
+ SetPendingPermissions(app_policy, RESULT_REQUEST_SUBTYPE_CHANGED);
+ }
+
+ if (is_request_type_changed || is_request_subtype_changed) {
+ NotifySystem(app_policy);
+ }
}
if (RESULT_NO_CHANGES == result) {
LOG4CXX_INFO(logger_,
@@ -412,17 +423,19 @@ void policy::CheckAppPolicy::SetPendingPermissions(
case RESULT_REQUEST_TYPE_CHANGED:
permissions_diff.priority.clear();
permissions_diff.requestTypeChanged = true;
- {
- // Getting RequestTypes from PTU (not from cache)
- policy_table::RequestTypes::const_iterator it_request_type =
- app_policy.second.RequestType->begin();
- for (; app_policy.second.RequestType->end() != it_request_type;
- ++it_request_type) {
- permissions_diff.requestType.push_back(
- EnumToJsonString(*it_request_type));
- }
- }
+ // Getting Request Types from PTU (not from cache)
+ for (const auto& request_type : *app_policy.second.RequestType) {
+ permissions_diff.requestType.push_back(EnumToJsonString(request_type));
+ }
+ break;
+ case RESULT_REQUEST_SUBTYPE_CHANGED:
+ permissions_diff.priority.clear();
+ permissions_diff.requestSubTypeChanged = true;
+ // Getting Request SubTypes from PTU (not from cache)
+ for (const auto& request_subtype : *app_policy.second.RequestSubType) {
+ permissions_diff.requestSubType.push_back(request_subtype);
+ }
break;
default:
return;
@@ -491,6 +504,32 @@ bool CheckAppPolicy::IsRequestTypeChanged(
return diff.size();
}
+bool CheckAppPolicy::IsRequestSubTypeChanged(
+ const AppPoliciesValueType& app_policy) const {
+ policy::AppPoliciesConstItr it =
+ snapshot_->policy_table.app_policies_section.apps.find(app_policy.first);
+
+ if (it == snapshot_->policy_table.app_policies_section.apps.end()) {
+ if (!app_policy.second.RequestSubType->empty()) {
+ return true;
+ }
+ return false;
+ }
+
+ if (it->second.RequestSubType->size() !=
+ app_policy.second.RequestSubType->size()) {
+ return true;
+ }
+
+ policy_table::RequestSubTypes diff;
+ std::set_difference(it->second.RequestSubType->begin(),
+ it->second.RequestSubType->end(),
+ app_policy.second.RequestSubType->begin(),
+ app_policy.second.RequestSubType->end(),
+ std::back_inserter(diff));
+ return diff.size();
+}
+
FillNotificationData::FillNotificationData(Permissions& data,
GroupConsent group_state,
GroupConsent undefined_group_consent)
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 3e08147a4c..4985035629 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -44,17 +44,14 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
#include "config_profile/profile.h"
#include "utils/timer_task_impl.h"
-#include "utils/make_shared.h"
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
@@ -65,7 +62,7 @@ void DeleteManager(policy::PolicyManager* pm) {
namespace {
const uint32_t kDefaultRetryTimeoutInMSec =
- 60u * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ 60u * date_time::MILLISECONDS_IN_SECOND;
} // namespace
namespace policy {
@@ -76,10 +73,8 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
-#ifdef SDL_REMOTE_CONTROL
- , access_remote_(new AccessRemoteImpl(
- CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
-#endif // SDL_REMOTE_CONTROL
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(kDefaultRetryTimeoutInMSec)
, retry_sequence_index_(0)
, timer_retry_sequence_("Retry sequence timer",
@@ -89,8 +84,7 @@ PolicyManagerImpl::PolicyManagerImpl()
, retry_sequence_url_(0, 0, "")
, wrong_ptu_update_received_(false)
, send_on_update_sent_out_(false)
- , trigger_ptu_(false) {
-}
+ , trigger_ptu_(false) {}
void PolicyManagerImpl::set_listener(PolicyListener* listener) {
listener_ = listener;
@@ -99,21 +93,21 @@ void PolicyManagerImpl::set_listener(PolicyListener* listener) {
#ifdef USE_HMI_PTU_DECRYPTION
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
Json::Reader reader;
if (reader.parse(json.c_str(), value)) {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::make_shared<policy_table::Table>();
}
}
#else
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::ParseArray(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
@@ -122,12 +116,12 @@ utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray(
// For PT Update received from SDL Server.
if (value["data"].size() != 0) {
Json::Value data = value["data"];
- return new policy_table::Table(&data[0]);
+ return std::make_shared<policy_table::Table>(&data[0]);
} else {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
}
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::shared_ptr<policy_table::Table>();
}
}
@@ -149,6 +143,149 @@ void PolicyManagerImpl::CheckTriggers() {
}
}
+/**
+ * @brief FilterInvalidFunctions filter functions that are absent in schema
+ * @param rpcs list of functions to filter
+ */
+void FilterInvalidFunctions(policy_table::Rpc& rpcs) {
+ policy_table::Rpc valid_rpcs;
+ for (const auto& rpc : rpcs) {
+ const std::string& rpc_name = rpc.first;
+ policy_table::FunctionID function_id;
+ if (policy_table::EnumFromJsonString(rpc_name, &function_id)) {
+ valid_rpcs.insert(rpc);
+ }
+ }
+ rpcs.swap(valid_rpcs);
+}
+
+/**
+ * @brief FilterInvalidRPCParameters filter parameters that not present in
+ * schema
+ * @param rpc_parameters parameters to filter
+ */
+void FilterInvalidRPCParameters(policy_table::RpcParameters& rpc_parameters) {
+ policy_table::HmiLevels valid_hmi_levels;
+ for (const auto& hmi_level : rpc_parameters.hmi_levels) {
+ if (hmi_level.is_valid()) {
+ valid_hmi_levels.push_back(hmi_level);
+ }
+ }
+ rpc_parameters.hmi_levels.swap(valid_hmi_levels);
+
+ policy_table::Parameters valid_params;
+ const policy_table::Parameters& params = *(rpc_parameters.parameters);
+ for (const auto& param : params) {
+ if (param.is_valid()) {
+ valid_params.push_back(param);
+ }
+ }
+ rpc_parameters.parameters->swap(valid_params);
+}
+
+/**
+ * @brief FilterInvalidPriorityValues filter notification priorities that are
+ * not present in schema
+ * @param notifications priorities to filter
+ */
+void FilterInvalidPriorityValues(
+ policy_table::NumberOfNotificationsPerMinute& notifications) {
+ policy_table::NumberOfNotificationsPerMinute valid_notifications;
+ for (const auto& notification : notifications) {
+ policy_table::Priority priority;
+ if (policy_table::EnumFromJsonString(notification.first, &priority)) {
+ valid_notifications.insert(notification);
+ }
+ }
+ notifications.swap(valid_notifications);
+}
+
+/**
+ * @brief FilterInvalidApplicationParameters filter app params that are not
+ * present in schema
+ * @param app_params object of app policy params to filter
+ */
+void FilterInvalidApplicationParameters(
+ policy_table::ApplicationParams& app_params) {
+ // Filter AppHMIType array
+ policy_table::AppHMITypes valid_app_hmi_types;
+ const policy_table::AppHMITypes& app_hmi_types = *(app_params.AppHMIType);
+ for (const auto& app_hmi_type : app_hmi_types) {
+ if (app_hmi_type.is_valid()) {
+ valid_app_hmi_types.push_back(app_hmi_type);
+ }
+ }
+ app_params.AppHMIType->swap(valid_app_hmi_types);
+
+ // Filter RquestTypes array
+ policy_table::RequestTypes valid_request_types;
+ const policy_table::RequestTypes& request_types = *(app_params.RequestType);
+ for (const auto& request_type : request_types) {
+ if (request_type.is_valid()) {
+ valid_request_types.push_back(request_type);
+ }
+ }
+ if (valid_request_types.empty() && !request_types.empty()) {
+ // An empty RequestType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.RequestType) = policy_table::RequestTypes();
+ } else {
+ app_params.RequestType->swap(valid_request_types);
+ }
+
+ // Filter moduleType array
+ policy_table::ModuleTypes valid_module_types;
+ const policy_table::ModuleTypes& module_types = *(app_params.moduleType);
+ for (const auto& module_type : module_types) {
+ if (module_type.is_valid()) {
+ valid_module_types.push_back(module_type);
+ }
+ }
+ if (valid_module_types.empty() && !module_types.empty()) {
+ // An empty moduleType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.moduleType) = policy_table::ModuleTypes();
+ } else {
+ app_params.moduleType->swap(valid_module_types);
+ }
+
+ // Filter priority
+ if (!app_params.priority.is_valid()) {
+ app_params.priority = policy_table::Priority();
+ }
+}
+
+/**
+ * @brief FilterPolicyTable filter values that not present in schema
+ * @param pt policy table to filter
+ */
+void FilterPolicyTable(policy_table::PolicyTable& pt) {
+ policy_table::ModuleConfig& module_config = pt.module_config;
+ if (module_config.is_initialized() &&
+ module_config.notifications_per_minute_by_priority.is_initialized()) {
+ FilterInvalidPriorityValues(
+ module_config.notifications_per_minute_by_priority);
+ }
+
+ if (pt.app_policies_section.is_initialized()) {
+ policy_table::ApplicationPolicies& apps = pt.app_policies_section.apps;
+ for (auto& app_policy : apps) {
+ FilterInvalidApplicationParameters(app_policy.second);
+ }
+ }
+
+ for (auto& group : pt.functional_groupings) {
+ policy_table::Rpc& rpcs = group.second.rpcs;
+ FilterInvalidFunctions(rpcs);
+
+ for (auto& func : rpcs) {
+ FilterInvalidRPCParameters(func.second);
+ }
+ }
+}
+
bool PolicyManagerImpl::LoadPT(const std::string& file,
const BinaryMessage& pt_content) {
LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
@@ -160,11 +297,11 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
// Assuemes Policy Table was parsed, formatted, and/or decrypted by
// the HMI after system request before calling OnReceivedPolicyUpdate
// Parse message into table struct
- utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = Parse(pt_content);
#else
// Message Received from server unecnrypted with PTU in first element
// of 'data' array. No Parsing was done by HMI.
- utils::SharedPtr<policy_table::Table> pt_update = ParseArray(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = ParseArray(pt_content);
#endif
if (!pt_update) {
LOG4CXX_WARN(logger_, "Parsed table pointer is 0.");
@@ -174,6 +311,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
file_system::DeleteFile(file);
+ FilterPolicyTable(pt_update->policy_table);
if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
wrong_ptu_update_received_ = true;
update_status_manager_.OnWrongUpdateReceived();
@@ -193,7 +331,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
sync_primitives::AutoLock lock(apps_registration_lock_);
// Get current DB data, since it could be updated during awaiting of PTU
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(
@@ -219,10 +357,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
return false;
}
- if (pt_update->policy_table.module_config.certificate.is_initialized()) {
- listener_->OnCertificateUpdated(
- *(pt_update->policy_table.module_config.certificate));
- }
+ listener_->OnCertificateUpdated(
+ *(pt_update->policy_table.module_config.certificate));
std::map<std::string, StringArray> app_hmi_types;
cache_->GetHMIAppTypeAfterUpdate(app_hmi_types);
@@ -246,8 +382,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
}
void PolicyManagerImpl::CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> pt_update,
- const utils::SharedPtr<policy_table::Table> snapshot) {
+ const std::shared_ptr<policy_table::Table> pt_update,
+ const std::shared_ptr<policy_table::Table> snapshot) {
LOG4CXX_INFO(logger_, "Checking incoming permissions.");
// Replace predefined policies with its actual setting, e.g. "123":"default"
@@ -282,7 +418,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
bool PolicyManagerImpl::RequestPTUpdate() {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
@@ -385,6 +521,25 @@ const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
return request_types;
}
+RequestType::State PolicyManagerImpl::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestTypesState(policy_app_id);
+}
+
+RequestSubType::State PolicyManagerImpl::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestSubTypesState(policy_app_id);
+}
+
+const std::vector<std::string> PolicyManagerImpl::GetAppRequestSubTypes(
+ const std::string& policy_app_id) const {
+ std::vector<std::string> request_subtypes;
+ cache_->GetAppRequestSubTypes(policy_app_id, request_subtypes);
+ return request_subtypes;
+}
+
const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
return cache_->GetVehicleInfo();
}
@@ -406,12 +561,16 @@ void PolicyManagerImpl::CheckPermissions(const PTString& device_id,
"CheckPermissions for " << app_id << " and rpc " << rpc
<< " for " << hmi_level << " level.");
-#ifdef SDL_REMOTE_CONTROL
ApplicationOnDevice who = {device_id, app_id};
- const policy_table::Strings& groups = access_remote_->GetGroups(who);
-#else // SDL_REMOTE_CONTROL
- const policy_table::Strings& groups = cache_->GetGroups(app_id);
-#endif // SDL_REMOTE_CONTROL
+ policy_table::Strings groups;
+ if (access_remote_->IsAppRemoteControl(who)) {
+ groups = access_remote_->GetGroups(who);
+ LOG4CXX_INFO(logger_,
+ "CheckPermissions for " << app_id << " and rpc " << rpc
+ << " for " << hmi_level << " level.");
+ } else {
+ groups = cache_->GetGroups(app_id);
+ }
cache_->CheckPermissions(groups, hmi_level, rpc, result);
if (cache_->IsApplicationRevoked(app_id)) {
@@ -467,13 +626,11 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
std::string default_hmi;
default_hmi = "NONE";
-#ifdef SDL_REMOTE_CONTROL
const ApplicationOnDevice who = {device_id, application_id};
if (access_remote_->IsAppRemoteControl(who)) {
listener()->OnPermissionsUpdated(application_id, notification_data);
return;
}
-#endif // SDL_REMOTE_CONTROL
listener()->OnPermissionsUpdated(
application_id, notification_data, default_hmi);
@@ -711,14 +868,15 @@ void PolicyManagerImpl::GetPermissionsForApp(
}
FunctionalIdType group_types;
-#ifdef SDL_REMOTE_CONTROL
- allowed_by_default = false;
- bool ret = access_remote_->GetPermissionsForApp(
- device_id, policy_app_id, group_types);
-#else
- bool ret =
- cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
-#endif // REMOTE_CONTROL
+ const ApplicationOnDevice who = {device_id, app_id_to_check};
+ bool ret = false;
+ if (access_remote_->IsAppRemoteControl(who)) {
+ allowed_by_default = false;
+ ret = access_remote_->GetPermissionsForApp(
+ device_id, policy_app_id, group_types);
+ } else {
+ ret = cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
+ }
if (!ret) {
LOG4CXX_WARN(logger_,
@@ -792,7 +950,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() {
}
bool PolicyManagerImpl::IsPTValid(
- utils::SharedPtr<policy_table::Table> policy_table,
+ std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const {
policy_table->SetPolicyTableType(type);
if (!policy_table->is_valid()) {
@@ -813,9 +971,9 @@ const PolicySettings& PolicyManagerImpl::get_settings() const {
bool PolicyManagerImpl::ExceededDays() {
LOG4CXX_AUTO_TRACE(logger_);
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days = current_time.tv_sec / kSecondsInDay;
+ const int days = date_time::getSecs(current_time) / kSecondsInDay;
return 0 == cache_->DaysBeforeExchange(days);
}
@@ -865,8 +1023,7 @@ uint32_t PolicyManagerImpl::NextRetryTimeout() {
}
for (uint32_t i = 0u; i < retry_sequence_index_; ++i) {
- next += retry_sequence_seconds_[i] *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next += retry_sequence_seconds_[i] * date_time::MILLISECONDS_IN_SECOND;
next += retry_sequence_timeout_;
}
++retry_sequence_index_;
@@ -1052,19 +1209,12 @@ StatusNotifier PolicyManagerImpl::AddApplication(
sync_primitives::AutoLock lock(apps_registration_lock_);
if (IsNewApplication(application_id)) {
AddNewApplication(application_id, device_consent);
- return utils::MakeShared<CallStatusChange>(update_status_manager_,
- device_consent);
- } else {
- PromoteExistedApplication(application_id, device_consent);
- const policy_table::AppHMIType type = policy_table::AHT_NAVIGATION;
- if (helpers::in_range(hmi_types,
- (rpc::Enum<policy_table::AppHMIType>)type) &&
- !HasCertificate()) {
- LOG4CXX_DEBUG(logger_, "Certificate does not exist, scheduling update.");
- update_status_manager_.ScheduleUpdate();
- }
- return utils::MakeShared<utils::CallNothing>();
+ return std::make_shared<CallStatusChange>(update_status_manager_,
+ device_consent);
}
+ PromoteExistedApplication(application_id, device_consent);
+ update_status_manager_.OnExistedApplicationAdded(cache_->UpdateRequired());
+ return std::make_shared<utils::CallNothing>();
}
void PolicyManagerImpl::RemoveAppConsentForGroup(
@@ -1087,6 +1237,7 @@ void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
void PolicyManagerImpl::PromoteExistedApplication(
const std::string& application_id, DeviceConsent device_consent) {
+ LOG4CXX_AUTO_TRACE(logger_);
// If device consent changed to allowed during application being
// disconnected, app permissions should be changed also
if (kDeviceAllowed == device_consent &&
@@ -1139,7 +1290,10 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
const bool ret = cache_->Init(file_name, settings);
if (ret) {
RefreshRetrySequence();
- update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
+ const std::string certificate_data = cache_->GetCertificate();
+ if (!certificate_data.empty()) {
+ listener_->OnCertificateUpdated(certificate_data);
+ }
}
return ret;
}
@@ -1154,7 +1308,7 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) {
void PolicyManagerImpl::set_cache_manager(
CacheManagerInterface* cache_manager) {
- cache_ = cache_manager;
+ cache_ = std::shared_ptr<CacheManagerInterface>(cache_manager);
}
void PolicyManagerImpl::RetrySequence() {
@@ -1174,7 +1328,6 @@ void PolicyManagerImpl::RetrySequence() {
timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic);
}
-#ifdef SDL_REMOTE_CONTROL
void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
const std::vector<int>& hmi_types) {
LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
@@ -1277,9 +1430,8 @@ bool PolicyManagerImpl::GetModuleTypes(
}
void PolicyManagerImpl::set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) {
+ std::shared_ptr<AccessRemote> access_remote) {
access_remote_ = access_remote;
}
-#endif // SDL_REMOTE_CONTROL
} // namespace policy
diff --git a/src/components/policy/policy_regular/src/policy_table.cc b/src/components/policy/policy_regular/src/policy_table.cc
index c5c6e3e132..b0fa5739da 100644
--- a/src/components/policy/policy_regular/src/policy_table.cc
+++ b/src/components/policy/policy_regular/src/policy_table.cc
@@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
PolicyTable::PolicyTable() : pt_data_(new SQLPTRepresentation()) {}
-PolicyTable::PolicyTable(utils::SharedPtr<PTRepresentation> pt_data)
+PolicyTable::PolicyTable(std::shared_ptr<PTRepresentation> pt_data)
: pt_data_(pt_data) {}
PolicyTable::~PolicyTable() {
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 34d12420d8..428e18d0bd 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -15,6 +15,8 @@ bool IsValidEnum(Priority val) {
return true;
case P_NORMAL:
return true;
+ case P_PROJECTION:
+ return true;
case P_NONE:
return true;
default:
@@ -33,6 +35,8 @@ const char* EnumToJsonString(Priority val) {
return "COMMUNICATION";
case P_NORMAL:
return "NORMAL";
+ case P_PROJECTION:
+ return "PROJECTION";
case P_NONE:
return "NONE";
default:
@@ -55,6 +59,9 @@ bool EnumFromJsonString(const std::string& literal, Priority* result) {
} else if ("NORMAL" == literal) {
*result = P_NORMAL;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = P_PROJECTION;
+ return true;
} else if ("NONE" == literal) {
*result = P_NONE;
return true;
@@ -119,6 +126,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_EXTERNALTEMPERATURE:
return true;
+ case P_TURNSIGNAL:
+ return true;
case P_FUELLEVEL:
return true;
case P_FUELLEVEL_STATE:
@@ -127,6 +136,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_INSTANTFUELCONSUMPTION:
return true;
+ case P_FUELRANGE:
+ return true;
case P_ODOMETER:
return true;
case P_TIREPRESSURE:
@@ -139,6 +150,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_BELTSTATUS:
return true;
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return true;
case P_DRIVERBRAKING:
return true;
case P_PRNDL:
@@ -147,6 +160,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_STEERINGWHEELANGLE:
return true;
+ case P_ENGINEOILLIFE:
+ return true;
case P_MYKEY:
return true;
case P_AIRBAGSTATUS:
@@ -177,6 +192,8 @@ const char* EnumToJsonString(Parameter val) {
return "engineTorque";
case P_EXTERNALTEMPERATURE:
return "externalTemperature";
+ case P_TURNSIGNAL:
+ return "turnSignal";
case P_FUELLEVEL:
return "fuelLevel";
case P_FUELLEVEL_STATE:
@@ -185,6 +202,8 @@ const char* EnumToJsonString(Parameter val) {
return "headLampStatus";
case P_INSTANTFUELCONSUMPTION:
return "instantFuelConsumption";
+ case P_FUELRANGE:
+ return "fuelRange";
case P_ODOMETER:
return "odometer";
case P_TIREPRESSURE:
@@ -197,6 +216,8 @@ const char* EnumToJsonString(Parameter val) {
return "accPedalPosition";
case P_BELTSTATUS:
return "beltStatus";
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return "electronicParkBrakeStatus";
case P_DRIVERBRAKING:
return "driverBraking";
case P_PRNDL:
@@ -205,6 +226,8 @@ const char* EnumToJsonString(Parameter val) {
return "rpm";
case P_STEERINGWHEELANGLE:
return "steeringWheelAngle";
+ case P_ENGINEOILLIFE:
+ return "engineOilLife";
case P_MYKEY:
return "myKey";
case P_AIRBAGSTATUS:
@@ -239,6 +262,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("externalTemperature" == literal) {
*result = P_EXTERNALTEMPERATURE;
return true;
+ } else if ("turnSignal" == literal) {
+ *result = P_TURNSIGNAL;
+ return true;
} else if ("fuelLevel" == literal) {
*result = P_FUELLEVEL;
return true;
@@ -251,6 +277,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("instantFuelConsumption" == literal) {
*result = P_INSTANTFUELCONSUMPTION;
return true;
+ } else if ("fuelRange" == literal) {
+ *result = P_FUELRANGE;
+ return true;
} else if ("odometer" == literal) {
*result = P_ODOMETER;
return true;
@@ -269,6 +298,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("beltStatus" == literal) {
*result = P_BELTSTATUS;
return true;
+ } else if ("electronicParkBrakeStatus" == literal) {
+ *result = P_ELECTRONICPARKBRAKESTATUS;
+ return true;
} else if ("driverBraking" == literal) {
*result = P_DRIVERBRAKING;
return true;
@@ -281,6 +313,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("steeringWheelAngle" == literal) {
*result = P_STEERINGWHEELANGLE;
return true;
+ } else if ("engineOilLife" == literal) {
+ *result = P_ENGINEOILLIFE;
+ return true;
} else if ("myKey" == literal) {
*result = P_MYKEY;
return true;
@@ -454,6 +489,10 @@ bool IsValidEnum(RequestType val) {
return true;
case RT_FOTA:
return true;
+ case RT_OEM_SPECIFIC:
+ return true;
+ case RT_EMPTY:
+ return true;
default:
return false;
}
@@ -501,6 +540,10 @@ const char* EnumToJsonString(RequestType val) {
return "MEDIA";
case RT_FOTA:
return "FOTA";
+ case RT_OEM_SPECIFIC:
+ return "OEM_SPECIFIC";
+ case RT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -586,18 +629,35 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) {
if ("FOTA" == literal) {
*result = RT_FOTA;
return true;
+ }
+ if ("OEM_SPECIFIC" == literal) {
+ *result = RT_OEM_SPECIFIC;
+ return true;
+ }
+ if ("EMPTY" == literal) {
+ *result = RT_EMPTY;
+ return true;
} else {
return false;
}
}
-#ifdef SDL_REMOTE_CONTROL
bool IsValidEnum(ModuleType val) {
switch (val) {
case MT_CLIMATE:
return true;
case MT_RADIO:
return true;
+ case MT_SEAT:
+ return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
+ case MT_EMPTY:
+ return true;
default:
return false;
}
@@ -608,6 +668,16 @@ const char* EnumToJsonString(ModuleType val) {
return "CLIMATE";
case MT_RADIO:
return "RADIO";
+ case MT_SEAT:
+ return "SEAT";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
+ case MT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -620,11 +690,671 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("RADIO" == literal) {
*result = MT_RADIO;
return true;
- } else {
- return false;
+ } else if ("SEAT" == literal) {
+ *result = MT_SEAT;
+ return true;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
+ } else if ("EMPTY" == literal) {
+ *result = MT_EMPTY;
+ return true;
}
+ return false;
}
-#endif // SDL_REMOTE_CONTROL
+
+bool IsValidEnum(FunctionID val) {
+ switch (val) {
+ case RegisterAppInterfaceID:
+ return true;
+ case UnregisterAppInterfaceID:
+ return true;
+ case SetGlobalPropertiesID:
+ return true;
+ case ResetGlobalPropertiesID:
+ return true;
+ case AddCommandID:
+ return true;
+ case DeleteCommandID:
+ return true;
+ case AddSubMenuID:
+ return true;
+ case DeleteSubMenuID:
+ return true;
+ case CreateInteractionChoiceSetID:
+ return true;
+ case PerformInteractionID:
+ return true;
+ case DeleteInteractionChoiceSetID:
+ return true;
+ case AlertID:
+ return true;
+ case ShowID:
+ return true;
+ case SpeakID:
+ return true;
+ case SetMediaClockTimerID:
+ return true;
+ case PerformAudioPassThruID:
+ return true;
+ case EndAudioPassThruID:
+ return true;
+ case SubscribeButtonID:
+ return true;
+ case UnsubscribeButtonID:
+ return true;
+ case SubscribeVehicleDataID:
+ return true;
+ case UnsubscribeVehicleDataID:
+ return true;
+ case GetVehicleDataID:
+ return true;
+ case ReadDIDID:
+ return true;
+ case GetDTCsID:
+ return true;
+ case ScrollableMessageID:
+ return true;
+ case SliderID:
+ return true;
+ case ShowConstantTBTID:
+ return true;
+ case AlertManeuverID:
+ return true;
+ case UpdateTurnListID:
+ return true;
+ case ChangeRegistrationID:
+ return true;
+ case GenericResponseID:
+ return true;
+ case PutFileID:
+ return true;
+ case DeleteFileID:
+ return true;
+ case ListFilesID:
+ return true;
+ case SetAppIconID:
+ return true;
+ case SetDisplayLayoutID:
+ return true;
+ case DiagnosticMessageID:
+ return true;
+ case SystemRequestID:
+ return true;
+ case SendLocationID:
+ return true;
+ case DialNumberID:
+ return true;
+ case ButtonPressID:
+ return true;
+ case GetInteriorVehicleDataID:
+ return true;
+ case SetInteriorVehicleDataID:
+ return true;
+ case GetWayPointsID:
+ return true;
+ case SubscribeWayPointsID:
+ return true;
+ case UnsubscribeWayPointsID:
+ return true;
+ case GetSystemCapabilityID:
+ return true;
+ case SendHapticDataID:
+ return true;
+ case OnHMIStatusID:
+ return true;
+ case OnAppInterfaceUnregisteredID:
+ return true;
+ case OnButtonEventID:
+ return true;
+ case OnButtonPressID:
+ return true;
+ case OnVehicleDataID:
+ return true;
+ case OnCommandID:
+ return true;
+ case OnTBTClientStateID:
+ return true;
+ case OnDriverDistractionID:
+ return true;
+ case OnPermissionsChangeID:
+ return true;
+ case OnAudioPassThruID:
+ return true;
+ case OnLanguageChangeID:
+ return true;
+ case OnKeyboardInputID:
+ return true;
+ case OnTouchEventID:
+ return true;
+ case OnSystemRequestID:
+ return true;
+ case OnHashChangeID:
+ return true;
+ case OnInteriorVehicleDataID:
+ return true;
+ case OnWayPointChangeID:
+ return true;
+ case OnRCStatusID:
+ return true;
+ case EncodedSyncPDataID:
+ return true;
+ case SyncPDataID:
+ return true;
+ case OnEncodedSyncPDataID:
+ return true;
+ case OnSyncPDataID:
+ return true;
+ default:
+ return false;
+ }
+};
+
+const char* EnumToJsonString(FunctionID val) {
+ switch (val) {
+ case RegisterAppInterfaceID:
+ return "RegisterAppInterface";
+ case UnregisterAppInterfaceID:
+ return "UnregisterAppInterface";
+ case SetGlobalPropertiesID:
+ return "SetGlobalProperties";
+ case ResetGlobalPropertiesID:
+ return "ResetGlobalProperties";
+ case AddCommandID:
+ return "AddCommand";
+ case DeleteCommandID:
+ return "DeleteCommand";
+ case AddSubMenuID:
+ return "AddSubMenu";
+ case DeleteSubMenuID:
+ return "DeleteSubMenu";
+ case CreateInteractionChoiceSetID:
+ return "CreateInteractionChoiceSet";
+ case PerformInteractionID:
+ return "PerformInteraction";
+ case DeleteInteractionChoiceSetID:
+ return "DeleteInteractionChoiceSet";
+ case AlertID:
+ return "Alert";
+ case ShowID:
+ return "Show";
+ case SpeakID:
+ return "Speak";
+ case SetMediaClockTimerID:
+ return "SetMediaClockTimer";
+ case PerformAudioPassThruID:
+ return "PerformAudioPassThru";
+ case EndAudioPassThruID:
+ return "EndAudioPassThru";
+ case SubscribeButtonID:
+ return "SubscribeButton";
+ case UnsubscribeButtonID:
+ return "UnsubscribeButton";
+ case SubscribeVehicleDataID:
+ return "SubscribeVehicleData";
+ case UnsubscribeVehicleDataID:
+ return "UnsubscribeVehicleData";
+ case GetVehicleDataID:
+ return "GetVehicleData";
+ case ReadDIDID:
+ return "ReadDID";
+ case GetDTCsID:
+ return "GetDTCs";
+ case ScrollableMessageID:
+ return "ScrollableMessage";
+ case SliderID:
+ return "Slider";
+ case ShowConstantTBTID:
+ return "ShowConstantTBT";
+ case AlertManeuverID:
+ return "AlertManeuver";
+ case UpdateTurnListID:
+ return "UpdateTurnList";
+ case ChangeRegistrationID:
+ return "ChangeRegistration";
+ case GenericResponseID:
+ return "GenericResponse";
+ case PutFileID:
+ return "PutFile";
+ case DeleteFileID:
+ return "DeleteFile";
+ case ListFilesID:
+ return "ListFiles";
+ case SetAppIconID:
+ return "SetAppIcon";
+ case SetDisplayLayoutID:
+ return "SetDisplayLayout";
+ case DiagnosticMessageID:
+ return "DiagnosticMessage";
+ case SystemRequestID:
+ return "SystemRequest";
+ case SendLocationID:
+ return "SendLocation";
+ case DialNumberID:
+ return "DialNumber";
+ case ButtonPressID:
+ return "ButtonPress";
+ case GetInteriorVehicleDataID:
+ return "GetInteriorVehicleData";
+ case SetInteriorVehicleDataID:
+ return "SetInteriorVehicleData";
+ case GetWayPointsID:
+ return "GetWayPoints";
+ case SubscribeWayPointsID:
+ return "SubscribeWayPoints";
+ case UnsubscribeWayPointsID:
+ return "UnsubscribeWayPoints";
+ case GetSystemCapabilityID:
+ return "GetSystemCapability";
+ case SendHapticDataID:
+ return "SendHapticData";
+ case OnHMIStatusID:
+ return "OnHMIStatus";
+ case OnAppInterfaceUnregisteredID:
+ return "OnAppInterfaceUnregistered";
+ case OnButtonEventID:
+ return "OnButtonEvent";
+ case OnButtonPressID:
+ return "OnButtonPress";
+ case OnVehicleDataID:
+ return "OnVehicleData";
+ case OnCommandID:
+ return "OnCommand";
+ case OnTBTClientStateID:
+ return "OnTBTClientState";
+ case OnDriverDistractionID:
+ return "OnDriverDistraction";
+ case OnPermissionsChangeID:
+ return "OnPermissionsChange";
+ case OnAudioPassThruID:
+ return "OnAudioPassThru";
+ case OnLanguageChangeID:
+ return "OnLanguageChange";
+ case OnKeyboardInputID:
+ return "OnKeyboardInput";
+ case OnTouchEventID:
+ return "OnTouchEvent";
+ case OnSystemRequestID:
+ return "OnSystemRequest";
+ case OnHashChangeID:
+ return "OnHashChange";
+ case OnInteriorVehicleDataID:
+ return "OnInteriorVehicleData";
+ case OnWayPointChangeID:
+ return "OnWayPointChange";
+ case OnRCStatusID:
+ return "OnRCStatus";
+ case EncodedSyncPDataID:
+ return "EncodedSyncPData";
+ case SyncPDataID:
+ return "SyncPData";
+ case OnEncodedSyncPDataID:
+ return "OnEncodedSyncPData";
+ case OnSyncPDataID:
+ return "OnSyncPData";
+ default:
+ return "";
+ }
+};
+
+bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
+ if ("RegisterAppInterface" == literal) {
+ *result = RegisterAppInterfaceID;
+ return true;
+ }
+
+ if ("UnregisterAppInterface" == literal) {
+ *result = UnregisterAppInterfaceID;
+ return true;
+ }
+
+ if ("SetGlobalProperties" == literal) {
+ *result = SetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("ResetGlobalProperties" == literal) {
+ *result = ResetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("AddCommand" == literal) {
+ *result = AddCommandID;
+ return true;
+ }
+
+ if ("DeleteCommand" == literal) {
+ *result = DeleteCommandID;
+ return true;
+ }
+
+ if ("AddSubMenu" == literal) {
+ *result = AddSubMenuID;
+ return true;
+ }
+
+ if ("DeleteSubMenu" == literal) {
+ *result = DeleteSubMenuID;
+ return true;
+ }
+
+ if ("CreateInteractionChoiceSet" == literal) {
+ *result = CreateInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("PerformInteraction" == literal) {
+ *result = PerformInteractionID;
+ return true;
+ }
+
+ if ("DeleteInteractionChoiceSet" == literal) {
+ *result = DeleteInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("Alert" == literal) {
+ *result = AlertID;
+ return true;
+ }
+
+ if ("Show" == literal) {
+ *result = ShowID;
+ return true;
+ }
+
+ if ("Speak" == literal) {
+ *result = SpeakID;
+ return true;
+ }
+
+ if ("SetMediaClockTimer" == literal) {
+ *result = SetMediaClockTimerID;
+ return true;
+ }
+
+ if ("PerformAudioPassThru" == literal) {
+ *result = PerformAudioPassThruID;
+ return true;
+ }
+
+ if ("EndAudioPassThru" == literal) {
+ *result = EndAudioPassThruID;
+ return true;
+ }
+
+ if ("SubscribeButton" == literal) {
+ *result = SubscribeButtonID;
+ return true;
+ }
+
+ if ("UnsubscribeButton" == literal) {
+ *result = UnsubscribeButtonID;
+ return true;
+ }
+
+ if ("SubscribeVehicleData" == literal) {
+ *result = SubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("UnsubscribeVehicleData" == literal) {
+ *result = UnsubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("GetVehicleData" == literal) {
+ *result = GetVehicleDataID;
+ return true;
+ }
+
+ if ("ReadDID" == literal) {
+ *result = ReadDIDID;
+ return true;
+ }
+
+ if ("GetDTCs" == literal) {
+ *result = GetDTCsID;
+ return true;
+ }
+
+ if ("ScrollableMessage" == literal) {
+ *result = ScrollableMessageID;
+ return true;
+ }
+
+ if ("Slider" == literal) {
+ *result = SliderID;
+ return true;
+ }
+
+ if ("ShowConstantTBT" == literal) {
+ *result = ShowConstantTBTID;
+ return true;
+ }
+
+ if ("AlertManeuver" == literal) {
+ *result = AlertManeuverID;
+ return true;
+ }
+
+ if ("UpdateTurnList" == literal) {
+ *result = UpdateTurnListID;
+ return true;
+ }
+
+ if ("ChangeRegistration" == literal) {
+ *result = ChangeRegistrationID;
+ return true;
+ }
+
+ if ("GenericResponse" == literal) {
+ *result = GenericResponseID;
+ return true;
+ }
+
+ if ("PutFile" == literal) {
+ *result = PutFileID;
+ return true;
+ }
+
+ if ("DeleteFile" == literal) {
+ *result = DeleteFileID;
+ return true;
+ }
+
+ if ("ListFiles" == literal) {
+ *result = ListFilesID;
+ return true;
+ }
+
+ if ("SetAppIcon" == literal) {
+ *result = SetAppIconID;
+ return true;
+ }
+
+ if ("SetDisplayLayout" == literal) {
+ *result = SetDisplayLayoutID;
+ return true;
+ }
+
+ if ("DiagnosticMessage" == literal) {
+ *result = DiagnosticMessageID;
+ return true;
+ }
+
+ if ("SystemRequest" == literal) {
+ *result = SystemRequestID;
+ return true;
+ }
+
+ if ("SendLocation" == literal) {
+ *result = SendLocationID;
+ return true;
+ }
+
+ if ("DialNumber" == literal) {
+ *result = DialNumberID;
+ return true;
+ }
+
+ if ("ButtonPress" == literal) {
+ *result = ButtonPressID;
+ return true;
+ }
+
+ if ("GetInteriorVehicleData" == literal) {
+ *result = GetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("SetInteriorVehicleData" == literal) {
+ *result = SetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("GetWayPoints" == literal) {
+ *result = GetWayPointsID;
+ return true;
+ }
+
+ if ("SubscribeWayPoints" == literal) {
+ *result = SubscribeWayPointsID;
+ return true;
+ }
+
+ if ("UnsubscribeWayPoints" == literal) {
+ *result = UnsubscribeWayPointsID;
+ return true;
+ }
+
+ if ("GetSystemCapability" == literal) {
+ *result = GetSystemCapabilityID;
+ return true;
+ }
+
+ if ("SendHapticData" == literal) {
+ *result = SendHapticDataID;
+ return true;
+ }
+
+ if ("OnHMIStatus" == literal) {
+ *result = OnHMIStatusID;
+ return true;
+ }
+
+ if ("OnAppInterfaceUnregistered" == literal) {
+ *result = OnAppInterfaceUnregisteredID;
+ return true;
+ }
+
+ if ("OnButtonEvent" == literal) {
+ *result = OnButtonEventID;
+ return true;
+ }
+
+ if ("OnButtonPress" == literal) {
+ *result = OnButtonPressID;
+ return true;
+ }
+
+ if ("OnVehicleData" == literal) {
+ *result = OnVehicleDataID;
+ return true;
+ }
+
+ if ("OnCommand" == literal) {
+ *result = OnCommandID;
+ return true;
+ }
+
+ if ("OnTBTClientState" == literal) {
+ *result = OnTBTClientStateID;
+ return true;
+ }
+
+ if ("OnDriverDistraction" == literal) {
+ *result = OnDriverDistractionID;
+ return true;
+ }
+
+ if ("OnPermissionsChange" == literal) {
+ *result = OnPermissionsChangeID;
+ return true;
+ }
+
+ if ("OnAudioPassThru" == literal) {
+ *result = OnAudioPassThruID;
+ return true;
+ }
+
+ if ("OnLanguageChange" == literal) {
+ *result = OnLanguageChangeID;
+ return true;
+ }
+
+ if ("OnKeyboardInput" == literal) {
+ *result = OnKeyboardInputID;
+ return true;
+ }
+
+ if ("OnTouchEvent" == literal) {
+ *result = OnTouchEventID;
+ return true;
+ }
+
+ if ("OnSystemRequest" == literal) {
+ *result = OnSystemRequestID;
+ return true;
+ }
+
+ if ("OnHashChange" == literal) {
+ *result = OnHashChangeID;
+ return true;
+ }
+
+ if ("OnInteriorVehicleData" == literal) {
+ *result = OnInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("OnWayPointChange" == literal) {
+ *result = OnWayPointChangeID;
+ return true;
+ }
+
+ if ("OnRCStatus" == literal) {
+ *result = OnRCStatusID;
+ return true;
+ }
+
+ if ("EncodedSyncPData" == literal) {
+ *result = EncodedSyncPDataID;
+ return true;
+ }
+
+ if ("SyncPData" == literal) {
+ *result = SyncPDataID;
+ return true;
+ }
+
+ if ("OnEncodedSyncPData" == literal) {
+ *result = OnEncodedSyncPDataID;
+ return true;
+ }
+
+ if ("OnSyncPData" == literal) {
+ *result = OnSyncPDataID;
+ return true;
+ }
+ return false;
+};
const std::string kDefaultApp = "default";
const std::string kPreDataConsentApp = "pre_DataConsent";
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 5f6f85f5dd..851ed1bd18 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -164,14 +164,11 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, nicknames(impl::ValueMember(value__, "nicknames"))
, AppHMIType(impl::ValueMember(value__, "AppHMIType"))
, RequestType(impl::ValueMember(value__, "RequestType"))
+ , RequestSubType(impl::ValueMember(value__, "RequestSubType"))
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
, heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
, certificate(impl::ValueMember(value__, "certificate"), "not_specified")
-#ifdef SDL_REMOTE_CONTROL
- , moduleType(impl::ValueMember(value__, "moduleType"))
-#endif // SDL_REMOTE_CONTROL
-{
-}
+ , moduleType(impl::ValueMember(value__, "moduleType")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -179,17 +176,17 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField("nicknames", nicknames, &result__);
impl::WriteJsonField("AppHMIType", AppHMIType, &result__);
impl::WriteJsonField("RequestType", RequestType, &result__);
+ impl::WriteJsonField("RequestSubType", RequestSubType, &result__);
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
-#ifdef SDL_REMOTE_CONTROL
impl::WriteJsonField("moduleType", moduleType, &result__);
-#endif // SDL_REMOTE_CONTROL
return result__;
}
bool ApplicationParams::is_valid() const {
- // RequestType is not validated since there is high-level validation logic,
+ // RequestType and RequestSubType are not validated since there is high-level
+ // validation logic,
// which takes into account information not available here.
if (!PolicyBase::is_valid()) {
return false;
@@ -212,11 +209,9 @@ bool ApplicationParams::is_valid() const {
if (!certificate.is_valid()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return Validate();
}
@@ -240,6 +235,9 @@ bool ApplicationParams::struct_empty() const {
if (RequestType.is_initialized()) {
return false;
}
+ if (RequestSubType.is_initialized()) {
+ return false;
+ }
if (memory_kb.is_initialized()) {
return false;
}
@@ -249,11 +247,9 @@ bool ApplicationParams::struct_empty() const {
if (certificate.is_initialized()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (moduleType.is_initialized()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return true;
}
@@ -273,6 +269,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!RequestType.is_valid()) {
RequestType.ReportErrors(&report__->ReportSubobject("RequestType"));
}
+ if (!RequestSubType.is_valid()) {
+ RequestSubType.ReportErrors(&report__->ReportSubobject("RequestSubType"));
+ }
if (!priority.is_valid()) {
priority.ReportErrors(&report__->ReportSubobject("priority"));
}
@@ -286,11 +285,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!certificate.is_valid()) {
certificate.ReportErrors(&report__->ReportSubobject("certificate"));
}
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
}
-#endif // SDL_REMOTE_CONTROL
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -298,12 +295,11 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
groups.SetPolicyTableType(pt_type);
AppHMIType.SetPolicyTableType(pt_type);
RequestType.SetPolicyTableType(pt_type);
+ RequestSubType.SetPolicyTableType(pt_type);
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
-#ifdef SDL_REMOTE_CONTROL
moduleType.SetPolicyTableType(pt_type);
-#endif // SDL_REMOTE_CONTROL
}
// RpcParameters methods
@@ -459,6 +455,7 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, device_certificates(impl::ValueMember(value__, "device_certificates"))
, preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
+ , full_app_id_supported(impl::ValueMember(value__, "full_app_id_supported"))
, exchange_after_x_ignition_cycles(
impl::ValueMember(value__, "exchange_after_x_ignition_cycles"))
, exchange_after_x_kilometers(
@@ -498,6 +495,8 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
Json::Value ModuleConfig::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField(
+ "full_app_id_supported", full_app_id_supported, &result__);
impl::WriteJsonField("exchange_after_x_ignition_cycles",
exchange_after_x_ignition_cycles,
&result__);
@@ -525,6 +524,9 @@ bool ModuleConfig::is_valid() const {
if (!preloaded_pt.is_valid()) {
return false;
}
+ if (!full_app_id_supported.is_valid()) {
+ return false;
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
return false;
}
@@ -572,6 +574,9 @@ bool ModuleConfig::struct_empty() const {
if (preloaded_pt.is_initialized()) {
return false;
}
+ if (full_app_id_supported.is_initialized()) {
+ return false;
+ }
if (exchange_after_x_ignition_cycles.is_initialized()) {
return false;
@@ -621,6 +626,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (!preloaded_pt.is_valid()) {
preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
}
+ if (!full_app_id_supported.is_valid()) {
+ full_app_id_supported.ReportErrors(
+ &report__->ReportSubobject("full_app_id_supported"));
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
exchange_after_x_ignition_cycles.ReportErrors(
&report__->ReportSubobject("exchange_after_x_ignition_cycles"));
@@ -679,6 +688,7 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
CompositeType::SetPolicyTableType(pt_type);
preloaded_pt.SetPolicyTableType(pt_type);
+ full_app_id_supported.SetPolicyTableType(pt_type);
exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
exchange_after_x_kilometers.SetPolicyTableType(pt_type);
exchange_after_x_days.SetPolicyTableType(pt_type);
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 10b8e4bf7c..714dfaae5a 100644
--- a/src/components/policy/policy_regular/src/policy_table/validation.cc
+++ b/src/components/policy/policy_regular/src/policy_table/validation.cc
@@ -40,11 +40,12 @@ bool ApplicationPoliciesSection::Validate() const {
return false;
}
- PolicyTableType pt_type = GetPolicyTableType();
+ const PolicyTableType pt_type = GetPolicyTableType();
if (PT_PRELOADED != pt_type && PT_UPDATE != pt_type) {
return true;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request Types...");
if (!it_default_policy->second.RequestType.is_valid()) {
LOG4CXX_WARN(logger_,
"Default policy RequestTypes are not valid. Will be cleaned.");
@@ -65,10 +66,15 @@ bool ApplicationPoliciesSection::Validate() const {
ApplicationPolicies::iterator end_iter = apps.end();
while (iter != end_iter) {
+ if (it_default_policy == iter || it_pre_data_policy == iter) {
+ ++iter;
+ continue;
+ }
ApplicationParams& app_params = (*iter).second;
- bool is_request_type_omitted = !app_params.RequestType.is_initialized();
- bool is_request_type_valid = app_params.RequestType.is_valid();
- bool is_request_type_empty = app_params.RequestType->empty();
+ const bool is_request_type_omitted =
+ !app_params.RequestType.is_initialized();
+ const bool is_request_type_valid = app_params.RequestType.is_valid();
+ const bool is_request_type_empty = app_params.RequestType->empty();
if (PT_PRELOADED == pt_type) {
if (!is_request_type_valid) {
@@ -111,10 +117,36 @@ bool ApplicationPoliciesSection::Validate() const {
++iter;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request SubTypes...");
+ iter = apps.begin();
+ while (iter != end_iter) {
+ if (it_default_policy == iter || it_pre_data_policy == iter) {
+ ++iter;
+ continue;
+ }
+ ApplicationParams& app_params = (*iter).second;
+ const bool is_request_subtype_omitted =
+ !app_params.RequestSubType.is_initialized();
+
+ if (is_request_subtype_omitted) {
+ LOG4CXX_WARN(logger_,
+ "App policy RequestSubTypes omitted."
+ " Will be replaced with default.");
+ app_params.RequestSubType = apps[kDefaultApp].RequestSubType;
+ ++iter;
+ continue;
+ }
+
+ const bool is_request_subtype_empty = app_params.RequestSubType->empty();
+ if (is_request_subtype_empty) {
+ LOG4CXX_WARN(logger_, "App policy RequestSubTypes empty.");
+ }
+ ++iter;
+ }
+
return true;
}
-#ifdef SDL_REMOTE_CONTROL
bool ApplicationParams::ValidateModuleTypes() const {
// moduleType is optional so see Optional<T>::is_valid()
bool is_initialized = moduleType->is_initialized();
@@ -148,11 +180,6 @@ bool ApplicationParams::ValidateModuleTypes() const {
bool ApplicationParams::Validate() const {
return ValidateModuleTypes();
}
-#else // SDL_REMOTE_CONTROL
-bool ApplicationParams::Validate() const {
- return true;
-}
-#endif // SDL_REMOTE_CONTROL
bool RpcParameters::Validate() const {
return true;
diff --git a/src/components/policy/policy_regular/src/sql_pt_ext_queries.cc b/src/components/policy/policy_regular/src/sql_pt_ext_queries.cc
deleted file mode 100644
index 3fde462a32..0000000000
--- a/src/components/policy/policy_regular/src/sql_pt_ext_queries.cc
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- Copyright (c) 2013, " Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, " with or without
- modification, " are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, " this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice, "
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
- CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
- CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "policy/sql_pt_ext_queries.h"
-
-namespace policy {
-namespace sql_pt_ext {
-
-const std::string kSelectKeepContext =
- "SELECT `keep_context` FROM `application` WHERE `id` = ? LIMIT 1";
-
-const std::string kSelectStealFocus =
- "SELECT `steal_focus` FROM `application` WHERE `id` = ? LIMIT 1";
-
-const std::string kSelectDefaultHmi =
- "SELECT `default_hmi` FROM `application` WHERE `id` = ? LIMIT 1";
-
-const std::string kResetDeviceConsents = "DELETE FROM `device_consent_group`";
-
-const std::string kResetAppConsents = "DELETE FROM `consent_group`";
-
-const std::string kCountDeviceConsentGroup =
- "SELECT COUNT (`device_id`) "
- "FROM `device_consent_group` WHERE `device_id` = ?";
-
-const std::string kCountDevice =
- "SELECT COUNT (`id`) "
- "FROM `device` WHERE `id` = ?";
-
-const std::string kSelectDeviceConsentedGroup =
- "SELECT * FROM `device_consent_group` WHERE `device_id` = ?";
-
-const std::string kUpdateDeviceConsentedGroup =
- "UPDATE `device_consent_group` SET `is_consented` = ?, `input` = ? WHERE "
- "(`device_id` = ? AND `functional_group_id` = ?)";
-
-const std::string kUpdateDevice =
- "UPDATE `device` SET `hardware` = ?, `firmware_rev` = ?, `os` = ?, "
- "`os_version` = ?, `carrier` = ?, `max_number_rfcom_ports` = ?, "
- " `connection_type` = ? WHERE `id` = ? ";
-
-const std::string kInsertDeviceConsentedGroup =
- "INSERT OR REPLACE INTO `device_consent_group` "
- "(`device_id`, `functional_group_id`, `is_consented`, `input`, "
- "`time_stamp`) "
- "VALUES (?,?,?,?,?)";
-
-const std::string kInsertDevice =
- "INSERT OR IGNORE INTO `device` "
- "(`id`, `hardware`, `firmware_rev`, `os`, `os_version`, `carrier`,"
- "`max_number_rfcom_ports`, `connection_type`) "
- "VALUES (?,?,?,?,?,?,?,?)";
-
-const std::string kSelectDeviceData = "SELECT * FROM `device`";
-
-const std::string kSelectConsentGroup =
- "SELECT * FROM `consent_group` WHERE `device_id` = ? ";
-
-const std::string kInsertPreconsentedGroups =
- "INSERT INTO `preconsented_group` (`application_id`, `functional_group_id`)"
- " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
-
-const std::string kSelectPreconsentedGroups =
- "SELECT `f`.`name` FROM `preconsented_group` AS `p`"
- " LEFT JOIN `functional_group` AS `f` "
- " ON (`f`.`id` = `p`.`functional_group_id`)"
- " WHERE `p`.`application_id` = ?";
-
-const std::string kDeletePreconsentedGroups =
- "DELETE FROM `preconsented_group`";
-
-const std::string kSelectUsageAndErrorCount =
- "SELECT `count_of_iap_buffer_full`, `count_sync_out_of_memory`, "
- " `count_of_sync_reboots` "
- "FROM `usage_and_error_count` LIMIT 1";
-
-const std::string kSelectAppLevels =
- "SELECT `application_id`, `minutes_in_hmi_full`, `minutes_in_hmi_limited`, "
- " `minutes_in_hmi_background`, `minutes_in_hmi_none`, "
- " `count_of_user_selections`, "
- " `count_of_rejections_sync_out_of_memory`, "
- " `count_of_rejections_nickname_mismatch`, "
- " `count_of_rejections_duplicate_name`, "
- " `count_of_rejected_rpcs_calls`, "
- " `count_of_rpcs_sent_in_hmi_none`, "
- " `count_of_removals_for_bad_behavior`, "
- " `count_of_run_attempts_while_revoked`, "
- " `app_registration_language_gui`, "
- " `app_registration_language_vui`, "
- " `count_of_tls_errors` "
- "FROM `app_level`";
-
-const std::string kUpdateGlobalCounters =
- "UPDATE `usage_and_error_count` SET "
- "`count_of_iap_buffer_full` = ?, "
- "`count_sync_out_of_memory` = ?, "
- "`count_of_sync_reboots` = ? ";
-
-const std::string kInsertDeviceData =
- "INSERT OR IGNORE INTO `device` "
- "(`id`, `hardware`, `firmware_rev`, `os`, `os_version`, `carrier`, "
- "`max_number_rfcom_ports`,`connection_type`) VALUES (?,?,?,?,?,?,?,?) ";
-
-const std::string kInsertConsentGroups =
- "INSERT OR REPLACE INTO `consent_group` "
- "(`device_id`, `application_id`, `functional_group_id`, `is_consented`, "
- "`input`, `time_stamp`) "
- "VALUES (?,?,?,?,?,?)";
-
-const std::string kDeleteAppGroupConsent =
- "DELETE FROM `consent_group` WHERE "
- "`application_id` = ? AND `functional_group_id` = ? ";
-
-const std::string kSelectGroupId =
- "SELECT `id` FROM `functional_group` WHERE `name` = ? ";
-
-const std::string kCountUnconsentedGroups =
- "SELECT COUNT(`a`.`functional_group_id`) FROM `app_group` AS `a` "
- " WHERE `a`.`application_id` = ? AND NOT EXISTS "
- " (SELECT NULL FROM `preconsented_group` AS `p` WHERE "
- " (`p`.`functional_group_id` = `a`.`functional_group_id` AND "
- " `p`.`application_id` = `a`.`application_id`)) "
- " AND NOT EXISTS (SELECT NULL FROM `consent_group` AS `c` "
- " WHERE (`c`.`application_id` = `a`.`application_id` "
- " AND `c`.`functional_group_id` = `a`.`functional_group_id` "
- " AND `c`.`device_id` = ?)) AND NOT EXISTS "
- " (SELECT NULL FROM `app_group` AS `def` WHERE "
- " (`def`.`application_id` = ? OR "
- " `def`.`application_id` = ?) "
- " AND `def`.`functional_group_id` = `a`.`functional_group_id`)"
- " AND NOT EXISTS (SELECT NULL FROM `functional_group` AS `f` "
- " WHERE (`a`.`functional_group_id` = `f`.`id`"
- " AND`f`.`user_consent_prompt` IS NULL))";
-
-const std::string kSelectModuleMeta = "SELECT* FROM `module_meta`";
-
-const std::string kUpdateMetaParams =
- "UPDATE `module_meta` SET "
- "`ccpu_version` = ?, `wers_country_code` = ?, `language` = ? ";
-
-const std::string kUpdateModuleMetaVinParam =
- "UPDATE `module_meta` SET `vin` = ? ";
-
-const std::string kSaveModuleMeta =
- "UPDATE `module_meta` SET `ccpu_version` = ?, `language` = ?,"
- "`wers_country_code` = ?, `pt_exchanged_at_odometer_x` = ?,"
- "`pt_exchanged_x_days_after_epoch` = ?,"
- "`ignition_cycles_since_last_exchange` = ?, `vin` = ?";
-
-const std::string kSelectMetaParams =
- "SELECT `ccpu_version`, "
- "`wers_country_code`, `language` from `module_meta`";
-
-const std::string kUpdateMetaLanguage =
- "UPDATE `module_meta` SET `language` = ? ";
-
-const std::string kCountAppLevel =
- "SELECT COUNT(`application_id`) FROM `app_level`"
- " WHERE `application_id` = ? ";
-
-const std::string kUpdateGroupPermissions =
- "UPDATE `consent_group` "
- "SET `is_consented` = ?, `input` = ? "
- "WHERE(`application_id` = ? AND `functional_group_id` = ? AND `device_id` "
- "= ?) ";
-
-const std::string kInsertApplication =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, `steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `memory_kb`, "
- " `heart_beat_timeout_ms`, `certificate`) VALUES( ?, ?, ?, ?, ?, ?, ?, ?, "
- "?) ";
-
-const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
-
-const std::string kSelectFriendlyMsg =
- "SELECT `tts`, `label`, `line1`, `line2`, `textBody` FROM `message` "
- "WHERE `message_type_name` = ? AND `language_code` = ? LIMIT 1";
-
-const std::string kSelectAppGroupsId =
- "SELECT `functional_group_id` "
- "FROM `app_group` WHERE `application_id` = ? ";
-
-const std::string kSelectConsentedGroupsId =
- "SELECT `functional_group_id`, `is_consented` "
- "FROM `consent_group` WHERE(`application_id` = ? AND `device_id` = ?) ";
-
-const std::string kCountAppConsents =
- "SELECT COUNT(*) from `consent_group`"
- "WHERE(`device_id` = ? AND `application_id` = ? AND "
- "`functional_group_id` = ?) ";
-
-const std::string kSelectPreconsentedGroupsId =
- "SELECT `functional_group_id` "
- "FROM `preconsented_group` WHERE `application_id` = ? ";
-
-const std::string kSelectAppPolicies =
- "SELECT `id`, `priority_value`, `default_hmi`, `keep_context`, "
- "`steal_focus`, "
- " `memory_kb`, `heart_beat_timeout_ms`, `certificate` FROM `application`";
-
-const std::string kSelectFunctionalGroupNames =
- "SELECT `id`, `user_consent_prompt`, `name`"
- " FROM `functional_group`";
-
-const std::string kDeleteDeviceConsent =
- "DELETE FROM `device_consent_group` "
- "WHERE `device_id` = ? ";
-
-const std::string kDeleteAppConsent =
- "DELETE FROM `consent_group` "
- "WHERE `device_id` = ? ";
-
-const std::string kSelectApplicationIsPreData =
- "SELECT `is_predata` FROM `application` WHERE `id` = ? ";
-
-const std::string kUpdateIsPredata =
- "UPDATE `application` SET `is_predata` = ? WHERE `id` = ? ";
-
-const std::string kHasAppPreloadedGroups =
- "SELECT COUNT(`a1`.`functional_group_id`) FROM `app_group` "
- " AS `a1` JOIN `app_group` AS `a2` "
- " ON `a1`.`functional_group_id` = `a2`.`functional_group_id` "
- " WHERE `a1`.`application_id` = ? AND `a2`.`application_id` = ? ";
-
-const std::string kUpdateUnpairedDevice =
- "UPDATE `device` SET `unpaired` = ? WHERE `id` = ? ";
-
-const std::string kSelectUnpairedDevices =
- "SELECT `id` FROM `device` WHERE `unpaired` = 1";
-
-const std::string kHasMsgLanguageCode =
- "SELECT COUNT (`id`) FROM message "
- "WHERE `message_type_name` = ? AND `language_code` = ? ";
-
-const std::string kDeletePreconsentedGroupsByApplicationId =
- "DELETE FROM `preconsented_group` WHERE `application_id` = ?";
-
-} // namespace sql_pt_ext
-} // namespace policy
diff --git a/src/components/policy/policy_regular/src/sql_pt_ext_representation.cc b/src/components/policy/policy_regular/src/sql_pt_ext_representation.cc
deleted file mode 100644
index c64efaaede..0000000000
--- a/src/components/policy/policy_regular/src/sql_pt_ext_representation.cc
+++ /dev/null
@@ -1,1807 +0,0 @@
-/*
- Copyright (c) 2015, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include <algorithm>
-#include <utility>
-#include "utils/logger.h"
-#include "policy/sql_pt_ext_representation.h"
-#include "policy/sql_wrapper.h"
-#include "policy/sql_pt_queries.h"
-#include "policy/sql_pt_ext_queries.h"
-#include "policy/policy_helper.h"
-#include "policy/cache_manager.h"
-
-namespace policy {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
-
-bool SQLPTExtRepresentation::CanAppKeepContext(const std::string& app_id) {
- utils::dbms::SQLQuery query(db());
- if (query.Prepare(sql_pt_ext::kSelectKeepContext)) {
- query.Bind(0, app_id);
- if (query.Exec()) {
- return query.GetBoolean(0);
- }
- }
- return false;
-}
-
-bool SQLPTExtRepresentation::CanAppStealFocus(const std::string& app_id) {
- utils::dbms::SQLQuery query(db());
- if (query.Prepare(sql_pt_ext::kSelectStealFocus)) {
- query.Bind(0, app_id);
- if (query.Exec()) {
- return query.GetBoolean(0);
- }
- }
- return false;
-}
-
-bool SQLPTExtRepresentation::ResetUserConsent() {
- return ResetDeviceConsents() && ResetAppConsents();
-}
-
-bool SQLPTExtRepresentation::ResetDeviceConsents() {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kResetDeviceConsents)) {
- LOG4CXX_WARN(logger_, "Incorrect delete statement from device_consents.");
- return false;
- }
- return query.Exec();
-}
-
-bool SQLPTExtRepresentation::ResetAppConsents() {
- return utils::dbms::SQLQuery(db()).Exec(sql_pt_ext::kResetAppConsents);
-}
-
-bool SQLPTExtRepresentation::GetUserPermissionsForDevice(
- const std::string& device_id,
- StringArray* consented_groups,
- StringArray* disallowed_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectDeviceConsentedGroup)) {
- LOG4CXX_WARN(logger_, "Incorrect select from device consented groups");
- return false;
- }
- query.Bind(0, device_id);
- while (query.Next()) {
- if (query.GetBoolean(2)) {
- if (!consented_groups) {
- continue;
- }
- consented_groups->push_back(query.GetString(1));
- } else {
- if (!disallowed_groups) {
- continue;
- }
- disallowed_groups->push_back(query.GetString(1));
- }
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::GetPermissionsForApp(
- const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalIdType* group_types) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!group_types) {
- LOG4CXX_WARN(logger_, "Input parameter for group types is null.");
- return false;
- }
- // Get all app groups for specified device and application
- FunctionalGroupIDs all_groups;
- if (!GetAllAppGroups(policy_app_id, all_groups)) {
- return false;
- }
- // Get preconsented group
- FunctionalGroupIDs preconsented_groups;
- if (!GetPreconsentedGroups(policy_app_id, preconsented_groups)) {
- return false;
- }
- // Get consented (allowed/disallowed) groups
- FunctionalGroupIDs allowed_groups;
- FunctionalGroupIDs disallowed_groups;
- if (!GetConsentedGroups(
- policy_app_id, device_id, allowed_groups, disallowed_groups)) {
- return false;
- }
- // Get all default groups
- FunctionalGroupIDs default_groups;
- if (!GetAllAppGroups(kDefaultId, default_groups)) {
- return false;
- }
-
- // Get all pre_DataConsent groups
- FunctionalGroupIDs predataconsented_groups;
- if (!GetAllAppGroups(kPreDataConsentId, predataconsented_groups)) {
- return false;
- }
-
- // Get all device groups
- FunctionalGroupIDs device_groups;
- if (!GetAllAppGroups(kDeviceId, device_groups)) {
- return false;
- }
-
- (*group_types)[kTypeDefault] = default_groups;
- (*group_types)[kTypeAllowed] = allowed_groups;
- (*group_types)[kTypeDisallowed] = disallowed_groups;
- (*group_types)[kTypePreconsented] = preconsented_groups;
- (*group_types)[kTypeGeneral] = all_groups;
- (*group_types)[kTypePreDataConsented] = predataconsented_groups;
- (*group_types)[kTypeDevice] = device_groups;
-
- return true;
-}
-
-bool SQLPTExtRepresentation::GetDeviceGroupsFromPolicies(
- policy_table::Strings* groups, policy_table::Strings* preconsented_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (groups) {
- GatherAppGroup(kDeviceId, groups);
- }
- if (preconsented_groups) {
- GatherPreconsentedGroup(kDeviceId, preconsented_groups);
- }
- return true;
-}
-
-bool SQLPTExtRepresentation::SetDeviceData(const std::string& device_id,
- const std::string& hardware,
- const std::string& firmware,
- const std::string& os,
- const std::string& os_version,
- const std::string& carrier,
- const uint32_t number_of_ports,
- const std::string& connection_type) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery count_query(db());
- if (!count_query.Prepare(sql_pt_ext::kCountDevice)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for count of device.");
- return false;
- }
-
- count_query.Bind(0, device_id);
-
- if (!count_query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect count of device.");
- return false;
- }
-
- bool update = count_query.GetInteger(0);
-
- // Update old value
- if (update) {
- utils::dbms::SQLQuery update_query(db());
- if (!update_query.Prepare(sql_pt_ext::kUpdateDevice)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for udpate device.");
- return false;
- }
-
- update_query.Bind(0, hardware);
- update_query.Bind(1, firmware);
- update_query.Bind(2, os);
- update_query.Bind(3, os_version);
- update_query.Bind(4, carrier);
- update_query.Bind(5, static_cast<int>(number_of_ports));
- update_query.Bind(6, device_id);
- update_query.Bind(7, connection_type);
-
- if (!update_query.Exec() || !update_query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect update for device.");
- return false;
- }
-
- return true;
- }
-
- // Insert new data
- utils::dbms::SQLQuery insert_query(db());
- if (!insert_query.Prepare(sql_pt_ext::kInsertDevice)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for device.");
- return false;
- }
-
- insert_query.Bind(0, device_id);
- insert_query.Bind(1, hardware);
- insert_query.Bind(2, firmware);
- insert_query.Bind(3, os);
- insert_query.Bind(4, os_version);
- insert_query.Bind(5, carrier);
- insert_query.Bind(6, static_cast<int>(number_of_ports));
- insert_query.Bind(7, connection_type);
-
- if (!insert_query.Exec() || !insert_query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert to device.");
- return false;
- }
-
- SetPreloaded(false);
-
- return true;
-}
-
-bool SQLPTExtRepresentation::SetUserPermissionsForDevice(
- const std::string& device_id,
- const StringArray& consented_groups,
- const StringArray& disallowed_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery count_query(db());
- if (!count_query.Prepare(sql_pt_ext::kCountDeviceConsentGroup)) {
- LOG4CXX_WARN(logger_, "Incorrect count of device consented groups");
- return false;
- }
-
- count_query.Bind(0, device_id);
-
- if (!count_query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed count of device consented groups");
- return false;
- }
-
- bool update = count_query.GetInteger(0);
-
- // TODO(AOleynik): Split to several methods?
- utils::dbms::SQLQuery query(db());
- // Update old values
- if (update) {
- if (!query.Prepare(sql_pt_ext::kUpdateDeviceConsentedGroup)) {
- LOG4CXX_WARN(
- logger_,
- "Incorrect statement for updating consented groups on device");
- return false;
- }
-
- StringArray::const_iterator it_consented_groups = consented_groups.begin();
- StringArray::const_iterator it_consented_groups_end =
- consented_groups.end();
- for (; it_consented_groups != it_consented_groups_end;
- ++it_consented_groups) {
- query.Bind(0, true);
- query.Bind(1, std::string("GUI"));
- query.Bind(2, device_id);
- query.Bind(3, *it_consented_groups);
- // TODO(AOleynik): Get this info from external data
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Failed update of device allowed consented groups.");
- return false;
- }
- }
-
- StringArray::const_iterator it_disallowed_groups =
- disallowed_groups.begin();
- StringArray::const_iterator it_disallowed_groups_end =
- disallowed_groups.end();
- for (; it_disallowed_groups != it_disallowed_groups_end;
- ++it_disallowed_groups) {
- query.Bind(0, false);
- query.Bind(1);
- query.Bind(2, device_id);
- query.Bind(3, *it_disallowed_groups);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Failed update of device disallowed consented groups.");
- return false;
- }
- }
-
- return true;
- }
-
- // Insert new values
- if (!query.Prepare(sql_pt_ext::kInsertDeviceConsentedGroup)) {
- LOG4CXX_WARN(logger_,
- "Incorrect statement of inserting to device consented groups");
- return false;
- }
-
- StringArray::const_iterator it_consented_groups = consented_groups.begin();
- StringArray::const_iterator it_consented_groups_end = consented_groups.end();
- for (; it_consented_groups != it_consented_groups_end;
- ++it_consented_groups) {
- query.Bind(0, device_id);
- query.Bind(1, *it_consented_groups);
- query.Bind(2, true);
- // TODO(AOleynik): Get this info from external data
- query.Bind(3, std::string("GUI"));
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Failed insert to device allowed consented groups.");
- return false;
- }
- }
-
- StringArray::const_iterator it_disallowed_groups = disallowed_groups.begin();
- StringArray::const_iterator it_disallowed_groups_end =
- disallowed_groups.end();
- for (; it_disallowed_groups != it_disallowed_groups_end;
- ++it_disallowed_groups) {
- query.Bind(0, device_id);
- query.Bind(1, *it_disallowed_groups);
- query.Bind(2, false);
- query.Bind(3);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Failed insert to device disallowed consented groups.");
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::ReactOnUserDevConsentForApp(
- const std::string& app_id, bool is_device_allowed) {
- bool result = true;
- if (is_device_allowed) {
- // If app has pre_DataConsented groups it should be 'promoted' to default
- // If app has only pre_DataConsented flag it should be only set to false and
- // all groups get restored automatically
- if (IsPredataPolicy(app_id)) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kHasAppPreloadedGroups)) {
- LOG4CXX_WARN(logger_,
- "Incorrect statement for has app preloaded groups");
- return false;
- }
- query.Bind(0, app_id);
- query.Bind(1, kPreDataConsentId);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_,
- "Incorrect select for app has predataconsted groups");
- return false;
- }
- if (query.GetInteger(0) > 0) {
- result = result && SetDefaultPolicy(app_id);
- } else {
- result = result && SetIsPredata(app_id, false);
- }
- }
- } else {
- // If app has default groups change them to pre_DataConsented
- // If app has 'normal' groups leave them as is and set
- // pre_DataConsented flag to true.
- if (IsDefaultPolicy(app_id)) {
- result = result && SetPredataPolicy(app_id);
- } else {
- result = result && SetIsPredata(app_id, true);
- }
- }
- return result;
-}
-
-bool SQLPTExtRepresentation::SetUserPermissionsForApp(
- const PermissionConsent& permissions) {
- LOG4CXX_AUTO_TRACE(logger_);
- // TODO(AOleynik): Handle situation, when no application was specified, i.e.
- // general permissions were set
- std::vector<FunctionalGroupPermission>::const_iterator it =
- permissions.group_permissions.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_end =
- permissions.group_permissions.end();
-
- utils::dbms::SQLQuery query(db());
- for (; it != it_end; ++it) {
- utils::dbms::SQLQuery counter(db());
- if (!counter.Prepare(sql_pt_ext::kCountAppConsents)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for consent group count.");
- return false;
- }
-
- counter.Bind(0, permissions.device_id);
- counter.Bind(1, permissions.policy_app_id);
- counter.Bind(2, static_cast<int>((*it).group_id));
- if (!counter.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrent count on consent groups.");
- return false;
- }
-
- bool update_required = counter.GetInteger(0);
-
- // Update already present consent record
- if (update_required) {
- if (!query.Prepare(sql_pt_ext::kUpdateGroupPermissions)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for update consent groups.");
- return false;
- }
-
- // Skip consent saving, if user didn't choose any state
- if (policy::kGroupUndefined == (*it).state) {
- continue;
- }
- query.Bind(0, (*it).state == kGroupAllowed ? 1 : 0);
- query.Bind(1, permissions.consent_source);
- query.Bind(2, permissions.policy_app_id);
- query.Bind(3, static_cast<int>((*it).group_id));
- query.Bind(4, permissions.device_id);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Incorrect update on user defined permissions "
- "for app groups.");
- return false;
- }
- continue;
- }
-
- // Insert new consent record
- if (!query.Prepare(sql_pt_ext::kInsertConsentGroups)) {
- LOG4CXX_WARN(logger_,
- "Incorrect statement for update app group permissions.");
- return false;
- }
-
- // Skip consent saving, if user didn't choose any state
- if (policy::kGroupUndefined == (*it).state) {
- continue;
- }
- query.Bind(0, permissions.device_id);
- query.Bind(1, permissions.policy_app_id);
- query.Bind(2, static_cast<int>((*it).group_id));
- query.Bind(3, (*it).state == kGroupAllowed ? 1 : 0);
- query.Bind(4, permissions.consent_source);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert to user defined permissions "
- "for app groups.");
- return false;
- }
- continue;
- }
- return true;
-}
-
-std::vector<UserFriendlyMessage> SQLPTExtRepresentation::GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language) {
- utils::dbms::SQLQuery query(db());
- std::vector<UserFriendlyMessage> result;
- if (!query.Prepare(sql_pt_ext::kSelectFriendlyMsg)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages.");
- return result;
- }
-
- const std::string fallback_language = "en-us";
- std::vector<std::string>::const_iterator it = msg_codes.begin();
- std::vector<std::string>::const_iterator it_end = msg_codes.end();
- for (; it != it_end; ++it) {
- std::string msg_language = language;
- // If message has no records with required language, fallback language
- // should be used instead.
- if (!IsMsgLanguagePresent((*it), language)) {
- msg_language = fallback_language;
- }
- query.Bind(0, *it);
- query.Bind(1, msg_language);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect select from friendly messages.");
- return result;
- }
-
- UserFriendlyMessage msg;
-
- msg.message_code = *it;
- msg.tts = query.GetString(0);
- msg.label = query.GetString(1);
- msg.line1 = query.GetString(2);
- msg.line2 = query.GetString(3);
- msg.text_body = query.GetString(4);
-
- result.push_back(msg);
-
- if (!query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Failed reset statement for selecting friendly "
- "messages.");
- return result;
- }
- }
-
- return result;
-}
-
-bool SQLPTExtRepresentation::GatherConsumerFriendlyMessages(
- policy_table::ConsumerFriendlyMessages* messages) const {
- if (NULL == messages) {
- LOG4CXX_ERROR(logger_, "NULL pointer has been passed to fill");
- return false;
- }
-
- if (!SQLPTRepresentation::GatherConsumerFriendlyMessages(messages)) {
- return false;
- }
-
- utils::dbms::SQLQuery query(db());
- bool result = query.Prepare(sql_pt_ext::kCollectFriendlyMsg);
-
- if (result) {
- while (query.Next()) {
- UserFriendlyMessage msg;
-
- msg.tts = query.GetString(1);
- msg.label = query.GetString(2);
- msg.line1 = query.GetString(3);
- msg.line2 = query.GetString(4);
- msg.text_body = query.GetString(5);
- msg.message_code = query.GetString(7);
-
- std::string language = query.GetString(6);
-
- *(*messages->messages)[msg.message_code].languages[language].tts =
- msg.tts;
- *(*messages->messages)[msg.message_code].languages[language].label =
- msg.label;
- *(*messages->messages)[msg.message_code].languages[language].line1 =
- msg.line1;
- *(*messages->messages)[msg.message_code].languages[language].line2 =
- msg.line2;
- *(*messages->messages)[msg.message_code].languages[language].textBody =
- msg.text_body;
- }
- } else {
- LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages.");
- }
- return result;
-}
-
-bool SQLPTExtRepresentation::SetMetaInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kUpdateMetaParams)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for insert to module meta.");
- return false;
- }
-
- query.Bind(0, ccpu_version);
- query.Bind(1, wers_country_code);
- query.Bind(2, language);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert to module meta.");
- return false;
- }
- return true;
-}
-
-bool SQLPTExtRepresentation::IsMetaInfoPresent() {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectMetaParams)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for selecting meta info.");
- return false;
- }
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect select from module meta.");
- return false;
- }
-
- return !query.IsNull(0) && !query.IsNull(1) && !query.IsNull(2);
-}
-
-bool SQLPTExtRepresentation::SetSystemLanguage(const std::string& language) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kUpdateMetaLanguage)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for update meta language.");
- return false;
- }
-
- query.Bind(0, language);
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect update for meta language.");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::SaveApplicationPoliciesSection(
- const policy_table::ApplicationPoliciesSection& policies) {
- LOG4CXX_INFO(logger_, "SaveApplicationPolicies ext");
- utils::dbms::SQLQuery query_delete(db());
- if (!query_delete.Exec(sql_pt::kDeleteAppGroup)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
- return false;
- }
-
- utils::dbms::SQLQuery query_delete_preconsented(db());
- if (!query_delete_preconsented.Exec(sql_pt_ext::kDeletePreconsentedGroups)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from preconsented_group.");
- return false;
- }
-
- if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from application.");
- return false;
- }
-
- if (!query_delete.Exec(sql_pt::kDeleteRequestType)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from request type.");
- 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
- policy_table::ApplicationPolicies::const_iterator it_default =
- policies.apps.find(kDefaultId);
- if (policies.apps.end() != it_default) {
- if (!SaveSpecificAppPolicy(*it_default)) {
- return false;
- }
- }
- policy_table::ApplicationPolicies::const_iterator it_pre_data_consent =
- policies.apps.find(kPreDataConsentId);
- if (policies.apps.end() != it_pre_data_consent) {
- if (!SaveSpecificAppPolicy(*it_pre_data_consent)) {
- return false;
- }
- }
-
- if (!SaveDevicePolicy(policies.device)) {
- return false;
- }
-
- policy_table::ApplicationPolicies::const_iterator it;
- for (it = policies.apps.begin(); it != policies.apps.end(); ++it) {
- // Skip saving of predefined app, since they should be saved before
- if (IsPredefinedApp(*it)) {
- continue;
- }
- if (!SaveSpecificAppPolicy(*it)) {
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
- const policy_table::ApplicationPolicies::value_type& app) {
- if (app.second.is_string()) {
- if (kDefaultId.compare(app.second.get_string()) == 0) {
- if (!SetDefaultPolicy(app.first)) {
- return false;
- }
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
- } else if (kPreDataConsentId.compare(app.second.get_string()) == 0) {
- if (!SetPredataPolicy(app.first)) {
- return false;
- }
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
- }
-
- // Stop saving other params, since predefined permissions already set
- return true;
- }
-
- SetIsDefault(app.first, false);
- SetIsPredata(app.first, false);
-
- utils::dbms::SQLQuery app_query(db());
- if (!app_query.Prepare(sql_pt_ext::kInsertApplication)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
- return false;
- }
-
- app_query.Bind(0, app.first);
- app_query.Bind(1, app.second.keep_context);
- app_query.Bind(2, app.second.steal_focus);
- app_query.Bind(
- 3, std::string(policy_table::EnumToJsonString(app.second.default_hmi)));
- app_query.Bind(
- 4, std::string(policy_table::EnumToJsonString(app.second.priority)));
- app_query.Bind(5, app.second.is_null());
- app_query.Bind(6, *app.second.memory_kb);
- app_query.Bind(7, static_cast<int64_t>(*app.second.heart_beat_timeout_ms));
- app.second.certificate.is_initialized()
- ? app_query.Bind(8, *app.second.certificate)
- : app_query.Bind(8, std::string());
-
- if (!app_query.Exec() || !app_query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into application.");
- return false;
- }
-
- if (!SaveAppGroup(app.first, app.second.groups)) {
- return false;
- }
- // TODO(IKozyrenko): Check logic if optional container is missing
- if (!SaveNickname(app.first, *app.second.nicknames)) {
- return false;
- }
- // TODO(IKozyrenko): Check logic if optional container is missing
- if (!SaveAppType(app.first, *app.second.AppHMIType)) {
- return false;
- }
- // TODO(IKozyrenko): Check logic if optional container is missing
- if (!SavePreconsentedGroup(app.first, *app.second.preconsented_groups)) {
- return false;
- }
-
- return true;
-}
-
-bool policy::SQLPTExtRepresentation::SaveDevicePolicy(
- const policy_table::DevicePolicy& device) {
- dbms::SQLQuery app_query(db());
- if (!app_query.Prepare(sql_pt_ext::kInsertApplication)) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert statement into application (device).");
- return false;
- }
- app_query.Bind(0, kDeviceId);
- app_query.Bind(1, device.keep_context);
- app_query.Bind(2, device.steal_focus);
- app_query.Bind(
- 3, std::string(policy_table::EnumToJsonString(device.default_hmi)));
- app_query.Bind(4,
- std::string(policy_table::EnumToJsonString(device.priority)));
- app_query.Bind(5, false);
- app_query.Bind(6, 0);
- app_query.Bind(7, 0);
- app_query.Bind(8, std::string());
-
- if (!app_query.Exec() || !app_query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into application.");
- return false;
- }
-
- if (!SaveAppGroup(kDeviceId, device.groups)) {
- return false;
- }
- if (!SavePreconsentedGroup(kDeviceId, *device.preconsented_groups)) {
- return false;
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
- policy_table::ApplicationPoliciesSection* policies) const {
- LOG4CXX_INFO(logger_, "Gather applications policies");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectAppPolicies)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app_policies");
- return false;
- }
-
- while (query.Next()) {
- rpc::Nullable<policy_table::ApplicationParams> params;
- const std::string& app_id = query.GetString(0);
- if (IsApplicationRevoked(app_id)) {
- params.set_to_null();
- (*policies).apps[app_id] = params;
- continue;
- }
- if (IsDefaultPolicy(app_id)) {
- (*policies).apps[app_id].set_to_string(kDefaultId);
- }
- if (IsPredataPolicy(app_id)) {
- (*policies).apps[app_id].set_to_string(kPreDataConsentId);
- }
- if (kDeviceId == app_id) {
- policy_table::DevicePolicy device_policy;
- policy_table::Priority priority;
- policy_table::EnumFromJsonString(query.GetString(1), &priority);
- device_policy.priority = priority;
- policy_table::HmiLevel hmi;
- policy_table::EnumFromJsonString(query.GetString(2), &hmi);
- device_policy.default_hmi = hmi;
- device_policy.keep_context = query.GetBoolean(3);
- device_policy.steal_focus = query.GetBoolean(4);
- if (!GatherAppGroup(app_id, &device_policy.groups)) {
- return false;
- }
- GatherPreconsentedGroup(app_id, &*device_policy.preconsented_groups);
- (*policies).device = device_policy;
- continue;
- }
- policy_table::Priority priority;
- policy_table::EnumFromJsonString(query.GetString(1), &priority);
- params.priority = priority;
- policy_table::HmiLevel hmi;
- policy_table::EnumFromJsonString(query.GetString(2), &hmi);
- params.default_hmi = hmi;
- params.keep_context = query.GetBoolean(3);
- params.steal_focus = query.GetBoolean(4);
- *params.memory_kb = query.GetInteger(5);
- *params.heart_beat_timeout_ms = query.GetUInteger(6);
- if (!query.IsNull(7)) {
- *params.certificate = query.GetString(7);
- }
- if (!GatherAppGroup(app_id, &params.groups)) {
- return false;
- }
- if (!GatherNickName(app_id, &*params.nicknames)) {
- return false;
- }
- if (!GatherAppType(app_id, &*params.AppHMIType)) {
- return false;
- }
- if (!GatherRequestType(app_id, &*params.RequestType)) {
- return false;
- }
- GatherPreconsentedGroup(app_id, &*params.preconsented_groups);
- (*policies).apps[app_id] = params;
- }
- return true;
-}
-
-void SQLPTExtRepresentation::GatherPreconsentedGroup(
- const std::string& app_id, policy_table::Strings* groups) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectPreconsentedGroups)) {
- LOG4CXX_WARN(logger_, "Incorrect select from preconsented group");
- return;
- }
-
- query.Bind(0, app_id);
- while (query.Next()) {
- groups->push_back(query.GetString(0));
- }
-}
-
-bool SQLPTExtRepresentation::GatherUsageAndErrorCounts(
- policy_table::UsageAndErrorCounts* counts) const {
- LOG4CXX_INFO(logger_, "Gather Usage and Error Counts.");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectUsageAndErrorCount) || !query.Exec()) {
- LOG4CXX_INFO(logger_, "Failed select from user_and_error_count");
- return false;
- }
-
- *counts->count_of_iap_buffer_full = query.GetInteger(0);
- *counts->count_sync_out_of_memory = query.GetInteger(1);
- *counts->count_of_sync_reboots = query.GetInteger(2);
-
- return GatherAppLevels(&*counts->app_level);
-}
-
-bool SQLPTExtRepresentation::GatherAppLevels(
- policy_table::AppLevels* apps) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectAppLevels)) {
- LOG4CXX_INFO(logger_,
- "Failed select from app_level. SQLError = "
- << query.LastError().text());
- return false;
- }
- while (query.Next()) {
- policy_table::AppLevel level;
- // value of time fields database is seconds
- level.minutes_in_hmi_full = query.GetInteger(1);
- level.minutes_in_hmi_limited = query.GetInteger(2);
- level.minutes_in_hmi_background = query.GetInteger(3);
- level.minutes_in_hmi_none = query.GetInteger(4);
- level.count_of_user_selections = query.GetInteger(5);
- level.count_of_rejections_sync_out_of_memory = query.GetInteger(6);
- level.count_of_rejections_nickname_mismatch = query.GetInteger(7);
- level.count_of_rejections_duplicate_name = query.GetInteger(8);
- level.count_of_rejected_rpc_calls = query.GetInteger(9);
- level.count_of_rpcs_sent_in_hmi_none = query.GetInteger(10);
- level.count_of_removals_for_bad_behavior = query.GetInteger(11);
- level.count_of_run_attempts_while_revoked = query.GetInteger(12);
- level.app_registration_language_gui = query.GetString(13);
- level.app_registration_language_vui = query.GetString(14);
- level.count_of_tls_errors = query.GetInteger(15);
- (*apps)[query.GetString(0)] = level;
- }
-
- return true;
-}
-
-void SQLPTExtRepresentation::GatherDeviceData(
- policy_table::DeviceData* data) const {
- LOG4CXX_INFO(logger_, "Gather device data.");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectDeviceData)) {
- LOG4CXX_WARN(logger_, "Incorrect select statement for device data.");
- return;
- }
- data->mark_initialized();
- while (query.Next()) {
- policy_table::DeviceParams* specific_device = &(*data)[query.GetString(0)];
- *specific_device->hardware = query.GetString(1);
- *specific_device->firmware_rev = query.GetString(2);
- *specific_device->os = query.GetString(3);
- *specific_device->os_version = query.GetString(4);
- *specific_device->carrier = query.GetString(5);
- *specific_device->max_number_rfcom_ports = query.GetInteger(6);
-
- // TODO(IKozyrenko): Check logic if optional container is missing
- GatherConsentGroup(query.GetString(0),
- &(*specific_device->user_consent_records));
- }
-}
-
-void SQLPTExtRepresentation::GatherConsentGroup(
- const std::string& device_id,
- policy_table::UserConsentRecords* records) const {
- LOG4CXX_INFO(logger_, "Gather consent records.");
- utils::dbms::SQLQuery query(db());
- // Fill data for device
- if (!query.Prepare(sql_pt_ext::kSelectDeviceConsentedGroup)) {
- LOG4CXX_WARN(logger_,
- "Incorrect select statement for device consented groups.");
- return;
- }
-
- query.Bind(0, device_id);
-
- // Fill device_data -> user_consent_records -> "device"
- while (query.Next()) {
- policy_table::ConsentRecords* device_consent_records =
- &(*records)[kDeviceId];
- // TODO(IKozyrenko): Check logic if optional container is missing
- policy_table::ConsentGroups& consent_groups =
- *device_consent_records->consent_groups;
- consent_groups[query.GetString(1)] = query.GetBoolean(2);
- policy_table::Input input;
- policy_table::EnumFromJsonString(query.GetString(3), &input);
- *device_consent_records->input = input;
- *device_consent_records->time_stamp = query.GetString(4);
- }
-
- if (!query.Reset()) {
- return;
- }
-
- // Fill data for applications
- if (!query.Prepare(sql_pt_ext::kSelectConsentGroup)) {
- LOG4CXX_WARN(logger_,
- "Incorrect select statement for app consented groups.");
- return;
- }
-
- query.Bind(0, device_id);
-
- // Fill device_data -> user_consent_records -> <app_id>
- while (query.Next()) {
- policy_table::ConsentRecords* app_consent_records =
- &(*records)[query.GetString(1)];
- // TODO(IKozyrenko): Check logic if optional container is missing
- policy_table::ConsentGroups& consent_groups =
- *app_consent_records->consent_groups;
-
- consent_groups[query.GetString(2)] = query.GetBoolean(3);
- policy_table::Input input;
- policy_table::EnumFromJsonString(query.GetString(4), &input);
- *app_consent_records->input = input;
- *app_consent_records->time_stamp = query.GetString(5);
- }
-}
-
-bool SQLPTExtRepresentation::SaveDeviceData(
- const policy_table::DeviceData& devices) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery drop_device_query(db());
- const std::string drop_device = "DELETE FROM `device`";
- if (!drop_device_query.Exec(drop_device)) {
- LOG4CXX_WARN(logger_, "Could not clear device table.");
- return false;
- }
-
- utils::dbms::SQLQuery drop_device_consents_query(db());
- const std::string drop_device_consents = "DELETE FROM `device_consent_group`";
- if (!drop_device_consents_query.Exec(drop_device_consents)) {
- LOG4CXX_WARN(logger_, "Could not clear device consents.");
- return false;
- }
-
- utils::dbms::SQLQuery drop_user_consents_query(db());
- const std::string drop_user_consents = "DELETE FROM `consent_group`";
- if (!drop_user_consents_query.Exec(drop_user_consents)) {
- LOG4CXX_WARN(logger_, "Could not clear user consents.");
- return false;
- }
-
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kInsertDeviceData)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for device data.");
- return false;
- }
-
- policy_table::DeviceData::const_iterator it = devices.begin();
- policy_table::DeviceData::const_iterator it_end = devices.end();
- for (; it != it_end; ++it) {
- query.Bind(0, it->first);
- query.Bind(1, *(it->second.hardware));
- query.Bind(2, *(it->second.firmware_rev));
- query.Bind(3, *(it->second.os));
- query.Bind(4, *(it->second.os_version));
- query.Bind(5, *(it->second.carrier));
- query.Bind(6, *(it->second.max_number_rfcom_ports));
- query.Bind(7, *(it->second.connection_type));
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into device data.");
- return false;
- }
-
- // TODO(IKozyrenko): Check logic if optional container is missing
- if (!SaveConsentGroup(it->first, *it->second.user_consent_records)) {
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::SaveConsentGroup(
- const std::string& device_id,
- const policy_table::UserConsentRecords& records) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
-
- policy_table::UserConsentRecords::const_iterator it = records.begin();
- policy_table::UserConsentRecords::const_iterator it_end = records.end();
- for (; it != it_end; ++it) {
- // TODO(IKozyrenko): Check logic if optional container is missing
- policy_table::ConsentGroups::const_iterator it_groups =
- it->second.consent_groups->begin();
- policy_table::ConsentGroups::const_iterator it_groups_end =
- it->second.consent_groups->end();
- for (; it_groups != it_groups_end; ++it_groups) {
- if (kDeviceId == it->first) {
- if (!query.Prepare(sql_pt_ext::kInsertDeviceConsentedGroup)) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert statement for device consent group.");
- return false;
- }
- query.Bind(0, device_id);
- query.Bind(1, it_groups->first);
- query.Bind(2, it_groups->second);
- query.Bind(
- 3,
- std::string(policy_table::EnumToJsonString(*(it->second.input))));
- query.Bind(4, std::string(*(it->second.time_stamp)));
- LOG4CXX_INFO(logger_,
- "Device:"
- << "time stamp "
- << std::string(*(it->second.time_stamp)) << " group "
- << it_groups->first << " consent "
- << it_groups->second);
- } else {
- if (!query.Prepare(sql_pt_ext::kInsertConsentGroups)) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert statement for consent group.");
- return false;
- }
- query.Bind(0, device_id);
- query.Bind(1, it->first);
- query.Bind(2, it_groups->first);
- query.Bind(3, it_groups->second);
- query.Bind(
- 4,
- std::string(policy_table::EnumToJsonString(*(it->second.input))));
- query.Bind(5, std::string(*(it->second.time_stamp)));
- LOG4CXX_INFO(logger_,
- "Device:"
- << "time stamp "
- << std::string(*(it->second.time_stamp)) << " group "
- << it_groups->first << " consent "
- << it_groups->second);
- }
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into consent group.");
- return false;
- }
- }
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::SavePreconsentedGroup(
- const std::string& app_id, const policy_table::Strings& groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kInsertPreconsentedGroups)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for preconsented groups");
- return false;
- }
-
- policy_table::Strings::const_iterator it;
- for (it = groups.begin(); it != groups.end(); ++it) {
- query.Bind(0, app_id);
- query.Bind(1, *it);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into preconsented groups.");
- return false;
- }
- }
-
- return true;
-}
-
-void SQLPTExtRepresentation::GatherModuleMeta(
- policy_table::ModuleMeta* meta) const {
- LOG4CXX_INFO(logger_, "Gather Module Meta Info");
- utils::dbms::SQLQuery query(db());
- if (query.Prepare(sql_pt_ext::kSelectModuleMeta) && query.Next()) {
- *meta->ccpu_version = query.GetString(0);
- *meta->language = query.GetString(1);
- *meta->wers_country_code = query.GetString(2);
- *meta->pt_exchanged_at_odometer_x = query.GetInteger(3);
- *meta->pt_exchanged_x_days_after_epoch = query.GetInteger(4);
- *meta->ignition_cycles_since_last_exchange = query.GetInteger(5);
- *meta->vin = query.GetString(6);
- }
-}
-
-void SQLPTExtRepresentation::Increment(const std::string& type) const {
- utils::dbms::SQLQuery query(db());
- std::string update_counter =
- "UPDATE `usage_and_error_count` SET `" + type + "` = `" + type + "` + 1";
- if (!query.Exec(update_counter)) {
- LOG4CXX_INFO(logger_, "Failed updating global counter");
- }
-}
-
-bool SQLPTExtRepresentation::IsExistAppLevel(const std::string& app_id) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kCountAppLevel)) {
- LOG4CXX_INFO(logger_, "Incorrect statement of count app_level");
- return false;
- }
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_INFO(logger_, "Failed count app_level");
- return false;
- }
- return query.GetInteger(0) > 0;
-}
-
-bool SQLPTExtRepresentation::GetAllAppGroups(const std::string& policy_app_id,
- FunctionalGroupIDs& all_groups) {
- LOG4CXX_INFO(logger_, "GetAllAppGroups for '" << policy_app_id << "'");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectAppGroupsId)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for select app groups id.");
- return false;
- }
-
- query.Bind(0, policy_app_id);
-
- while (query.Next()) {
- all_groups.push_back(query.GetInteger(0));
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::GetConsentedGroups(
- const std::string& policy_app_id,
- const std::string& device_id,
- FunctionalGroupIDs& allowed_groups,
- FunctionalGroupIDs& disallowed_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectConsentedGroupsId)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for select consent groups id.");
- return false;
- }
-
- query.Bind(0, policy_app_id);
- query.Bind(1, device_id);
-
- while (query.Next()) {
- if (query.GetBoolean(1)) {
- allowed_groups.push_back(query.GetInteger(0));
- } else {
- disallowed_groups.push_back(query.GetInteger(0));
- }
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::GetPreconsentedGroups(
- const std::string& policy_app_id, FunctionalGroupIDs& preconsented_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectPreconsentedGroupsId)) {
- LOG4CXX_WARN(logger_,
- "Incorrect statement for select preconsented groups id.");
- return false;
- }
-
- query.Bind(0, policy_app_id);
-
- while (query.Next()) {
- preconsented_groups.push_back(query.GetInteger(0));
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::GetFunctionalGroupNames(
- FunctionalGroupNames& names) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectFunctionalGroupNames)) {
- LOG4CXX_WARN(logger_,
- "Incorrect statement for select functional groups names.");
- return false;
- }
-
- while (query.Next()) {
- // Some of functional grous doesn't have filled user_consent_prompt
- if (query.IsNull(1)) {
- names[query.GetInteger(0)] =
- std::make_pair<std::string, std::string>("", query.GetString(2));
- } else {
- names[query.GetInteger(0)] = std::make_pair<std::string, std::string>(
- query.GetString(1), query.GetString(2));
- }
- }
-
- return true;
-}
-
-void SQLPTExtRepresentation::FillFunctionalGroupPermissions(
- FunctionalGroupIDs& ids,
- FunctionalGroupNames& names,
- GroupConsent state,
- std::vector<FunctionalGroupPermission>& permissions) {
- FunctionalGroupIDs::const_iterator it = ids.begin();
- FunctionalGroupIDs::const_iterator it_end = ids.end();
- for (; it != it_end; ++it) {
- FunctionalGroupPermission current_group;
- current_group.group_id = *it;
- current_group.group_alias = names[*it].first;
- current_group.group_name = names[*it].second;
- current_group.state = state;
- permissions.push_back(current_group);
- }
-}
-
-void SQLPTExtRepresentation::Increment(const std::string& app_id,
- const std::string& type) const {
- utils::dbms::SQLQuery query(db());
- std::string sql_counter;
- if (IsExistAppLevel(app_id)) {
- // update
- sql_counter = "UPDATE `app_level` SET `" + type + "` = `" + type +
- "` + 1 WHERE `application_id` = ?";
- } else {
- // insert
- sql_counter = "INSERT INTO `app_level` (`application_id`, `" + type +
- "`) "
- "VALUES (?, 1)";
- }
- if (!query.Prepare(sql_counter)) {
- LOG4CXX_INFO(logger_, "Incorrect statement of update app counter");
- return;
- }
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_INFO(logger_, "Failed updating app counter");
- }
-}
-
-void SQLPTExtRepresentation::Set(const std::string& app_id,
- const std::string& type,
- const std::string& value) const {
- utils::dbms::SQLQuery query(db());
- std::string sql_info;
- if (IsExistAppLevel(app_id)) {
- // update
- sql_info = "UPDATE `app_level` SET `" + type +
- "` = ? "
- "WHERE `application_id` = ?";
- } else {
- // insert
- sql_info = "INSERT INTO `app_level` (`" + type +
- "`, `application_id`) "
- "VALUES (?, ?)";
- }
- if (!query.Prepare(sql_info)) {
- LOG4CXX_INFO(logger_, "Incorrect statement of update app info");
- return;
- }
- query.Bind(0, value);
- query.Bind(1, app_id);
- if (!query.Exec()) {
- LOG4CXX_INFO(logger_, "Failed updating app info");
- }
-}
-
-void SQLPTExtRepresentation::Add(const std::string& app_id,
- const std::string& type,
- int seconds) const {
- utils::dbms::SQLQuery query(db());
- std::string sql_stopwatch;
- if (IsExistAppLevel(app_id)) {
- // update
- sql_stopwatch = "UPDATE `app_level` SET `" + type + "` = `" + type +
- "` + ? WHERE `application_id` = ?";
- } else {
- // insert
- sql_stopwatch = "INSERT INTO `app_level` (`" + type +
- "`, `application_id`) "
- "VALUES (?, ?)";
- }
- if (!query.Prepare(sql_stopwatch)) {
- LOG4CXX_INFO(logger_, "Incorrect statement of update app stopwatch");
- return;
- }
- query.Bind(0, seconds);
- query.Bind(1, app_id);
- if (!query.Exec()) {
- LOG4CXX_INFO(logger_, "Failed updating app stopwatch");
- }
-}
-
-bool SQLPTExtRepresentation::GetDefaultHMI(const std::string& policy_app_id,
- std::string* default_hmi) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectDefaultHmi)) {
- LOG4CXX_INFO(logger_, "Incorrect statement for default hmi.");
- return false;
- }
-
- query.Bind(0, policy_app_id);
-
- if (!query.Exec()) {
- LOG4CXX_INFO(logger_, "Error during default hmi getting.");
- return false;
- }
-
- if (query.IsNull(0)) {
- default_hmi->clear();
- return true;
- }
-
- default_hmi->assign(query.GetString(0));
-
- return true;
-}
-
-bool SQLPTExtRepresentation::CountUnconsentedGroups(
- const std::string& policy_app_id,
- const std::string& device_id,
- int* result) const {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kCountUnconsentedGroups)) {
- LOG4CXX_WARN(logger_, "Incorrect select for unconsented groups.");
- return false;
- }
-
- query.Bind(0, policy_app_id);
- query.Bind(1, device_id);
- query.Bind(2, kDefaultId);
- query.Bind(3, kPreDataConsentId);
-
- if (!query.Exec()) {
- LOG4CXX_INFO(logger_, "Error during executing unconsented groups.");
- return false;
- }
- *result = query.GetInteger(0);
- return true;
-}
-
-bool SQLPTExtRepresentation::IsMsgLanguagePresent(const std::string& message,
- const std::string& language) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kHasMsgLanguageCode)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for message language check.");
- return false;
- }
-
- query.Bind(0, message);
- query.Bind(1, language);
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed to check message language code.");
- return false;
- }
-
- return query.GetInteger(0) != 0;
-}
-
-bool SQLPTExtRepresentation::SaveMessageString(
- const std::string& type,
- const std::string& lang,
- const policy_table::MessageString& strings) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertMessageString)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for message.");
- return false;
- }
-
- query.Bind(0, *strings.tts);
- query.Bind(1, *strings.label);
- query.Bind(2, *strings.line1);
- query.Bind(3, *strings.line2);
- query.Bind(4, lang);
- query.Bind(5, type);
- query.Bind(6, *strings.textBody);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into message.");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::SaveUsageAndErrorCounts(
- const policy_table::UsageAndErrorCounts& counts) {
- return SaveAppCounters(*counts.app_level) && SaveGlobalCounters(counts);
-}
-
-bool SQLPTExtRepresentation::SaveModuleMeta(
- const policy_table::ModuleMeta& meta) {
- utils::dbms::SQLQuery query(db());
-
- if (!query.Prepare(sql_pt_ext::kSaveModuleMeta)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for module_meta.");
- return false;
- }
- const int64_t odometer = *(meta.pt_exchanged_at_odometer_x);
-
- query.Bind(0, *(meta.ccpu_version));
- query.Bind(1, *(meta.language));
- query.Bind(2, *(meta.wers_country_code));
- query.Bind(3, odometer);
- query.Bind(4, *(meta.pt_exchanged_x_days_after_epoch));
- query.Bind(5, *(meta.ignition_cycles_since_last_exchange));
- query.Bind(6, *(meta.vin));
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect update for module_meta.");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::SaveAppCounters(
- const rpc::policy_table_interface_base::AppLevels& app_levels) {
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDeleteAppLevel)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from app level.");
- return false;
- }
- if (!query.Prepare(sql_pt::kInsertAppLevel)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for app level.");
- return false;
- }
-
- policy_table::AppLevels::const_iterator it;
- for (it = app_levels.begin(); it != app_levels.end(); ++it) {
- query.Bind(0, it->first);
- query.Bind(1, it->second.minutes_in_hmi_full);
- query.Bind(2, it->second.minutes_in_hmi_limited);
- query.Bind(3, it->second.minutes_in_hmi_background);
- query.Bind(4, it->second.minutes_in_hmi_none);
- query.Bind(5, it->second.count_of_user_selections);
- query.Bind(6, it->second.count_of_rejections_sync_out_of_memory);
- query.Bind(7, it->second.count_of_rejections_nickname_mismatch);
- query.Bind(8, it->second.count_of_rejections_duplicate_name);
- query.Bind(9, it->second.count_of_rejected_rpc_calls);
- query.Bind(10, it->second.count_of_rpcs_sent_in_hmi_none);
- query.Bind(11, it->second.count_of_removals_for_bad_behavior);
- query.Bind(12, it->second.count_of_run_attempts_while_revoked);
- query.Bind(13, it->second.app_registration_language_gui);
- query.Bind(14, it->second.app_registration_language_vui);
- query.Bind(15, it->second.count_of_tls_errors);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into app level.");
- return false;
- }
- }
- return true;
-}
-
-bool SQLPTExtRepresentation::SaveGlobalCounters(
- const rpc::policy_table_interface_base::UsageAndErrorCounts& counts) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kUpdateGlobalCounters)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for global counters.");
- return false;
- }
-
- query.Bind(0, *counts.count_of_iap_buffer_full);
- query.Bind(1, *counts.count_sync_out_of_memory);
- query.Bind(2, *counts.count_of_sync_reboots);
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into global counters.");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTExtRepresentation::CleanupUnpairedDevices(
- const DeviceIds& device_ids) const {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery delete_device_query(db());
- if (!delete_device_query.Prepare(sql_pt::kDeleteDevice)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for device delete.");
- return true;
- }
-
- utils::dbms::SQLQuery delete_device_consent_query(db());
- if (!delete_device_consent_query.Prepare(sql_pt_ext::kDeleteDeviceConsent)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for delete device consent.");
- return false;
- }
-
- utils::dbms::SQLQuery delete_app_consent_query(db());
- if (!delete_app_consent_query.Prepare(sql_pt_ext::kDeleteAppConsent)) {
- LOG4CXX_WARN(logger_, "Incorrect statement for delete app consent.");
- return false;
- }
-
- DeviceIds::const_iterator it = device_ids.begin();
- DeviceIds::const_iterator it_end = device_ids.end();
- for (; it != it_end; ++it) {
- delete_device_query.Bind(0, (*it));
- if (!delete_device_query.Exec() || !delete_device_query.Reset()) {
- LOG4CXX_WARN(logger_, "Failed to delete from device");
- return false;
- }
-
- delete_device_consent_query.Bind(0, (*it));
- if (!delete_device_consent_query.Exec() ||
- !delete_device_consent_query.Reset()) {
- LOG4CXX_WARN(logger_, "Failed to delete from device consent.");
- return false;
- }
-
- delete_app_consent_query.Bind(0, (*it));
- if (!delete_app_consent_query.Exec() || !delete_app_consent_query.Reset()) {
- LOG4CXX_WARN(logger_, "Failed to delete from app consent.");
- return false;
- }
- }
- return true;
-}
-
-bool SQLPTExtRepresentation::SetDefaultPolicy(const std::string& app_id) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kDeleteAppGroupByApplicationId)) {
- LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
- return false;
- }
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
- return false;
- }
-
- if (!query.Prepare(sql_pt_ext::kDeletePreconsentedGroupsByApplicationId)) {
- LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
- return false;
- }
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
- return false;
- }
-
- if (!CopyApplication(kDefaultId, app_id)) {
- return false;
- }
-
- SetPreloaded(false);
-
- policy_table::Strings default_groups;
- policy_table::Strings default_preconsented_groups;
- GatherAppGroup(kDefaultId, &default_groups);
- GatherPreconsentedGroup(kDefaultId, &default_preconsented_groups);
- if (SaveAppGroup(app_id, default_groups) &&
- SavePreconsentedGroup(app_id, default_preconsented_groups)) {
- return SetIsDefault(app_id, true) && SetIsPredata(app_id, false);
- }
-
- return false;
-}
-
-bool SQLPTExtRepresentation::SetPredataPolicy(const std::string& app_id) {
- LOG4CXX_INFO(logger_,
- "SQLPTExtRepresentation::SetPredataPolicy for " << app_id);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kDeleteAppGroupByApplicationId)) {
- LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
- return false;
- }
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
- return false;
- }
-
- if (!query.Prepare(sql_pt_ext::kDeletePreconsentedGroupsByApplicationId)) {
- LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
- return false;
- }
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
- return false;
- }
-
- if (!CopyApplication(kPreDataConsentId, app_id)) {
- return false;
- }
-
- SetPreloaded(false);
-
- policy_table::Strings predataconsent_groups;
- policy_table::Strings predataconsent_preconsented_groups;
- GatherAppGroup(kPreDataConsentId, &predataconsent_groups);
- GatherPreconsentedGroup(kPreDataConsentId, &predataconsent_groups);
- if (SaveAppGroup(app_id, predataconsent_groups) &&
- SavePreconsentedGroup(app_id, predataconsent_groups)) {
- return SetIsDefault(app_id, false) && SetIsPredata(app_id, true);
- }
- return false;
-}
-
-bool SQLPTExtRepresentation::IsPredataPolicy(const std::string& app_id) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectApplicationIsPreData)) {
- LOG4CXX_WARN(logger_, "Incorrect select application is pre_dataConsented");
- return false;
- }
-
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed select application is pre_dataConsented");
- return false;
- }
- return query.IsNull(0) ? false : query.GetBoolean(0);
-}
-
-bool SQLPTExtRepresentation::SetIsPredata(const std::string& app_id,
- bool is_pre_data) {
- LOG4CXX_TRACE(logger_, "Set flag is_predata of application");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kUpdateIsPredata)) {
- LOG4CXX_WARN(logger_, "Incorect statement for updating is_predata");
- return false;
- }
-
- query.Bind(0, is_pre_data);
- query.Bind(1, app_id);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed update is_predata");
- return false;
- }
- return true;
-}
-
-bool SQLPTExtRepresentation::SetUnpairedDevice(const std::string& device_id,
- bool unpaired) const {
- LOG4CXX_TRACE(logger_, "Set unpaired device: " << device_id);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kUpdateUnpairedDevice)) {
- LOG4CXX_WARN(logger_, "Incorect statement for updating unpaired device");
- return false;
- }
-
- query.Bind(0, unpaired);
- query.Bind(1, device_id);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed update unpaired device");
- return false;
- }
- return true;
-}
-
-bool SQLPTExtRepresentation::UnpairedDevicesList(DeviceIds* device_ids) const {
- LOG4CXX_TRACE(logger_, "Get list of unpaired devices");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kSelectUnpairedDevices)) {
- LOG4CXX_WARN(logger_, "Incorect statement for selecting unpaired devices");
- return false;
- }
-
- while (query.Next()) {
- device_ids->push_back(query.GetString(0));
- }
- return true;
-}
-
-bool SQLPTExtRepresentation::SetVINValue(const std::string& value) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kUpdateModuleMetaVinParam)) {
- LOG4CXX_WARN(logger_, "Incorect statement for updating module_meta params");
- return false;
- }
-
- query.Bind(0, value);
- const bool result = query.Exec();
-
- if (!result) {
- LOG4CXX_WARN(logger_, "Failed update module_meta");
- }
- return result;
-}
-
-bool SQLPTExtRepresentation::RemoveAppConsentForGroup(
- const std::string& policy_app_id,
- const std::string& functional_group_name) const {
- utils::dbms::SQLQuery query_group_id(db());
- if (!query_group_id.Prepare(sql_pt_ext::kSelectGroupId)) {
- LOG4CXX_WARN(logger_, "Incorect statement for select group name.");
- return false;
- }
-
- query_group_id.Bind(0, functional_group_name);
-
- if (!query_group_id.Exec()) {
- LOG4CXX_WARN(logger_, "Failed to select group id.");
- return false;
- }
-
- const int id = query_group_id.GetInteger(0);
-
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt_ext::kDeleteAppGroupConsent)) {
- LOG4CXX_WARN(logger_, "Incorect statement for remove app consent.");
- return false;
- }
-
- query.Bind(0, policy_app_id);
- query.Bind(1, id);
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed to remove app consent.");
- return false;
- }
-
- return true;
-}
-
-} // namespace policy
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 ef4ef49273..f5ccffce3b 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -258,13 +258,21 @@ const std::string kCreateSchema =
" REFERENCES `application`(`id`) "
"); "
"CREATE TABLE IF NOT EXISTS `request_type`( "
- " `request_type` VARCHAR(50) NOT NULL, "
+ " `request_type` VARCHAR(50), "
" `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`request_type`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `request_subtype`( "
+ " `request_subtype` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`request_subtype`,`application_id`), "
+ " CONSTRAINT `fk_request_subtype_app_id` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`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`( "
@@ -440,6 +448,8 @@ const std::string kDropSchema =
"DROP TABLE IF EXISTS `consent_group`; "
"DROP INDEX IF EXISTS `app_type.fk_app_type_application1_idx`; "
"DROP TABLE IF EXISTS `app_type`; "
+ "DROP TABLE IF EXISTS `request_type`; "
+ "DROP TABLE IF EXISTS `request_subtype`; "
"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`; "
@@ -582,7 +592,12 @@ const std::string kInsertAppType =
"INSERT OR IGNORE INTO `app_type` (`application_id`, `name`) VALUES (?, ?)";
const std::string kInsertRequestType =
- "INSERT OR IGNORE INTO `request_type` (`application_id`, `request_type`) "
+ "INSERT INTO `request_type` (`application_id`, `request_type`) "
+ "VALUES (?, ?)";
+
+const std::string kInsertRequestSubType =
+ "INSERT INTO `request_subtype` (`application_id`, "
+ "`request_subtype`) "
"VALUES (?, ?)";
const std::string kUpdateVersion = "UPDATE `version` SET `number`= ?";
@@ -695,6 +710,11 @@ const std::string kSelectRequestTypes =
"SELECT DISTINCT `request_type` FROM `request_type` WHERE `application_id` "
"= ?";
+const std::string kSelectRequestSubTypes =
+ "SELECT DISTINCT `request_subtype` FROM `request_subtype` WHERE "
+ "`application_id` "
+ "= ?";
+
const std::string kSelectSecondsBetweenRetries =
"SELECT `value` FROM `seconds_between_retry` ORDER BY `index`";
@@ -740,6 +760,8 @@ const std::string kDeleteApplication = "DELETE FROM `application`";
const std::string kDeleteRequestType = "DELETE FROM `request_type`";
+const std::string kDeleteRequestSubType = "DELETE FROM `request_subtype`";
+
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 9840a08b26..75f8be74eb 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -187,10 +187,10 @@ int SQLPTRepresentation::TimeoutResponse() {
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
- const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ const int defaultTimeout = 30 * date_time::MILLISECONDS_IN_SECOND;
return defaultTimeout;
}
- return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return query.GetInteger(0) * date_time::MILLISECONDS_IN_SECOND;
}
bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
@@ -483,10 +483,10 @@ bool SQLPTRepresentation::RefreshDB() {
return true;
}
-utils::SharedPtr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
+std::shared_ptr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
const {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ auto table = std::make_shared<policy_table::Table>();
GatherModuleMeta(&*table->policy_table.module_meta);
GatherModuleConfig(&table->policy_table.module_config);
GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
@@ -692,6 +692,7 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
while (query.Next()) {
rpc::Nullable<policy_table::ApplicationParams> params;
const std::string& app_id = query.GetString(0);
+
if (IsApplicationRevoked(app_id)) {
params.set_to_null();
(*policies).apps[app_id] = params;
@@ -720,27 +721,36 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!query.IsNull(3)) {
*params.certificate = query.GetString(4);
}
- if (!GatherAppGroup(app_id, &params.groups)) {
+
+ const auto& gather_app_id = ((*policies).apps[app_id].is_string())
+ ? (*policies).apps[app_id].get_string()
+ : app_id;
+ // Data should be gathered from db by "default" key if application has
+ // default policies
+
+ if (!GatherAppGroup(gather_app_id, &params.groups)) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
bool denied = false;
- if (!GatherRemoteControlDenied(app_id, &denied)) {
+ if (!GatherRemoteControlDenied(gather_app_id, &denied)) {
return false;
}
if (!denied) {
- if (!GatherModuleType(app_id, &*params.moduleType)) {
+ if (!GatherModuleType(gather_app_id, &*params.moduleType)) {
return false;
}
}
-#endif // SDL_REMOTE_CONTROL
- if (!GatherNickName(app_id, &*params.nicknames)) {
+ if (!GatherNickName(gather_app_id, &*params.nicknames)) {
return false;
}
- if (!GatherAppType(app_id, &*params.AppHMIType)) {
+ if (!GatherAppType(gather_app_id, &*params.AppHMIType)) {
return false;
}
- if (!GatherRequestType(app_id, &*params.RequestType)) {
+ if (!GatherRequestType(gather_app_id, &*params.RequestType)) {
+ return false;
+ }
+
+ if (!GatherRequestSubType(gather_app_id, &*params.RequestSubType)) {
return false;
}
@@ -837,6 +847,7 @@ bool SQLPTRepresentation::SaveFunctionalGroupings(
bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
const policy_table::Rpc& rpcs) {
+ LOG4CXX_AUTO_TRACE(logger_);
utils::dbms::SQLQuery query(db());
utils::dbms::SQLQuery query_parameter(db());
if (!query.Prepare(sql_pt::kInsertRpc) ||
@@ -900,12 +911,10 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) {
LOG4CXX_WARN(logger_, "Incorrect delete from module_type.");
return false;
}
-#endif // SDL_REMOTE_CONTROL
if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
LOG4CXX_WARN(logger_, "Incorrect delete from application.");
return false;
@@ -916,6 +925,11 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request subtype.");
+ 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
@@ -988,13 +1002,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
bool denied = !app.second.moduleType->is_initialized();
if (!SaveRemoteControlDenied(app.first, denied) ||
!SaveModuleType(app.first, *app.second.moduleType)) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
}
@@ -1006,6 +1018,10 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
+
return true;
}
@@ -1109,15 +1125,59 @@ bool SQLPTRepresentation::SaveRequestType(
}
policy_table::RequestTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ LOG4CXX_WARN(logger_, "Request types not empty.");
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request types empty.");
query.Bind(0, app_id);
- query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::RequestType::RT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
return false;
}
}
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for request subtypes.");
+ return false;
+ }
+ policy_table::Strings::const_iterator it;
+ if (!request_subtypes.empty()) {
+ LOG4CXX_TRACE(logger_, "Request subtypes are not empty.");
+ for (it = request_subtypes.begin(); it != request_subtypes.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
+ } else if (request_subtypes.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request subtypes empty.");
+ query.Bind(0, app_id);
+ query.Bind(1, std::string("EMPTY"));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
return true;
}
@@ -1529,11 +1589,36 @@ bool SQLPTRepresentation::GatherRequestType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::RequestType::RT_EMPTY == type) {
+ request_types->mark_initialized();
+ continue;
+ }
request_types->push_back(type);
}
return true;
}
+bool SQLPTRepresentation::GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRequestSubTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from request subtypes.");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ const std::string request_subtype = query.GetString(0);
+ if ("EMPTY" == request_subtype) {
+ request_subtypes->mark_initialized();
+ continue;
+ }
+ request_subtypes->push_back(request_subtype);
+ }
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -1564,8 +1649,6 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
-#ifdef SDL_REMOTE_CONTROL
-
bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
bool* denied) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1597,6 +1680,10 @@ bool SQLPTRepresentation::GatherModuleType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::ModuleType::MT_EMPTY == type) {
+ app_types->mark_initialized();
+ continue;
+ }
app_types->push_back(type);
}
return true;
@@ -1629,18 +1716,30 @@ bool SQLPTRepresentation::SaveModuleType(
}
policy_table::ModuleTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
query.Bind(0, app_id);
- std::string module(policy_table::EnumToJsonString(*it));
- query.Bind(1, module);
- LOG4CXX_DEBUG(logger_,
- "Module(app: " << app_id << ", type: " << module << ")");
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::ModuleType::MT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ LOG4CXX_WARN(logger_, "Incorrect insert into module types.");
return false;
}
+ } else {
+ LOG4CXX_WARN(logger_, "Module Type omitted.");
}
-
return true;
}
@@ -1755,7 +1854,6 @@ bool SQLPTRepresentation::GatherRemoteRpc(
}
return true;
}
-#endif // SDL_REMOTE_CONTROL
bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
bool is_revoked,
@@ -1858,6 +1956,13 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
!SaveRequestType(app_id, request_types)) {
return false;
}
+
+ policy_table::Strings request_subtypes;
+ if (!GatherRequestSubType(kDefaultId, &request_subtypes) ||
+ !SaveRequestSubType(app_id, request_subtypes)) {
+ return false;
+ }
+
policy_table::AppHMITypes app_types;
if (!GatherAppType(kDefaultId, &app_types) ||
!SaveAppType(app_id, app_types)) {
diff --git a/src/components/policy/policy_regular/src/status.cc b/src/components/policy/policy_regular/src/status.cc
index 8d65c606d0..00a6a95af3 100644
--- a/src/components/policy/policy_regular/src/status.cc
+++ b/src/components/policy/policy_regular/src/status.cc
@@ -32,7 +32,6 @@
#include "policy/status.h"
#include "policy/update_status_manager_interface.h"
-#include "utils/make_shared.h"
policy::UpToDateStatus::UpToDateStatus()
: Status("UP_TO_DATE", policy::PolicyTableStatus::StatusUpToDate) {}
@@ -44,7 +43,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManagerInterface* manager,
case kOnResetPolicyTableRequireUpdate:
case kScheduleUpdate:
case kOnResetRetrySequence:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -59,17 +58,17 @@ void policy::UpdateNeededStatus::ProcessEvent(
policy::UpdateStatusManagerInterface* manager, policy::UpdateEvent event) {
switch (event) {
case kOnUpdateSentOut:
- manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ manager->SetNextStatus(std::make_shared<UpdatingStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -88,22 +87,22 @@ void policy::UpdatingStatus::ProcessEvent(
switch (event) {
case kOnValidUpdateReceived:
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnWrongUpdateReceived:
case kOnUpdateTimeout:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kScheduleUpdate:
case kOnResetRetrySequence:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc
index 941113c753..c37f8bbadc 100644
--- a/src/components/policy/policy_regular/src/update_status_manager.cc
+++ b/src/components/policy/policy_regular/src/update_status_manager.cc
@@ -33,7 +33,6 @@
#include "policy/update_status_manager.h"
#include "policy/policy_listener.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace policy {
@@ -41,7 +40,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
UpdateStatusManager::UpdateStatusManager()
: listener_(NULL)
- , current_status_(utils::MakeShared<UpToDateStatus>())
+ , current_status_(std::make_shared<UpToDateStatus>())
, last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
, app_registered_from_non_consented_device_(true) {}
@@ -55,11 +54,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
DoTransition();
}
-void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) {
next_status_ = status;
}
-void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetPostponedStatus(std::shared_ptr<Status> status) {
postponed_status_ = status;
}
@@ -101,6 +100,15 @@ void UpdateStatusManager::OnResetRetrySequence() {
ProcessEvent(kOnResetRetrySequence);
}
+void UpdateStatusManager::OnExistedApplicationAdded(
+ const bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ current_status_.reset(new UpToDateStatus());
+ ProcessEvent(kScheduleUpdate);
+ }
+}
+
void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
LOG4CXX_AUTO_TRACE(logger_);
if (kDeviceAllowed != consent) {
@@ -111,14 +119,6 @@ void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
ProcessEvent(kOnNewAppRegistered);
}
-void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (is_update_required) {
- current_status_.reset(new UpToDateStatus());
- ProcessEvent(kScheduleUpdate);
- }
-}
-
void UpdateStatusManager::OnDeviceConsented() {
LOG4CXX_AUTO_TRACE(logger_);
if (app_registered_from_non_consented_device_) {
diff --git a/src/components/policy/policy_regular/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
index 60e34a929d..ed16fa3e8d 100644
--- a/src/components/policy/policy_regular/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
@@ -36,13 +36,13 @@
#include <cassert>
#include "policy/usage_statistics/counter.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace usage_statistics {
GlobalCounter::GlobalCounter(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type)
: counter_type_(counter_type), statistics_manager_(statistics_manager) {}
@@ -52,7 +52,7 @@ void GlobalCounter::operator++() const {
}
}
-AppCounter::AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+AppCounter::AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type)
: app_id_(app_id)
@@ -65,7 +65,7 @@ void AppCounter::operator++() const {
}
}
-AppInfo::AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+AppInfo::AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type)
: app_id_(app_id)
@@ -79,7 +79,7 @@ void AppInfo::Update(const std::string& new_info) const {
}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id)
: app_id_(app_id)
, stopwatch_type_(SECONDS_HMI_NONE)
@@ -90,7 +90,7 @@ AppStopwatchImpl::AppStopwatchImpl(
, time_out_(60) {}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
uint32_t timeout)
: app_id_(app_id)
@@ -103,8 +103,7 @@ AppStopwatchImpl::AppStopwatchImpl(
void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND,
- timer::kPeriodic);
+ timer_.Start(time_out_ * date_time::MILLISECONDS_IN_SECOND, timer::kPeriodic);
}
void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {
diff --git a/src/components/policy/policy_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt
index 62ff691f83..bd6af96867 100644
--- a/src/components/policy/policy_regular/test/CMakeLists.txt
+++ b/src/components/policy/policy_regular/test/CMakeLists.txt
@@ -45,11 +45,6 @@ include_directories(
)
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
-if (NOT REMOTE_CONTROL)
- list (REMOVE_ITEM SOURCES
- ${CMAKE_CURRENT_SOURCE_DIR}/access_remote_impl_test.cc
- )
-endif ()
set(LIBRARIES
gmock
diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json
index 6d663e9a0c..2f4735dd66 100644
--- a/src/components/policy/policy_regular/test/PTU.json
+++ b/src/components/policy/policy_regular/test/PTU.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json
index 4062e94516..806ab8bcc0 100644
--- a/src/components/policy/policy_regular/test/PTU2.json
+++ b/src/components/policy/policy_regular/test/PTU2.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json
index 78596189da..28396be29a 100644
--- a/src/components/policy/policy_regular/test/PTU3.json
+++ b/src/components/policy/policy_regular/test/PTU3.json
@@ -83,7 +83,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json
index ab4c2f8927..4592e228df 100644
--- a/src/components/policy/policy_regular/test/PTU4.json
+++ b/src/components/policy/policy_regular/test/PTU4.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
index d086144d86..f79bb683f8 100644
--- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc
+++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
@@ -37,7 +37,7 @@ namespace policy {
TEST(AccessRemoteImplTest, CheckModuleType) {
AccessRemoteImpl access_remote;
- access_remote.cache_->pt_ = new policy_table::Table();
+ access_remote.cache_->pt_ = std::make_shared<policy_table::Table>();
// No application
EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
@@ -81,7 +81,7 @@ TEST(AccessRemoteImplTest, GetGroups) {
ApplicationOnDevice who = {"dev1", "1234"};
access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL);
- access_remote.cache_->pt_ = new policy_table::Table();
+ access_remote.cache_->pt_ = std::make_shared<policy_table::Table>();
policy_table::ApplicationPolicies& apps =
access_remote.cache_->pt_->policy_table.app_policies_section.apps;
apps["1234"].groups.push_back("group_default");
diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc
index 2c0ab73c0b..d11bcec2ac 100644
--- a/src/components/policy/policy_regular/test/counter_test.cc
+++ b/src/components/policy/policy_regular/test/counter_test.cc
@@ -53,7 +53,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -67,7 +67,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -82,7 +82,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -96,7 +96,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -110,7 +110,7 @@ TEST(
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -123,7 +123,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -138,7 +138,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
@@ -155,7 +155,7 @@ TEST(StatisticsManagerAddMethod,
TEST(StatisticsManagerAddMethod,
DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
@@ -171,7 +171,7 @@ TEST(
StatisticsManagerAddMethod,
DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h
deleted file mode 100644
index 34ad6af5a6..0000000000
--- a/src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
-
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-
-#include "policy/pt_ext_representation.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
-#include "mock_pt_representation.h"
-
-namespace policy_table = ::rpc::policy_table_interface_base;
-
-namespace policy {
-class MockPTExtRepresentation : public MockPTRepresentation,
- public PTExtRepresentation {
- public:
- MOCK_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
- MOCK_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
- MOCK_METHOD2(GetDefaultHMI,
- bool(const std::string& app_id, std::string* default_hmi));
- MOCK_METHOD0(ResetUserConsent, bool());
- MOCK_METHOD0(ResetDeviceConsents, bool());
- MOCK_METHOD0(ResetAppConsents, bool());
- MOCK_METHOD3(GetUserPermissionsForDevice,
- bool(const std::string&, StringArray*, StringArray*));
- MOCK_METHOD3(GetPermissionsForApp,
- bool(const std::string&,
- const std::string&,
- FunctionalIdType* group_types));
- MOCK_METHOD2(GetDeviceGroupsFromPolicies,
- bool(policy_table::Strings*, policy_table::Strings*));
- MOCK_METHOD2(
- GetUserFriendlyMsg,
- std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
- const std::string& language));
- MOCK_METHOD8(SetDeviceData,
- bool(const std::string& device_id,
- const std::string& hardware,
- const std::string& firmware,
- const std::string& os,
- const std::string& os_version,
- const std::string& carrier,
- const uint32_t number_of_ports,
- const std::string& connection_type));
- MOCK_METHOD6(SetDeviceData,
- bool(const std::string&,
- const std::string&,
- const std::string&,
- const std::string&,
- const std::string&,
- const std::string&));
- MOCK_METHOD2(SetMaxNumberPorts,
- bool(const std::string& device_id,
- unsigned int number_of_ports));
- MOCK_METHOD3(SetUserPermissionsForDevice,
- bool(const std::string&,
- const StringArray&,
- const StringArray&));
- MOCK_METHOD1(SetUserPermissionsForApp, bool(const PermissionConsent&));
- MOCK_METHOD1(IncreaseStatisticsData, bool(StatisticsType type));
- MOCK_METHOD3(SetAppRegistrationLanguage,
- bool(const std::string& app_id,
- LanguageType type,
- const std::string& language));
- MOCK_METHOD3(SetMetaInfo,
- bool(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& vin));
- MOCK_METHOD0(IsMetaInfoPresent, bool());
- MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
- MOCK_METHOD0(GetKmFromSuccessfulExchange, int());
- MOCK_METHOD0(GetDayFromScsExchange, int());
- MOCK_METHOD0(GetIgnitionsFromScsExchange, int());
- MOCK_CONST_METHOD1(Increment, void(const std::string& type));
- MOCK_CONST_METHOD2(Increment,
- void(const std::string& app_id, const std::string& type));
- MOCK_CONST_METHOD3(Set,
- void(const std::string& app_id,
- const std::string& type,
- const std::string& value));
- MOCK_CONST_METHOD3(Add,
- void(const std::string& app_id,
- const std::string& type,
- int seconds));
- MOCK_CONST_METHOD3(CountUnconsentedGroups,
- bool(const std::string& app_id,
- const std::string& device_id,
- int* count));
- MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
- MOCK_CONST_METHOD1(CleanupUnpairedDevices, bool(const DeviceIds& device_ids));
- MOCK_METHOD2(ReactOnUserDevConsentForApp,
- bool(const std::string& app_id, bool is_device_allowed));
- MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id));
- MOCK_METHOD2(SetIsPredata, bool(const std::string& app_id, bool is_predata));
- MOCK_CONST_METHOD2(SetUnpairedDevice,
- bool(const std::string& device_id, bool unpaired));
- MOCK_CONST_METHOD1(UnpairedDevicesList, bool(DeviceIds* device_ids));
- MOCK_CONST_METHOD2(RemoveAppConsentForGroup,
- bool(const std::string& policy_app_id,
- const std::string& functional_group));
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
index 8a47e7ca97..72f183175c 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
@@ -76,7 +76,7 @@ class MockPTRepresentation : virtual public PTRepresentation {
MOCK_METHOD0(Close, bool());
MOCK_METHOD0(Clear, bool());
MOCK_METHOD0(Drop, bool());
- MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
MOCK_METHOD1(SaveUpdateRequired, void(bool value));
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h
index 924284c8cc..e66d2012cb 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h
+++ b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h
@@ -47,8 +47,8 @@ class MockUpdateStatusManager : public UpdateStatusManager {
MOCK_METHOD0(OnWrongUpdateReceived, void());
MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required));
MOCK_METHOD0(OnResetRetrySequence, void());
+ MOCK_METHOD1(OnExistedApplicationAdded, void(const bool is_update_required));
MOCK_METHOD0(OnNewApplicationAdded, void());
- MOCK_METHOD1(OnPolicyInit, void(bool is_update_required));
MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus());
};
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index f76e856cd0..ff054b3cc4 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -51,11 +51,10 @@
#include "utils/macro.h"
#include "utils/file_system.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/gen_hash.h"
-#ifdef SDL_REMOTE_CONTROL
#include "policy/mock_access_remote.h"
-#endif // SDL_REMOTE_CONTROL
+
using ::testing::ReturnRef;
using ::testing::DoAll;
using ::testing::SetArgReferee;
@@ -146,20 +145,15 @@ class PolicyManagerImplTest : public ::testing::Test {
MockCacheManagerInterface* cache_manager;
NiceMock<MockPolicyListener> listener;
const std::string device_id;
-#ifdef SDL_REMOTE_CONTROL
- utils::SharedPtr<access_remote_test::MockAccessRemote> access_remote;
-#endif // SDL_REMOTE_CONTROL
+ std::shared_ptr<access_remote_test::MockAccessRemote> access_remote;
void SetUp() OVERRIDE {
manager = new PolicyManagerImpl();
manager->set_listener(&listener);
cache_manager = new MockCacheManagerInterface();
manager->set_cache_manager(cache_manager);
-
-#ifdef SDL_REMOTE_CONTROL
- access_remote = new access_remote_test::MockAccessRemote();
+ access_remote = std::shared_ptr<access_remote_test::MockAccessRemote>();
manager->set_access_remote(access_remote);
-#endif // SDL_REMOTE_CONTROL
}
void TearDown() OVERRIDE {
@@ -181,7 +175,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
public:
PolicyManagerImplTest2()
: app_id1("123456789")
- , app_id2("1766825573")
+ , app_id2("1010101010")
, dev_id1("XXX123456789ZZZ")
, dev_id2("08-00-27-CE-76-FE")
, PTU_request_types(Json::arrayValue) {}
@@ -208,6 +202,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
manager = new PolicyManagerImpl();
ON_CALL(policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, use_full_app_id()).WillByDefault(Return(true));
manager->set_listener(&listener);
const char* levels[] = {"BACKGROUND", "FULL", "LIMITED", "NONE"};
hmi_level.assign(levels, levels + sizeof(levels) / sizeof(levels[0]));
@@ -244,6 +239,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
file_system::remove_directory_content(kAppStorageFolder);
ON_CALL(policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, use_full_app_id()).WillByDefault(Return(true));
ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_));
}
@@ -358,7 +354,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
// Get cache
::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
// Get table_snapshot
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Set functional groupings from policy table
input_functional_groupings = table->policy_table.functional_groupings;
}
@@ -387,12 +383,12 @@ Json::Value CreatePTforLoad() {
"}"
"},"
"\"notifications_per_minute_by_priority\": {"
- "\"emergency\": 1,"
- "\"navigation\": 2,"
- "\"VOICECOMM\": 3,"
- "\"communication\": 4,"
- "\"normal\": 5,"
- "\"none\": 6"
+ "\"EMERGENCY\": 1,"
+ "\"NAVIGATION\": 2,"
+ "\"VOICECOM\": 3,"
+ "\"COMMUNICATION\": 4,"
+ "\"NORMAL\": 5,"
+ "\"NONE\": 6"
"},"
"\"vehicle_make\" : \"MakeT\","
"\"vehicle_model\" : \"ModelT\","
@@ -472,6 +468,7 @@ TEST_F(PolicyManagerImplTest, GetNotificationsNumber) {
TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
// Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
Json::Value table = CreatePTforLoad();
manager->ForcePTExchange();
manager->SetSendOnUpdateSentOut(false);
@@ -484,32 +481,33 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
EXPECT_CALL(listener, OnUpdateStatusChanged(_));
EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
- std::string priority = "emergency";
+ std::string priority = "EMERGENCY";
uint32_t notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "navigation";
+ priority = "NAVIGATION";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(2u, notif_number);
- priority = "emergency";
+ priority = "EMERGENCY";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "VOICECOMM";
+ priority = "VOICECOM";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(3u, notif_number);
- priority = "normal";
+ priority = "NORMAL";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(5u, notif_number);
- priority = "none";
+ priority = "NONE";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(6u, notif_number);
}
TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) {
+ CreateLocalPT("sdl_preloaded_pt.json");
// Arrange
std::ifstream ifile("sdl_preloaded_pt.json");
Json::Reader reader;
@@ -726,8 +724,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
const std::string json = table.toStyledString();
::policy::BinaryMessage msg(json.begin(), json.end());
- utils::SharedPtr<policy_table::Table> snapshot =
- utils::MakeShared<policy_table::Table>(update.policy_table);
+ std::shared_ptr<policy_table::Table> snapshot =
+ std::make_shared<policy_table::Table>(update.policy_table);
// Assert
EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot));
EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true));
@@ -840,9 +838,9 @@ TEST_F(PolicyManagerImplTest2,
PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- int days = current_time.tv_sec / kSecondsInDay;
+ int days = date_time::getSecs(current_time) / kSecondsInDay;
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
GetPTU("valid_sdl_pt_update.json");
@@ -900,24 +898,24 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
uint32_t timeout_after_x_seconds =
root["policy_table"]["module_config"]["timeout_after_x_seconds"]
.asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
const uint32_t first_retry = timeout_after_x_seconds;
EXPECT_EQ(first_retry, manager->NextRetryTimeout());
- uint32_t next_retry = first_retry +
- seconds_between_retries[0].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ uint32_t next_retry =
+ first_retry +
+ seconds_between_retries[0].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[1].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[1].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[2].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[2].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[3].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[3].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
}
}
@@ -967,7 +965,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
// Arrange
::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Get FunctionalGroupings
policy_table::FunctionalGroupings& fc =
table->policy_table.functional_groupings;
@@ -1259,7 +1257,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
GetPTU("valid_sdl_pt_update.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt();
+ std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt();
policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo();
@@ -1340,7 +1338,7 @@ TEST_F(
HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt();
+ std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt();
::policy_table::PolicyTableType type1 =
::policy_table::PolicyTableType::PT_PRELOADED;
pt->SetPolicyTableType(type1);
diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json
index 50364397fd..2a05a94f8b 100644
--- a/src/components/policy/policy_regular/test/ptu2_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu2_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -416,6 +416,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -432,6 +433,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -448,6 +450,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -464,6 +467,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -485,12 +489,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -506,12 +513,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -527,12 +537,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -547,12 +560,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2595,7 +2611,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json
index 44bd8356fe..b0d9117568 100644
--- a/src/components/policy/policy_regular/test/ptu_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -416,6 +416,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -432,6 +433,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -448,6 +450,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -464,6 +467,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -485,12 +489,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -506,12 +513,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -527,12 +537,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -547,12 +560,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2590,7 +2606,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
index d6f34c12fc..59e3f947c3 100644
--- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
@@ -14,12 +14,13 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"COMMUNICATION": 6,
"NORMAL": 4,
"NONE": 0
@@ -296,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +354,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +374,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +394,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +413,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
index e6817da0d3..7b882c6ceb 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
index d5f5f480f3..7d90275328 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json
index a332f92382..909e4d5238 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1433,6 +1433,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1445,6 +1446,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1457,6 +1459,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1469,6 +1472,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1587,12 +1591,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1602,12 +1609,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1617,12 +1627,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1631,12 +1644,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1698,7 +1714,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
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 fd83c82b1a..7d192515dc 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
@@ -47,8 +47,7 @@
#include "json/writer.h"
#include "json/reader.h"
#include "rpc_base/rpc_base.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "utils/sqlite_wrapper/sql_database.h"
@@ -78,12 +77,12 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
static const std::string kDatabaseName;
static const std::string kAppStorageFolder;
// Gtest can show message that this object doesn't destroyed
- std::auto_ptr<NiceMock<MockPolicySettings> > policy_settings_;
+ std::unique_ptr<NiceMock<MockPolicySettings> > policy_settings_;
void SetUp() OVERRIDE {
file_system::CreateDirectory(kAppStorageFolder);
reps = new SQLPTRepresentation;
- policy_settings_ = std::auto_ptr<NiceMock<MockPolicySettings> >(
+ policy_settings_ = std::unique_ptr<NiceMock<MockPolicySettings> >(
new NiceMock<MockPolicySettings>());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
@@ -289,6 +288,7 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
app_policies["default"]["default_hmi"] = Json::Value("FULL");
app_policies["default"]["keep_context"] = Json::Value(true);
app_policies["default"]["steal_focus"] = Json::Value(true);
+ app_policies["default"]["RequestType"] = Json::Value(Json::arrayValue);
app_policies["pre_DataConsent"] = Json::Value(Json::objectValue);
app_policies["pre_DataConsent"]["memory_kb"] = Json::Value(40);
@@ -300,6 +300,9 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
app_policies["pre_DataConsent"]["is_revoked"] = Json::Value(false);
app_policies["pre_DataConsent"]["keep_context"] = Json::Value(true);
app_policies["pre_DataConsent"]["steal_focus"] = Json::Value(true);
+ app_policies["pre_DataConsent"]["RequestType"] =
+ Json::Value(Json::arrayValue);
+
app_policies["1234"] = Json::Value(Json::objectValue);
app_policies["1234"]["memory_kb"] = Json::Value(150);
app_policies["1234"]["heart_beat_timeout_ms"] = Json::Value(200);
@@ -310,6 +313,8 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
app_policies["1234"]["is_revoked"] = Json::Value(true);
app_policies["1234"]["keep_context"] = Json::Value(false);
app_policies["1234"]["steal_focus"] = Json::Value(false);
+ app_policies["1234"]["RequestType"] = Json::Value(Json::arrayValue);
+
app_policies["device"] = Json::Value(Json::objectValue);
app_policies["device"]["groups"] = Json::Value(Json::arrayValue);
app_policies["device"]["groups"][0] = Json::Value("default");
@@ -420,7 +425,9 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_EQ(0, dbms->FetchOneInt(query_select));
ASSERT_TRUE(reps->RefreshDB());
// Check PT structure destroyed and tables number is 0
- const int32_t total_tables_number = 28;
+
+ // There are 29 tables in the database, now.
+ const int32_t total_tables_number = 29;
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`";
@@ -1509,7 +1516,7 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
// Remove fields which must be absent in snapshot
table["policy_table"]["consumer_friendly_messages"].removeMember("messages");
diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc
index 9d0326d0be..244858554f 100644
--- a/src/components/policy/policy_regular/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc
@@ -34,7 +34,6 @@
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
namespace test {
namespace components {
@@ -46,13 +45,13 @@ using ::testing::Return;
class UpdateStatusManagerTest : public ::testing::Test {
protected:
- utils::SharedPtr<UpdateStatusManager> manager_;
- utils::SharedPtr<MockPolicyListener> listener_;
+ std::shared_ptr<UpdateStatusManager> manager_;
+ std::shared_ptr<MockPolicyListener> listener_;
public:
UpdateStatusManagerTest()
- : manager_(utils::MakeShared<UpdateStatusManager>())
- , listener_(utils::MakeShared<MockPolicyListener>()) {}
+ : manager_(std::make_shared<UpdateStatusManager>())
+ , listener_(std::make_shared<MockPolicyListener>()) {}
void SetUp() OVERRIDE {
manager_->set_listener(listener_.get());
@@ -63,20 +62,6 @@ class UpdateStatusManagerTest : public ::testing::Test {
};
TEST_F(UpdateStatusManagerTest,
- StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) {
- // Arrange
- manager_->OnPolicyInit(false);
- // Check
- EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus());
- manager_->OnPolicyInit(true);
- // Check
- EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus());
- manager_->OnUpdateSentOut();
- // Check
- EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus());
-}
-
-TEST_F(UpdateStatusManagerTest,
OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) {
// Arrange
manager_->OnAppsSearchStarted();
diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
index 56c728f104..5827ab287a 100644
--- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1585,12 +1589,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1600,12 +1607,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1615,12 +1625,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1629,12 +1642,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1696,7 +1712,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/protocol/src/bson_object_keys.cc b/src/components/protocol/src/bson_object_keys.cc
index fb225b1461..11160d7082 100644
--- a/src/components/protocol/src/bson_object_keys.cc
+++ b/src/components/protocol/src/bson_object_keys.cc
@@ -12,6 +12,12 @@ const char* height = "height";
const char* width = "width";
const char* video_protocol = "videoProtocol";
const char* video_codec = "videoCodec";
+const char* secondary_transports = "secondaryTransports";
+const char* audio_service_transports = "audioServiceTransports";
+const char* video_service_transports = "videoServiceTransports";
+const char* tcp_ip_address = "tcpIpAddress";
+const char* tcp_port = "tcpPort";
+const char* reason = "reason";
} // namespace strings
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index ed3aaaf24c..ff8678b826 100644
--- a/src/components/protocol_handler/CMakeLists.txt
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -65,7 +65,6 @@ endforeach()
add_library(ProtocolHandler ${SOURCES})
-add_dependencies(ProtocolHandler libbson)
target_link_libraries(ProtocolHandler ${LIBRARIES})
if(BUILD_TESTS)
diff --git a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
index 0ef40290f2..cb52c9d375 100644
--- a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
+++ b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
@@ -40,6 +40,8 @@
#include "protocol_handler/session_observer.h"
#include "security_manager/security_manager_listener.h"
+#include "utils/semantic_version.h"
+
namespace protocol_handler {
class ProtocolHandlerImpl;
@@ -50,25 +52,12 @@ class ProtocolHandlerImpl;
*/
class HandshakeHandler : public security_manager::SecurityManagerListener {
public:
- DEPRECATED HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
- SessionObserver& session_observer,
- uint32_t connection_key,
- ConnectionID connection_id,
- uint8_t session_id,
- uint8_t protocol_version,
- uint32_t hash_id,
- ServiceType service_type,
- const std::vector<int>& force_protected_service,
- const bool is_new_service,
- ProtocolPacket::ProtocolVersion& full_version,
- std::shared_ptr<uint8_t> payload);
-
HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
SessionObserver& session_observer,
- ProtocolPacket::ProtocolVersion& full_version,
+ utils::SemanticVersion& full_version,
const SessionContext& context,
const uint8_t protocol_version,
- std::shared_ptr<uint8_t> payload);
+ std::shared_ptr<BsonObject> payload);
~HandshakeHandler();
@@ -90,6 +79,12 @@ class HandshakeHandler : public security_manager::SecurityManagerListener {
security_manager::SSLContext::HandshakeResult result) OVERRIDE;
/**
+ * @brief Notification about handshake failure
+ * @return true on success notification handling or false otherwise
+ */
+ bool OnHandshakeFailed() OVERRIDE;
+
+ /**
* @brief Notification that certificate update is required.
*/
void OnCertificateUpdateRequired() OVERRIDE;
@@ -118,9 +113,9 @@ class HandshakeHandler : public security_manager::SecurityManagerListener {
ProtocolHandlerImpl& protocol_handler_;
SessionObserver& session_observer_;
SessionContext context_;
- ProtocolPacket::ProtocolVersion full_version_;
+ utils::SemanticVersion full_version_;
const uint8_t protocol_version_;
- std::shared_ptr<uint8_t> payload_;
+ std::shared_ptr<BsonObject> payload_;
};
} // namespace protocol_handler
diff --git a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
index bac37b508c..84ec3c9e30 100644
--- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
+++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
@@ -60,7 +60,7 @@ typedef uint32_t MessageID;
struct ProtocolFrameData {
ProtocolFramePtr frame;
- TimevalStruct append_time;
+ date_time::TimeDuration append_time;
};
/**
*\brief Map of frames with last frame data for messages received in multiple
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
index 0efb81cdd7..3e7d64e9d2 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
@@ -42,8 +42,10 @@
#include "utils/prioritized_queue.h"
#include "utils/message_queue.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/shared_ptr.h"
+
#include "utils/messagemeter.h"
+#include "utils/custom_string.h"
+#include "utils/semantic_version.h"
#include "protocol_handler/protocol_handler.h"
#include "protocol_handler/protocol_packet.h"
@@ -55,6 +57,7 @@
#include "transport_manager/common.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener_empty.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
#include "connection_handler/connection_handler.h"
#include "application_manager/policies/policy_handler_observer.h"
@@ -131,6 +134,30 @@ typedef threads::MessageLoopThread<
utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue;
typedef threads::MessageLoopThread<
utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue;
+
+// Type to allow easy mapping between a device type and transport
+// characteristics
+typedef enum {
+ TT_NONE = -1,
+ TT_USB = 0,
+ TT_BLUETOOTH = 1,
+ TT_WIFI = 2
+} TransportType;
+
+struct TransportDescription {
+ TransportDescription(const TransportType transport_type,
+ const bool ios_transport,
+ const bool android_transport)
+ : transport_type_(transport_type)
+ , ios_transport_(ios_transport)
+ , android_transport_(android_transport) {}
+
+ TransportType transport_type_;
+ bool ios_transport_;
+ bool android_transport_;
+};
+
+typedef std::map<std::string, TransportDescription> TransportTypes;
} // namespace impl
/**
@@ -231,10 +258,20 @@ class ProtocolHandlerImpl
*/
void SendEndSession(int32_t connection_id, uint8_t session_id);
- void SendEndService(int32_t connection_id,
+ /**
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
+ void SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type);
+ void NotifyOnFailedHandshake() OVERRIDE;
+
// TODO(Ezamakhov): move Ack/Nack as interface for StartSessionHandler
/**
* \brief Sends acknowledgement of starting session to mobile application
@@ -277,7 +314,7 @@ class ProtocolHandlerImpl
uint32_t hash_code,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version);
+ utils::SemanticVersion& full_version);
/**
* \brief Sends acknowledgement of starting session to mobile application
@@ -301,7 +338,7 @@ class ProtocolHandlerImpl
uint32_t hash_code,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version,
+ utils::SemanticVersion& full_version,
BsonObject& params);
const ProtocolHandlerSettings& get_settings() const OVERRIDE {
@@ -381,27 +418,6 @@ class ProtocolHandlerImpl
SessionObserver& get_session_observer() OVERRIDE;
/**
- * \brief Called by connection handler to notify the result of
- * OnSessionStartedCallback().
- * \param connection_id Identifier of connection within which session exists
- * \param session_id session ID passed to OnSessionStartedCallback()
- * \param generated_session_id Generated session ID, will be 0 if session is
- * not started
- * \param hash_id Generated Hash ID
- * \param protection whether the service will be protected
- * \param rejected_params list of parameters' name that are rejected.
- * Only valid when generated_session_id is 0. Note, even if
- * generated_session_id is 0, the list may be empty.
- */
- DEPRECATED void NotifySessionStartedResult(
- int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params) OVERRIDE;
-
- /**
* @brief Called by connection handler to notify the result of
* OnSessionStartedCallback().
* @param context reference to structure with started session data
@@ -420,10 +436,19 @@ class ProtocolHandlerImpl
const impl::ToMobileQueue& get_to_mobile_queue() const {
return raw_ford_messages_to_mobile_;
}
+
+ void set_tcp_config(bool tcp_enabled,
+ std::string tcp_address,
+ std::string tcp_port) {
+ tcp_enabled_ = tcp_enabled;
+ tcp_ip_address_ = tcp_address;
+ tcp_port_ = tcp_port;
+ }
#endif
private:
- void SendEndServicePrivate(int32_t connection_id,
+ void SendEndServicePrivate(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type);
@@ -434,6 +459,28 @@ class ProtocolHandlerImpl
uint8_t session_id,
uint32_t message_id);
+ /*
+ * Prepare and send TransportUpdateEvent message
+ */
+ void SendTransportUpdateEvent(ConnectionID connection_id, uint8_t session_id);
+
+ /*
+ * Prepare and send RegisterSecondaryTransportAck message
+ */
+ RESULT_CODE SendRegisterSecondaryTransportAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id);
+
+ /*
+ * Prepare and send RegisterSecondaryTransportNAck message
+ */
+ RESULT_CODE SendRegisterSecondaryTransportNAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id,
+ BsonObject* reason = NULL);
+
/**
* @brief Notifies about receiving message from TM.
*
@@ -472,13 +519,18 @@ class ProtocolHandlerImpl
void OnConnectionClosed(
const transport_manager::ConnectionUID connection_id) OVERRIDE;
+ void OnUnexpectedDisconnect(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError& error) OVERRIDE;
+
/**
- * @brief OnPTUFinished the callback which signals PTU has finished
+ * @brief Notifies that configuration of a transport has been updated.
*
- * @param ptu_result the result from the PTU - true if successful,
- * otherwise false.
+ * @param configs pairs of key and value that represent configuration.
*/
- void OnPTUFinished(const bool ptu_result) OVERRIDE;
+ void OnTransportConfigUpdated(
+ const transport_manager::transport_adapter::TransportConfig& configs)
+ OVERRIDE;
/**
* @brief Notifies subscribers about message
@@ -576,11 +628,11 @@ class ProtocolHandlerImpl
RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet);
- DEPRECATED RESULT_CODE
- HandleControlMessageStartSession(const ProtocolPacket& packet);
-
RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet);
+ RESULT_CODE HandleControlMessageRegisterSecondaryTransport(
+ const ProtocolFramePtr packet);
+
RESULT_CODE HandleControlMessageHeartBeat(const ProtocolPacket& packet);
void PopValideAndExpirateMultiframes();
@@ -609,6 +661,32 @@ class ProtocolHandlerImpl
*/
uint8_t SupportedSDLProtocolVersion() const;
+ const impl::TransportDescription GetTransportTypeFromConnectionType(
+ const std::string& device_type) const;
+
+ const bool ParseSecondaryTransportConfiguration(
+ const ConnectionID connection_id,
+ std::vector<std::string>& secondaryTransports,
+ std::vector<int32_t>& audioServiceTransports,
+ std::vector<int32_t>& videoServiceTransports) const;
+
+ void GenerateSecondaryTransportsForStartSessionAck(
+ const std::vector<std::string>& secondary_transport_types,
+ bool device_is_ios,
+ bool device_is_android,
+ std::vector<std::string>& secondaryTransports) const;
+
+ void GenerateServiceTransportsForStartSessionAck(
+ bool secondary_enabled,
+ const std::vector<std::string>& service_transports,
+ const std::string& primary_connection_type,
+ const impl::TransportType primary_transport_type,
+ const std::vector<std::string>& secondary_transport_types,
+ std::vector<int32_t>& serviceTransports) const;
+
+ const std::string TransportTypeFromTransport(
+ const utils::custom_string::CustomString& transport) const;
+
const ProtocolHandlerSettings& settings_;
/**
@@ -683,10 +761,6 @@ class ProtocolHandlerImpl
#ifdef ENABLE_SECURITY
security_manager::SecurityManager* security_manager_;
-
- bool is_ptu_triggered_;
- std::list<std::shared_ptr<HandshakeHandler> > ptu_pending_handlers_;
- sync_primitives::Lock ptu_handlers_lock_;
#endif // ENABLE_SECURITY
// Thread that pumps non-parsed messages coming from mobile side.
@@ -699,6 +773,10 @@ class ProtocolHandlerImpl
sync_primitives::Lock start_session_frame_map_lock_;
StartSessionFrameMap start_session_frame_map_;
+ bool tcp_enabled_;
+ std::string tcp_port_;
+ std::string tcp_ip_address_;
+
#ifdef TELEMETRY_MONITOR
PHTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
index 1c427533e6..de4af84915 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -64,58 +64,6 @@ class ProtocolPacket {
};
/**
- * \class ProtocolVersion
- * \brief Used for storing the full protocol version of a service
- * (major.minor.patch).
- */
- class ProtocolVersion {
- public:
- ProtocolVersion();
- ProtocolVersion(uint8_t majorVersion,
- uint8_t minorVersion,
- uint8_t patchVersion);
- ProtocolVersion(ProtocolVersion& other);
- ProtocolVersion(std::string versionString);
- uint8_t majorVersion;
- uint8_t minorVersion;
- uint8_t patchVersion;
- static inline int16_t cmp(const ProtocolVersion& version1,
- const ProtocolVersion& version2) {
- int16_t diff =
- static_cast<int16_t>(version1.majorVersion - version2.majorVersion);
- if (diff == 0) {
- diff =
- static_cast<int16_t>(version1.minorVersion - version2.minorVersion);
- if (diff == 0) {
- diff = static_cast<int16_t>(version1.patchVersion -
- version2.patchVersion);
- }
- }
- return diff;
- }
- inline bool operator==(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) == 0;
- }
- inline bool operator<(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) < 0;
- }
- bool operator>(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) > 0;
- }
- inline bool operator<=(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) <= 0;
- }
- bool operator>=(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) >= 0;
- }
- static inline ProtocolVersion* min(ProtocolVersion& version1,
- ProtocolVersion& version2) {
- return (version1 < version2) ? &version1 : &version2;
- }
- std::string to_string();
- };
-
- /**
* \class ProtocolHeader
* \brief Used for storing protocol header of a message.
*/
@@ -252,6 +200,12 @@ class ProtocolPacket {
const size_t messageSize);
/**
+ * @brief Calculates FIRST_FRAME data for further handling of consecutive
+ * frames
+ */
+ void HandleRawFirstFrameData(const uint8_t* message);
+
+ /**
* \brief Getter of protocol version.
*/
uint8_t protocol_version() const;
@@ -326,6 +280,11 @@ class ProtocolPacket {
ConnectionID connection_id() const;
/**
+ * \brief Setter of Connection Identifier
+ */
+ void set_connection_id(ConnectionID connection_id);
+
+ /**
* \brief Getter for data payload size
*/
uint32_t payload_size() const;
@@ -364,7 +323,7 @@ class ProtocolPacket {
* @brief Type definition for variable that hold shared pointer to protocolol
* packet
*/
-typedef utils::SharedPtr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
+typedef std::shared_ptr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
typedef std::list<ProtocolFramePtr> ProtocolFramePtrList;
template <typename _CharT>
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
index 055ff2cf45..775d77db66 100644
--- a/src/components/protocol_handler/src/handshake_handler.cc
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -43,33 +43,12 @@ namespace protocol_handler {
CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
-HandshakeHandler::HandshakeHandler(
- ProtocolHandlerImpl& protocol_handler,
- SessionObserver& session_observer,
- uint32_t connection_key,
- ConnectionID connection_id,
- uint8_t session_id,
- uint8_t protocol_version,
- uint32_t hash_id,
- ServiceType service_type,
- const std::vector<int>& force_protected_service,
- const bool is_new_service,
- ProtocolPacket::ProtocolVersion& full_version,
- std::shared_ptr<uint8_t> payload)
- : protocol_handler_(protocol_handler)
- , session_observer_(session_observer)
- , context_()
- , full_version_(full_version)
- , protocol_version_(protocol_version)
- , payload_(payload) {}
-
-HandshakeHandler::HandshakeHandler(
- ProtocolHandlerImpl& protocol_handler,
- SessionObserver& session_observer,
- ProtocolPacket::ProtocolVersion& full_version,
- const SessionContext& context,
- const uint8_t protocol_version,
- std::shared_ptr<uint8_t> payload)
+HandshakeHandler::HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ utils::SemanticVersion& full_version,
+ const SessionContext& context,
+ const uint8_t protocol_version,
+ std::shared_ptr<BsonObject> payload)
: protocol_handler_(protocol_handler)
, session_observer_(session_observer)
, context_(context)
@@ -92,6 +71,19 @@ bool HandshakeHandler::GetPolicyCertificateData(std::string& data) const {
void HandshakeHandler::OnCertificateUpdateRequired() {}
+bool HandshakeHandler::OnHandshakeFailed() {
+ if (payload_) {
+ ProcessFailedHandshake(*payload_);
+ } else {
+ BsonObject params;
+ bson_object_initialize_default(&params);
+ ProcessFailedHandshake(params);
+ bson_object_deinitialize(&params);
+ }
+
+ return true;
+}
+
bool HandshakeHandler::OnHandshakeDone(
uint32_t connection_key,
security_manager::SSLContext::HandshakeResult result) {
@@ -110,20 +102,23 @@ bool HandshakeHandler::OnHandshakeDone(
const bool success =
result == security_manager::SSLContext::Handshake_Result_Success;
- BsonObject params;
if (payload_) {
- params = bson_object_from_bytes(payload_.get());
+ if (success) {
+ ProcessSuccessfulHandshake(connection_key, *payload_);
+ } else {
+ ProcessFailedHandshake(*payload_);
+ }
} else {
+ BsonObject params;
bson_object_initialize_default(&params);
+ if (success) {
+ ProcessSuccessfulHandshake(connection_key, params);
+ } else {
+ ProcessFailedHandshake(params);
+ }
+ bson_object_deinitialize(&params);
}
- if (success) {
- ProcessSuccessfulHandshake(connection_key, params);
- } else {
- ProcessFailedHandshake(params);
- }
-
- bson_object_deinitialize(&params);
return true;
}
diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc
index 5a1fc6d205..c34e2ec640 100644
--- a/src/components/protocol_handler/src/multiframe_builder.cc
+++ b/src/components/protocol_handler/src/multiframe_builder.cc
@@ -35,7 +35,7 @@
#include <limits>
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/lock.h"
#include "utils/date_time.h"
@@ -91,6 +91,8 @@ bool MultiFrameBuilder::RemoveConnection(const ConnectionID connection_id) {
ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Current state is: " << multiframes_map_);
+ LOG4CXX_DEBUG(logger_,
+ "Current multiframe map size is: " << multiframes_map_.size());
ProtocolFramePtrList outpute_frame_list;
for (MultiFrameMap::iterator connection_it = multiframes_map_.begin();
connection_it != multiframes_map_.end();
@@ -122,7 +124,7 @@ ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
if (consecutive_frame_wait_msecs_ != 0) {
LOG4CXX_TRACE(logger_, "Expiration verification");
const int64_t time_left =
- date_time::DateTime::calculateTimeSpan(frame_data.append_time);
+ date_time::calculateTimeSpan(frame_data.append_time);
LOG4CXX_DEBUG(logger_, "mSecs left: " << time_left);
if (time_left >= consecutive_frame_wait_msecs_) {
LOG4CXX_WARN(logger_, "Expired frame: " << frame);
@@ -198,7 +200,7 @@ RESULT_CODE MultiFrameBuilder::HandleFirstFrame(const ProtocolFramePtr packet) {
<< connection_id
<< ", session_id: " << static_cast<int>(session_id)
<< ", message_id: " << message_id);
- messageId_map[message_id] = {packet, date_time::DateTime::getCurrentTime()};
+ messageId_map[message_id] = {packet, date_time::getCurrentTime()};
return RESULT_OK;
}
@@ -277,7 +279,7 @@ RESULT_CODE MultiFrameBuilder::HandleConsecutiveFrame(
LOG4CXX_INFO(logger_,
"Assembled frame with payload size: "
<< assembling_frame->payload_size());
- frame_data.append_time = date_time::DateTime::getCurrentTime();
+ frame_data.append_time = date_time::getCurrentTime();
return RESULT_OK;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 762b986782..d03030b747 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -31,6 +31,7 @@
*/
#include "protocol_handler/protocol_handler_impl.h"
+#include <arpa/inet.h> // for INET6_ADDRSTRLEN
#include <memory.h>
#include <algorithm> // std::find
#include <bson_object.h>
@@ -39,6 +40,7 @@
#include "connection_handler/connection_handler_impl.h"
#include "protocol_handler/session_observer.h"
#include "utils/byte_order.h"
+#include "utils/helpers.h"
#include "protocol/common.h"
#ifdef ENABLE_SECURITY
@@ -59,7 +61,8 @@ std::string ConvertPacketDataToString(const uint8_t* data,
const size_t kStackSize = 65536;
-ProtocolPacket::ProtocolVersion defaultProtocolVersion(5, 0, 0);
+utils::SemanticVersion defaultProtocolVersion(5, 1, 0);
+utils::SemanticVersion minMultipleTransportsVersion(5, 1, 0);
ProtocolHandlerImpl::ProtocolHandlerImpl(
const ProtocolHandlerSettings& settings,
@@ -75,7 +78,6 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
,
#ifdef ENABLE_SECURITY
security_manager_(NULL)
- , is_ptu_triggered_(false)
,
#endif // ENABLE_SECURITY
raw_ford_messages_from_mobile_(
@@ -84,6 +86,7 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
"PH ToMobile", this, threads::ThreadOptions(kStackSize))
, start_session_frame_map_lock_()
, start_session_frame_map_()
+ , tcp_enabled_(false)
#ifdef TELEMETRY_MONITOR
, metric_observer_(NULL)
#endif // TELEMETRY_MONITOR
@@ -196,7 +199,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
uint8_t service_type,
bool protection) {
LOG4CXX_AUTO_TRACE(logger_);
- ProtocolPacket::ProtocolVersion fullVersion;
+ utils::SemanticVersion fullVersion;
SendStartSessionAck(connection_id,
session_id,
input_protocol_version,
@@ -213,7 +216,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
uint32_t hash_id,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version) {
+ utils::SemanticVersion& full_version) {
LOG4CXX_AUTO_TRACE(logger_);
BsonObject empty_param;
@@ -238,16 +241,18 @@ void ProtocolHandlerImpl::SendStartSessionAck(
uint32_t hash_id,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version,
+ utils::SemanticVersion& full_version,
BsonObject& params) {
LOG4CXX_AUTO_TRACE(logger_);
+ bool send_transport_update_event = false;
+
uint8_t ack_protocol_version = SupportedSDLProtocolVersion();
const bool proxy_supports_v5_protocol =
input_protocol_version >= PROTOCOL_VERSION_5 ||
(ServiceTypeFromByte(service_type) == kRpc &&
- full_version.majorVersion >= PROTOCOL_VERSION_5);
+ full_version.major_version_ >= PROTOCOL_VERSION_5);
if (kRpc != service_type) {
// In case if input protocol version os bigger then supported, SDL should
@@ -279,26 +284,132 @@ void ProtocolHandlerImpl::SendStartSessionAck(
if (ack_protocol_version >= PROTOCOL_VERSION_5) {
ServiceType serviceTypeValue = ServiceTypeFromByte(service_type);
- bson_object_put_int64(
+ const bool mtu_written = bson_object_put_int64(
&params,
strings::mtu,
static_cast<int64_t>(
protocol_header_validator_.max_payload_size_by_service_type(
serviceTypeValue)));
+ UNUSED(mtu_written)
+ LOG4CXX_DEBUG(logger_,
+ "MTU parameter was written to bson params: "
+ << mtu_written << "; Value: "
+ << static_cast<int32_t>(
+ bson_object_get_int64(&params, strings::mtu)));
+
if (serviceTypeValue == kRpc) {
// Hash ID is only used in RPC case
- bson_object_put_int32(
+ const bool hash_written = bson_object_put_int32(
&params, strings::hash_id, static_cast<int32_t>(hash_id));
+ UNUSED(hash_written);
+ LOG4CXX_DEBUG(logger_,
+ "Hash parameter was written to bson params: "
+ << hash_written << "; Value: "
+ << static_cast<int32_t>(bson_object_get_int32(
+ &params, strings::hash_id)));
+
// Minimum protocol version supported by both
- ProtocolPacket::ProtocolVersion* minVersion =
- (full_version.majorVersion < PROTOCOL_VERSION_5)
+ utils::SemanticVersion* minVersion =
+ (full_version.major_version_ < PROTOCOL_VERSION_5)
? &defaultProtocolVersion
- : ProtocolPacket::ProtocolVersion::min(full_version,
- defaultProtocolVersion);
+ : utils::SemanticVersion::min(full_version,
+ defaultProtocolVersion);
char protocolVersionString[256];
- strncpy(protocolVersionString, (*minVersion).to_string().c_str(), 255);
- bson_object_put_string(
+ strncpy(protocolVersionString, (*minVersion).toString().c_str(), 255);
+
+ const bool protocol_ver_written = bson_object_put_string(
&params, strings::protocol_version, protocolVersionString);
+ UNUSED(protocol_ver_written);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Protocol version parameter was written to bson params: "
+ << protocol_ver_written << "; Value: "
+ << bson_object_get_string(&params, strings::protocol_version));
+
+ LOG4CXX_INFO(logger_,
+ "Protocol Version String " << protocolVersionString);
+
+ std::vector<std::string> secondaryTransports;
+ std::vector<int32_t> audioServiceTransports;
+ std::vector<int32_t> videoServiceTransports;
+ if (*minVersion >= minMultipleTransportsVersion) {
+ if (ParseSecondaryTransportConfiguration(connection_id,
+ secondaryTransports,
+ audioServiceTransports,
+ videoServiceTransports)) {
+ LOG4CXX_DEBUG(logger_, "Multiple transports are enabled.");
+ BsonArray secondaryTransportsArr;
+ bson_array_initialize(&secondaryTransportsArr,
+ secondaryTransports.size());
+ for (unsigned int i = 0; i < secondaryTransports.size(); i++) {
+ char secondaryTransport[255];
+ strncpy(secondaryTransport,
+ secondaryTransports[i].c_str(),
+ sizeof(secondaryTransport));
+ secondaryTransport[sizeof(secondaryTransport) - 1] = '\0';
+ LOG4CXX_DEBUG(
+ logger_,
+ "Adding "
+ << secondaryTransport
+ << " to secondaryTransports parameter of StartSessionAck");
+ bson_array_add_string(&secondaryTransportsArr, secondaryTransport);
+ }
+ bson_object_put_array(
+ &params, strings::secondary_transports, &secondaryTransportsArr);
+
+ BsonArray audioServiceTransportsArr;
+ bson_array_initialize(&audioServiceTransportsArr,
+ audioServiceTransports.size());
+ for (unsigned int i = 0; i < audioServiceTransports.size(); i++) {
+ LOG4CXX_DEBUG(logger_,
+ "Adding " << audioServiceTransports[i]
+ << " to audioServiceTransports parameter "
+ "of StartSessionAck");
+ bson_array_add_int32(&audioServiceTransportsArr,
+ audioServiceTransports[i]);
+ }
+ bson_object_put_array(&params,
+ strings::audio_service_transports,
+ &audioServiceTransportsArr);
+
+ BsonArray videoServiceTransportsArr;
+ bson_array_initialize(&videoServiceTransportsArr,
+ videoServiceTransports.size());
+ for (unsigned int i = 0; i < videoServiceTransports.size(); i++) {
+ LOG4CXX_DEBUG(logger_,
+ "Adding " << videoServiceTransports[i]
+ << " to videoServiceTransports parameter "
+ "of StartSessionAck");
+ bson_array_add_int32(&videoServiceTransportsArr,
+ videoServiceTransports[i]);
+ }
+ bson_object_put_array(&params,
+ strings::video_service_transports,
+ &videoServiceTransportsArr);
+
+ if (settings_.multiple_transports_enabled()) {
+ send_transport_update_event = true;
+ } else {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Multiple transports feature is disabled by configuration");
+ // In this case, we must remember that this session will never have
+ // a secondary transport.
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
+ } else {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to set up secondary transport and service type params");
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Older protocol version. No multiple transports");
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
}
uint8_t* payloadBytes = bson_object_to_bytes(&params);
ptr->set_data(payloadBytes, bson_object_size(&params));
@@ -316,6 +427,16 @@ void ProtocolHandlerImpl::SendStartSessionAck(
<< static_cast<int32_t>(service_type) << " session_id "
<< static_cast<int32_t>(session_id) << " protection "
<< (protection ? "ON" : "OFF"));
+
+ if (send_transport_update_event) {
+ // Wait until the StartService ACK has been processed for sending.
+ // The TransportUpdateEvent has a higher priority, being that it's
+ // a SERVICE_TYPE_CONTROL message. (The ACK is SERVICE_TYPE_RPC.)
+ LOG4CXX_DEBUG(logger_, "Waiting for the MessageToMobile queue to be empty");
+ raw_ford_messages_to_mobile_.WaitDumpQueue();
+ LOG4CXX_DEBUG(logger_, "Sending the TransportUpdate event");
+ SendTransportUpdateEvent(connection_id, session_id);
+ }
}
void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
@@ -473,14 +594,18 @@ void ProtocolHandlerImpl::SendEndSessionAck(ConnectionID connection_id,
<< static_cast<int32_t>(session_id));
}
-void ProtocolHandlerImpl::SendEndServicePrivate(int32_t connection_id,
+void ProtocolHandlerImpl::SendEndServicePrivate(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) {
LOG4CXX_AUTO_TRACE(logger_);
uint8_t protocol_version;
if (session_observer_.ProtocolVersionUsed(
- connection_id, session_id, protocol_version)) {
+ primary_connection_id, session_id, protocol_version)) {
+ LOG4CXX_TRACE(logger_,
+ "SendEndServicePrivate using protocol version "
+ << static_cast<int32_t>(protocol_version));
ProtocolFramePtr ptr(
new protocol_handler::ProtocolPacket(connection_id,
protocol_version,
@@ -495,25 +620,31 @@ void ProtocolHandlerImpl::SendEndServicePrivate(int32_t connection_id,
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
LOG4CXX_DEBUG(logger_,
- "SendEndSession() for connection "
- << connection_id << " for service_type " << service_type
+ "SendEndServicePrivate() for connection "
+ << connection_id << " for service_type "
+ << static_cast<int>(service_type)
+ << " primary connection " << primary_connection_id
<< " session_id " << static_cast<int32_t>(session_id));
} else {
LOG4CXX_WARN(
logger_,
- "SendEndSession is failed connection or session does not exist");
+ "SendEndServicePrivate is failed connection or session does not exist");
}
}
void ProtocolHandlerImpl::SendEndSession(int32_t connection_id,
uint8_t session_id) {
- SendEndServicePrivate(connection_id, session_id, SERVICE_TYPE_RPC);
+ // A session is always associated with a primary connection ID
+ SendEndServicePrivate(
+ connection_id, connection_id, session_id, SERVICE_TYPE_RPC);
}
-void ProtocolHandlerImpl::SendEndService(int32_t connection_id,
+void ProtocolHandlerImpl::SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) {
- SendEndServicePrivate(connection_id, session_id, service_type);
+ SendEndServicePrivate(
+ primary_connection_id, connection_id, session_id, service_type);
}
RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
@@ -545,6 +676,139 @@ RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
return RESULT_FAIL;
}
+void ProtocolHandlerImpl::SendTransportUpdateEvent(ConnectionID connection_id,
+ uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint8_t protocol_version;
+ if (session_observer_.ProtocolVersionUsed(
+ connection_id, session_id, protocol_version)) {
+ ProtocolFramePtr ptr(
+ new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ session_id,
+ 0,
+ message_counters_[session_id]++));
+
+ BsonObject payload_obj;
+ bson_object_initialize_default(&payload_obj);
+
+ int32_t tcp_port = atoi(tcp_port_.c_str());
+ char tcp_ip_address[INET6_ADDRSTRLEN + 1];
+ if (tcp_enabled_ && (tcp_port != 0)) {
+ strncpy(tcp_ip_address, tcp_ip_address_.c_str(), INET6_ADDRSTRLEN);
+ tcp_ip_address[INET6_ADDRSTRLEN] = '\0';
+ bson_object_put_string(
+ &payload_obj, strings::tcp_ip_address, tcp_ip_address);
+ bson_object_put_int32(&payload_obj, strings::tcp_port, tcp_port);
+ } else {
+ tcp_ip_address[0] = '\0';
+ bson_object_put_string(
+ &payload_obj, strings::tcp_ip_address, tcp_ip_address);
+ // omit TCP port number
+ }
+ LOG4CXX_INFO(logger_,
+ "SendTransportUpdateEvent IP address: "
+ << tcp_ip_address << " Port: " << tcp_port);
+
+ uint8_t* payloadBytes = bson_object_to_bytes(&payload_obj);
+ ptr->set_data(payloadBytes, bson_object_size(&payload_obj));
+ free(payloadBytes);
+ bson_object_deinitialize(&payload_obj);
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_DEBUG(logger_,
+ "SendTransportUpdateEvent() for connection "
+ << connection_id << " for session "
+ << static_cast<int32_t>(session_id));
+ } else {
+ LOG4CXX_WARN(logger_,
+ "SendTransportUpdateEvent is failed connection or session "
+ "does not exist");
+ }
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendRegisterSecondaryTransportAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // acquire the protocol version from primary transport
+ uint8_t protocol_version;
+ if (session_observer_.ProtocolVersionUsed(
+ primary_transport_connection_id, session_id, protocol_version)) {
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(
+ connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK,
+ session_id,
+ 0u,
+ 2));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ return RESULT_OK;
+ }
+ LOG4CXX_WARN(logger_,
+ "RegisterSecondaryTransportAck is failed connection or session "
+ "does not exist");
+ return RESULT_FAIL;
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendRegisterSecondaryTransportNAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id,
+ BsonObject* reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // If mobile sends an invalid session ID and we cannot find out the Connection
+ // ID of primary transport, then we use version 5. (The multiple-transports
+ // feature is added in 5.1.0.)
+ uint8_t protocol_version = PROTOCOL_VERSION_5;
+ if (primary_transport_connection_id > 0) {
+ // acquire the protocol version from primary transport
+ if (!session_observer_.ProtocolVersionUsed(
+ primary_transport_connection_id, session_id, protocol_version)) {
+ LOG4CXX_WARN(logger_,
+ "Failed to acquire protocol version for "
+ "RegisterSecondaryTransportNAck");
+ return RESULT_FAIL;
+ }
+ }
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(
+ connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK,
+ session_id,
+ 0u,
+ 2));
+
+ if (reason) {
+ uint8_t* payloadBytes = bson_object_to_bytes(reason);
+ ptr->set_data(payloadBytes, bson_object_size(reason));
+ free(payloadBytes);
+ }
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ return RESULT_OK;
+}
+
void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
uint8_t session_id) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -574,7 +838,7 @@ void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
bool final_message) {
#ifdef TELEMETRY_MONITOR
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
#endif // TELEMETRY_MONITOR
LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
@@ -664,8 +928,7 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
}
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->message_id = message_id;
metric->connection_key = message->connection_key();
metric->raw_msg = message;
@@ -720,7 +983,7 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
it != protocol_frames.end();
++it) {
#ifdef TELEMETRY_MONITOR
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
#endif // TELEMETRY_MONITOR
ProtocolFramePtr frame = *it;
#ifdef ENABLE_SECURITY
@@ -839,57 +1102,83 @@ void ProtocolHandlerImpl::OnConnectionClosed(
multiframe_builder_.RemoveConnection(connection_id);
}
-void ProtocolHandlerImpl::OnPTUFinished(const bool ptu_result) {
- LOG4CXX_AUTO_TRACE(logger_);
+void ProtocolHandlerImpl::OnUnexpectedDisconnect(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError& error) {
+ OnConnectionClosed(connection_id);
+}
+void ProtocolHandlerImpl::NotifyOnFailedHandshake() {
+ LOG4CXX_AUTO_TRACE(logger_);
#ifdef ENABLE_SECURITY
- sync_primitives::AutoLock lock(ptu_handlers_lock_);
+ security_manager_->NotifyListenersOnHandshakeFailed();
+#endif // ENABLE_SECURITY
+}
- if (!is_ptu_triggered_) {
- LOG4CXX_ERROR(logger_,
- "PTU was not triggered by service starting. Ignored");
+void ProtocolHandlerImpl::OnTransportConfigUpdated(
+ const transport_manager::transport_adapter::TransportConfig& configs) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_manager::transport_adapter::TransportConfig::const_iterator it =
+ configs.find(transport_manager::transport_adapter::tc_enabled);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No enabled field in OnTransportConfigUpdated");
return;
}
- const bool is_cert_expired = security_manager_->IsCertificateUpdateRequired();
- for (auto handler : ptu_pending_handlers_) {
- security_manager::SSLContext* ssl_context =
- is_cert_expired
- ? NULL
- : security_manager_->CreateSSLContext(handler->connection_key());
+ bool tcp_enabled = (0 == strcmp("true", it->second.c_str()));
+ std::string tcp_port;
- if (!ssl_context) {
- const std::string error("CreateSSLContext failed");
- LOG4CXX_ERROR(logger_, error);
- security_manager_->SendInternalError(
- handler->connection_key(),
- security_manager::SecurityManager::ERROR_INTERNAL,
- error);
-
- handler->OnHandshakeDone(
- handler->connection_key(),
- security_manager::SSLContext::Handshake_Result_Fail);
-
- continue;
+ if (tcp_enabled) {
+ it = configs.find(transport_manager::transport_adapter::tc_tcp_port);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No port field in OnTransportConfigUpdated");
+ return;
}
+ tcp_port = it->second;
- if (ssl_context->IsInitCompleted()) {
- handler->OnHandshakeDone(
- handler->connection_key(),
- security_manager::SSLContext::Handshake_Result_Success);
- } else {
- security_manager_->AddListener(new HandshakeHandler(*handler));
- if (!ssl_context->IsHandshakePending()) {
- // Start handshake process
- security_manager_->StartHandshake(handler->connection_key());
- }
+ it = configs.find(transport_manager::transport_adapter::tc_tcp_ip_address);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No IP address field in OnTransportConfigUpdated");
+ return;
+ }
+ tcp_enabled_ = true;
+ tcp_port_ = tcp_port;
+ tcp_ip_address_ = it->second;
+ } else {
+ tcp_enabled_ = false;
+ tcp_port_.clear();
+ tcp_ip_address_.clear();
+ }
+
+ LOG4CXX_INFO(logger_,
+ "OnTransportConfigUpdated: new config enabled is "
+ << tcp_enabled_ << ". Port is " << tcp_port_
+ << ". IP Address is " << tcp_ip_address_);
+
+ // Walk the SessionConnection map and find all sessions that need a
+ // TransportUpdate Event. Sessions flagged with kDisabledSecondary in their
+ // secondary transport are ineligible for secondary transport, and
+ // therefore don't get this event.
+ DataAccessor<connection_handler::SessionConnectionMap>
+ session_connection_map_accessor =
+ connection_handler_.session_connection_map();
+ const connection_handler::SessionConnectionMap& session_connection_map =
+ session_connection_map_accessor.GetData();
+ connection_handler::SessionConnectionMap::const_iterator itr =
+ session_connection_map.begin();
+ while (itr != session_connection_map.end()) {
+ const connection_handler::SessionTransports st = itr->second;
+ LOG4CXX_INFO(logger_,
+ "OnTransportConfigUpdated found session "
+ << itr->first << " with primary connection "
+ << st.primary_transport << " and secondary connection "
+ << st.secondary_transport);
+ if (st.secondary_transport != kDisabledSecondary) {
+ SendTransportUpdateEvent(st.primary_transport, itr->first);
}
+ itr++;
}
-
- LOG4CXX_DEBUG(logger_, "Handshake handlers were notified");
- ptu_pending_handlers_.clear();
- is_ptu_triggered_ = false;
-#endif // ENABLE_SECURITY
}
RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
@@ -1076,6 +1365,13 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
<< packet->data_size() << "; message "
<< ConvertPacketDataToString(packet->data(), packet->data_size()));
+ // Replace a potential secondary transport ID in the packet with the primary
+ // transport ID
+ const connection_handler::SessionTransports st =
+ connection_handler_.GetSessionTransports(packet->session_id());
+ if (st.primary_transport != 0) {
+ packet->set_connection_id(st.primary_transport);
+ }
const uint32_t connection_key = session_observer_.KeyFromPair(
packet->connection_id(), packet->session_id());
@@ -1090,8 +1386,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
}
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->message_id = packet->message_id();
metric->connection_key = connection_key;
metric->raw_msg = rawMessage;
@@ -1108,6 +1403,14 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
+ // Replace a potential secondary transport ID in the packet with the primary
+ // transport ID
+ const connection_handler::SessionTransports st =
+ connection_handler_.GetSessionTransports(packet->session_id());
+ if (st.primary_transport != 0) {
+ packet->set_connection_id(st.primary_transport);
+ }
+
if (multiframe_builder_.AddFrame(packet) != RESULT_OK) {
LOG4CXX_WARN(logger_, "Frame assembling issue");
}
@@ -1145,6 +1448,10 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
<< packet->connection_id());
return RESULT_OK;
}
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT: {
+ LOG4CXX_TRACE(logger_, "FrameData: RegisterSecondaryTransport");
+ return HandleControlMessageRegisterSecondaryTransport(packet);
+ }
default:
LOG4CXX_WARN(logger_,
"Control message of type "
@@ -1242,172 +1549,63 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndServiceACK(
return RESULT_OK;
}
-// Suppress warning for deprecated method used within another deprecated method
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
- const ProtocolPacket& packet) {
+ const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(
logger_,
- "Protocol version:" << static_cast<int>(packet.protocol_version()));
- const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
+ "Protocol version:" << static_cast<int>(packet->protocol_version()));
+ const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
+ const uint8_t protocol_version = packet->protocol_version();
#ifdef ENABLE_SECURITY
const bool protection =
- // Protocol version 1 is not support protection
- (packet.protocol_version() > PROTOCOL_VERSION_1)
- ? packet.protection_flag()
- : false;
+ // Protocol version 1 does not support protection
+ (protocol_version > PROTOCOL_VERSION_1) ? packet->protection_flag()
+ : false;
#else
const bool protection = false;
#endif // ENABLE_SECURITY
- uint32_t hash_id;
- const ConnectionID connection_id = packet.connection_id();
- const uint32_t session_id = session_observer_.OnSessionStartedCallback(
- connection_id, packet.session_id(), service_type, protection, &hash_id);
-
- if (0 == session_id) {
- LOG4CXX_WARN(logger_,
- "Refused by session_observer to create service "
- << static_cast<int32_t>(service_type) << " type.");
- SendStartSessionNAck(connection_id,
- packet.session_id(),
- packet.protocol_version(),
- packet.service_type());
- return RESULT_OK;
- }
-
-#ifdef ENABLE_SECURITY
- // for packet is encrypted and security plugin is enable
- if (protection && security_manager_) {
- const uint32_t connection_key =
- session_observer_.KeyFromPair(connection_id, session_id);
-
- security_manager::SSLContext* ssl_context =
- security_manager_->CreateSSLContext(connection_key);
- if (!ssl_context) {
- const std::string error("CreateSSLContext failed");
- LOG4CXX_ERROR(logger_, error);
- security_manager_->SendInternalError(
- connection_key,
- security_manager::SecurityManager::ERROR_INTERNAL,
- error);
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF);
- return RESULT_OK;
- }
- ProtocolPacket::ProtocolVersion* fullVersion;
- std::vector<std::string> rejectedParams(0, std::string(""));
- // Can't check protocol_version because the first packet is v1, but there
- // could still be a payload, in which case we can get the real protocol
- // version
- if (packet.service_type() == kRpc && packet.data_size() != 0) {
- BsonObject obj = bson_object_from_bytes(packet.data());
- fullVersion = new ProtocolPacket::ProtocolVersion(
- std::string(bson_object_get_string(&obj, "protocolVersion")));
- bson_object_deinitialize(&obj);
- // Constructed payloads added in Protocol v5
- if (fullVersion->majorVersion < PROTOCOL_VERSION_5) {
- rejectedParams.push_back(std::string("protocolVersion"));
- }
- } else {
- fullVersion = new ProtocolPacket::ProtocolVersion();
- }
- if (!rejectedParams.empty()) {
- SendStartSessionNAck(connection_id,
- packet.session_id(),
- packet.protocol_version(),
- packet.service_type(),
- rejectedParams);
- } else if (ssl_context->IsInitCompleted()) {
- // mark service as protected
- session_observer_.SetProtectionFlag(connection_key, service_type);
- // Start service as protected with current SSLContext
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_ON,
- *fullVersion);
- } else {
- security_manager_->AddListener(
- new HandshakeHandler(*this,
- session_observer_,
- connection_key,
- connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- service_type,
- get_settings().force_protected_service(),
- false,
- *fullVersion,
- NULL));
- if (!ssl_context->IsHandshakePending()) {
- // Start handshake process
- security_manager_->StartHandshake(connection_key);
- }
- }
- delete fullVersion;
+ const ConnectionID connection_id = packet->connection_id();
+ const uint8_t session_id = packet->session_id();
+ const std::string& transport =
+ session_observer_.TransportTypeProfileStringFromConnHandle(connection_id);
+
+ const auto video_transports = settings_.video_service_transports();
+ const bool is_video_allowed =
+ video_transports.empty() ||
+ std::find(video_transports.begin(), video_transports.end(), transport) !=
+ video_transports.end();
+
+ const auto audio_transports = settings_.audio_service_transports();
+ const bool is_audio_allowed =
+ audio_transports.empty() ||
+ std::find(audio_transports.begin(), audio_transports.end(), transport) !=
+ audio_transports.end();
+
+ if ((ServiceType::kMobileNav == service_type && !is_video_allowed) ||
+ (ServiceType::kAudio == service_type && !is_audio_allowed)) {
LOG4CXX_DEBUG(logger_,
- "Protection establishing for connection "
- << connection_key << " is in progress");
+ "Rejecting StartService for service:"
+ << service_type << ", over transport: " << transport
+ << ", disallowed by settings.");
+ SendStartSessionNAck(
+ connection_id, session_id, protocol_version, service_type);
return RESULT_OK;
}
-#endif // ENABLE_SECURITY
- if (packet.service_type() == kRpc && packet.data_size() != 0) {
- BsonObject obj = bson_object_from_bytes(packet.data());
- ProtocolPacket::ProtocolVersion fullVersion(
- bson_object_get_string(&obj, "protocolVersion"));
- bson_object_deinitialize(&obj);
- if (fullVersion.majorVersion >= PROTOCOL_VERSION_5) {
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF,
- fullVersion);
- } else {
- std::vector<std::string> rejectedParams(1,
- std::string("protocolVersion"));
- SendStartSessionNAck(connection_id,
- packet.session_id(),
- packet.protocol_version(),
- packet.service_type(),
- rejectedParams);
- }
+ LOG4CXX_INFO(logger_,
+ "StartSession ID " << static_cast<int>(session_id)
+ << " and Connection ID "
+ << static_cast<int>(connection_id));
- } else {
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF);
+ {
+ sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
+ start_session_frame_map_[std::make_pair(connection_id, session_id)] =
+ packet;
}
- return RESULT_OK;
-}
-#pragma GCC diagnostic pop
-RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
- const ProtocolFramePtr packet) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(
- logger_,
- "Protocol version:" << static_cast<int>(packet->protocol_version()));
- const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
BsonObject bson_obj;
if (packet->data() != NULL) {
bson_obj = bson_object_from_bytes(packet->data());
@@ -1415,25 +1613,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
bson_object_initialize_default(&bson_obj);
}
-#ifdef ENABLE_SECURITY
- const bool protection =
- // Protocol version 1 is not support protection
- (packet->protocol_version() > PROTOCOL_VERSION_1)
- ? packet->protection_flag()
- : false;
-#else
- const bool protection = false;
-#endif // ENABLE_SECURITY
-
- const ConnectionID connection_id = packet->connection_id();
- const uint8_t session_id = packet->session_id();
-
- {
- sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
- start_session_frame_map_[std::make_pair(connection_id, session_id)] =
- packet;
- }
-
session_observer_.OnSessionStartedCallback(
connection_id, packet->session_id(), service_type, protection, &bson_obj);
bson_object_deinitialize(&bson_obj);
@@ -1441,21 +1620,48 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
return RESULT_OK;
}
-void ProtocolHandlerImpl::NotifySessionStartedResult(
- int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params) {
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessageRegisterSecondaryTransport(
+ const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
- protocol_handler::SessionContext context(connection_id,
- session_id,
- generated_session_id,
- ServiceType::kInvalidServiceType,
- hash_id,
- protection);
- NotifySessionStarted(context, rejected_params);
+ const uint8_t session_id = packet->session_id();
+ const ConnectionID connection_id = packet->connection_id();
+ ConnectionID primary_connection_id = 0;
+
+ LOG4CXX_INFO(logger_,
+ "RegisterSecondaryTransport ID "
+ << static_cast<int>(session_id) << " and Connection ID "
+ << static_cast<int>(connection_id));
+
+ if (connection_handler_.OnSecondaryTransportStarted(
+ primary_connection_id, connection_id, session_id)) {
+ SendRegisterSecondaryTransportAck(
+ connection_id, primary_connection_id, session_id);
+ } else {
+ char reason[256];
+ BsonObject registerSecondaryTransportNackObj;
+ bson_object_initialize_default(&registerSecondaryTransportNackObj);
+ if (0 == session_id) {
+ strncpy(reason,
+ "RegisterSecondaryTransport MUST include a non-zero session ID",
+ 255);
+ } else if (primary_connection_id == 0) {
+ strncpy(reason, "RegisterSecondaryTransport session ID not found", 255);
+ } else {
+ strncpy(
+ reason,
+ "RegisterSecondaryTransport session ID has already been registered",
+ 255);
+ }
+ bson_object_put_string(
+ &registerSecondaryTransportNackObj, strings::reason, reason);
+ SendRegisterSecondaryTransportNAck(connection_id,
+ primary_connection_id,
+ session_id,
+ &registerSecondaryTransportNackObj);
+ bson_object_deinitialize(&registerSecondaryTransportNackObj);
+ }
+
+ return RESULT_OK;
}
void ProtocolHandlerImpl::NotifySessionStarted(
@@ -1525,7 +1731,7 @@ void ProtocolHandlerImpl::NotifySessionStarted(
bson_object_deinitialize(&req_param);
}
- std::shared_ptr<ProtocolPacket::ProtocolVersion> fullVersion;
+ std::shared_ptr<utils::SemanticVersion> fullVersion;
// Can't check protocol_version because the first packet is v1, but there
// could still be a payload, in which case we can get the real protocol
@@ -1535,15 +1741,14 @@ void ProtocolHandlerImpl::NotifySessionStarted(
char* version_param =
bson_object_get_string(&request_params, strings::protocol_version);
std::string version_string(version_param == NULL ? "" : version_param);
- fullVersion =
- std::make_shared<ProtocolPacket::ProtocolVersion>(version_string);
+ fullVersion = std::make_shared<utils::SemanticVersion>(version_string);
// Constructed payloads added in Protocol v5
- if (fullVersion->majorVersion < PROTOCOL_VERSION_5) {
+ if (fullVersion->major_version_ < PROTOCOL_VERSION_5) {
rejected_params.push_back(std::string(strings::protocol_version));
}
bson_object_deinitialize(&request_params);
} else {
- fullVersion = std::make_shared<ProtocolPacket::ProtocolVersion>();
+ fullVersion = std::make_shared<utils::SemanticVersion>();
}
#ifdef ENABLE_SECURITY
@@ -1552,51 +1757,19 @@ void ProtocolHandlerImpl::NotifySessionStarted(
const uint32_t connection_key = session_observer_.KeyFromPair(
context.connection_id_, context.new_session_id_);
- std::shared_ptr<uint8_t> bson_object_bytes(
- bson_object_to_bytes(start_session_ack_params.get()),
- [](uint8_t* p) { delete[] p; });
-
std::shared_ptr<HandshakeHandler> handler =
std::make_shared<HandshakeHandler>(*this,
session_observer_,
*fullVersion,
context,
packet->protocol_version(),
- bson_object_bytes);
-
- const bool is_certificate_empty =
- security_manager_->IsPolicyCertificateDataEmpty();
-
- const bool is_certificate_expired =
- is_certificate_empty ||
- security_manager_->IsCertificateUpdateRequired();
-
- if (context.is_ptu_required_ && is_certificate_empty) {
- LOG4CXX_DEBUG(logger_,
- "PTU for StartSessionHandler "
- << handler.get()
- << " is required and certificate data is empty");
-
- sync_primitives::AutoLock lock(ptu_handlers_lock_);
- if (!is_ptu_triggered_) {
- LOG4CXX_DEBUG(logger_,
- "PTU is not triggered yet. "
- << "Starting PTU and postponing SSL handshake");
-
- ptu_pending_handlers_.push_back(handler);
- is_ptu_triggered_ = true;
- security_manager_->NotifyOnCertificateUpdateRequired();
- } else {
- LOG4CXX_DEBUG(logger_, "PTU has been triggered. Added to pending.");
- ptu_pending_handlers_.push_back(handler);
- }
- return;
- }
+ start_session_ack_params);
security_manager::SSLContext* ssl_context =
- is_certificate_expired
- ? NULL
- : security_manager_->CreateSSLContext(connection_key);
+ security_manager_->CreateSSLContext(
+ connection_key,
+ security_manager::SecurityManager::ContextCreationStrategy::
+ kUseExisting);
if (!ssl_context) {
const std::string error("CreateSSLContext failed");
LOG4CXX_ERROR(logger_, error);
@@ -1630,12 +1803,27 @@ void ProtocolHandlerImpl::NotifySessionStarted(
*fullVersion,
*start_session_ack_params);
} else {
- security_manager_->AddListener(new HandshakeHandler(*handler));
+ LOG4CXX_DEBUG(logger_,
+ "Adding Handshake handler to listeners: " << handler.get());
+ security_manager::SecurityManagerListener* listener =
+ new HandshakeHandler(*handler);
+ security_manager_->AddListener(listener);
+
if (!ssl_context->IsHandshakePending()) {
// Start handshake process
security_manager_->StartHandshake(connection_key);
+
+ if (!security_manager_->IsSystemTimeProviderReady()) {
+ security_manager_->RemoveListener(listener);
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
+ protocol_version,
+ packet->service_type(),
+ rejected_params);
+ }
}
}
+
LOG4CXX_DEBUG(logger_,
"Protection establishing for connection "
<< connection_key << " is in progress");
@@ -1688,6 +1876,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
}
void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() {
+ LOG4CXX_AUTO_TRACE(logger_);
const ProtocolFramePtrList& frame_list = multiframe_builder_.PopMultiframes();
for (ProtocolFramePtrList::const_iterator it = frame_list.begin();
it != frame_list.end();
@@ -1713,8 +1902,7 @@ void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() {
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->raw_msg = rawMessage;
metric_observer_->EndMessageProcess(metric);
}
@@ -1845,7 +2033,9 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
DCHECK(packet);
// Control frames and data over control service shall be unprotected
if (packet->service_type() == kControl ||
- packet->frame_type() == FRAME_TYPE_CONTROL) {
+ // For protocol v5 control frames could be protected
+ (packet->frame_type() == FRAME_TYPE_CONTROL &&
+ packet->protocol_version() < PROTOCOL_VERSION_5)) {
return RESULT_OK;
}
if (!security_manager_) {
@@ -1888,12 +2078,30 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
DCHECK(packet);
- if (!packet->protection_flag() ||
- // Control frames and data over control service shall be unprotected
- packet->service_type() == kControl ||
- packet->frame_type() == FRAME_TYPE_CONTROL) {
+
+ bool shoud_not_decrypt;
+ if (packet->protocol_version() >= PROTOCOL_VERSION_5) {
+ // For v5 protocol control frames except StartService could be encrypted
+ shoud_not_decrypt =
+ !packet->protection_flag() || packet->service_type() == kControl ||
+ (FRAME_TYPE_CONTROL == packet->frame_type() &&
+ helpers::Compare<ServiceType, helpers::EQ, helpers::ONE>(
+ static_cast<ServiceType>(packet->service_type()),
+ kMobileNav,
+ kAudio,
+ kRpc));
+ } else {
+ // Control frames and data over control service shall be unprotected
+ shoud_not_decrypt = !packet->protection_flag() ||
+ packet->service_type() == kControl ||
+ packet->frame_type() == FRAME_TYPE_CONTROL;
+ }
+
+ if (shoud_not_decrypt) {
+ LOG4CXX_DEBUG(logger_, "Frame will not be decrypted");
return RESULT_OK;
}
+
if (!security_manager_) {
LOG4CXX_WARN(logger_, "No security_manager_ set.");
return RESULT_FAIL;
@@ -1934,6 +2142,11 @@ RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
<< out_data_size << " bytes");
DCHECK(out_data);
DCHECK(out_data_size);
+ // Special handling for decrypted FIRST_FRAME
+ if (packet->frame_type() == FRAME_TYPE_FIRST && packet->protection_flag()) {
+ packet->HandleRawFirstFrameData(out_data);
+ return RESULT_OK;
+ }
packet->set_data(out_data, out_data_size);
return RESULT_OK;
}
@@ -2007,4 +2220,241 @@ uint8_t ProtocolHandlerImpl::SupportedSDLProtocolVersion() const {
LOG4CXX_AUTO_TRACE(logger_);
return get_settings().max_supported_protocol_version();
}
+
+const impl::TransportTypes transportTypes = {
+ std::make_pair(
+ std::string("AOA_USB"),
+ impl::TransportDescription(impl::TransportType::TT_USB, false, true)),
+ std::make_pair(std::string("SPP_BLUETOOTH"),
+ impl::TransportDescription(
+ impl::TransportType::TT_BLUETOOTH, false, true)),
+ std::make_pair(std::string("IAP_BLUETOOTH"),
+ impl::TransportDescription(
+ impl::TransportType::TT_BLUETOOTH, true, false)),
+ std::make_pair(
+ std::string("IAP_USB"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("TCP_WIFI"),
+ impl::TransportDescription(impl::TransportType::TT_WIFI, true, true)),
+ std::make_pair(
+ std::string("IAP_USB_HOST_MODE"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("IAP_USB_DEVICE_MODE"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("IAP_CARPLAY"),
+ impl::TransportDescription(impl::TransportType::TT_WIFI, true, false))};
+
+const impl::TransportDescription
+ProtocolHandlerImpl::GetTransportTypeFromConnectionType(
+ const std::string& connection_type) const {
+ impl::TransportDescription result =
+ impl::TransportDescription(impl::TransportType::TT_NONE, false, false);
+ impl::TransportTypes::const_iterator it =
+ transportTypes.find(connection_type);
+ if (it != transportTypes.end()) {
+ result = it->second;
+ } else {
+ LOG4CXX_ERROR(logger_, "Unknown connection type " << connection_type);
+ }
+
+ return result;
+}
+
+const bool ProtocolHandlerImpl::ParseSecondaryTransportConfiguration(
+ const ConnectionID connection_id,
+ std::vector<std::string>& secondaryTransports,
+ std::vector<int32_t>& audioServiceTransports,
+ std::vector<int32_t>& videoServiceTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<std::string> secondary_transport_types;
+
+ // First discover what the connection type of the primary transport is
+ // and look up the allowed secondary transports for that primary transport
+ const std::string connection_type =
+ session_observer_.TransportTypeProfileStringFromConnHandle(connection_id);
+ const impl::TransportDescription td =
+ GetTransportTypeFromConnectionType(connection_type);
+ if (settings_.multiple_transports_enabled()) {
+ if (td.transport_type_ == impl::TransportType::TT_USB) {
+ secondary_transport_types = settings_.secondary_transports_for_usb();
+ } else if (td.transport_type_ == impl::TransportType::TT_BLUETOOTH) {
+ secondary_transport_types =
+ settings_.secondary_transports_for_bluetooth();
+ } else if (td.transport_type_ == impl::TransportType::TT_WIFI) {
+ secondary_transport_types = settings_.secondary_transports_for_wifi();
+ } else {
+ LOG4CXX_ERROR(
+ logger_,
+ "Bad or unknown device type in ParseSecondaryTransportConfiguration");
+ return false;
+ }
+ }
+ // note: even if settings_.multiple_transports_enabled() is false, we still
+ // send out an empty "secondaryTransports" parameter, along with
+ // "videoServiceTransports" and "audioServiceTransports" params which are
+ // useful without secondary transport.
+
+ // Then, generate the "secondaryTransports" array for the StartSession ACK
+ GenerateSecondaryTransportsForStartSessionAck(secondary_transport_types,
+ td.ios_transport_,
+ td.android_transport_,
+ secondaryTransports);
+
+ // Next, figure out which connections audio or video services are allowed on
+ GenerateServiceTransportsForStartSessionAck(
+ settings_.multiple_transports_enabled(),
+ settings_.audio_service_transports(),
+ connection_type,
+ td.transport_type_,
+ secondary_transport_types,
+ audioServiceTransports);
+
+ GenerateServiceTransportsForStartSessionAck(
+ settings_.multiple_transports_enabled(),
+ settings_.video_service_transports(),
+ connection_type,
+ td.transport_type_,
+ secondary_transport_types,
+ videoServiceTransports);
+
+ return true;
+}
+
+void ProtocolHandlerImpl::GenerateSecondaryTransportsForStartSessionAck(
+ const std::vector<std::string>& secondary_transport_types,
+ bool device_is_ios,
+ bool device_is_android,
+ std::vector<std::string>& secondaryTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Parse the "secondary_transport_types" vector (which comes from
+ // smartDeviceLink.ini). For each entry in the vector, add an
+ // appropriate string to the secondaryTransports
+ std::vector<std::string>::const_iterator it =
+ secondary_transport_types.begin();
+ while (it != secondary_transport_types.end()) {
+ const utils::custom_string::CustomString transport_type(*it);
+ if (transport_type.CompareIgnoreCase("USB")) {
+ if (device_is_ios) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding IAP_USB to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("IAP_USB");
+ }
+ if (device_is_android) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding AOA_USB to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("AOA_USB");
+ }
+ } else if (transport_type.CompareIgnoreCase("Bluetooth")) {
+ if (device_is_ios) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding IAP_BLUETOOTH to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("IAP_BLUETOOTH");
+ }
+ if (device_is_android) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding SPP_BLUETOOTH to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("SPP_BLUETOOTH");
+ }
+ }
+ if (transport_type.CompareIgnoreCase("WiFi")) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding TCP_WIFI to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("TCP_WIFI");
+ }
+
+ it++;
+ }
+}
+
+void ProtocolHandlerImpl::GenerateServiceTransportsForStartSessionAck(
+ bool secondary_enabled,
+ const std::vector<std::string>& service_transports,
+ const std::string& primary_connection_type,
+ const impl::TransportType primary_transport_type,
+ const std::vector<std::string>& secondary_transport_types,
+ std::vector<int32_t>& serviceTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (service_transports.size() == 0) {
+ if (secondary_enabled && !secondary_transport_types.empty()) {
+ LOG4CXX_TRACE(logger_,
+ "Empty Service Transports. Allowing service to run on both "
+ "connections");
+ serviceTransports.push_back(1);
+ serviceTransports.push_back(2);
+ } else {
+ serviceTransports.push_back(1);
+ }
+ } else {
+ bool fPrimaryAdded = false;
+ bool fSecondaryAdded = false;
+ std::vector<std::string>::const_iterator it = service_transports.begin();
+ for (; it != service_transports.end(); it++) {
+ const utils::custom_string::CustomString transport(*it);
+ LOG4CXX_TRACE(logger_,
+ "Service Allowed to run on " << transport.c_str()
+ << " transport");
+
+ if (!fPrimaryAdded &&
+ (transport.CompareIgnoreCase(primary_connection_type.c_str()) ||
+ (transport.CompareIgnoreCase("IAP_USB") &&
+ primary_transport_type == impl::TransportType::TT_USB))) {
+ LOG4CXX_TRACE(logger_, "Service allowed on primary transport");
+ serviceTransports.push_back(1);
+ fPrimaryAdded = true;
+ }
+
+ if (!fSecondaryAdded) {
+ const utils::custom_string::CustomString transport_type(
+ TransportTypeFromTransport(transport));
+ std::vector<std::string>::const_iterator found =
+ std::find_if(secondary_transport_types.begin(),
+ secondary_transport_types.end(),
+ [&](const std::string& secondary_transport_type) {
+ return transport_type.CompareIgnoreCase(
+ secondary_transport_type.c_str());
+ });
+ if (found != secondary_transport_types.end()) {
+ LOG4CXX_TRACE(logger_, "Service allowed on secondary transport");
+ serviceTransports.push_back(2);
+ fSecondaryAdded = true;
+ }
+ }
+
+ if (fPrimaryAdded && fSecondaryAdded) {
+ break;
+ }
+ }
+ }
+}
+
+const std::string ProtocolHandlerImpl::TransportTypeFromTransport(
+ const utils::custom_string::CustomString& transport) const {
+ std::string transport_type;
+
+ if (transport.CompareIgnoreCase("IAP_BLUETOOTH") ||
+ transport.CompareIgnoreCase("SPP_BLUETOOTH")) {
+ transport_type = "Bluetooth";
+ } else if (transport.CompareIgnoreCase("IAP_USB") ||
+ transport.CompareIgnoreCase("AOA_USB") ||
+ transport.CompareIgnoreCase("IAP_USB_HOST_MODE") ||
+ transport.CompareIgnoreCase("IAP_USB_DEVICE_MODE")) {
+ transport_type = "USB";
+ } else if (transport.CompareIgnoreCase("TCP_WIFI") ||
+ transport.CompareIgnoreCase("IAP_CARPLAY")) {
+ transport_type = "WiFi";
+ }
+
+ return transport_type;
+}
+
} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index ae52849de6..d5422e11bc 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -41,6 +41,7 @@
#include "protocol_handler/protocol_packet.h"
#include "utils/macro.h"
#include "utils/byte_order.h"
+#include "utils/semantic_version.h"
namespace protocol_handler {
@@ -52,48 +53,6 @@ ProtocolPacket::ProtocolData::~ProtocolData() {
delete[] data;
}
-ProtocolPacket::ProtocolVersion::ProtocolVersion()
- : majorVersion(0), minorVersion(0), patchVersion(0) {}
-
-ProtocolPacket::ProtocolVersion::ProtocolVersion(uint8_t majorVersion,
- uint8_t minorVersion,
- uint8_t patchVersion)
- : majorVersion(majorVersion)
- , minorVersion(minorVersion)
- , patchVersion(patchVersion) {}
-
-ProtocolPacket::ProtocolVersion::ProtocolVersion(ProtocolVersion& other) {
- this->majorVersion = other.majorVersion;
- this->minorVersion = other.minorVersion;
- this->patchVersion = other.patchVersion;
-}
-
-ProtocolPacket::ProtocolVersion::ProtocolVersion(std::string versionString)
- : majorVersion(0), minorVersion(0), patchVersion(0) {
- unsigned int majorInt, minorInt, patchInt;
- int readElements = sscanf(
- versionString.c_str(), "%u.%u.%u", &majorInt, &minorInt, &patchInt);
- if (readElements != 3) {
- LOG4CXX_WARN(logger_,
- "Error while parsing version string: " << versionString);
- } else {
- majorVersion = static_cast<uint8_t>(majorInt);
- minorVersion = static_cast<uint8_t>(minorInt);
- patchVersion = static_cast<uint8_t>(patchInt);
- }
-}
-
-std::string ProtocolPacket::ProtocolVersion::to_string() {
- char versionString[256];
- snprintf(versionString,
- 255,
- "%u.%u.%u",
- static_cast<unsigned int>(majorVersion),
- static_cast<unsigned int>(minorVersion),
- static_cast<unsigned int>(patchVersion));
- return std::string(versionString);
-}
-
ProtocolPacket::ProtocolHeader::ProtocolHeader()
: version(0x00)
, protection_flag(PROTECTION_OFF)
@@ -304,8 +263,8 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
// Check frame info for each frame type
// Frame type shall be 0x00 (Control), 0x01 (Single), 0x02 (First), 0x03
// (Consecutive)
- // For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
- // Ack), 0xFF(HB Ack)
+ // For Control frames Frame info value shall be from 0x00 to 0x09 or
+ // 0xFD(Transport Event Update), 0xFE(Data Ack), 0xFF(HB Ack)
// For Single and First frames Frame info value shall be equal 0x00
switch (header.frameType) {
case FRAME_TYPE_CONTROL: {
@@ -317,6 +276,10 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
case FRAME_DATA_END_SERVICE:
case FRAME_DATA_END_SERVICE_ACK:
case FRAME_DATA_END_SERVICE_NACK:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK:
+ case FRAME_DATA_TRANSPORT_EVENT_UPDATE:
case FRAME_DATA_SERVICE_DATA_ACK:
case FRAME_DATA_HEART_BEAT_ACK:
break;
@@ -520,6 +483,17 @@ bool ProtocolPacket::operator==(const ProtocolPacket& other) const {
return false;
}
+void ProtocolPacket::HandleRawFirstFrameData(const uint8_t* message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ payload_size_ = 0;
+ const uint8_t* data = message;
+ uint32_t total_data_bytes = data[0] << 24;
+ total_data_bytes |= data[1] << 16;
+ total_data_bytes |= data[2] << 8;
+ total_data_bytes |= data[3];
+ set_total_data_bytes(total_data_bytes);
+}
+
RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t* message,
const size_t messageSize) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -532,18 +506,15 @@ RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t* message,
packet_data_.totalDataBytes = packet_header_.dataSize;
uint32_t dataPayloadSize = 0;
- if ((offset < messageSize) && packet_header_.frameType != FRAME_TYPE_FIRST) {
+ if ((offset < messageSize)) {
dataPayloadSize = messageSize - offset;
}
- if (packet_header_.frameType == FRAME_TYPE_FIRST) {
+ if (packet_header_.frameType == FRAME_TYPE_FIRST &&
+ !packet_header_.protection_flag) {
payload_size_ = 0;
const uint8_t* data = message + offset;
- uint32_t total_data_bytes = data[0] << 24;
- total_data_bytes |= data[1] << 16;
- total_data_bytes |= data[2] << 8;
- total_data_bytes |= data[3];
- set_total_data_bytes(total_data_bytes);
+ HandleRawFirstFrameData(data);
if (0 == packet_data_.data) {
return RESULT_FAIL;
}
@@ -602,6 +573,8 @@ uint8_t* ProtocolPacket::data() const {
}
void ProtocolPacket::set_total_data_bytes(size_t dataBytes) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Data bytes : " << dataBytes);
if (dataBytes) {
delete[] packet_data_.data;
packet_data_.data = new (std::nothrow) uint8_t[dataBytes];
@@ -632,6 +605,10 @@ ConnectionID ProtocolPacket::connection_id() const {
return connection_id_;
}
+void ProtocolPacket::set_connection_id(ConnectionID connection_id) {
+ connection_id_ = connection_id;
+}
+
uint32_t ProtocolPacket::payload_size() const {
return payload_size_;
}
diff --git a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
index a1c1f188d1..9a91a5d1f7 100644
--- a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
+++ b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
@@ -43,8 +43,9 @@ namespace protocol_handler_test {
class MockPHTelemetryObserver : public ::protocol_handler::PHTelemetryObserver {
public:
- MOCK_METHOD2(StartMessageProcess, void(uint32_t, const TimevalStruct&));
- MOCK_METHOD2(EndMessageProcess, void(utils::SharedPtr<MessageMetric>));
+ MOCK_METHOD2(StartMessageProcess,
+ void(uint32_t, const date_time::TimeDuration&));
+ MOCK_METHOD2(EndMessageProcess, void(std::shared_ptr<MessageMetric>));
};
} // namespace protocol_handler_test
diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc
index d0a311583c..9abf5d69af 100644
--- a/src/components/protocol_handler/test/incoming_data_handler_test.cc
+++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc
@@ -74,7 +74,7 @@ class IncomingDataHandlerTest : public ::testing::Test {
void AppendPacketToTMData(const ProtocolPacket& packet) {
const RawMessagePtr msg = packet.serializePacket();
- EXPECT_TRUE(msg.valid());
+ EXPECT_TRUE(msg.use_count() != 0);
EXPECT_GT(msg->data_size(), 0u);
tm_data.insert(tm_data.end(), msg->data(), msg->data() + msg->data_size());
}
@@ -192,49 +192,51 @@ TEST_F(IncomingDataHandlerTest, Heartbeat_pack) {
TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
// single packet Nav
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_SINGLE,
- kMobileNav,
- FRAME_DATA_SINGLE,
- ++some_session_id,
- some_data_size,
- ++some_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_SINGLE,
+ kMobileNav,
+ FRAME_DATA_SINGLE,
+ ++some_session_id,
+ some_data_size,
+ ++some_message_id,
+ some_data));
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
for (FrameList::iterator it = mobile_packets.begin();
it != mobile_packets.end();
++it) {
@@ -268,16 +270,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) {
malformed_versions.push_back(version);
}
for (size_t i = 0; i < malformed_versions.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- malformed_versions[i],
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kControl,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ malformed_versions[i],
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kControl,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -316,16 +319,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ServiceType) {
malformed_serv_types.push_back(0x0D);
malformed_serv_types.push_back(0x0E);
for (size_t i = 0; i < malformed_serv_types.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- malformed_serv_types[i],
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ malformed_serv_types[i],
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -360,16 +364,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) {
malformed_frame_types.push_back(frame_type);
}
for (size_t i = 0; i < malformed_frame_types.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- malformed_frame_types[i],
- kControl,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ malformed_frame_types[i],
+ kControl,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -393,27 +398,28 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) {
}
}
-// For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
-// Ack), 0xFF(HB Ack)
+// For Control frames Frame info value shall be from 0x00 to 0x09 or 0xFD
+// (Transport Update Event), 0xFE(Data Ack), 0xFF(HB Ack)
TEST_F(IncomingDataHandlerTest, MalformedPacket_ControlFrame) {
FrameList malformed_packets;
std::vector<uint8_t> malformed_frame_data;
- for (uint8_t frame_type = FRAME_DATA_END_SERVICE_NACK + 1;
- frame_type < FRAME_DATA_SERVICE_DATA_ACK;
+ for (uint8_t frame_type = FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK + 1;
+ frame_type < FRAME_DATA_TRANSPORT_EVENT_UPDATE;
++frame_type) {
malformed_frame_data.push_back(frame_type);
}
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -448,16 +454,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_SingleFrame) {
}
malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -492,16 +499,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) {
}
malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -529,106 +537,110 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) {
TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed byte
tm_data.insert(tm_data.end(), 1, 0x1);
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 2, 0x2);
// single packet Nav
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_SINGLE,
- kMobileNav,
- FRAME_DATA_SINGLE,
- ++some_session_id,
- some_data_size,
- ++some_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_SINGLE,
+ kMobileNav,
+ FRAME_DATA_SINGLE,
+ ++some_session_id,
+ some_data_size,
+ ++some_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 3, 0x3);
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 4, 0x4);
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kRpc,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kRpc,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 5, 0x5);
// single packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kAudio,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kAudio,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 6, 0x6);
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
ProcessData(uid1, &tm_data[0], tm_data.size());
@@ -651,29 +663,30 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) {
TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Malformed packet 1
@@ -691,16 +704,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
AppendPacketToTMData(malformed_packet1);
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Malformed packet 2
@@ -718,16 +732,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
AppendPacketToTMData(malformed_packet2);
// Audio packet
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kAudio,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kAudio,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
ProcessData(uid1, &tm_data[0], tm_data.size());
diff --git a/src/components/protocol_handler/test/multiframe_builder_test.cc b/src/components/protocol_handler/test/multiframe_builder_test.cc
index ad8a39f79a..f919ec92af 100644
--- a/src/components/protocol_handler/test/multiframe_builder_test.cc
+++ b/src/components/protocol_handler/test/multiframe_builder_test.cc
@@ -35,7 +35,7 @@
#include <algorithm>
#include <utility>
#include <limits>
-#include "utils/make_shared.h"
+
#include "protocol_handler/multiframe_builder.h"
namespace test {
@@ -149,7 +149,7 @@ class MultiFrameBuilderTest : public ::testing::Test {
const ProtocolFramePtrList::const_iterator it_last = --(multiframes.end());
while (it != it_last) {
const ProtocolFramePtr frame = *it;
- ASSERT_TRUE(frame);
+ ASSERT_TRUE((bool)frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame))
<< "Non final CONSECUTIVE frame: " << frame;
EXPECT_EQ(ProtocolFramePtrList(), multiframe_builder_.PopMultiframes())
@@ -331,7 +331,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_NoConnections) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_FAIL, multiframe_builder_.AddFrame(first_frame))
<< "Non-existed connection " << connection_id
<< "- to be skipped first frame: " << first_frame;
@@ -365,7 +365,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_only) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame))
<< "First frame: " << first_frame;
@@ -440,7 +440,7 @@ TEST_F(MultiFrameBuilderTest, Add_ConsecutiveFrames_per1) {
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr frame = multiframes.front();
- ASSERT_TRUE(frame);
+ ASSERT_TRUE((bool)frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame))
<< "Frame: " << frame;
@@ -501,7 +501,7 @@ TEST_F(MultiFrameBuilderTest, FrameExpired_OneMSec) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame))
<< "First frame: " << first_frame;
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index 77de1705da..51284dfcda 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -41,15 +41,27 @@
#include "protocol_handler/mock_protocol_handler_settings.h"
#include "protocol_handler/mock_session_observer.h"
#include "connection_handler/mock_connection_handler.h"
+#include "connection_handler/connection_handler_impl.h"
#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
#endif // ENABLE_SECURITY
#include "transport_manager/mock_transport_manager.h"
-#include "utils/make_shared.h"
+#include "utils/mock_system_time_handler.h"
+#include "utils/semantic_version.h"
+
#include "utils/test_async_waiter.h"
#include <bson_object.h>
+namespace transport_manager {
+namespace transport_adapter {
+// taken from transport_adapter_impl.cc
+const char* tc_enabled = "enabled";
+const char* tc_tcp_port = "tcp_port";
+const char* tc_tcp_ip_address = "tcp_ip_address";
+}
+}
+
namespace test {
namespace components {
namespace protocol_handler_test {
@@ -87,6 +99,10 @@ using protocol_handler::FRAME_DATA_SERVICE_DATA_ACK;
using protocol_handler::FRAME_DATA_SINGLE;
using protocol_handler::FRAME_DATA_FIRST;
using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK;
+using protocol_handler::FRAME_DATA_TRANSPORT_EVENT_UPDATE;
using protocol_handler::kRpc;
using protocol_handler::kControl;
using protocol_handler::kAudio;
@@ -95,16 +111,24 @@ using protocol_handler::kBulk;
using protocol_handler::kInvalidServiceType;
// For TM states
using transport_manager::TransportManagerListener;
+using test::components::security_manager_test::MockSystemTimeHandler;
using transport_manager::E_SUCCESS;
using transport_manager::DeviceInfo;
+#ifdef ENABLE_SECURITY
+// For security
+using ContextCreationStrategy =
+ security_manager::SecurityManager::ContextCreationStrategy;
+#endif // ENABLE_SECURITY
// For CH entities
using connection_handler::DeviceHandle;
// Google Testing Framework Entities
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::ReturnRefOfCopy;
using ::testing::ReturnNull;
using ::testing::An;
using ::testing::AnyOf;
+using ::testing::AtLeast;
using ::testing::ByRef;
using ::testing::DoAll;
using ::testing::SaveArg;
@@ -183,6 +207,9 @@ class ProtocolHandlerImplTest : public ::testing::Test {
.
// Return false to avoid call KeepConnectionAlive
WillRepeatedly(Return(false));
+
+ session_connection_map_lock_ptr_ =
+ std::make_shared<sync_primitives::Lock>();
}
void TearDown() OVERRIDE {
@@ -209,6 +236,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
const uint32_t hash_id,
const bool protection_flag) {
return protocol_handler::SessionContext(connection_id,
+ connection_id,
initial_session_id,
new_session_id,
service_type,
@@ -216,7 +244,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
protection_flag);
}
- void AddSession(const ::utils::SharedPtr<TestAsyncWaiter>& waiter,
+ void AddSession(const std::shared_ptr<TestAsyncWaiter>& waiter,
uint32_t& times) {
using namespace protocol_handler;
ASSERT_TRUE(NULL != waiter.get());
@@ -241,6 +269,21 @@ class ProtocolHandlerImplTest : public ::testing::Test {
HASH_ID_WRONG,
callback_protection_flag);
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -313,10 +356,11 @@ class ProtocolHandlerImplTest : public ::testing::Test {
uint8_t service_type,
uint8_t sessionId,
uint32_t frame_data,
+ uint8_t protocol_version = PROTOCOL_VERSION_3,
uint32_t dataSize = 0u,
const uint8_t* data = NULL) {
SendTMMessage(connection_id,
- PROTOCOL_VERSION_3,
+ protocol_version,
protection,
FRAME_TYPE_CONTROL,
service_type,
@@ -327,8 +371,20 @@ class ProtocolHandlerImplTest : public ::testing::Test {
data);
}
+ void VerifySecondaryTransportParamsInStartSessionAck(
+ bool config_multiple_transports_enabled,
+ const std::vector<std::string>& config_secondary_transports_for_usb,
+ const std::vector<std::string>& config_secondary_transports_for_bluetooth,
+ const std::vector<std::string>& config_secondary_transports_for_wifi,
+ const std::vector<std::string>& config_audio_service_transports,
+ const std::vector<std::string>& config_video_service_transports,
+ const std::string& connection_type_string,
+ const std::vector<std::string>& expected_transport_strings,
+ const std::vector<int32_t>& expected_audio_service_transports,
+ const std::vector<int32_t>& expected_video_service_transports);
+
testing::NiceMock<MockProtocolHandlerSettings> protocol_handler_settings_mock;
- ::utils::SharedPtr<ProtocolHandlerImpl> protocol_handler_impl;
+ std::shared_ptr<ProtocolHandlerImpl> protocol_handler_impl;
TransportManagerListener* tm_listener;
// Uniq connection
::transport_manager::ConnectionUID connection_id;
@@ -353,6 +409,10 @@ class ProtocolHandlerImplTest : public ::testing::Test {
std::vector<int> force_unprotected_services;
#endif // ENABLE_SECURITY
std::vector<std::string> empty_rejected_param_;
+ // Used by OnTransportConfigUpdated() tests. The lifetime of these objects
+ // should be longer than that of a test case.
+ connection_handler::SessionConnectionMap session_connection_map_;
+ std::shared_ptr<sync_primitives::Lock> session_connection_map_lock_ptr_;
};
#ifdef ENABLE_SECURITY
@@ -407,6 +467,24 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
ServiceType service_type;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .Times(call_times)
+ .WillRepeatedly(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -475,6 +553,24 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
TestAsyncWaiter waiter;
uint32_t times = 0;
ServiceType service_type;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .Times(call_times)
+ .WillRepeatedly(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -533,6 +629,21 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -577,8 +688,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) {
SetProtocolVersion2();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -618,6 +728,18 @@ TEST_F(ProtocolHandlerImplTest,
const ::transport_manager::ConnectionUID connection_id2 = 0xBu;
const uint8_t session_id2 = 2u;
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id2, session_id2))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock,
+ GetSSLContext(connection_key, start_service))
+ .Times(2)
+ .WillRepeatedly(ReturnNull());
+#endif // ENABLE_SECURITY
+
EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id1, _))
.WillRepeatedly(Return(false));
EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id2, _))
@@ -638,6 +760,26 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id1))
+ .WillOnce(Return("TCP_WIFI"));
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id2))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .Times(2)
+ .WillRepeatedly(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .Times(2)
+ .WillRepeatedly(ReturnRef(video_service_transports));
+
BsonObject bson_params1;
bson_object_initialize_default(&bson_params1);
bson_object_put_string(&bson_params1,
@@ -774,14 +916,91 @@ TEST_F(ProtocolHandlerImplTest,
bson_object_deinitialize(&bson_params2);
}
+/*
+ * ProtocolHandler shall send NAck on session_observer rejection
+ * Check protection flag OFF for all services from kControl to kBulk
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Audio_RejectByTransportType) {
+ using namespace protocol_handler;
+ AddConnection();
+ const ServiceType start_service = kAudio;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("AOA_USB");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
+ // Expect send Ack
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK,
+ PROTECTION_OFF)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(
+ PROTECTION_OFF, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+/*
+ * ProtocolHandler shall send NAck on session_observer rejection
+ * Check protection flag OFF for all services from kControl to kBulk
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Video_RejectByTransportType) {
+ using namespace protocol_handler;
+ AddConnection();
+ const ServiceType start_service = kMobileNav;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("AOA_USB");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
+ // Expect send Ack
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK,
+ PROTECTION_OFF)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(
+ PROTECTION_OFF, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
// TODO(EZamakhov): add test for get_hash_id/set_hash_id from
// protocol_handler_impl.cc
/*
* ProtocolHandler shall send NAck on session_observer rejection
*/
TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -814,8 +1033,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
* ProtocolHandler shall send NAck on wrong hash code
*/
TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -848,8 +1066,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
#ifdef ENABLE_SECURITY
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
using namespace protocol_handler;
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -857,6 +1074,21 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
// Add security manager
AddSecurityManager();
const ServiceType start_service = kRpc;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -913,6 +1145,21 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -968,6 +1215,21 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
PROTECTION_ON);
context.is_new_service_ = true;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -987,7 +1249,10 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
SetProtocolVersion2();
// Expect start protection for unprotected session
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key,
+ security_manager::SecurityManager::
+ ContextCreationStrategy::kUseExisting))
.
// Return fail protection
WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
@@ -1018,6 +1283,21 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -1042,7 +1322,7 @@ TEST_F(ProtocolHandlerImplTest,
SetProtocolVersion2();
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(
@@ -1094,6 +1374,21 @@ TEST_F(ProtocolHandlerImplTest,
PROTECTION_ON);
context.is_new_service_ = true;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -1119,7 +1414,7 @@ TEST_F(ProtocolHandlerImplTest,
.WillOnce(ReturnRefOfCopy(services));
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(Return(&ssl_context_mock));
@@ -1175,6 +1470,21 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -1198,7 +1508,7 @@ TEST_F(ProtocolHandlerImplTest,
times++;
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(
@@ -1273,6 +1583,21 @@ TEST_F(
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -1296,7 +1621,7 @@ TEST_F(
times++;
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(
@@ -1369,6 +1694,21 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
@@ -1392,7 +1732,10 @@ TEST_F(ProtocolHandlerImplTest,
times++;
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key,
+ security_manager::SecurityManager::
+ ContextCreationStrategy::kUseExisting))
.
// Return new SSLContext
WillOnce(
@@ -1420,27 +1763,37 @@ TEST_F(ProtocolHandlerImplTest,
// Expect add listener for handshake result
EXPECT_CALL(security_manager_mock, AddListener(_))
- // Emulate handshake fail
- .WillOnce(Invoke(OnHandshakeDoneFunctor(
- connection_key,
- security_manager::SSLContext::Handshake_Result_Success)));
+ // Emulate handshake
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ Invoke(OnHandshakeDoneFunctor(
+ connection_key,
+ security_manager::SSLContext::Handshake_Result_Success))));
+ times++;
// Listener check SSLContext
EXPECT_CALL(session_observer_mock,
GetSSLContext(connection_key, start_service))
.
// Emulate protection for service is not enabled
- WillOnce(ReturnNull());
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
+ times++;
+
+ EXPECT_CALL(security_manager_mock, IsSystemTimeProviderReady())
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
- // Expect service protection enable
EXPECT_CALL(session_observer_mock,
- SetProtectionFlag(connection_key, start_service));
+ SetProtectionFlag(connection_key, start_service))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
- // Expect send Ack with PROTECTION_OFF (on fail handshake)
+ // Expect send Ack with PROTECTION_ON (on successfull handshake)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON)))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+
times++;
SendControlMessage(
@@ -1450,14 +1803,1138 @@ TEST_F(ProtocolHandlerImplTest,
}
#endif // ENABLE_SECURITY
+void ProtocolHandlerImplTest::VerifySecondaryTransportParamsInStartSessionAck(
+ bool config_multiple_transports_enabled,
+ const std::vector<std::string>& config_secondary_transports_for_usb,
+ const std::vector<std::string>& config_secondary_transports_for_bluetooth,
+ const std::vector<std::string>& config_secondary_transports_for_wifi,
+ const std::vector<std::string>& config_audio_service_transports,
+ const std::vector<std::string>& config_video_service_transports,
+ const std::string& connection_type_string,
+ const std::vector<std::string>& expected_transport_strings,
+ const std::vector<int32_t>& expected_audio_service_transports,
+ const std::vector<int32_t>& expected_video_service_transports) {
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+ char full_version_string[] = "5.1.0";
+
+ // configuration setup
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(config_multiple_transports_enabled));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ // Prepare expected BSON parameters. When we add another param in Start
+ // Service ACK frame in future, it should be also added here.
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // mtu
+ bson_object_put_int64(&expected_obj,
+ protocol_handler::strings::mtu,
+ static_cast<int64_t>(maximum_rpc_payload_size));
+ // hashId
+ bson_object_put_int32(&expected_obj,
+ protocol_handler::strings::hash_id,
+ static_cast<int32_t>(hash_id));
+ // protocolVersion
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::protocol_version,
+ full_version_string);
+ // secondaryTransports
+ BsonArray secondary_transports;
+ bson_array_initialize(&secondary_transports,
+ expected_transport_strings.size());
+ for (std::vector<std::string>::const_iterator it =
+ expected_transport_strings.begin();
+ it != expected_transport_strings.end();
+ ++it) {
+ // note: if there is no transport allowed, we can either make the array
+ // empty, or completely omit the array. (The spec allows both cases.) In
+ // this test case we make the array empty.
+ bson_array_add_string(&secondary_transports,
+ const_cast<char*>(it->c_str()));
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::secondary_transports,
+ &secondary_transports);
+ // audioServiceTransports
+ BsonArray audio_service_transports;
+ if (expected_audio_service_transports.size() > 0) {
+ bson_array_initialize(&audio_service_transports,
+ expected_audio_service_transports.size());
+ for (std::vector<int32_t>::const_iterator it =
+ expected_audio_service_transports.begin();
+ it != expected_audio_service_transports.end();
+ ++it) {
+ bson_array_add_int32(&audio_service_transports, *it);
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::audio_service_transports,
+ &audio_service_transports);
+ }
+ // videoServiceTransports
+ BsonArray video_service_transports;
+ if (expected_video_service_transports.size() > 0) {
+ bson_array_initialize(&video_service_transports,
+ expected_video_service_transports.size());
+ for (std::vector<int32_t>::const_iterator it =
+ expected_video_service_transports.begin();
+ it != expected_video_service_transports.end();
+ ++it) {
+ bson_array_add_int32(&video_service_transports, *it);
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::video_service_transports,
+ &video_service_transports);
+ }
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_Enabled) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is Android and is connected through Bluetooth SPP
+ std::string connection_type_string("SPP_BLUETOOTH");
+
+ // Core should specify WiFi for secondary transport, and should allow video
+ // and audio services only on secondary transport
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ // A TransportUpdateEvent is also issued after Start Service ACK. We don't
+ // check it in this test case.
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_NoSecondaryTransport) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over USB
+ std::string connection_type_string("IAP_USB");
+
+ // Core should not offer any secondary transport. It will allow both video
+ // and audio services on primary transport.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_MultipleSecondaryTransports) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi and USB
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should offer both Wi-Fi and USB for secondary transport. Since the
+ // device is iOS, Core should specify "IAP_USB".
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ expected_transport_strings.push_back("IAP_USB");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(
+ ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_ServiceAllowedOnBothTransports) {
+ std::vector<std::string> secondary_transports_for_usb;
+ secondary_transports_for_usb.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video service to run on Wi-Fi transports only, and audio
+ // service to run on all transports
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_BLUETOOTH");
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("SPP_BLUETOOTH");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is Android and is connected through AOA
+ std::string connection_type_string("AOA_USB");
+
+ // Core should offer Wi-Fi for secondary transport. It should allow audio
+ // service to run on both primary and secondary, while video service to run
+ // on secondary only. Since the list specifies AOA_USB then TCP_WIFI, the
+ // priority is primary > secondary.
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1); // primary preferred
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_SecondaryDisabled) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_BLUETOOTH");
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("SPP_BLUETOOTH");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_BLUETOOTH");
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("SPP_BLUETOOTH");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should not offer any secondary transport. It should still send
+ // the video/audio service transport lists.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ false, /* disabled */
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_ServicesMapEmpty) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi;
+ secondary_transports_for_wifi.push_back("USB");
+ // config does not specify video and audio services
+ std::vector<std::string> audio_service_transports; // empty
+ std::vector<std::string> video_service_transports; // empty
+
+ // assume the device is connected through Wi-Fi (so not sure if it's iOS or
+ // Android)
+ std::string connection_type_string("TCP_WIFI");
+
+ // Core should offer USB transport for secondary transport. (Since the OS type
+ // is unknown, it will offer both IAP_USB and AOA_USB.) Also, it should allow
+ // video/audio services on all transports.
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("IAP_USB");
+ expected_transport_strings.push_back("AOA_USB");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(
+ ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_SecondaryDisabled_ServicesMapEmpty) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config does not specify video and audio services
+ std::vector<std::string> audio_service_transports; // empty
+ std::vector<std::string> video_service_transports; // empty
+
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should not offer any secondary transport. It should still send
+ // the video/audio service transport lists.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ false, /* disabled */
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+// Secondary transport param should not be included for apps with v5.0.0
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_Unprotected_NoSecondaryTransportParamsForV5) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 0, 0);
+ char full_version_string[] = "5.0.0";
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // configuration
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> config_secondary_transports_for_wifi;
+ config_secondary_transports_for_wifi.push_back("USB");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // configuration setup
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ // BSON params should not include any of "secondaryTransports",
+ // "audioServiceTransports" and "videoServiceTransports" since v5.0.0 app
+ // does not understand them
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // mtu
+ bson_object_put_int64(&expected_obj,
+ protocol_handler::strings::mtu,
+ static_cast<int64_t>(maximum_rpc_payload_size));
+ // hashId
+ bson_object_put_int32(&expected_obj,
+ protocol_handler::strings::hash_id,
+ static_cast<int32_t>(hash_id));
+ // protocolVersion
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::protocol_version,
+ full_version_string);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ // Since the protocol version is less than 5.1.0, Core should not issue
+ // TransportEventUpdate frame. Enable ProtocolVersionUsed() call and verify
+ // that transport_manager_mock will NOT receive another SendMessageToDevice()
+ // call.
+ ON_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillByDefault(Return(true));
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, StartSessionAck_PrimaryTransportUSBHostMode) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb;
+ secondary_transports_for_usb.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is IOS and is connected through USB Host Mode
+ std::string connection_type_string("IAP_USB_HOST_MODE");
+
+ // Core should specify WiFi for secondary transport, and should allow video
+ // services on both transports, and audio only on secondary transport
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+ expected_video_service_transports.push_back(2);
+
+ // A TransportUpdateEvent is also issued after Start Service ACK. We don't
+ // check it in this test case.
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ TransportEventUpdate_afterVersionNegotiation_TCPEnabled) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // TCP configuration setup
+ bool tcp_enabled = true;
+ char tcp_address[] = "192.168.1.1";
+ int32_t tcp_port = 12345;
+ std::string tcp_port_str = "12345";
+ protocol_handler_impl->set_tcp_config(
+ tcp_enabled, std::string(tcp_address), tcp_port_str);
+
+ // configuration setup
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> config_secondary_transports_for_wifi; // empty
+ std::vector<std::string> config_audio_service_transports;
+ config_audio_service_transports.push_back("IAP_USB");
+ config_audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_audio_service_transports.push_back("IAP_CARPLAY");
+ config_audio_service_transports.push_back("AOA_USB");
+ config_audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> config_video_service_transports;
+ config_video_service_transports.push_back("IAP_USB");
+ config_video_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_video_service_transports.push_back("IAP_CARPLAY");
+ config_video_service_transports.push_back("AOA_USB");
+ config_video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(
+ FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF, connection_id, _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ bson_object_put_string(
+ &expected_obj, protocol_handler::strings::tcp_ip_address, tcp_address);
+ // TCP port number
+ bson_object_put_int32(
+ &expected_obj, protocol_handler::strings::tcp_port, tcp_port);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ TransportEventUpdate_afterVersionNegotiation_TCPDisabled) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // TCP configuration setup
+ bool tcp_enabled = false;
+ char tcp_address[] = "192.168.2.3";
+ std::string tcp_port_str = "12345";
+ protocol_handler_impl->set_tcp_config(
+ tcp_enabled, std::string(tcp_address), tcp_port_str);
+
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> config_secondary_transports_for_wifi; // empty
+ std::vector<std::string> config_audio_service_transports;
+ config_audio_service_transports.push_back("IAP_USB");
+ config_audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_audio_service_transports.push_back("IAP_CARPLAY");
+ config_audio_service_transports.push_back("AOA_USB");
+ config_audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> config_video_service_transports;
+ config_video_service_transports.push_back("IAP_USB");
+ config_video_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_video_service_transports.push_back("IAP_CARPLAY");
+ config_video_service_transports.push_back("AOA_USB");
+ config_video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(
+ FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF, connection_id, _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ char empty_ip_address[] = "";
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::tcp_ip_address,
+ empty_ip_address);
+ // TCP port number should be omitted
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ OnTransportConfigUpdated_TransportEventUpdate_TCPEnabled) {
+ using connection_handler::SessionConnectionMap;
+ using connection_handler::SessionTransports;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ char tcp_address[] = "172.16.2.3";
+ int32_t tcp_port = 23456;
+ std::string tcp_port_str = "23456";
+
+ transport_manager::transport_adapter::TransportConfig configs;
+ configs[transport_manager::transport_adapter::tc_enabled] =
+ std::string("true");
+ configs[transport_manager::transport_adapter::tc_tcp_port] = tcp_port_str;
+ configs[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string(tcp_address);
+
+ transport_manager::ConnectionUID device1_primary_connection_id = 100;
+ transport_manager::ConnectionUID device2_primary_connection_id = 101;
+ transport_manager::ConnectionUID device2_secondary_connection_id = 150;
+
+ SessionTransports st1 = {device1_primary_connection_id, kDisabledSecondary};
+ SessionTransports st2 = {device2_primary_connection_id,
+ device2_secondary_connection_id};
+ session_connection_map_[0x11] = st1;
+ session_connection_map_[0x22] = st2;
+
+ EXPECT_CALL(connection_handler_mock, session_connection_map())
+ .WillOnce(Return(DataAccessor<SessionConnectionMap>(
+ session_connection_map_, session_connection_map_lock_ptr_)));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ bson_object_put_string(
+ &expected_obj, protocol_handler::strings::tcp_ip_address, tcp_address);
+ // TCP port number
+ bson_object_put_int32(
+ &expected_obj, protocol_handler::strings::tcp_port, tcp_port);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ // since device 1 doesn't support secondary transport feature,
+ // TransportEvetUpdate should be delivered only to device 2
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device2_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ tm_listener->OnTransportConfigUpdated(configs);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ OnTransportConfigUpdated_TransportEventUpdate_TCPDisabled) {
+ using connection_handler::SessionConnectionMap;
+ using connection_handler::SessionTransports;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ char tcp_address[] = "172.16.2.3";
+ std::string tcp_port_str = "23456";
+
+ transport_manager::transport_adapter::TransportConfig configs;
+ configs[transport_manager::transport_adapter::tc_enabled] =
+ std::string("false");
+ configs[transport_manager::transport_adapter::tc_tcp_port] = tcp_port_str;
+ configs[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string(tcp_address);
+
+ transport_manager::ConnectionUID device1_primary_connection_id = 100;
+ transport_manager::ConnectionUID device1_secondary_connection_id = 150;
+ transport_manager::ConnectionUID device2_primary_connection_id = 101;
+ transport_manager::ConnectionUID device3_primary_connection_id = 102;
+ transport_manager::ConnectionUID device3_secondary_connection_id = 151;
+
+ SessionTransports st1 = {device1_primary_connection_id,
+ device1_secondary_connection_id};
+ SessionTransports st2 = {device2_primary_connection_id, kDisabledSecondary};
+ SessionTransports st3 = {device3_primary_connection_id,
+ device3_secondary_connection_id};
+ session_connection_map_[0x11] = st1;
+ session_connection_map_[0x22] = st2;
+ session_connection_map_[0x33] = st3;
+
+ EXPECT_CALL(connection_handler_mock, session_connection_map())
+ .WillOnce(Return(DataAccessor<SessionConnectionMap>(
+ session_connection_map_, session_connection_map_lock_ptr_)));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ char empty_ip_address[] = "";
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::tcp_ip_address,
+ empty_ip_address);
+ // TCP port number should be omitted
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ // both device 1 and device 3 should receive TransportEventUpdate frames
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device1_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device3_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ tm_listener->OnTransportConfigUpdated(configs);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, RegisterSecondaryTransport_SUCCESS) {
+ AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ transport_manager::ConnectionUID primary_connection_id = 123;
+
+ EXPECT_CALL(session_observer_mock,
+ ProtocolVersionUsed(primary_connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ EXPECT_CALL(connection_handler_mock,
+ OnSecondaryTransportStarted(_, connection_id, session_id))
+ .WillOnce(DoAll(SetArgReferee<0>(primary_connection_id), Return(true)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(
+ ControlMessage(FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(PROTECTION_OFF,
+ kControl,
+ session_id,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT,
+ PROTOCOL_VERSION_5);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, RegisterSecondaryTransport_FAILURE) {
+ AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ transport_manager::ConnectionUID primary_connection_id = 123;
+
+ EXPECT_CALL(session_observer_mock,
+ ProtocolVersionUsed(primary_connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ // check the behavior when OnSecondaryTransportStarted() returns false
+ EXPECT_CALL(connection_handler_mock,
+ OnSecondaryTransportStarted(_, connection_id, session_id))
+ .WillOnce(DoAll(SetArgReferee<0>(primary_connection_id), Return(false)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(
+ ControlMessage(FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK,
+ PROTECTION_OFF,
+ connection_id,
+ _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(PROTECTION_OFF,
+ kControl,
+ session_id,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT,
+ PROTOCOL_VERSION_5);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification) {
const size_t period_msec = 10000;
const size_t max_messages = 1000;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1494,8 +2971,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_ThresholdValue) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1531,8 +3007,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_VideoFrameSkip) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1560,8 +3035,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_AudioFrameSkip) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1589,8 +3063,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerificationDisable) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1618,8 +3091,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
InitProtocolHandlerImpl(0u, 0u, false, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1651,8 +3123,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_MalformedLimitVerification) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1699,8 +3170,7 @@ TEST_F(ProtocolHandlerImplTest,
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1771,8 +3241,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1832,8 +3301,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1866,8 +3334,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullCount) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1910,8 +3377,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
DISABLED_SendEndServicePrivate_EndSession_MessageSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1935,8 +3401,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
SendEndServicePrivate_ServiceTypeControl_MessageSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1955,7 +3420,8 @@ TEST_F(ProtocolHandlerImplTest,
times++;
// Act
- protocol_handler_impl->SendEndService(connection_id, session_id, kControl);
+ protocol_handler_impl->SendEndService(
+ connection_id, connection_id, session_id, kControl);
EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
@@ -1974,8 +3440,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_NoConnection_NotSent) {
TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1989,7 +3454,8 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
transport_manager_mock,
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_CONTROL, FRAME_DATA_HEART_BEAT, PROTECTION_OFF, kControl)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
// Act
protocol_handler_impl->SendHeartBeat(connection_id, session_id);
@@ -1999,8 +3465,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2029,8 +3494,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
TEST_F(ProtocolHandlerImplTest,
DISABLED_SendHeartBeatAck_WrongProtocolVersion_NotSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2059,8 +3523,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleControlMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2068,7 +3531,7 @@ TEST_F(ProtocolHandlerImplTest,
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kControl);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -2086,7 +3549,8 @@ TEST_F(ProtocolHandlerImplTest,
transport_manager_mock,
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_SINGLE, FRAME_DATA_SINGLE, PROTECTION_OFF, kControl)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
// Act
protocol_handler_impl->SendMessageToMobileApp(message, is_final);
@@ -2097,8 +3561,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleNonControlMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2106,7 +3569,7 @@ TEST_F(ProtocolHandlerImplTest,
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kRpc);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -2140,8 +3603,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2150,7 +3612,7 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
const uint32_t total_data_size = MAXIMUM_FRAME_DATA_V2_SIZE * 2;
UCharDataVector data(total_data_size);
const uint8_t first_consecutive_frame = 0x01;
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kBulk);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -2195,8 +3657,7 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
}
TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2222,8 +3683,7 @@ TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) {
}
TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc
index e42ba96251..5554bfd280 100644
--- a/src/components/protocol_handler/test/protocol_header_validator_test.cc
+++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc
@@ -230,12 +230,12 @@ TEST_F(ProtocolHeaderValidatorTest, Malformed_FrameType) {
}
}
-// For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
-// Ack), 0xFF(HB Ack)
+// For Control frames Frame info value shall be from 0x00 to 0x09 or 0xFD
+// (Transport Update Event), 0xFE(Data Ack), 0xFF(HB Ack)
TEST_F(ProtocolHeaderValidatorTest, Malformed_ControlFrame) {
std::vector<uint8_t> malformed_frame_data;
- for (uint8_t frame_type = FRAME_DATA_END_SERVICE_NACK + 1;
- frame_type < FRAME_DATA_SERVICE_DATA_ACK;
+ for (uint8_t frame_type = FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK + 1;
+ frame_type < FRAME_DATA_TRANSPORT_EVENT_UPDATE;
++frame_type) {
malformed_frame_data.push_back(frame_type);
}
diff --git a/src/components/remote_control/CMakeLists.txt b/src/components/remote_control/CMakeLists.txt
deleted file mode 100644
index a320273a1e..0000000000
--- a/src/components/remote_control/CMakeLists.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-set(target "RemoteControlModule")
-set(install_destination ${CMAKE_BINARY_DIR}/bin/plugins)
-if (ENABLE_GCOV)
- set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs")
-else()
- set(GCOV_FLAGS "")
-endif()
-
-if (CMAKE_BUILD_TYPE)
- if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
- set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
- set(CMAKE_CXX_FLAGS_DEBUG "")
- else ()
- set(CMAKE_CXX_FLAGS_RELEASE "")
- set(CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG")
- endif()
-endif()
-
-include_directories (
- ${COMPONENTS_DIR}/include/
- ${COMPONENTS_DIR}/application_manager/include
- ${COMPONENTS_DIR}/remote_control/include/
- ${COMPONENTS_DIR}/connection_handler/include/
- ${COMPONENTS_DIR}/protocol_handler/include/
- ${COMPONENTS_DIR}/functional_module/include/
- ${COMPONENTS_DIR}/config_profile/include/
-
- ${COMPONENTS_DIR}/hmi_message_handler/include/
- ${COMPONENTS_DIR}/formatters/include/
- ${POLICY_PATH}/include/
- ${POLICY_GLOBAL_INCLUDE_PATH}/
- ${COMPONENTS_DIR}/rpc_base/include/
- ${COMPONENTS_DIR}/application_manager/test/include/
-
- ${COMPONENTS_DIR}/smart_objects/include/
- ${COMPONENTS_DIR}/utils/include/
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${CMAKE_BINARY_DIR}/src/components/
-)
-
-set (RC_SOURCE_DIR ${COMPONENTS_DIR}/remote_control/src)
-set (RC_TEST_DIR ${COMPONENTS_DIR}/remote_control/test)
-set (RC_COMMANDS_DIR ${RC_SOURCE_DIR}/commands)
-
-collect_sources(RC_SOURCES "${RC_SOURCE_DIR}")
-collect_sources(RC_COMMANDS_SOURCES "${RC_COMMANDS_DIR}")
-
-set (SOURCES
- ${RC_SOURCES}
- ${RC_COMMANDS_SOURCES}
-)
-
-set (LIBRARIES
- jsoncpp
- FunctionalModule
- Utils
- ConfigProfile
-)
-
-add_library(${target} SHARED ${SOURCES})
-target_link_libraries(${target} ${LIBRARIES} )
-
-if(ENABLE_LOG)
- target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
-endif()
-
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-
-install(
- FILES ${FILES_FOR_COPY}
- DESTINATION ${install_destination}
-)
-
-if(BUILD_TESTS)
- add_subdirectory(test)
-endif()
diff --git a/src/components/remote_control/include/remote_control/commands/base_command_notification.h b/src/components/remote_control/include/remote_control/commands/base_command_notification.h
deleted file mode 100644
index 578afad67b..0000000000
--- a/src/components/remote_control/include/remote_control/commands/base_command_notification.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_
-
-#include "remote_control/commands/command.h"
-#include "application_manager/message.h"
-#include "application_manager/service.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/remote_plugin_interface.h"
-#include "utils/logger.h"
-
-namespace Json {
-class Value;
-}
-
-namespace remote_control {
-
-namespace commands {
-
-/**
- * @brief Base command class for notifications
- */
-class BaseCommandNotification : public Command {
- public:
- /**
- * @brief BaseCommandNotification class constructor
- *
- * @param message Message from mobile
- **/
- BaseCommandNotification(const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module);
-
- /**
- * @brief BaseCommandNotification class destructor
- */
- virtual ~BaseCommandNotification();
-
- /**
- * \brief BaseCommandNotification on timeout reaction
- */
- virtual void OnTimeout() {}
-
- void Run();
-
- protected:
- application_manager::MessagePtr message() {
- return message_;
- }
- application_manager::ServicePtr service_;
-
- RCAppExtensionPtr GetAppExtension(
- application_manager::ApplicationSharedPtr app) const;
-
- /**
- * @brief executes specific logic of children classes
- */
- virtual void Execute() = 0;
-
- /**
- * @brief Validates notification by xml schema
- */
- virtual bool Validate();
-
- virtual std::string ModuleType(const Json::Value& message);
- virtual std::vector<std::string> ControlData(const Json::Value& message);
-
- void NotifyOneApplication(application_manager::MessagePtr message);
-
- private:
- void NotifyApplications();
- bool CheckPolicy(application_manager::MessagePtr message);
- application_manager::MessagePtr message_;
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_
diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h
deleted file mode 100644
index 64128b971e..0000000000
--- a/src/components/remote_control/include/remote_control/commands/base_command_request.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_
-
-#include "remote_control/commands/command.h"
-#include "remote_control/event_engine/event_observer.h"
-#include "application_manager/message.h"
-#include "application_manager/service.h"
-#include "utils/logger.h"
-#include "interfaces/HMI_API.h"
-#include "remote_control/rc_app_extension.h"
-#include "json/json.h"
-#include "remote_control/remote_plugin_interface.h"
-
-namespace remote_control {
-
-namespace commands {
-
-// Forward declaration to make this struct friend to BaseCommandRequest
-struct OnDriverAnswerCallback;
-
-/**
- * @brief Base command class for requests
- */
-class BaseCommandRequest
- : public Command,
- public rc_event_engine::EventObserver<application_manager::MessagePtr,
- std::string> {
- public:
- /**
- * @brief BaseCommandRequest class constructor
- *
- * @param message Message from mobile
- **/
- BaseCommandRequest(const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module);
-
- /**
- * @brief BaseCommandRequest class destructor
- */
- virtual ~BaseCommandRequest();
-
- /**
- * @brief BaseCommandRequest on timeout reaction
- */
- virtual void OnTimeout();
-
- void Run();
- void on_event(const rc_event_engine::Event<application_manager::MessagePtr,
- std::string>& event);
-
- /**
- * @brief Generates correct request to HMI
- * @param function_id request ID
- * @param msg_params json with message params
- * @return generated request shared ptr
- */
- application_manager::MessagePtr CreateHmiRequest(
- const char* function_id, const Json::Value& message_params);
-
- /**
- * @brief Prepares response for sending to mobile
- * Adds necessary fields to message
- * @param success true if successful; false, if failed
- * @param result_code Mobile result code in string ("SUCCESS", "INVALID_DATA",
- * e.t.c)
- * @param info Provides additional human readable info regarding the
- *result(may be empty)
- */
- void PrepareResponse(const bool success,
- const char* result_code,
- const std::string& info);
-
- protected:
- application_manager::MessagePtr message_;
- Json::Value response_params_;
-
- /**
- * @brief AcquireResource try to allocate resource for application
- * In case if allocation of resource is not required, return ALLOWED by
- * default.
- * This method should be overrided in RPCs that requires resource allocation
- * @return result of resource allocation, in case if allocation os not
- * required, return ALLOWED
- */
- virtual AcquireResult::eType AcquireResource(const Json::Value&) {
- return AcquireResult::ALLOWED;
- }
-
- /**
- * @brief IsResourceFree check resource state
- * This is default implementation which has to be redefined for RPCs which
- * need to manage the resources
- * @param module_type Resource name
- * @return True if free, otherwise - false
- */
- virtual bool IsResourceFree(const std::string& module_type) const {
- UNUSED(module_type);
- return true;
- }
-
- /**
- * @brief SetResourceState changes state of resource
- * This is default implementation which has to be redefined for RPCs which
- * need to manage the resources
- * @param Message containing type of module to extract
- * @param State to set for resource
- */
- virtual void SetResourceState(const Json::Value&,
- const ResourceState::eType) {}
-
- /**
- * @brief Get extension for specified application. If extension doesn't exist,
- * it will be created
- * @param app pointer to application
- * @return pointer to extension
- */
- RCAppExtensionPtr GetAppExtension(
- application_manager::ApplicationSharedPtr app) const;
-
- /**
- * @brief Converts HMI result code to string with mobile result code
- *
- * @param hmi_code HMI result code
- * @return String with mobile result code
- */
- const char* GetMobileResultCode(
- const hmi_apis::Common_Result::eType& hmi_code) const;
-
- /**
- * @brief Sends Mobile response
- * @param success true if successful; false, if failed
- * @param result_code Mobile result code in string ("SUCCESS", "INVALID_DATA",
- *e.t.c)
- * @param info Provides additional human readable info regarding the
- *result(may be empty)
- */
- void SendResponse(const bool success,
- const char* result_code,
- const std::string& info);
-
- /**
- * @brief Parse result code from response
- *
- * @param message Response from HMI or Can
- * @param result_code Outgoing param with mobile result code in string
- *("SUCCESS", "INVALID_DATA", e.t.c)
- * @param info Outgoing param with additional human readable info regarding
- *the result(may be empty)
- * @return true if it is success response? otherwise false
- */
- bool ParseResultCode(const Json::Value& value,
- std::string& result_code,
- std::string& info);
-
- /**
- * @brief Sends request to HMI
- * @param message_to_send to send
- */
- void SendMessageToHMI(const application_manager::MessagePtr& message_to_send);
-
- /**
- * @brief Sends request to CAN or HMI
- * @param function_id request ID
- * @param msg_params json with message params
- */
- void SendRequest(const char* function_id, const Json::Value& message_params);
-
- application_manager::ApplicationSharedPtr app() {
- DCHECK(app_);
- return app_;
- }
-
- /**
- * @brief executes specific logic of children classes
- */
- void virtual Execute() = 0;
-
- /**
- * @brief Validates request by xml schema
- */
- bool Validate();
-
- /*
- * @brief Parses incoming string into Json
- * @param parsed_mgs Resulting json object (must be valid pointer)
- * @returns True if json string was valid false otherwise.
- */
- virtual bool ParseJsonString(Json::Value* parsed_msg);
-
- /**
- * @brief Interface method that is called whenever new event received
- * @param event The received event
- */
- void virtual OnEvent(
- const rc_event_engine::Event<application_manager::MessagePtr,
- std::string>& event) = 0;
-
- virtual std::string ModuleType(const Json::Value& message);
- virtual std::vector<std::string> ControlData(const Json::Value& message);
- virtual application_manager::TypeAccess CheckModule(
- const Json::Value& message);
-
- bool auto_allowed() const {
- return auto_allowed_;
- }
-
- void set_auto_allowed(bool value) {
- auto_allowed_ = value;
- }
-
- application_manager::ServicePtr service() {
- return service_;
- }
-
- void set_disallowed_info(const std::string& info) {
- disallowed_info_ = info;
- }
-
- private:
- /**
- * @brief CheckPolicyPermissions checks RPC permissions defined in policy
- * table
- * @return True if RPC is allowed, otherwise - false
- */
- bool CheckPolicyPermissions();
-
- /**
- * @brief CheckDriverConsent checks driver consent defined in policy table
- * @return True if no consent is required, otherwise - false
- */
- bool CheckDriverConsent();
-
- /**
- * @brief AcquireResources checks whether resource status is busy or not and
- * then tries to acquire this resource. In case driver consent is required -
- * sends consent request to HMI.
- * @return True in case of resource is free and successfully acquired,
- * otherwise false
- */
- bool AcquireResources();
- inline bool IsAutoAllowed(application_manager::TypeAccess access) const;
- void SendDisallowed(application_manager::TypeAccess access);
- void SendGetUserConsent(const Json::Value& value);
- void ProcessAccessResponse(
- const rc_event_engine::Event<application_manager::MessagePtr,
- std::string>& event);
-
- const Json::Value msg_json_;
- application_manager::ApplicationSharedPtr app_;
- application_manager::ServicePtr service_;
- bool auto_allowed_;
- std::string disallowed_info_;
-
- friend struct OnDriverAnswerCallback;
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/commands/button_press_request.h b/src/components/remote_control/include/remote_control/commands/button_press_request.h
deleted file mode 100644
index 945f98bdc8..0000000000
--- a/src/components/remote_control/include/remote_control/commands/button_press_request.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_
-
-#include "remote_control/commands/base_command_request.h"
-#include "remote_control/event_engine/event.h"
-#include "utils/macro.h"
-
-namespace remote_control {
-
-namespace commands {
-
-/**
- * @brief ButtonPressRequest command class
- */
-class ButtonPressRequest : public BaseCommandRequest {
- public:
- /**
- * @brief ButtonPressRequest class constructor
- *
- * @param message Message from mobile
- **/
- ButtonPressRequest(const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module);
- /**
- * @brief Execute command
- */
- void Execute() FINAL;
-
- /**
- * @brief AcquireResource Tries to acquire specific resource
- * @param message Incoming message containg the resource name
- * @return Acquire result
- */
- AcquireResult::eType AcquireResource(
- const Json::Value& message) OVERRIDE FINAL;
-
- /**
- * @brief IsResourceFree check resource state
- * @param module_type Resource name
- * @return True if free, otherwise - false
- */
- bool IsResourceFree(const std::string& module_type) const FINAL;
-
- /**
- * @brief SetResourceState changes state of resource
- * @param state State to set for resource
- */
- void SetResourceState(const Json::Value& message,
- const ResourceState::eType state) FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void OnEvent(const rc_event_engine::Event<application_manager::MessagePtr,
- std::string>& event);
-
- /**
- * @brief ButtonPressRequest class destructor
- */
- virtual ~ButtonPressRequest();
-
- protected:
- std::string ModuleType(const Json::Value& message) FINAL;
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/commands/command.h b/src/components/remote_control/include/remote_control/commands/command.h
deleted file mode 100644
index 0e03f8b330..0000000000
--- a/src/components/remote_control/include/remote_control/commands/command.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_
-
-#include "utils/shared_ptr.h"
-#include "remote_control/remote_plugin_interface.h"
-#include "remote_control/event_engine/event.h"
-
-namespace remote_control {
-
-class RemotePluginInterface;
-
-namespace commands {
-
-/**
- * @brief Command interface
- **/
-class Command {
- public:
- /**
- * @brief Execute command
- */
- virtual void Run() = 0;
-
- /**
- * \brief Command class destructor
- */
- virtual ~Command() {}
-
- /**
- * \brief Command on timeout reaction
- */
- virtual void OnTimeout() = 0;
-
- /**
- * @brief Interface method that is called whenever new event received
- * @param event The received event
- */
- virtual void on_event(
- const rc_event_engine::Event<application_manager::MessagePtr,
- std::string>& event) {}
-
- protected:
- Command(RemotePluginInterface& rc_module) : rc_module_(rc_module) {}
-
- RemotePluginInterface& rc_module_;
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_
diff --git a/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h
deleted file mode 100644
index 220f7da979..0000000000
--- a/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
-
-#include "remote_control/commands/base_command_request.h"
-#include "remote_control/event_engine/event.h"
-#include "utils/macro.h"
-
-namespace remote_control {
-
-namespace commands {
-
-/**
- * @brief GetInteriorVehicleDataRequest command class
- */
-class GetInteriorVehicleDataRequest : public BaseCommandRequest {
- public:
- /**
- * @brief GetInteriorVehicleDataRequest class constructor
- *
- * @param message Message from mobile
- **/
- explicit GetInteriorVehicleDataRequest(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module);
-
- /**
- * @brief Execute command
- */
- void Execute() FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void OnEvent(const rc_event_engine::Event<application_manager::MessagePtr,
- std::string>& event);
-
- /**
- * @brief Check if app wants to proceed with already setup subscription
- * @param request_params request parameters to check
- * @return true if app already subscribed(unsubsribed) for module type but
- * wants to subscribe(unsubscribe) for the same module again
- * otherwise - false
- */
- bool HasRequestExcessiveSubscription(const Json::Value& request_params);
-
- protected:
- virtual std::string ModuleType(const Json::Value& message);
-
- private:
- /**
- * @brief Handle subscription to vehicle data
- * @param hmi_response json message with response from HMI
- */
- void ProccessSubscription(const Json::Value& hmi_response);
-
- /**
- * @brief Cuts off subscribe parameter
- * @param request_params request parameters to handle
- */
- void RemoveExcessiveSubscription(Json::Value& request_params);
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h
deleted file mode 100644
index 4ee9ce4709..0000000000
--- a/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
-
-#include "utils/macro.h"
-#include "remote_control/commands/base_command_notification.h"
-
-namespace remote_control {
-
-namespace commands {
-
-/**
- * @brief OnInteriorVehicleDataNotification command class
- */
-class OnInteriorVehicleDataNotification : public BaseCommandNotification {
- public:
- /**
- * @brief OnInteriorVehicleDataNotification class constructor
- *
- * @param message Message with notification
- **/
- OnInteriorVehicleDataNotification(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module);
-
- /**
- * @brief Execute command
- */
- void Execute() FINAL;
-
- /**
- * @brief OnInteriorVehicleDataNotification class destructor
- */
- virtual ~OnInteriorVehicleDataNotification();
-
- protected:
- std::string ModuleType(const Json::Value& message) FINAL;
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h b/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h
deleted file mode 100644
index ef248a2b38..0000000000
--- a/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
-
-#include "utils/macro.h"
-#include "remote_control/commands/base_command_notification.h"
-
-namespace remote_control {
-
-namespace commands {
-
-/**
- * @brief OnRemoteControlSettingsNotification command class
- */
-class OnRemoteControlSettingsNotification : public BaseCommandNotification {
- public:
- /**
- * @brief OnRemoteControlSettingsNotification class constructor
- *
- * @param message Message with notification
- * @param rc_module Module used for handling RC functionality
- **/
- OnRemoteControlSettingsNotification(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module);
-
- /**
- * @brief Execute command
- */
- void Execute() FINAL;
-
- private:
- /**
- * @brief Disalows RC functionality for all RC apps
- * All registered apps with appHMIType REMOTE_CONTROL will be put to NONE hmi
- * level
- * OnHMIStatus (NONE) will be send to such apps
- * All registered apps will be unsubsribed from OnInteriorVehicleData
- * notifications
- */
- void DisallowRCFunctionality();
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
diff --git a/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h
deleted file mode 100644
index bc1e3942e5..0000000000
--- a/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
-
-#include "remote_control/commands/base_command_request.h"
-#include "remote_control/event_engine/event.h"
-#include "utils/macro.h"
-
-namespace remote_control {
-
-namespace commands {
-
-/**
- * @brief SetInteriorVehicleDataRequest command class
- */
-class SetInteriorVehicleDataRequest : public BaseCommandRequest {
- public:
- /**
- * @brief SetInteriorVehicleDataRequest class constructor
- *
- * @param message Message from mobile
- * @param rc_module Module used for handling RC functionality
- **/
- SetInteriorVehicleDataRequest(const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module);
-
- /**
- * @brief Execute command
- */
- void Execute() FINAL;
-
- /**
- * @brief AcquireResource proxy AcquireResource to Resource allocation manager
- * @param message message of requires contatin module types
- * @return result of acauiring resources
- */
- AcquireResult::eType AcquireResource(
- const Json::Value& message) OVERRIDE FINAL;
-
- /**
- * @brief IsResourceFree check resource state
- * @param module_type Resource name
- * @return True if free, otherwise - false
- */
- bool IsResourceFree(const std::string& module_type) const FINAL;
-
- /**
- * @brief SetResourceState changes state of resource
- * @param state State to set for resource
- */
- void SetResourceState(const Json::Value& message,
- const ResourceState::eType state) FINAL;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void OnEvent(const rc_event_engine::Event<application_manager::MessagePtr,
- std::string>& event) OVERRIDE;
- /**
- * @brief Method that check if READ_ONLY parameters present
- * @param request_params params from received message
- * @return true if present , false - otherwise
- */
- bool AreReadOnlyParamsPresent(const Json::Value& request_params);
-
- /**
- * @brief Method that check if all request parameters are READ_ONLY
- * @param request_params params from received message
- * @return true if all are read only , false - otherwise
- */
- bool AreAllParamsReadOnly(const Json::Value& request_params);
-
- /**
- * @brief Method that cuts-off READ_ONLY parameters
- * @param request_params params to handle
- */
- void CutOffReadOnlyParams(Json::Value& request_params);
-
- /**
- * @brief SetInteriorVehicleDataRequest class destructor
- */
- virtual ~SetInteriorVehicleDataRequest();
-
- protected:
- virtual std::string ModuleType(const Json::Value& message) FINAL;
- virtual std::vector<std::string> ControlData(
- const Json::Value& message) FINAL;
-};
-
-} // namespace commands
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/event_engine/event.h b/src/components/remote_control/include/remote_control/event_engine/event.h
deleted file mode 100644
index 0da248e5a7..0000000000
--- a/src/components/remote_control/include/remote_control/event_engine/event.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_
-
-#include <string>
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/message.h"
-
-namespace rc_event_engine {
-
-template <typename EventMessage, typename EventID>
-class EventDispatcher;
-
-template <typename EventMessage, typename EventID>
-class Event {
- public:
- /*
- * @brief Constructor with parameters
- *
- * @param id Event ID.
- * @param message Message received in event
- */
- Event(EventMessage& message, const EventID& id);
-
- /*
- * @brief Destructor
- */
- virtual ~Event() {}
-
- /*
- * @brief Provides event ID
- */
- inline const EventID& id() const;
-
- /*
- * @brief Sets event message
- *
- * @param message The message received in event
- */
- void set_event_message(EventMessage& message);
-
- /*
- * @brief Retrieves event message
- *
- * @return The message received in event
- */
- inline const EventMessage& event_message() const;
-
- /*
- * @brief Retrieves event message request ID
- */
- virtual int32_t event_message_function_id() const = 0;
-
- /*
- * @brief Retrieves event message correlation ID
- */
- virtual int32_t event_message_correlation_id() const = 0;
-
- /*
- * @brief Retrieves event message response type
- */
- virtual int32_t event_message_type() const = 0;
-
- void raise(EventDispatcher<EventMessage, EventID>& event_dispatcher);
-
- protected:
- EventMessage event_message_;
-
- private:
- EventID id_;
-};
-
-template <typename EventMessage, typename EventID>
-const EventID& Event<EventMessage, EventID>::id() const {
- return id_;
-}
-
-template <typename EventMessage, typename EventID>
-const EventMessage& Event<EventMessage, EventID>::event_message() const {
- return event_message_;
-}
-
-template <typename EventMessage, typename EventID>
-Event<EventMessage, EventID>::Event(EventMessage& message, const EventID& id)
- : event_message_(message), id_(id) {}
-
-template <typename EventMessage, typename EventID>
-void Event<EventMessage, EventID>::raise(
- EventDispatcher<EventMessage, EventID>& event_dispatcher) {
- event_dispatcher.raise_event(*this);
-}
-
-} // namespace event_engine
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_
diff --git a/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h
deleted file mode 100644
index ddee6caccc..0000000000
--- a/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_
-
-#include <list>
-#include <map>
-
-#include "utils/lock.h"
-
-#include "remote_control/event_engine/event.h"
-#include "remote_control/event_engine/event_observer.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace rc_event_engine {
-
-template <typename EventMessage, typename EventID>
-class Event;
-
-template <typename EventMessage, typename EventID>
-class EventObserver;
-
-template <typename EventMessage, typename EventID>
-class EventDispatcher {
- public:
- /**
- * @brief Default constructor
- */
- EventDispatcher();
-
- /**
- * @brief Destructor
- */
- virtual ~EventDispatcher();
-
- /*
- * @brief Delivers the event to all subscribers
- *
- * @param event Received event
- */
- void raise_event(const Event<EventMessage, EventID>& event);
-
- /*
- * @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_observer(const EventID& event_id,
- int32_t hmi_correlation_id,
- EventObserver<EventMessage, EventID>* const observer);
-
- /*
- * @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_observer(
- const EventID& event_id,
- const EventObserver<EventMessage, EventID>* const observer);
-
- /*
- * @brief Unsubscribes the observer from all events
- *
- * @param observer The observer to be unsubscribed
- */
- void remove_observer(
- const EventObserver<EventMessage, EventID>* const observer);
-
- protected:
- private:
- DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
-
- // Data types section
- typedef std::list<EventObserver<EventMessage, EventID>*> ObserverList;
- typedef std::map<int32_t, ObserverList> ObserversMap;
- typedef std::map<EventID, ObserversMap> EventObserverMap;
-
- // Members section
- sync_primitives::Lock state_lock_;
- EventObserverMap observers_;
-};
-
-template <typename EventMessage, typename EventID>
-EventDispatcher<EventMessage, EventID>::EventDispatcher()
- : observers_() {}
-
-template <typename EventMessage, typename EventID>
-EventDispatcher<EventMessage, EventID>::~EventDispatcher() {}
-
-template <typename EventMessage, typename EventID>
-void EventDispatcher<EventMessage, EventID>::raise_event(
- const Event<EventMessage, EventID>& event) {
- // create local list
- ObserverList list;
- {
- sync_primitives::AutoLock auto_lock(state_lock_);
- // check if event is notification
- if (hmi_apis::messageType::notification == event.event_message_type()) {
- // ObserversMap iterator
- typename ObserversMap::iterator it = observers_[event.id()].begin();
- for (; observers_[event.id()].end() != it; ++it) {
- list = it->second;
- }
- }
-
- if ((hmi_apis::messageType::response == event.event_message_type()) ||
- (hmi_apis::messageType::error_response == event.event_message_type())) {
- list = observers_[event.id()][event.event_message_correlation_id()];
- }
- }
-
- // Call observers
- typename ObserverList::iterator observers = list.begin();
- for (; list.end() != observers; ++observers) {
- (*observers)->on_event(event);
- }
-}
-
-template <typename EventMessage, typename EventID>
-void EventDispatcher<EventMessage, EventID>::add_observer(
- const EventID& event_id,
- int32_t hmi_correlation_id,
- EventObserver<EventMessage, EventID>* const observer) {
- sync_primitives::AutoLock auto_lock(state_lock_);
- observers_[event_id][hmi_correlation_id].push_back(observer);
-}
-
-template <typename EventMessage, typename EventID>
-void EventDispatcher<EventMessage, EventID>::remove_observer(
- const EventID& event_id,
- const EventObserver<EventMessage, EventID>* const observer) {
- sync_primitives::AutoLock auto_lock(state_lock_);
- typename ObserversMap::iterator it = observers_[event_id].begin();
- for (; observers_[event_id].end() != it; ++it) {
- // ObserverList iterator
- typename ObserverList::iterator observer_it = it->second.begin();
- while (it->second.end() != observer_it) {
- if (observer->id() == (*observer_it)->id()) {
- observer_it = it->second.erase(observer_it);
- } else {
- ++observer_it;
- }
- }
- }
-}
-
-template <typename EventMessage, typename EventID>
-void EventDispatcher<EventMessage, EventID>::remove_observer(
- const EventObserver<EventMessage, EventID>* const observer) {
- sync_primitives::AutoLock auto_lock(state_lock_);
- typename EventObserverMap::iterator event_map = observers_.begin();
- for (; observers_.end() != event_map; ++event_map) {
- typename ObserversMap::iterator it = event_map->second.begin();
- for (; event_map->second.end() != it; ++it) {
- // ObserverList iterator
- typename ObserverList::iterator observer_it = it->second.begin();
- while (it->second.end() != observer_it) {
- if (observer->id() == (*observer_it)->id()) {
- observer_it = it->second.erase(observer_it);
- } else {
- ++observer_it;
- }
- }
- }
- }
-}
-}
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_
diff --git a/src/components/remote_control/include/remote_control/event_engine/event_observer.h b/src/components/remote_control/include/remote_control/event_engine/event_observer.h
deleted file mode 100644
index 66a38da88b..0000000000
--- a/src/components/remote_control/include/remote_control/event_engine/event_observer.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_
-
-#include <string>
-#include "remote_control/event_engine/event.h"
-
-namespace rc_event_engine {
-
-template <typename EventMessage, typename EventID>
-class Event;
-
-template <typename EventMessage, typename EventID>
-class EventObserver {
- public:
- // Typedef for possible Observer ID's from mobile_apis functionID enum
- typedef unsigned long ObserverID;
-
- /*
- * @brief Constructor
- *
- */
- EventObserver();
-
- /*
- * @brief Destructor
- */
- virtual ~EventObserver();
-
- /**
- * @brief Retrieves observer unique id
- *
- * @return Unique Observer id
- */
- const ObserverID& id() const {
- return id_;
- }
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const Event<EventMessage, EventID>& event) = 0;
-
- private:
- ObserverID id_;
-
- DISALLOW_COPY_AND_ASSIGN(EventObserver);
-};
-
-template <typename EventMessage, typename EventID>
-EventObserver<EventMessage, EventID>::EventObserver()
- : id_(0) {
- // Get unique id based on this
- id_ = reinterpret_cast<unsigned long>(this);
-}
-
-template <typename EventMessage, typename EventID>
-EventObserver<EventMessage, EventID>::~EventObserver() {
- // unsubscribe_from_all_events();
-}
-}
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_
diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h
deleted file mode 100644
index 6358459da7..0000000000
--- a/src/components/remote_control/include/remote_control/message_helper.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_
-
-#include <stdint.h>
-#include <string>
-#include <map>
-
-#include "utils/macro.h"
-#include "json/json.h"
-#include "interfaces/HMI_API.h"
-#include "functional_module/function_ids.h"
-#include "remote_control/remote_plugin_interface.h"
-#include "application_manager/message.h"
-
-namespace remote_control {
-
-/**
- * @brief MessageHelper class
- **/
-class MessageHelper {
- public:
- static const std::string GetMobileAPIName(
- functional_modules::RCFunctionID func_id);
-
- /**
- * @brief Convert Json::Value to std::string
- *
- * @param value Value with json
- *
- * @return string with json
- */
- static std::string ValueToString(const Json::Value& value);
-
- /**
- * @brief Convert std::string to Json::Value
- *
- * @param string string with json
- *
- * @return Value created from string with json
- */
- static Json::Value StringToValue(const std::string& string);
-
- /**
- * Creates hmi request
- * @param function_id - API function we create request for
- * @param message_params - params in request
- * @param rc_module - used module for requests handling
- * @param hmi_app_id - app is used between SDL & HMI
- * @return creted request - reqdy to be sent to hmi
- */
- static application_manager::MessagePtr CreateHmiRequest(
- const char* function_id,
- const uint32_t hmi_app_id,
- const Json::Value& message_params,
- RemotePluginInterface& rc_module);
-
- /** @brief Converts string to hmi AccessMode enum value
- * @param access_mode stringified value
- * @return hmi AccessMode enum value if succedeed, otherwise - INVALID_ENUM
- * value
- */
- static hmi_apis::Common_RCAccessMode::eType AccessModeFromString(
- const std::string& access_mode);
-
- /**
- * @brief AccessModeToString converts enum values to string
- * @param access_mode Access mode enum value
- * @return Appropriate string value
- */
- static std::string AccessModeToString(
- const hmi_apis::Common_RCAccessMode::eType access_mode);
-
- private:
- MessageHelper();
-
- static const std::map<functional_modules::RCFunctionID, std::string>
- kMobileAPINames;
- DISALLOW_COPY_AND_ASSIGN(MessageHelper);
-};
-
-/** @brief Check for existence of specified key in Json::Value
- * @param value Value with json
- * @param key string with key name
- * @return true if key exist
- */
-bool IsMember(const Json::Value& value, const std::string& key);
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_
diff --git a/src/components/remote_control/include/remote_control/module_helper.h b/src/components/remote_control/include/remote_control/module_helper.h
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/components/remote_control/include/remote_control/module_helper.h
+++ /dev/null
diff --git a/src/components/remote_control/include/remote_control/rc_app_extension.h b/src/components/remote_control/include/remote_control/rc_app_extension.h
deleted file mode 100644
index 485514faba..0000000000
--- a/src/components/remote_control/include/remote_control/rc_app_extension.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
-
-#include <string>
-#include <set>
-#include "application_manager/service.h"
-#include "application_manager/app_extension.h"
-#include "remote_control/remote_control_plugin.h"
-#include "json/json.h"
-
-namespace remote_control {
-
-class RCAppExtension : public application_manager::AppExtension {
- public:
- explicit RCAppExtension(application_manager::AppExtensionUID uid);
- ~RCAppExtension();
-
- /**
- * @brief Subscribe to OnInteriorVehicleDataNotification
- * @param module interior data specification(zone, data type)
- */
- void SubscribeToInteriorVehicleData(const Json::Value& module_type);
-
- /**
- * @brief Unsubscribe from OnInteriorVehicleDataNotification
- * @param module interior data specification(zone, data type)
- */
- void UnsubscribeFromInteriorVehicleData(const Json::Value& module_type);
-
- /**
- * @brief UnsubscribeFromInteriorVehicleData removes all subscriptions for
- * interior data
- */
- void UnsubscribeFromInteriorVehicleData();
-
- /**
- * @brief Check if application subscribed to OnInteriorVehicleDataNotification
- * @param module interior data specification(zone, data type)
- */
- bool IsSubscibedToInteriorVehicleData(const Json::Value& module_type);
-
- private:
- std::set<Json::Value> subscribed_interior_vehicle_data_;
-};
-
-typedef utils::SharedPtr<RCAppExtension> RCAppExtensionPtr;
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
diff --git a/src/components/remote_control/include/remote_control/rc_command_factory.h b/src/components/remote_control/include/remote_control/rc_command_factory.h
deleted file mode 100644
index 9463c4b1ef..0000000000
--- a/src/components/remote_control/include/remote_control/rc_command_factory.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_
-
-#include "utils/shared_ptr.h"
-#include "remote_control/commands/command.h"
-#include "remote_control/remote_control_plugin.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace remote_control {
-
-/**
- * @brief Factory class for command creation
- **/
-class RCCommandFactory {
- public:
- /**
- * @brief Create command object and return pointer to it
- *
- * @param message Message shared pointer.
- * @return Pointer to created command object.
- **/
- static utils::SharedPtr<commands::Command> CreateCommand(
- const application_manager::MessagePtr& msg,
- RemotePluginInterface& rc_module);
-
- private:
- RCCommandFactory();
- DISALLOW_COPY_AND_ASSIGN(RCCommandFactory);
-};
-
-} // namespace can_cooperaion
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_
diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h
deleted file mode 100644
index 021e3cd6f0..0000000000
--- a/src/components/remote_control/include/remote_control/rc_module_constants.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
-
-namespace remote_control {
-
-namespace strings {
-// RemoteControlCapabilities constants
-const char kclimateControlCapabilities[] = "climateControlCapabilities";
-const char kradioControlCapabilities[] = "radioControlCapabilities";
-const char kbuttonCapabilities[] = "buttonCapabilities";
-// RemoteControlCapabilities constants
-
-const char kRadioControlData[] = "radioControlData";
-const char kClimateControlData[] = "climateControlData";
-} // strings
-
-namespace result_codes {
-const char kSuccess[] = "SUCCESS";
-const char kUnsupportedRequest[] = "UNSUPPORTED_REQUEST";
-const char kUnsupportedResource[] = "UNSUPPORTED_RESOURCE";
-const char kDisallowed[] = "DISALLOWED";
-const char kRejected[] = "REJECTED";
-const char kAborted[] = "ABORTED";
-const char kIgnored[] = "IGNORED";
-const char kRetry[] = "RETRY";
-const char kInUse[] = "IN_USE";
-const char kVehicleDataNotAvailable[] = "VEHICLE_DATA_NOT_AVAILABLE";
-const char kTimedOut[] = "TIMED_OUT";
-const char kInvalidData[] = "INVALID_DATA";
-const char kCharLimitExceeded[] = "CHAR_LIMIT_EXCEEDED";
-const char kInvalidId[] = "INVALID_ID";
-const char kDuplicateName[] = "DUPLICATE_NAME";
-const char kApplicationNotRegistered[] = "APPLICATION_NOT_REGISTERED";
-const char kOutOfMemory[] = "OUT_OF_MEMORY";
-const char kTooManyPendingRequests[] = "TOO_MANY_PENDING_REQUESTS";
-const char kWarnings[] = "WARNINGS";
-const char kWrongLanguage[] = "WRONG_LANGUAGE";
-const char kGenericError[] = "GENERIC_ERROR";
-const char kUserDisallowed[] = "USER_DISALLOWED";
-const char kReadOnly[] = "READ_ONLY";
-} // result_codes
-
-namespace json_keys {
-const char kParams[] = "params";
-const char kSuccess[] = "success";
-const char kResultCode[] = "resultCode";
-const char kResult[] = "result";
-const char kInfo[] = "info";
-const char kId[] = "id";
-const char kJsonrpc[] = "jsonrpc";
-const char kMethod[] = "method";
-const char kError[] = "error";
-const char kMessage[] = "message";
-const char kData[] = "data";
-const char kAppId[] = "appID";
-const char kCode[] = "code";
-} // json_keys
-
-namespace message_params {
-const char kName[] = "name";
-
-// SetInteriorVehicleData request
-const char kModuleData[] = "moduleData";
-// SetInteriorVehicleData request
-
-// GetInteriorVehicleData request
-const char kSubscribe[] = "subscribe";
-// GetInteriorVehicleData request
-
-// GetInteriorVehicleData response
-const char kIsSubscribed[] = "isSubscribed";
-// GetInteriorVehicleData response
-
-// OnRemoteControlSettings notification
-const char kAccessMode[] = "accessMode";
-const char kAllowed[] = "allowed";
-// OnRemoteControlSettings notification
-
-// ButtonPress request
-const char kModuleType[] = "moduleType";
-const char kButtonName[] = "buttonName";
-const char kButtonPressMode[] = "buttonPressMode";
-// ButtonPress request
-
-// RdsData struct
-const char kPS[] = "PS";
-const char kRT[] = "RT";
-const char kCT[] = "CT";
-const char kPI[] = "PI";
-const char kPTY[] = "PTY";
-const char kTA[] = "TA";
-const char kTP[] = "TP";
-const char kREG[] = "REG";
-// RdsData struct
-
-// RadioControlData struct
-const char kFrequencyInteger[] = "frequencyInteger";
-const char kFrequencyFraction[] = "frequencyFraction";
-const char kBand[] = "band";
-const char kRdsData[] = "rdsData";
-const char kAvailableHDs[] = "availableHDs";
-const char kHdChannel[] = "hdChannel";
-const char kSignalStrength[] = "signalStrength";
-const char kSignalChangeThreshold[] = "signalChangeThreshold";
-const char kRadioEnable[] = "radioEnable";
-const char kState[] = "state";
-// RadioControlData struct
-
-// ClimateControlData struct
-const char kFanSpeed[] = "fanSpeed";
-const char kCurrentTemperature[] = "currentTemperature";
-const char kDesiredTemperature[] = "desiredTemperature";
-const char kTemperatureUnit[] = "temperatureUnit";
-const char kACEnable[] = "acEnable";
-const char kCirculateAirEnable[] = "circulateAirEnable";
-const char kAutoModeEnable[] = "autoModeEnable";
-const char kDefrostZone[] = "defrostZone";
-const char kDualModeEnable[] = "dualModeEnable";
-const char kACMaxEnable[] = "acMaxEnable";
-const char kVentilationMode[] = "ventilationMode";
-// ClimateControlData struct
-
-// ModuleData struct
-const char kRadioControlData[] = "radioControlData";
-const char kClimateControlData[] = "climateControlData";
-// ModuleData struct
-
-const char kHMIAppID[] = "appID";
-const char kHmiLevel[] = "hmiLevel";
-const char kSysContext[] = "systemContext";
-const char kAudioState[] = "audioStreamingState";
-} // namespace message_params
-
-namespace enums_value {
-
-// ModuleType enum
-const char kClimate[] = "CLIMATE";
-const char kRadio[] = "RADIO";
-// ModuleType enum
-
-// RadioBand enum
-const char kAM[] = "AM";
-const char kFM[] = "FM";
-const char kXM[] = "XM";
-// RadioBand enum
-
-// RadioState enum
-const char kAcquiring[] = "ACQUIRING";
-const char kAcquired[] = "ACQUIRED";
-const char kMulticast[] = "MULTICAST";
-const char kNotFound[] = "NOT_FOUND";
-// RadioState enum
-
-// DefrostZone enum
-const char kFront[] = "FRONT";
-const char kRear[] = "REAR";
-const char kAll[] = "ALL";
-// DefrostZone enum
-
-// TemperatureUnit enum
-const char kFahrenheit[] = "FAHRENHEIT";
-const char kCelsius[] = "CELSIUS";
-// TemperatureUnit enum
-
-// ButtonName enum
-const char kACMax[] = "AC_MAX";
-const char kAC[] = "AC";
-const char kRecirculate[] = "RECIRCULATE";
-const char kFanUp[] = "FAN_UP";
-const char kFanDown[] = "FAN_DOWN";
-const char kTempUp[] = "TEMP_UP";
-const char kTempDown[] = "TEMP_DOWN";
-const char kDefrostMax[] = "DEFROST_MAX";
-const char kDefrost[] = "DEFROST";
-const char kDefrostRear[] = "DEFROST_REAR";
-const char kUpperVent[] = "UPPER_VENT";
-const char kLowerVent[] = "LOWER_VENT";
-const char kVolumeUp[] = "VOLUME_UP";
-const char kVolumeDown[] = "VOLUME_DOWN";
-const char kEject[] = "EJECT";
-const char kSource[] = "SOURCE";
-const char kShuffle[] = "SHUFFLE";
-const char kRepeat[] = "REPEAT";
-// ButtonName enum
-
-// ButtonPressMode enum
-const char kLong[] = "LONG";
-const char kShort[] = "SHORT";
-// ButtonPressMode enum
-
-// Access mode enum
-const char kAutoAllow[] = "AUTO_ALLOW";
-const char kAutoDeny[] = "AUTO_DENY";
-const char kAskDriver[] = "ASK_DRIVER";
-// Access mode enum
-
-} // namespace enums_value
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
diff --git a/src/components/remote_control/include/remote_control/rc_module_timer.h b/src/components/remote_control/include/remote_control/rc_module_timer.h
deleted file mode 100644
index 813f26a885..0000000000
--- a/src/components/remote_control/include/remote_control/rc_module_timer.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_
-
-#include "functional_module/timer/module_timer.h"
-
-namespace remote_control {
-
-class TrackableMessage : public functional_modules::Trackable {
- public:
- TrackableMessage(uint32_t app_id, uint32_t correlation_id)
- : custom_interval_(0), app_id_(app_id), correlation_id_(correlation_id) {}
-
- functional_modules::TimeUnit custom_interval() const {
- return custom_interval_;
- }
-
- uint32_t app_id() const {
- return app_id_;
- }
-
- uint32_t correlation_id() const {
- return correlation_id_;
- }
-
- bool operator==(const TrackableMessage& other) const {
- return (other.app_id_ == app_id_ &&
- other.correlation_id_ == correlation_id_);
- }
-
- private:
- functional_modules::TimeUnit custom_interval_;
- uint32_t app_id_;
- uint32_t correlation_id_;
-};
-
-} // namesapce remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_
diff --git a/src/components/remote_control/include/remote_control/remote_control_event.h b/src/components/remote_control/include/remote_control/remote_control_event.h
deleted file mode 100644
index 3c98f971ac..0000000000
--- a/src/components/remote_control/include/remote_control/remote_control_event.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_
-
-#include <string>
-
-#include "application_manager/message.h"
-
-#include "remote_control/event_engine/event.h"
-
-namespace remote_control {
-
-class RCPluginEvent
- : public rc_event_engine::Event<application_manager::MessagePtr,
- std::string> {
- public:
- /*
- * @brief Constructor with parameters
- *
- * @param id Event ID. (HMI or CAN function name)
- * @param message Message received in HMI or CAN response
- */
- RCPluginEvent(application_manager::MessagePtr& message,
- const std::string& id);
-
- /*
- * @brief Destructor
- */
- virtual ~RCPluginEvent();
-
- /*
- * @brief Retrieves event message request ID
- */
- virtual int32_t event_message_function_id() const;
-
- /*
- * @brief Retrieves event message correlation ID
- */
- virtual int32_t event_message_correlation_id() const;
-
- /*
- * @brief Retrieves event message response type
- */
- virtual int32_t event_message_type() const;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RCPluginEvent);
-};
-}
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_
diff --git a/src/components/remote_control/include/remote_control/remote_control_plugin.h b/src/components/remote_control/include/remote_control/remote_control_plugin.h
deleted file mode 100644
index 1e7d49c18e..0000000000
--- a/src/components/remote_control/include/remote_control/remote_control_plugin.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_
-
-#include <queue>
-#include <string>
-
-#include "remote_control/remote_plugin_interface.h"
-#include "functional_module/generic_module.h"
-#include "remote_control/request_controller.h"
-#include "utils/threads/message_loop_thread.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "remote_control/resource_allocation_manager_impl.h"
-
-namespace remote_control {
-typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
- std::string> RCEventDispatcher;
-
-class RemoteControlPlugin : public RemotePluginInterface {
- public:
- RemoteControlPlugin();
- ~RemoteControlPlugin();
-
- functional_modules::PluginInfo GetPluginInfo() const;
- virtual functional_modules::ProcessResult ProcessMessage(
- application_manager::MessagePtr msg);
- virtual functional_modules::ProcessResult ProcessHMIMessage(
- application_manager::MessagePtr msg);
-
- /**
- * @brief Sends response to mobile application
- * @param msg response mesage
- */
- void SendResponseToMobile(application_manager::MessagePtr msg);
-
- /**
- * @brief Sends timeout response to mobile application
- * @param msg response mesage
- */
- void SendTimeoutResponseToMobile(application_manager::MessagePtr msg);
-
- /**
- * @brief Remove extension created for specified application
- * @param app_id application id
- */
- virtual void RemoveAppExtension(uint32_t app_id);
-
- /**
- * @brief Check registering app can be handled by plugin
- * @param msg Registration message
- * @param app Application basis already create by Core
- */
- bool IsAppForPlugin(application_manager::ApplicationSharedPtr app);
-
- /**
- * @brief Notify about change of HMILevel of plugin's app
- * @param app App with new HMILevel
- * @param old_level Old HMILevel of app
- */
- void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType old_level);
-
- /**
- * @brief Sends HMI status notification to mobile
- * @param app application with changed HMI status
- **/
- void SendHmiStatusNotification(
- application_manager::ApplicationSharedPtr app) OVERRIDE;
-
- /**
- * @brief Getter for event_dispatcher
- * @return reference to RCEventDispatcher instance
- */
- RCEventDispatcher& event_dispatcher() OVERRIDE;
-
- /**
- * @brief Getter for resource_allocation_manager
- * @return reference to ResourceAllocationManager instance
- */
- ResourceAllocationManager& resource_allocation_manager() OVERRIDE;
-
- /**
- * @brief Overriden setter for service
- * @param service pointer to new service instance
- */
- void set_service(application_manager::ServicePtr service) OVERRIDE;
-
- /**
- * @brief OnApplicationEvent Processes application related events
- * @param event Event
- * @param application Pointer to application struct
- */
- void OnApplicationEvent(
- functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) OVERRIDE;
-
- /**
- * @brief OnPolicyEvent Processes policy related events
- * @param event Policy event
- */
- void OnPolicyEvent(functional_modules::PolicyEvent event) OVERRIDE;
-
- protected:
- /**
- * @brief Remove extension for all applications
- */
- virtual void RemoveAppExtensions() OVERRIDE;
-
- private:
- /**
- * @brief Trigger actions which should be done after plugin service instance
- * have been changed
- */
- void OnPluginServiceChanged();
-
- /**
- * @brief Subscribes on all RC related functions
- */
- void SubscribeOnFunctions();
-
- functional_modules::PluginInfo plugin_info_;
- bool is_scan_started_;
- request_controller::RequestController request_controller_;
-
- RCEventDispatcher event_dispatcher_;
-
- ResourceAllocationManagerImpl resource_allocation_manager_;
- DISALLOW_COPY_AND_ASSIGN(RemoteControlPlugin);
-};
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_
diff --git a/src/components/remote_control/include/remote_control/remote_plugin_interface.h b/src/components/remote_control/include/remote_control/remote_plugin_interface.h
deleted file mode 100644
index 51135d8a8a..0000000000
--- a/src/components/remote_control/include/remote_control/remote_plugin_interface.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_
-
-#include <queue>
-#include <string>
-#include "functional_module/generic_module.h"
-#include "remote_control/request_controller.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "utils/threads/message_loop_thread.h"
-#include "utils/shared_ptr.h"
-
-namespace remote_control {
-
-class RCAppExtension;
-class ResourceAllocationManager;
-
-typedef utils::SharedPtr<RCAppExtension> RCAppExtensionPtr;
-
-class RemotePluginInterface : public functional_modules::GenericModule {
- public:
- RemotePluginInterface() : GenericModule(kCANModuleID) {}
- virtual ~RemotePluginInterface() {}
- virtual functional_modules::PluginInfo GetPluginInfo() const = 0;
- virtual functional_modules::ProcessResult ProcessMessage(
- application_manager::MessagePtr msg) = 0;
- virtual functional_modules::ProcessResult ProcessHMIMessage(
- application_manager::MessagePtr msg) = 0;
-
- /**
- * @brief Sends response to mobile application
- * @param msg response mesage
- */
- virtual void SendResponseToMobile(application_manager::MessagePtr msg) = 0;
-
- /**
- * @brief Sends timeout response to mobile application
- * @param msg response mesage
- */
- virtual void SendTimeoutResponseToMobile(
- application_manager::MessagePtr msg) = 0;
-
- /**
- * @brief Remove extension created for specified application
- * @param app_id application id
- */
- virtual void RemoveAppExtension(uint32_t app_id) = 0;
-
- /**
- * @brief Check registering app can be handled by plugin
- * @param msg Registration message
- * @param app Application basis already create by Core
- */
- virtual bool IsAppForPlugin(
- application_manager::ApplicationSharedPtr app) = 0;
-
- /**
- * @brief Notify about change of HMILevel of plugin's app
- * @param app App with new HMILevel
- * @param old_level Old HMILevel of app
- */
- virtual void OnAppHMILevelChanged(
- application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType old_level) = 0;
-
- virtual void SendHmiStatusNotification(
- application_manager::ApplicationSharedPtr app) = 0;
-
- typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
- std::string> RCPluginEventDispatcher;
-
- virtual RCPluginEventDispatcher& event_dispatcher() = 0;
-
- virtual ResourceAllocationManager& resource_allocation_manager() = 0;
-
- protected:
- /**
- * @brief Remove extension for all applications
- */
- virtual void RemoveAppExtensions() = 0;
-
- static const functional_modules::ModuleID kCANModuleID = 153;
-};
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_
diff --git a/src/components/remote_control/include/remote_control/request_controller.h b/src/components/remote_control/include/remote_control/request_controller.h
deleted file mode 100644
index 8a79d9ebc4..0000000000
--- a/src/components/remote_control/include/remote_control/request_controller.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_
-
-#include <map>
-
-#include "remote_control/commands/command.h"
-#include "remote_control/rc_module_timer.h"
-#include "functional_module/timer/timer_director.h"
-#include "utils/lock.h"
-
-namespace remote_control {
-
-namespace commands {
-class Command;
-}
-
-namespace request_controller {
-
-typedef utils::SharedPtr<commands::Command> MobileRequestPtr;
-typedef uint32_t correlation_id;
-
-/**
- * @brief RequestController class is used to manage mobile requests lifetime.
- */
-class RequestController
- : public functional_modules::TimerObserver<TrackableMessage> {
- public:
- /**
- * @brief Class constructor
- *
- */
- RequestController();
-
- /**
- * @brief Class destructor
- *
- */
- virtual ~RequestController();
-
- /**
- * @brief Adds pointer to request.
- * @param mobile_correlation_id mobile request correlation id
- * @param command pointer to request created in mobile factory
- */
- void AddRequest(const uint32_t mobile_correlation_id,
- MobileRequestPtr request);
-
- /**
- * @brief Removes request
- * @param mobile_corellation_id mobile request correlation id
- */
- void DeleteRequest(const uint32_t& mobile_correlation_id);
-
- /**
- * @brief Sets timeout value for RC requests
- * @param timeout_seconds new timeout value in seconds
- */
- void SetRequestTimeout(const functional_modules::TimeUnit timeout_seconds);
-
- /**
- * @brief Triggers actions when timeout for some request is expired
- * @param expired reference to request which timeout was expired
- */
- void OnTimeoutTriggered(const TrackableMessage& expired) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RequestController);
-
- std::map<correlation_id, MobileRequestPtr> mobile_request_list_;
- functional_modules::ModuleTimer<TrackableMessage> timer_;
- functional_modules::TimerDirector time_director_;
- sync_primitives::Lock mobile_request_lock_;
-};
-
-} // namespace request_controller
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_
diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager.h b/src/components/remote_control/include/remote_control/resource_allocation_manager.h
deleted file mode 100644
index f789fe4af9..0000000000
--- a/src/components/remote_control/include/remote_control/resource_allocation_manager.h
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
-#include <string>
-#include "utils/macro.h"
-#include "utils/shared_ptr.h"
-#include "interfaces/HMI_API.h"
-#include "remote_control/event_engine/event.h"
-#include "functional_module/generic_module.h"
-
-namespace remote_control {
-
-/**
- * Enum for list of results of allocation resources
- */
-namespace AcquireResult {
-enum eType { ALLOWED = 0, IN_USE, ASK_DRIVER, REJECTED };
-}
-
-/**
- * Defines states of acquired resource
- */
-namespace ResourceState {
-enum eType { FREE = 0, BUSY };
-}
-
-/**
- * @brief Resources defines list of resources
- */
-typedef std::vector<std::string> Resources;
-
-class ResourceAllocationManager {
- public:
- /**
- * @brief AcquireResource acquires resource by application
- * @param module_type resource to acquire
- * @param app_id application that acquire resource
- * @return ALLOWED if resource acquired \
- * IN_USE if subscription is not allowed
- * ASK_DRIVER if driver confirmation is required
- */
- virtual AcquireResult::eType AcquireResource(const std::string& module_type,
- const uint32_t app_id) = 0;
-
- /**
- * @brief SetResourceState changes resource state. Resource must be acquired
- * beforehand.
- * @param module_type Resource to change its state
- * @param app_id Application aquired resource before
- * @param state State to set for resource
- */
- virtual void SetResourceState(const std::string& module_type,
- const uint32_t app_id,
- const ResourceState::eType state) = 0;
-
- /**
- * @brief IsResourceFree check resource state
- * @param module_type Resource name
- * @return True if free, otherwise - false
- */
- virtual bool IsResourceFree(const std::string& module_type) const = 0;
-
- /**
- * @brief AcquireResource forces acquiring resource by application
- * @param module_type resource to acquire
- * @param app_id application that acquire resource
- */
- virtual void ForceAcquireResource(const std::string& module_type,
- const uint32_t app_id) = 0;
-
- /**
- * @brief OnDriverDisallowed callback for rejecting acquiring resource
- * @param module_type resource type
- * @param app_id application id
- */
- virtual void OnDriverDisallowed(const std::string& module_type,
- const uint32_t app_id) = 0;
-
- /**
- * @brief OnApplicationEvent Processes application related events
- * @param event Event
- * @param application Pointer to application struct
- */
- virtual void OnApplicationEvent(
- functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) = 0;
-
- /**
- * @brief OnPolicyEvent Processes policy related events
- * @param event Policy event
- */
- virtual void OnPolicyEvent(functional_modules::PolicyEvent event) = 0;
-
- /**
- * @brief Set current access mode for acquiring resource
- * @param access_mode
- */
- virtual void SetAccessMode(
- const hmi_apis::Common_RCAccessMode::eType access_mode) = 0;
-
- /**
- * @brief Get last set access mode for acquiring resource
- * @param access_mode
- */
- virtual hmi_apis::Common_RCAccessMode::eType GetAccessMode() const = 0;
-
- /**
- * @brief Remove all information about all allocations
- */
- virtual void ResetAllAllocations() = 0;
-
- virtual ~ResourceAllocationManager() {}
-};
-
-} // namespace remote_control
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h
deleted file mode 100644
index 57c2a8f360..0000000000
--- a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h
+++ /dev/null
@@ -1,137 +0,0 @@
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
-#include "remote_control/resource_allocation_manager.h"
-#include "remote_control/remote_plugin_interface.h"
-#include "utils/macro.h"
-#include "utils/lock.h"
-
-namespace remote_control {
-
-typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
- std::string> RCEventDispatcher;
-
-class ResourceAllocationManagerImpl : public ResourceAllocationManager {
- public:
- ResourceAllocationManagerImpl(RemotePluginInterface& rc_plugin);
-
- ~ResourceAllocationManagerImpl();
-
- AcquireResult::eType AcquireResource(const std::string& module_type,
- const uint32_t app_id) OVERRIDE FINAL;
-
- void SetResourceState(const std::string& module_type,
- const uint32_t app_id,
- const ResourceState::eType state) FINAL;
-
- bool IsResourceFree(const std::string& module_type) const FINAL;
-
- void SetAccessMode(
- const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL;
-
- hmi_apis::Common_RCAccessMode::eType GetAccessMode() const FINAL;
-
- void ForceAcquireResource(const std::string& module_type,
- const uint32_t app_id) FINAL;
-
- void OnDriverDisallowed(const std::string& module_type,
- const uint32_t app_id) FINAL;
-
- /**
- * @brief OnApplicationEvent Notifies modules on certain application events
- * @param event Event
- * @param application Pointer to application struct
- */
- void OnApplicationEvent(
- functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) FINAL;
-
- /**
- * @brief OnPolicyEvent Processes policy related events
- * @param event Policy event
- */
- void OnPolicyEvent(functional_modules::PolicyEvent event) FINAL;
-
- void ResetAllAllocations() FINAL;
-
- private:
- typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
-
- /**
- * @brief IsModuleTypeRejected check if current resource was rejected by
- * driver for current application
- * @param module_type resource to check
- * @param app_id application id
- * @return true if current resource was rejected by driver for current
- * application, otherwise - false
- */
- bool IsModuleTypeRejected(const std::string& module_type,
- const uint32_t app_id);
-
- /**
- * @brief ReleaseResource Releases resource acquired by application
- * @param module_type Module name
- * @param application_id Application id
- */
- void ReleaseResource(const std::string& module_type,
- const uint32_t application_id);
-
- /**
- * @brief GetAcquiredResources Provides resources acquired by particular
- * application currently
- * @param application_id Application id
- * @return List of acquired resources by specific application
- */
- Resources GetAcquiredResources(const uint32_t application_id) const;
-
- /**
- * @brief ProcessApplicationPolicyUpdate Checks if allowed modules list is
- * changed for registered RC applications and releases in case some modules
- * now out of the list
- */
- void ProcessApplicationPolicyUpdate();
-
- /**
- * @brief GetApplicationExtention Provides access to application RC extention
- * @param application Application
- * @return Pointer to RC extention of application or NULL if not available
- */
- RCAppExtensionPtr GetApplicationExtention(
- application_manager::ApplicationSharedPtr application);
-
- /**
- * @brief RemoveAppsSubscriptions Removes subscriptions for interior data for
- * applications in the list
- * @param apps Application list
- */
- void RemoveAppsSubscriptions(const Apps& apps);
-
- /**
- * @brief AllocatedResources contains link between resource and application
- * owning that resource
- */
- typedef std::map<std::string, uint32_t> AllocatedResources;
- AllocatedResources allocated_resources_;
- mutable sync_primitives::Lock allocated_resources_lock_;
-
- /**
- * @brief ResourcesState contains states of ALLOCATED resources
- */
- typedef std::map<std::string, ResourceState::eType> ResourcesState;
- ResourcesState resources_state_;
- mutable sync_primitives::Lock resources_state_lock_;
-
- /**
- * @brief RejectedResources type for connecting list of resources rejected by
- * driver for application
- * application_id : [vector of rejected resources]
- */
- typedef std::map<uint32_t, std::vector<std::string> > RejectedResources;
- RejectedResources rejected_resources_for_application_;
- mutable sync_primitives::Lock rejected_resources_for_application_lock_;
-
- hmi_apis::Common_RCAccessMode::eType current_access_mode_;
- RemotePluginInterface& rc_plugin_;
-};
-} // remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
diff --git a/src/components/remote_control/src/commands/base_command_notification.cc b/src/components/remote_control/src/commands/base_command_notification.cc
deleted file mode 100644
index 2de82abdef..0000000000
--- a/src/components/remote_control/src/commands/base_command_notification.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/base_command_notification.h"
-#include "json/json.h"
-#include "remote_control/remote_control_plugin.h"
-#include "remote_control/rc_module_constants.h"
-#include "application_manager/application_manager.h"
-
-namespace remote_control {
-
-namespace commands {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
-
-BaseCommandNotification::BaseCommandNotification(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module)
- : Command(rc_module), service_(rc_module_.service()), message_(message) {
- Json::Value value;
- Json::Reader reader;
- reader.parse(message_->json_message(), value);
- if (value.isMember(json_keys::kParams)) {
- Json::FastWriter writer;
- message_->set_json_message(writer.write(value[json_keys::kParams]));
- } else {
- message_->set_json_message("");
- }
-}
-
-BaseCommandNotification::~BaseCommandNotification() {}
-
-RCAppExtensionPtr BaseCommandNotification::GetAppExtension(
- application_manager::ApplicationSharedPtr app) const {
- if (!app) {
- return NULL;
- }
-
- functional_modules::ModuleID id = rc_module_.GetModuleID();
-
- RCAppExtensionPtr rc_app_extension;
- application_manager::AppExtensionPtr app_extension = app->QueryInterface(id);
- if (!app_extension) {
- return NULL;
- }
-
- rc_app_extension =
- application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
- app_extension);
-
- return rc_app_extension;
-}
-
-void BaseCommandNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- Execute();
-}
-
-void BaseCommandNotification::NotifyApplications() {
- LOG4CXX_AUTO_TRACE(logger_);
- typedef std::vector<application_manager::ApplicationSharedPtr> AppList;
- AppList applications = service_->GetApplications(rc_module_.GetModuleID());
- for (AppList::iterator i = applications.begin(); i != applications.end();
- ++i) {
- application_manager::MessagePtr message(
- new application_manager::Message(*message_));
- message->set_connection_key((*i)->app_id());
- NotifyOneApplication(message);
- }
-}
-
-void BaseCommandNotification::NotifyOneApplication(
- application_manager::MessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (CheckPolicy(message)) {
- service_->SendMessageToMobile(message);
- } else {
- LOG4CXX_WARN(logger_,
- "Function \"" << message->function_name() << "\" (#"
- << message->function_id()
- << ") not allowed by policy");
- }
-}
-
-bool BaseCommandNotification::CheckPolicy(
- application_manager::MessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager::ApplicationSharedPtr app =
- service_->GetApplication(message->connection_key());
-
- if (!app) {
- LOG4CXX_WARN(logger_,
- "Application " << message->connection_key()
- << "isn't registered");
- return false;
- }
-
- mobile_apis::Result::eType permission =
- service_->CheckPolicyPermissions(message);
-
- Json::Value value;
- Json::Reader reader;
- LOG4CXX_DEBUG(logger_, "Notification: " << message->json_message());
- reader.parse(message->json_message(), value);
-
- return permission == mobile_apis::Result::eType::SUCCESS &&
- service_->CheckModule(app->app_id(), ModuleType(value));
-}
-
-std::string BaseCommandNotification::ModuleType(const Json::Value& message) {
- return "";
-}
-
-bool BaseCommandNotification::Validate() {
- return true;
-}
-
-std::vector<std::string> BaseCommandNotification::ControlData(
- const Json::Value& message) {
- return std::vector<std::string>();
-}
-
-} // namespace commands
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc
deleted file mode 100644
index bc6202d2a8..0000000000
--- a/src/components/remote_control/src/commands/base_command_request.cc
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/base_command_request.h"
-#include <cstring>
-#include "utils/make_shared.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/remote_control_plugin.h"
-#include "remote_control/rc_module_constants.h"
-#include "application_manager/application_manager_impl.h"
-
-namespace remote_control {
-
-namespace commands {
-
-using rc_event_engine::EventDispatcher;
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
-
-BaseCommandRequest::BaseCommandRequest(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module)
- : Command(rc_module)
- , message_(message)
- , msg_json_(MessageHelper::StringToValue(message->json_message()))
- , auto_allowed_(false) {
- service_ = rc_module_.service();
- app_ = service_->GetApplication(message_->connection_key());
-}
-
-BaseCommandRequest::~BaseCommandRequest() {
- rc_module_.event_dispatcher().remove_observer(this);
-}
-
-void BaseCommandRequest::OnTimeout() {
- LOG4CXX_AUTO_TRACE(logger_);
- SetResourceState(msg_json_, ResourceState::FREE);
-
- PrepareResponse(
- false, result_codes::kGenericError, "Request timeout expired.");
- rc_module_.SendTimeoutResponseToMobile(message_);
-}
-
-void BaseCommandRequest::PrepareResponse(const bool success,
- const char* result_code,
- const std::string& info) {
- message_->set_message_type(application_manager::MessageType::kResponse);
- Json::Value msg_params;
-
- if (!response_params_.isNull()) {
- msg_params = response_params_;
- }
-
- msg_params[json_keys::kSuccess] = success;
- msg_params[json_keys::kResultCode] = result_code;
- if (!info.empty()) {
- msg_params[json_keys::kInfo] = info;
- }
-
- Json::FastWriter writer;
- std::string params = writer.write(msg_params);
- message_->set_json_message(params);
-}
-
-void BaseCommandRequest::SendResponse(const bool success,
- const char* result_code,
- const std::string& info) {
- LOG4CXX_AUTO_TRACE(logger_);
- SetResourceState(msg_json_, ResourceState::FREE);
- PrepareResponse(success, result_code, info);
- rc_module_.SendResponseToMobile(message_);
-}
-
-void BaseCommandRequest::SendMessageToHMI(
- const application_manager::MessagePtr& message_to_send) {
- LOG4CXX_AUTO_TRACE(logger_);
- using application_manager::HmiInterfaces;
-
- const bool is_rc_available =
- service_->IsInterfaceAvailable(HmiInterfaces::HMI_INTERFACE_RC);
- LOG4CXX_DEBUG(logger_, "HMI interface RC is available: " << is_rc_available);
- if (!is_rc_available) {
- const bool success = false;
- const char* result_code = result_codes::kUnsupportedResource;
- const std::string info = "Remote control is not supported by system";
-
- SendResponse(success, result_code, info);
- return;
- }
-
- const std::string function_name = message_to_send->function_name();
- const int32_t correlation_id = message_to_send->correlation_id();
- LOG4CXX_DEBUG(logger_,
- "Subsribing to response for function: "
- << function_name
- << " and correlation id: " << correlation_id);
-
- rc_module_.event_dispatcher().add_observer(
- function_name, correlation_id, this);
-
- LOG4CXX_DEBUG(logger_, "HMI Request:\n " << message_to_send->json_message());
-
- service_->SendMessageToHMI(message_to_send);
-}
-
-void BaseCommandRequest::SendRequest(const char* function_id,
- const Json::Value& message_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager::MessagePtr message_to_send =
- CreateHmiRequest(function_id, message_params);
- SendMessageToHMI(message_to_send);
-}
-
-application_manager::MessagePtr BaseCommandRequest::CreateHmiRequest(
- const char* function_id, const Json::Value& message_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t hmi_app_id = app_->hmi_app_id();
- return MessageHelper::CreateHmiRequest(
- function_id, hmi_app_id, message_params, rc_module_);
-}
-
-bool BaseCommandRequest::Validate() {
- return application_manager::MessageValidationResult::SUCCESS ==
- service_->ValidateMessageBySchema(*message_);
-}
-
-bool BaseCommandRequest::ParseJsonString(Json::Value* parsed_msg) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(parsed_msg);
- if (!parsed_msg)
- return false;
-
- (*parsed_msg) = MessageHelper::StringToValue(message_->json_message());
- if (Json::ValueType::nullValue == parsed_msg->type()) {
- LOG4CXX_ERROR(logger_,
- "Invalid JSON received in " << message_->json_message());
- SendResponse(
- false, result_codes::kInvalidData, "Mobile request validation failed!");
- return false;
- }
- return true;
-}
-
-const char* BaseCommandRequest::GetMobileResultCode(
- const hmi_apis::Common_Result::eType& hmi_code) const {
- LOG4CXX_AUTO_TRACE(logger_);
- switch (hmi_code) {
- case hmi_apis::Common_Result::SUCCESS: {
- return result_codes::kSuccess;
- }
- case hmi_apis::Common_Result::UNSUPPORTED_REQUEST: {
- return result_codes::kUnsupportedRequest;
- }
- case hmi_apis::Common_Result::UNSUPPORTED_RESOURCE: {
- return result_codes::kUnsupportedResource;
- }
- case hmi_apis::Common_Result::DISALLOWED: {
- return result_codes::kDisallowed;
- }
- case hmi_apis::Common_Result::REJECTED: {
- return result_codes::kRejected;
- }
- case hmi_apis::Common_Result::ABORTED: {
- return result_codes::kAborted;
- }
- case hmi_apis::Common_Result::IGNORED: {
- return result_codes::kIgnored;
- }
- case hmi_apis::Common_Result::RETRY: {
- return result_codes::kRetry;
- }
- case hmi_apis::Common_Result::IN_USE: {
- return result_codes::kInUse;
- }
- case hmi_apis::Common_Result::DATA_NOT_AVAILABLE: {
- return result_codes::kVehicleDataNotAvailable;
- }
- case hmi_apis::Common_Result::TIMED_OUT: {
- return result_codes::kTimedOut;
- }
- case hmi_apis::Common_Result::INVALID_DATA: {
- return result_codes::kInvalidData;
- }
- case hmi_apis::Common_Result::CHAR_LIMIT_EXCEEDED: {
- return result_codes::kCharLimitExceeded;
- }
- case hmi_apis::Common_Result::INVALID_ID: {
- return result_codes::kInvalidId;
- }
- case hmi_apis::Common_Result::DUPLICATE_NAME: {
- return result_codes::kDuplicateName;
- }
- case hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED: {
- return result_codes::kApplicationNotRegistered;
- }
- case hmi_apis::Common_Result::WRONG_LANGUAGE: {
- return result_codes::kWrongLanguage;
- }
- case hmi_apis::Common_Result::OUT_OF_MEMORY: {
- return result_codes::kOutOfMemory;
- }
- case hmi_apis::Common_Result::TOO_MANY_PENDING_REQUESTS: {
- return result_codes::kTooManyPendingRequests;
- }
- case hmi_apis::Common_Result::NO_APPS_REGISTERED: {
- return result_codes::kApplicationNotRegistered;
- }
- case hmi_apis::Common_Result::NO_DEVICES_CONNECTED: {
- return result_codes::kApplicationNotRegistered;
- }
- case hmi_apis::Common_Result::WARNINGS: {
- return result_codes::kWarnings;
- }
- case hmi_apis::Common_Result::GENERIC_ERROR: {
- return result_codes::kGenericError;
- }
- case hmi_apis::Common_Result::USER_DISALLOWED: {
- return result_codes::kUserDisallowed;
- }
- case hmi_apis::Common_Result::READ_ONLY: {
- return result_codes::kReadOnly;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Unknown HMI result code " << hmi_code);
- return result_codes::kGenericError;
- }
- }
-}
-
-RCAppExtensionPtr BaseCommandRequest::GetAppExtension(
- application_manager::ApplicationSharedPtr app) const {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- return NULL;
- }
-
- functional_modules::ModuleID id = rc_module_.GetModuleID();
-
- RCAppExtensionPtr rc_app_extension;
- application_manager::AppExtensionPtr app_extension = app->QueryInterface(id);
- if (!app_extension) {
- LOG4CXX_DEBUG(logger_, "New app extension will be created");
- app_extension = new RCAppExtension(id);
- app->AddExtension(app_extension);
- }
-
- rc_app_extension =
- application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
- app_extension);
-
- return rc_app_extension;
-}
-
-bool BaseCommandRequest::ParseResultCode(const Json::Value& value,
- std::string& result_code,
- std::string& info) {
- LOG4CXX_AUTO_TRACE(logger_);
- result_code = result_codes::kInvalidData;
- info = "";
-
- if (IsMember(value, json_keys::kResult) &&
- IsMember(value[json_keys::kResult], json_keys::kCode)) {
- result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- value[json_keys::kResult][json_keys::kCode].asInt()));
- } else if (IsMember(value, json_keys::kError) &&
- IsMember(value[json_keys::kError], json_keys::kCode)) {
- result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- value[json_keys::kError][json_keys::kCode].asInt()));
-
- if (IsMember(value[json_keys::kError], json_keys::kMessage)) {
- info = value[json_keys::kError][json_keys::kMessage].asCString();
- }
- }
-
- if ((result_codes::kSuccess == result_code) ||
- (result_codes::kWarnings == result_code)) {
- return true;
- }
-
- return false;
-}
-
-void BaseCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!Validate()) {
- LOG4CXX_WARN(logger_, "Request message validation failed !");
- SendResponse(
- false, result_codes::kInvalidData, "Validation by schema failed");
- return;
- }
- LOG4CXX_TRACE(logger_, "Request message validated successfully!");
- using application_manager::HmiInterfaces;
- if (!service_->IsInterfaceAvailable(HmiInterfaces::HMI_INTERFACE_RC)) {
- LOG4CXX_WARN(logger_, "HMI interface RC is not available");
- SendResponse(false,
- result_codes::kUnsupportedResource,
- "Remote control is not supported by system");
- return;
- }
- LOG4CXX_TRACE(logger_, "RC interface is available!");
- if (CheckPolicyPermissions() && CheckDriverConsent()) {
- if (AcquireResources()) {
- Execute(); // run child's logic
- }
- // If resource is not aqcuired, AcquireResources method will either
- // send response to mobile or
- // send additional request to HMI to ask driver consent
- }
-}
-
-bool BaseCommandRequest::CheckPolicyPermissions() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!app_) {
- LOG4CXX_ERROR(logger_, "Application doesn't registered!");
- SendResponse(false, result_codes::kApplicationNotRegistered, "");
- return false;
- }
-
- if (!service_->IsRemoteControlApplication(app_)) {
- LOG4CXX_WARN(logger_, "Application has no remote control functions");
- SendResponse(false, result_codes::kDisallowed, "");
- return false;
- }
-
- mobile_apis::Result::eType ret = service_->CheckPolicyPermissions(message_);
- if (ret != mobile_apis::Result::eType::SUCCESS) {
- LOG4CXX_WARN(logger_,
- "Function \"" << message_->function_name() << "\" (#"
- << message_->function_id()
- << ") not allowed by policy");
-
- SendResponse(false, result_codes::kDisallowed, "");
- return false;
- }
-
- return true;
-}
-
-application_manager::TypeAccess BaseCommandRequest::CheckModule(
- const Json::Value& message) {
- const std::string& module = ModuleType(message);
- return service_->CheckModule(app_->app_id(), module)
- ? application_manager::TypeAccess::kAllowed
- : application_manager::TypeAccess::kDisallowed;
-}
-
-bool BaseCommandRequest::CheckDriverConsent() {
- LOG4CXX_AUTO_TRACE(logger_);
- RCAppExtensionPtr extension = GetAppExtension(app_);
- if (!extension) {
- return false;
- }
- Json::Value value;
- Json::Reader reader;
- LOG4CXX_DEBUG(logger_, "Request: " << message_->json_message());
- reader.parse(message_->json_message(), value);
-
- application_manager::TypeAccess access = CheckModule(value);
-
- if (IsAutoAllowed(access)) {
- set_auto_allowed(true);
- return true;
- } else {
- SendDisallowed(access);
- }
- return false;
-}
-
-bool BaseCommandRequest::AcquireResources() {
- LOG4CXX_AUTO_TRACE(logger_);
- const Json::Value message_params =
- MessageHelper::StringToValue(message_->json_message());
-
- if (!IsResourceFree(ModuleType(message_params))) {
- LOG4CXX_WARN(logger_, "Resource is busy.");
- SendResponse(false, result_codes::kInUse, "");
- return false;
- }
-
- AcquireResult::eType acquire_result = AcquireResource(message_params);
- switch (acquire_result) {
- case AcquireResult::ALLOWED: {
- SetResourceState(msg_json_, ResourceState::BUSY);
- return true;
- }
- case AcquireResult::IN_USE: {
- SendResponse(false, result_codes::kInUse, "");
- return false;
- }
- case AcquireResult::ASK_DRIVER: {
- SetResourceState(msg_json_, ResourceState::BUSY);
-
- Json::Value value;
- Json::Reader reader;
- LOG4CXX_DEBUG(logger_, "Request: " << message_->json_message());
- reader.parse(message_->json_message(), value);
-
- SendGetUserConsent(value);
-
- return false;
- }
- case AcquireResult::REJECTED: {
- SendResponse(false, result_codes::kRejected, "");
- return false;
- }
- }
-
- return false;
-}
-
-bool BaseCommandRequest::IsAutoAllowed(
- application_manager::TypeAccess access) const {
- return access == application_manager::kAllowed;
-}
-
-void BaseCommandRequest::SendDisallowed(
- application_manager::TypeAccess access) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::string info;
- switch (access) {
- case application_manager::kAllowed:
- return;
- case application_manager::kDisallowed:
- info = disallowed_info_.empty()
- ? "The RPC is disallowed by vehicle settings"
- : disallowed_info_;
- break;
- default:
- info = "Unknown issue";
- }
- LOG4CXX_ERROR(logger_, info);
- SendResponse(false, result_codes::kDisallowed, info);
-}
-
-void BaseCommandRequest::SendGetUserConsent(const Json::Value& value) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(app_);
- Json::Value params;
- params[json_keys::kAppId] = app_->hmi_app_id();
- params[message_params::kModuleType] = ModuleType(value);
- SendRequest(functional_modules::hmi_api::get_user_consent, params);
-}
-
-std::string BaseCommandRequest::ModuleType(const Json::Value& message) {
- return "";
-}
-
-std::vector<std::string> BaseCommandRequest::ControlData(
- const Json::Value& message) {
- return std::vector<std::string>();
-}
-
-void BaseCommandRequest::on_event(
- const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
- event) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SetResourceState(msg_json_, ResourceState::FREE);
-
- if (event.id() == functional_modules::hmi_api::get_user_consent) {
- ProcessAccessResponse(event);
- } else {
- OnEvent(event); // run child's logic
- }
-}
-
-void BaseCommandRequest::ProcessAccessResponse(
- const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
- event) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!app_) {
- LOG4CXX_ERROR(logger_, "Application doesn't registered!");
- SendResponse(false, result_codes::kApplicationNotRegistered, "");
- return;
- }
-
- application_manager::Message& hmi_response = *(event.event_message());
- const application_manager::MessageValidationResult validate_result =
- service_->ValidateMessageBySchema(hmi_response);
- LOG4CXX_DEBUG(logger_,
- "HMI response validation result is " << validate_result);
-
- if (validate_result !=
- application_manager::MessageValidationResult::SUCCESS) {
- SendResponse(
- false, result_codes::kGenericError, "HMI has sent invalid parameters");
- return;
- }
-
- Json::Value value;
- Json::Reader reader;
- reader.parse(event.event_message()->json_message(), value);
-
- std::string result_code;
- std::string info;
- const bool is_succeeded = ParseResultCode(value, result_code, info);
-
- bool is_allowed = false;
- if (is_succeeded) {
- if (IsMember(value[json_keys::kResult], message_params::kAllowed) &&
- value[json_keys::kResult][message_params::kAllowed].isBool()) {
- is_allowed = value[json_keys::kResult][message_params::kAllowed].asBool();
- }
-
- const std::string module = ModuleType(msg_json_);
-
- // Check the actual User's answer.
- LOG4CXX_DEBUG(logger_,
- "Setting allowed access for " << app_->app_id() << " for "
- << module);
- if (is_allowed) {
- rc_module_.resource_allocation_manager().ForceAcquireResource(
- module, app_->app_id());
-
- Execute(); // run child's logic
- } else {
- rc_module_.resource_allocation_manager().OnDriverDisallowed(
- module, app_->app_id());
-
- SendResponse(
- false,
- result_codes::kRejected,
- "The resource is in use and the driver disallows this remote "
- "control RPC");
- }
- } else {
- SendResponse(false, result_code.c_str(), info);
- }
-}
-
-} // namespace commands
-} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/button_press_request.cc b/src/components/remote_control/src/commands/button_press_request.cc
deleted file mode 100644
index 1e5eef1e64..0000000000
--- a/src/components/remote_control/src/commands/button_press_request.cc
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/button_press_request.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_module_constants.h"
-#include "functional_module/function_ids.h"
-#include "json/json.h"
-#include "utils/helpers.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace remote_control {
-
-namespace commands {
-
-using namespace json_keys;
-using namespace message_params;
-
-typedef std::map<std::string, mobile_apis::ButtonName::eType> ButtonsMap;
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "ButtonPressRequest")
-
-ButtonPressRequest::ButtonPressRequest(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module)
- : BaseCommandRequest(message, rc_module) {}
-
-ButtonPressRequest::~ButtonPressRequest() {}
-
-const std::vector<std::string> buttons_climate() {
- std::vector<std::string> data;
- data.push_back(enums_value::kACMax);
- data.push_back(enums_value::kAC);
- data.push_back(enums_value::kRecirculate);
- data.push_back(enums_value::kFanUp);
- data.push_back(enums_value::kFanDown);
- data.push_back(enums_value::kTempUp);
- data.push_back(enums_value::kTempDown);
- data.push_back(enums_value::kDefrostMax);
- data.push_back(enums_value::kDefrost);
- data.push_back(enums_value::kDefrostRear);
- data.push_back(enums_value::kUpperVent);
- data.push_back(enums_value::kLowerVent);
- return data;
-}
-
-const std::vector<std::string> buttons_radio() {
- std::vector<std::string> data;
- data.push_back(enums_value::kVolumeUp);
- data.push_back(enums_value::kVolumeDown);
- data.push_back(enums_value::kEject);
- data.push_back(enums_value::kSource);
- data.push_back(enums_value::kShuffle);
- data.push_back(enums_value::kRepeat);
- return data;
-}
-
-const ButtonsMap buttons_map() {
- using namespace mobile_apis;
-
- ButtonsMap buttons_map;
- buttons_map[enums_value::kACMax] = ButtonName::AC_MAX;
- buttons_map[enums_value::kAC] = ButtonName::AC;
- buttons_map[enums_value::kRecirculate] = ButtonName::RECIRCULATE;
- buttons_map[enums_value::kFanUp] = ButtonName::FAN_UP;
- buttons_map[enums_value::kFanDown] = ButtonName::FAN_DOWN;
- buttons_map[enums_value::kTempUp] = ButtonName::TEMP_UP;
- buttons_map[enums_value::kTempDown] = ButtonName::TEMP_DOWN;
- buttons_map[enums_value::kDefrostMax] = ButtonName::DEFROST_MAX;
- buttons_map[enums_value::kDefrost] = ButtonName::DEFROST;
- buttons_map[enums_value::kDefrostRear] = ButtonName::DEFROST_REAR;
- buttons_map[enums_value::kUpperVent] = ButtonName::UPPER_VENT;
- buttons_map[enums_value::kLowerVent] = ButtonName::LOWER_VENT;
- buttons_map[enums_value::kVolumeUp] = ButtonName::VOLUME_UP;
- buttons_map[enums_value::kVolumeDown] = ButtonName::VOLUME_DOWN;
- buttons_map[enums_value::kEject] = ButtonName::EJECT;
- buttons_map[enums_value::kSource] = ButtonName::SOURCE;
- buttons_map[enums_value::kShuffle] = ButtonName::SHUFFLE;
- buttons_map[enums_value::kRepeat] = ButtonName::REPEAT;
-
- return buttons_map;
-}
-
-bool CheckIfButtonExistInRCCaps(
- const smart_objects::SmartObject& rc_capabilities,
- const mobile_apis::ButtonName::eType button) {
- if (rc_capabilities.keyExists(strings::kbuttonCapabilities)) {
- const smart_objects::SmartObject& button_caps =
- rc_capabilities[strings::kbuttonCapabilities];
- smart_objects::SmartArray::iterator it = button_caps.asArray()->begin();
- for (; it != button_caps.asArray()->end(); ++it) {
- smart_objects::SmartObject& so = *it;
- int64_t current_id = so[message_params::kName].asInt();
- if (-1 == current_id) {
- // capabilities received from HMI contains enum values
- // capabilities loaded from file contains string values
- // TODO : unificate capabilities storing
- const std::string& bt_name = so[message_params::kName].asString();
- static ButtonsMap btn_map = buttons_map();
- current_id = btn_map[bt_name];
- }
- const mobile_apis::ButtonName::eType current_button =
- static_cast<mobile_apis::ButtonName::eType>(current_id);
- if (current_button == button) {
- LOG4CXX_TRACE(logger_,
- "Button id " << current_button
- << " exist in capabilities");
- return true;
- }
- }
- }
- LOG4CXX_TRACE(logger_,
- "Button id " << button << " do not exist in capabilities");
- return false;
-}
-
-bool CheckButtonName(const std::string& module_type,
- const std::string& button_name,
- const smart_objects::SmartObject* rc_capabilities) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (rc_capabilities == NULL) {
- LOG4CXX_ERROR(logger_, "No remote controll capabilities available");
- return false;
- }
-
- if (enums_value::kRadio == module_type) {
- if (!helpers::in_range(buttons_radio(), button_name)) {
- LOG4CXX_WARN(logger_,
- "Trying to acceess climate button with module type radio");
- return false;
- }
- }
-
- if (enums_value::kClimate == module_type) {
- if (!helpers::in_range(buttons_climate(), button_name)) {
- LOG4CXX_WARN(logger_,
- "Trying to acceess radio button with module type climate");
- return false;
- }
- }
- return true;
-}
-
-void ButtonPressRequest::Execute() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const Json::Value request_params =
- MessageHelper::StringToValue(message_->json_message());
-
- const std::string button_name = request_params[kButtonName].asString();
- const std::string module_type = request_params[kModuleType].asString();
-
- static ButtonsMap btn_map = buttons_map();
- mobile_apis::ButtonName::eType button_id =
- mobile_apis::ButtonName::INVALID_ENUM;
- if (btn_map.end() != btn_map.find(button_name)) {
- button_id = btn_map[button_name];
- }
-
- const smart_objects::SmartObject* rc_capabilities =
- service()->GetRCCapabilities();
- const bool button_name_matches_module_type =
- CheckButtonName(module_type, button_name, rc_capabilities);
- const bool button_id_exist_in_caps =
- rc_capabilities &&
- CheckIfButtonExistInRCCaps(*rc_capabilities, button_id);
-
- if (button_name_matches_module_type && button_id_exist_in_caps) {
- SendRequest(functional_modules::hmi_api::button_press, request_params);
- } else if (!button_name_matches_module_type) {
- LOG4CXX_WARN(logger_, "Request module type and button name mismatch!");
- SendResponse(false,
- result_codes::kInvalidData,
- "Request module type and button name mismatch!");
- } else {
- LOG4CXX_WARN(logger_, "Requested button is not exists in capabilities!");
- SendResponse(false,
- result_codes::kUnsupportedResource,
- "Requested button is not exists in capabilities!");
- }
-}
-
-AcquireResult::eType ButtonPressRequest::AcquireResource(
- const Json::Value& message) {
- ResourceAllocationManager& allocation_manager =
- rc_module_.resource_allocation_manager();
- const std::string& module_type = ModuleType(message);
- const uint32_t app_id = app()->app_id();
- return allocation_manager.AcquireResource(module_type, app_id);
-}
-
-bool ButtonPressRequest::IsResourceFree(const std::string& module_type) const {
- return rc_module_.resource_allocation_manager().IsResourceFree(module_type);
-}
-
-void ButtonPressRequest::SetResourceState(const Json::Value& message,
- const ResourceState::eType state) {
- const std::string& module_type = ModuleType(message);
- const uint32_t app_id = app()->app_id();
-
- ResourceAllocationManager& allocation_manager =
- rc_module_.resource_allocation_manager();
- allocation_manager.SetResourceState(module_type, app_id, state);
-}
-
-void ButtonPressRequest::OnEvent(
- const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
- event) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(
- (functional_modules::hmi_api::button_press == event.id()));
-
- application_manager::Message& hmi_response = *(event.event_message());
- const Json::Value value =
- MessageHelper::StringToValue(hmi_response.json_message());
-
- std::string result_code;
- std::string info;
-
- bool is_response_successful = ParseResultCode(value, result_code, info);
-
- if (remote_control::result_codes::kReadOnly == result_code) {
- is_response_successful = false;
- result_code = result_codes::kGenericError;
- }
- SendResponse(is_response_successful, result_code.c_str(), info);
-}
-
-std::string ButtonPressRequest::ModuleType(const Json::Value& message) {
- return message.get(message_params::kModuleType, Json::Value("")).asString();
-}
-
-} // namespace commands
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc
deleted file mode 100644
index 6a7e746aa5..0000000000
--- a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <map>
-
-#include "remote_control/commands/get_interior_vehicle_data_request.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/remote_control_plugin.h"
-#include "functional_module/function_ids.h"
-#include "json/json.h"
-
-namespace remote_control {
-
-namespace commands {
-
-using namespace enums_value;
-using namespace json_keys;
-using namespace message_params;
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "GetInteriorVehicleDataRequest")
-
-GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module)
- : BaseCommandRequest(message, rc_module) {}
-
-bool CheckIfModuleTypeExistInCapabilities(
- const smart_objects::SmartObject& rc_capabilities,
- const std::string& module_type) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (enums_value::kRadio == module_type &&
- !rc_capabilities.keyExists(strings::kradioControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Radio control capabilities not present");
- return false;
- }
- if (enums_value::kClimate == module_type &&
- !rc_capabilities.keyExists(strings::kclimateControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Climate control capabilities not present");
- return false;
- }
-
- return true;
-}
-
-void GetInteriorVehicleDataRequest::Execute() {
- LOG4CXX_AUTO_TRACE(logger_);
- Json::Value request_params =
- MessageHelper::StringToValue(message_->json_message());
-
- const smart_objects::SmartObject* capabilities =
- service()->GetRCCapabilities();
- if (capabilities &&
- !CheckIfModuleTypeExistInCapabilities(*capabilities,
- ModuleType(request_params))) {
- LOG4CXX_WARN(logger_, "Accessing not supported module data");
- SendResponse(false,
- result_codes::kUnsupportedResource,
- "Accessing not supported module data");
- return;
- }
- if (HasRequestExcessiveSubscription(request_params)) {
- RemoveExcessiveSubscription(request_params);
- }
-
- SendRequest(functional_modules::hmi_api::get_interior_vehicle_data,
- request_params);
-}
-
-void GetInteriorVehicleDataRequest::OnEvent(
- const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
- event) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(
- (functional_modules::hmi_api::get_interior_vehicle_data == event.id()));
-
- application_manager::Message& hmi_response = *(event.event_message());
- const bool validate_result =
- application_manager::MessageValidationResult::SUCCESS ==
- service()->ValidateMessageBySchema(hmi_response);
- LOG4CXX_DEBUG(logger_,
- "HMI response validation result is " << validate_result);
- const Json::Value value =
- MessageHelper::StringToValue(hmi_response.json_message());
- std::string result_code;
- std::string info;
- bool success = validate_result && ParseResultCode(value, result_code, info);
-
- if (!validate_result ||
- remote_control::result_codes::kReadOnly == result_code) {
- success = false;
- result_code = result_codes::kGenericError;
- }
-
- if (success) {
- ProccessSubscription(value);
- response_params_[kModuleData] =
- value[json_keys::kResult][message_params::kModuleData];
- }
- SendResponse(success, result_code.c_str(), info);
-}
-
-void GetInteriorVehicleDataRequest::ProccessSubscription(
- const Json::Value& hmi_response) {
- LOG4CXX_AUTO_TRACE(logger_);
- Json::Value request_params;
- Json::Reader reader;
- reader.parse(message_->json_message(), request_params);
-
- const bool is_subscribe_present_in_request =
- IsMember(request_params, kSubscribe);
- const bool isSubscribed_present_in_response =
- IsMember(hmi_response[json_keys::kResult], message_params::kIsSubscribed);
-
- if (!is_subscribe_present_in_request && !isSubscribed_present_in_response) {
- return;
- }
-
- RCAppExtensionPtr extension = GetAppExtension(app());
- if (is_subscribe_present_in_request && !isSubscribed_present_in_response) {
- LOG4CXX_WARN(logger_,
- "conditional mandatory parameter "
- << kIsSubscribed << " missed in hmi response");
- response_params_[kIsSubscribed] =
- extension->IsSubscibedToInteriorVehicleData(
- request_params[kModuleType]);
- return;
- }
-
- if (!is_subscribe_present_in_request && isSubscribed_present_in_response) {
- LOG4CXX_WARN(logger_,
- "Parameter " << message_params::kIsSubscribed
- << " is ignored due to absence '"
- << message_params::kSubscribe
- << "' parameter in request");
- return;
- }
-
- const bool request_subscribe = request_params[kSubscribe].asBool();
- const bool response_subscribe =
- hmi_response[json_keys::kResult][message_params::kIsSubscribed].asBool();
- response_params_[message_params::kIsSubscribed] = response_subscribe;
- LOG4CXX_TRACE(logger_, "request_subscribe = " << request_subscribe);
- LOG4CXX_TRACE(logger_, "response_subscribe = " << response_subscribe);
- if (request_subscribe == response_subscribe) {
- if (response_subscribe) {
- LOG4CXX_DEBUG(logger_,
- "SubscribeToInteriorVehicleData "
- << app()->app_id() << " "
- << request_params[kModuleType].asString());
- extension->SubscribeToInteriorVehicleData(request_params[kModuleType]);
- } else {
- LOG4CXX_DEBUG(logger_,
- "UnsubscribeFromInteriorVehicleData "
- << app()->app_id() << " "
- << request_params[kModuleType].asString());
- extension->UnsubscribeFromInteriorVehicleData(
- request_params[kModuleType]);
- }
- }
-}
-
-bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription(
- const Json::Value& request_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- const bool is_subscribe_present_in_request =
- IsMember(request_params, kSubscribe);
- if (is_subscribe_present_in_request) {
- RCAppExtensionPtr extension = GetAppExtension(app());
- const bool is_app_already_subscribed =
- extension->IsSubscibedToInteriorVehicleData(
- request_params[kModuleType]);
- const bool app_wants_to_subscribe = request_params[kSubscribe].asBool();
- if (!app_wants_to_subscribe && !is_app_already_subscribed) {
- return true;
- }
- return app_wants_to_subscribe && is_app_already_subscribed;
- }
- return false;
-}
-
-void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription(
- Json::Value& request_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- request_params.removeMember(kSubscribe);
-}
-
-std::string GetInteriorVehicleDataRequest::ModuleType(
- const Json::Value& message) {
- return message.get(message_params::kModuleType, "").asString();
-}
-
-} // namespace commands
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc b/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc
deleted file mode 100644
index fccd8392c7..0000000000
--- a/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/on_interior_vehicle_data_notification.h"
-#include <algorithm>
-#include <vector>
-#include "json/json.h"
-#include "utils/make_shared.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/remote_control_plugin.h"
-#include "remote_control/rc_app_extension.h"
-
-namespace remote_control {
-
-namespace commands {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "OnInteriorVehicleDataNotification")
-
-OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module)
- : BaseCommandNotification(message, rc_module) {}
-
-OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() {}
-
-void OnInteriorVehicleDataNotification::Execute() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- Json::Value json;
-
- application_manager::MessagePtr msg = message();
-
- json = MessageHelper::StringToValue(msg->json_message());
-
- Json::Value module_type = ModuleType(json);
-
- typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs;
- AppPtrs apps = service_->GetApplications(rc_module_.GetModuleID());
-
- for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) {
- DCHECK(*it);
- application_manager::Application& app = **it;
-
- RCAppExtensionPtr extension =
- application_manager::AppExtensionPtr::static_pointer_cast<
- RCAppExtension>(app.QueryInterface(rc_module_.GetModuleID()));
- DCHECK(extension);
- LOG4CXX_TRACE(logger_, "Check subscription for " << app.app_id());
- if (extension->IsSubscibedToInteriorVehicleData(module_type)) {
- application_manager::MessagePtr message =
- utils::MakeShared<application_manager::Message>(*msg);
- message->set_message_type(
- application_manager::MessageType::kNotification);
- message->set_protocol_version(app.protocol_version());
- message->set_function_id(functional_modules::ON_INTERIOR_VEHICLE_DATA);
- message->set_function_name(MessageHelper::GetMobileAPIName(
- functional_modules::ON_INTERIOR_VEHICLE_DATA));
- message->set_connection_key(app.app_id());
- NotifyOneApplication(message);
- }
- }
-}
-
-std::string OnInteriorVehicleDataNotification::ModuleType(
- const Json::Value& message) {
- const Json::Value& module_data =
- message.get(message_params::kModuleData, Json::Value(Json::objectValue));
- return module_data.get(message_params::kModuleType, "").asString();
-}
-
-} // namespace commands
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc
deleted file mode 100644
index f18180aa21..0000000000
--- a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/on_remote_control_settings_notification.h"
-#include <algorithm>
-#include <vector>
-#include "json/json.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/remote_control_plugin.h"
-#include "remote_control/rc_app_extension.h"
-#include "functional_module/function_ids.h"
-
-namespace remote_control {
-
-namespace commands {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "OnRemoteControlSettingsNotification");
-
-OnRemoteControlSettingsNotification::OnRemoteControlSettingsNotification(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module)
- : BaseCommandNotification(message, rc_module) {}
-
-void UnsubscribeFromInteriorVehicleDataForAllModules(
- RCAppExtensionPtr extension) {
- LOG4CXX_AUTO_TRACE(logger_);
- const Json::Value climate(enums_value::kClimate);
- extension->UnsubscribeFromInteriorVehicleData(climate);
- const Json::Value radio(enums_value::kRadio);
- extension->UnsubscribeFromInteriorVehicleData(radio);
-}
-
-void OnRemoteControlSettingsNotification::DisallowRCFunctionality() {
- LOG4CXX_AUTO_TRACE(logger_);
- typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
- Apps apps = service_->GetApplications(rc_module_.GetModuleID());
- for (Apps::iterator it = apps.begin(); it != apps.end(); ++it) {
- application_manager::ApplicationSharedPtr app = *it;
- DCHECK(app);
- service_->ChangeNotifyHMILevel(app, mobile_apis::HMILevel::eType::HMI_NONE);
-
- const RCAppExtensionPtr extension =
- application_manager::AppExtensionPtr::static_pointer_cast<
- RCAppExtension>(app->QueryInterface(rc_module_.GetModuleID()));
- if (extension) {
- UnsubscribeFromInteriorVehicleDataForAllModules(extension);
- }
- }
-}
-
-void OnRemoteControlSettingsNotification::Execute() {
- LOG4CXX_AUTO_TRACE(logger_);
- const Json::Value value =
- MessageHelper::StringToValue(message()->json_message());
-
- if (!value.isMember(message_params::kAllowed)) {
- LOG4CXX_DEBUG(logger_,
- "Notification is ignored due to \"allow\" parameter absense");
- LOG4CXX_DEBUG(logger_, "RC Functionality remains unchanged");
- return;
- }
- ResourceAllocationManager& allocation_manager =
- rc_module_.resource_allocation_manager();
- const bool is_allowed = value[message_params::kAllowed].asBool();
- if (is_allowed) {
- hmi_apis::Common_RCAccessMode::eType access_mode =
- hmi_apis::Common_RCAccessMode::INVALID_ENUM;
- LOG4CXX_DEBUG(logger_, "Allowing RC Functionality");
- if (value.isMember(message_params::kAccessMode)) {
- const std::string access_mode_str =
- value.get(message_params::kAccessMode, enums_value::kAutoAllow)
- .asString();
-
- access_mode = MessageHelper::AccessModeFromString(access_mode_str);
- LOG4CXX_DEBUG(logger_, "Setting up access mode : " << access_mode_str);
- } else {
- access_mode = allocation_manager.GetAccessMode();
- LOG4CXX_DEBUG(logger_,
- "No access mode received. Using last known: "
- << MessageHelper::AccessModeToString(access_mode));
- }
- allocation_manager.SetAccessMode(access_mode);
- } else {
- LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality");
- DisallowRCFunctionality();
- allocation_manager.ResetAllAllocations();
- }
-}
-
-} // namespace commands
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc
deleted file mode 100644
index 70fbd9280e..0000000000
--- a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/set_interior_vehicle_data_request.h"
-#include <algorithm>
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "functional_module/function_ids.h"
-#include "json/json.h"
-#include "utils/helpers.h"
-
-namespace remote_control {
-
-namespace commands {
-
-using namespace json_keys;
-using namespace message_params;
-
-namespace {
-std::vector<std::string> GetModuleReadOnlyParams(
- const std::string& module_type) {
- std::vector<std::string> module_ro_params;
- if (enums_value::kClimate == module_type) {
- module_ro_params.push_back(kCurrentTemperature);
- } else if (enums_value::kRadio == module_type) {
- module_ro_params.push_back(kRdsData);
- module_ro_params.push_back(kAvailableHDs);
- module_ro_params.push_back(kSignalStrength);
- module_ro_params.push_back(kSignalChangeThreshold);
- module_ro_params.push_back(kState);
- }
- return module_ro_params;
-}
-
-const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
- std::map<std::string, std::string> mapping;
- // climate
- mapping["fanSpeed"] = "fanSpeedAvailable";
- mapping["currentTemperature"] = "currentTemperatureAvailable";
- mapping["desiredTemperature"] = "desiredTemperatureAvailable";
- mapping["acEnable"] = "acEnableAvailable";
- mapping["circulateAirEnable"] = "circulateAirEnableAvailable";
- mapping["autoModeEnable"] = "autoModeEnableAvailable";
- mapping["defrostZone"] = "defrostZoneAvailable";
- mapping["dualModeEnable"] = "dualModeEnableAvailable";
- mapping["acMaxEnable"] = "acMaxEnableAvailable";
- mapping["ventilationMode"] = "ventilationModeAvailable";
-
- // radio
- mapping["band"] = "radioBandAvailable";
- mapping["frequencyInteger"] = "radioFrequencyAvailable";
- mapping["frequencyFraction"] = "radioFrequencyAvailable";
- mapping["rdsData"] = "rdsDataAvailable";
- mapping["availableHDs"] = "availableHDsAvailable";
- mapping["hdChannel"] = "availableHDsAvailable";
- mapping["signalStrength"] = "signalStrengthAvailable";
- mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable";
- mapping["radioEnable"] = "radioEnableAvailable";
- mapping["state"] = "stateAvailable";
-
- return mapping;
-}
-} // namespace
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "SetInteriorVehicleDataRequest")
-
-SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest(
- const application_manager::MessagePtr& message,
- RemotePluginInterface& rc_module)
- : BaseCommandRequest(message, rc_module) {}
-
-SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {}
-
-bool CheckControlDataByCapabilities(
- const smart_objects::SmartObject& module_caps,
- const Json::Value& control_data) {
- std::map<std::string, std::string> mapping =
- GetModuleDataToCapabilitiesMapping();
- Json::Value::Members control_data_keys = control_data.getMemberNames();
-
- Json::Value::Members::const_iterator it = control_data_keys.begin();
- for (; it != control_data_keys.end(); ++it) {
- const std::string& request_parameter = *it;
- const std::string& caps_key = mapping[request_parameter];
- const smart_objects::SmartObject& capabilities_status = module_caps[0];
- LOG4CXX_DEBUG(logger_,
- "Checking request parameter "
- << request_parameter
- << " with capabilities. Appropriate key is " << caps_key);
- if (!capabilities_status.keyExists(caps_key)) {
- LOG4CXX_DEBUG(logger_,
- "Capability "
- << caps_key
- << " is missed in RemoteControl capabilities");
- return false;
- }
- if (!capabilities_status[caps_key].asBool()) {
- LOG4CXX_DEBUG(logger_,
- "Capability "
- << caps_key
- << " is switched off in RemoteControl capabilities");
- return false;
- }
- }
- return true;
-}
-
-bool CheckIfModuleDataExistInCapabilities(
- const smart_objects::SmartObject& rc_capabilities,
- const Json::Value& module_data) {
- LOG4CXX_AUTO_TRACE(logger_);
- bool is_radio_data_valid = true;
- bool is_climate_data_valid = true;
- if (IsMember(module_data, kRadioControlData)) {
- if (!rc_capabilities.keyExists(strings::kradioControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Radio control capabilities not present");
- return false;
- }
- const smart_objects::SmartObject& radio_caps =
- rc_capabilities[strings::kradioControlCapabilities];
- is_radio_data_valid = CheckControlDataByCapabilities(
- radio_caps, module_data[strings::kRadioControlData]);
- }
- if (IsMember(module_data, kClimateControlData)) {
- if (!rc_capabilities.keyExists(strings::kclimateControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Climate control capabilities not present");
- return false;
- }
- const smart_objects::SmartObject& climate_caps =
- rc_capabilities[strings::kclimateControlCapabilities];
- is_climate_data_valid = CheckControlDataByCapabilities(
- climate_caps, module_data[strings::kClimateControlData]);
- }
-
- return is_radio_data_valid && is_climate_data_valid;
-}
-
-void SetInteriorVehicleDataRequest::Execute() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- Json::Value request_params =
- MessageHelper::StringToValue(message_->json_message());
- const Json::Value module_data = request_params[kModuleData];
- const std::string module_type = module_data[kModuleType].asString();
- bool module_type_and_data_match = true;
-
- if (enums_value::kRadio == module_type) {
- module_type_and_data_match = !IsMember(module_data, kClimateControlData);
- }
-
- if (enums_value::kClimate == module_type) {
- module_type_and_data_match = !IsMember(module_data, kRadioControlData);
- }
-
- if (module_type_and_data_match) {
- const smart_objects::SmartObject* capabilities =
- service()->GetRCCapabilities();
- if (capabilities &&
- !CheckIfModuleDataExistInCapabilities(*capabilities, module_data)) {
- LOG4CXX_WARN(logger_, "Accessing not supported module data");
- SendResponse(false,
- result_codes::kUnsupportedResource,
- "Accessing not supported module data");
- return;
- }
- if (AreAllParamsReadOnly(request_params)) {
- LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!");
- SendResponse(false,
- result_codes::kReadOnly,
- "All request params in module type are READ ONLY!");
- return;
- }
- if (AreReadOnlyParamsPresent(request_params)) {
- LOG4CXX_DEBUG(logger_, "Request module type has READ ONLY parameters");
- LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameters... ");
- CutOffReadOnlyParams(request_params);
- }
- application_manager::MessagePtr hmi_request = CreateHmiRequest(
- functional_modules::hmi_api::set_interior_vehicle_data, request_params);
- service()->RemoveHMIFakeParameters(hmi_request);
- SendMessageToHMI(hmi_request);
- } else {
- LOG4CXX_WARN(logger_, "Request module type & data mismatch!");
- SendResponse(false,
- result_codes::kInvalidData,
- "Request module type & data mismatch!");
- }
-}
-
-AcquireResult::eType SetInteriorVehicleDataRequest::AcquireResource(
- const Json::Value& message) {
- return rc_module_.resource_allocation_manager().AcquireResource(
- ModuleType(message), app()->app_id());
-}
-
-bool SetInteriorVehicleDataRequest::IsResourceFree(
- const std::string& module_type) const {
- return rc_module_.resource_allocation_manager().IsResourceFree(module_type);
-}
-
-void SetInteriorVehicleDataRequest::SetResourceState(
- const Json::Value& message, const ResourceState::eType state) {
- const std::string& module_type = ModuleType(message);
- const uint32_t app_id = app()->app_id();
-
- ResourceAllocationManager& allocation_manager =
- rc_module_.resource_allocation_manager();
-
- allocation_manager.SetResourceState(module_type, app_id, state);
-}
-
-bool SetInteriorVehicleDataRequest::AreReadOnlyParamsPresent(
- const Json::Value& request_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::vector<std::string> module_type_params = ControlData(request_params);
- std::vector<std::string>::iterator it = module_type_params.begin();
- std::vector<std::string> ro_params =
- GetModuleReadOnlyParams(ModuleType(request_params));
- for (; it != module_type_params.end(); ++it) {
- if (helpers::in_range(ro_params, *it)) {
- return true;
- }
- }
- return false;
-}
-
-void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
- Json::Value& request_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::vector<std::string> module_type_params = ControlData(request_params);
- std::vector<std::string>::iterator it = module_type_params.begin();
- const std::string module_type = ModuleType(request_params);
- std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
- for (; it != module_type_params.end(); ++it) {
- if (helpers::in_range(ro_params, *it)) {
- if (enums_value::kClimate == module_type) {
- request_params[message_params::kModuleData]
- [message_params::kClimateControlData].removeMember(*it);
- LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << *it);
- } else if (enums_value::kRadio == module_type) {
- request_params[message_params::kModuleData]
- [message_params::kRadioControlData].removeMember(*it);
- LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << *it);
- }
- }
- }
-}
-
-bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly(
- const Json::Value& request_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::vector<std::string> module_type_params = ControlData(request_params);
- std::vector<std::string>::iterator it = module_type_params.begin();
- std::vector<std::string> ro_params =
- GetModuleReadOnlyParams(ModuleType(request_params));
- for (; it != module_type_params.end(); ++it) {
- if (!helpers::in_range(ro_params, *it)) {
- return false;
- }
- }
- return true;
-}
-
-void SetInteriorVehicleDataRequest::OnEvent(
- const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
- event) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(
- (functional_modules::hmi_api::set_interior_vehicle_data == event.id()));
-
- application_manager::Message& hmi_response = *(event.event_message());
- if (application_manager::MessageValidationResult::SUCCESS !=
- service()->ValidateMessageBySchema(hmi_response)) {
- SendResponse(false, result_codes::kGenericError, "");
- return;
- }
-
- LOG4CXX_DEBUG(logger_, "HMI response is valid");
- const Json::Value value =
- MessageHelper::StringToValue(hmi_response.json_message());
-
- std::string result_code;
- std::string info;
-
- const bool is_response_successful = ParseResultCode(value, result_code, info);
-
- if (is_response_successful) {
- response_params_[message_params::kModuleData] =
- value[json_keys::kResult][message_params::kModuleData];
- }
-
- SendResponse(is_response_successful, result_code.c_str(), info);
-}
-
-std::string SetInteriorVehicleDataRequest::ModuleType(
- const Json::Value& message) {
- const Json::Value& module_data =
- message.get(message_params::kModuleData, Json::Value(Json::objectValue));
- return module_data.get(message_params::kModuleType, "").asString();
-}
-
-std::vector<std::string> SetInteriorVehicleDataRequest::ControlData(
- const Json::Value& message) {
- Json::Value data =
- message.get(message_params::kModuleData, Json::Value(Json::objectValue));
- std::string module = ModuleType(message);
- Json::Value params;
- if (module == enums_value::kRadio) {
- params = data.get(message_params::kRadioControlData,
- Json::Value(Json::objectValue));
- }
- if (module == enums_value::kClimate) {
- params = data.get(message_params::kClimateControlData,
- Json::Value(Json::objectValue));
- }
- return params.getMemberNames();
-}
-
-} // namespace commands
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc
deleted file mode 100644
index 140e0a977a..0000000000
--- a/src/components/remote_control/src/message_helper.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_module_constants.h"
-#include "utils/make_shared.h"
-
-namespace remote_control {
-using functional_modules::RCFunctionID;
-namespace {
-std::map<RCFunctionID, std::string> GenerateAPINames() {
- std::map<RCFunctionID, std::string> result;
- result.insert(std::make_pair<RCFunctionID, std::string>(
- RCFunctionID::BUTTON_PRESS, "ButtonPress"));
- result.insert(std::make_pair<RCFunctionID, std::string>(
- RCFunctionID::GET_INTERIOR_VEHICLE_DATA, "GetInteriorVehicleData"));
- result.insert(std::make_pair<RCFunctionID, std::string>(
- RCFunctionID::SET_INTERIOR_VEHICLE_DATA, "SetInteriorVehicleData"));
- result.insert(std::make_pair<RCFunctionID, std::string>(
- RCFunctionID::ON_INTERIOR_VEHICLE_DATA, "OnInteriorVehicleData"));
- result.insert(std::make_pair<RCFunctionID, std::string>(
- RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSettings"));
- return result;
-}
-
-std::map<std::string, hmi_apis::Common_RCAccessMode::eType> access_modes{
- {enums_value::kAutoAllow, hmi_apis::Common_RCAccessMode::AUTO_ALLOW},
- {enums_value::kAutoDeny, hmi_apis::Common_RCAccessMode::AUTO_DENY},
- {enums_value::kAskDriver, hmi_apis::Common_RCAccessMode::ASK_DRIVER}};
-}
-
-const std::map<RCFunctionID, std::string> MessageHelper::kMobileAPINames =
- GenerateAPINames();
-
-const std::string MessageHelper::GetMobileAPIName(RCFunctionID func_id) {
- std::map<RCFunctionID, std::string>::const_iterator it =
- kMobileAPINames.find(func_id);
- if (kMobileAPINames.end() != it) {
- return it->second;
- } else {
- return "";
- }
-}
-
-std::string MessageHelper::ValueToString(const Json::Value& value) {
- Json::FastWriter writer;
-
- return writer.write(value);
-}
-
-Json::Value MessageHelper::StringToValue(const std::string& string) {
- Json::Reader reader;
- Json::Value json;
-
- return reader.parse(string, json) ? json
- : Json::Value(Json::ValueType::nullValue);
-}
-
-bool IsMember(const Json::Value& value, const std::string& key) {
- if (!value.isObject()) {
- return false;
- }
-
- return value.isMember(key);
-}
-
-application_manager::MessagePtr MessageHelper::CreateHmiRequest(
- const char* function_id,
- const uint32_t hmi_app_id,
- const Json::Value& message_params,
- RemotePluginInterface& rc_module) {
- using namespace json_keys;
- Json::Value msg;
-
- msg[json_keys::kId] = rc_module.service()->GetNextCorrelationID();
-
- msg[json_keys::kJsonrpc] = "2.0";
- msg[json_keys::kMethod] = function_id;
- if (!message_params.isNull()) {
- msg[json_keys::kParams] = message_params;
- }
-
- msg[json_keys::kParams][json_keys::kAppId] = hmi_app_id;
-
- Json::FastWriter writer;
- application_manager::MessagePtr message_to_send =
- utils::MakeShared<application_manager::Message>(
- application_manager::Message(
- protocol_handler::MessagePriority::kDefault));
- message_to_send->set_protocol_version(
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
- message_to_send->set_correlation_id(msg[json_keys::kId].asInt());
- message_to_send->set_function_name(msg[json_keys::kMethod].asString());
- std::string json_msg = writer.write(msg);
- message_to_send->set_json_message(json_msg);
- message_to_send->set_message_type(application_manager::MessageType::kRequest);
-
- return message_to_send;
-}
-
-hmi_apis::Common_RCAccessMode::eType MessageHelper::AccessModeFromString(
- const std::string& access_mode) {
- std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
- mode = access_modes.find(access_mode);
- return access_modes.end() != mode
- ? mode->second
- : hmi_apis::Common_RCAccessMode::INVALID_ENUM;
-}
-
-std::string MessageHelper::AccessModeToString(
- const hmi_apis::Common_RCAccessMode::eType access_mode) {
- std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
- it = access_modes.begin();
- for (; access_modes.end() != it; ++it) {
- if (access_mode == it->second) {
- return it->first;
- }
- }
- const std::string error = "UNKNOW_ACCESS_MODE";
- DCHECK_OR_RETURN(false, error);
- return error;
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/module_helper.cc b/src/components/remote_control/src/module_helper.cc
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/components/remote_control/src/module_helper.cc
+++ /dev/null
diff --git a/src/components/remote_control/src/rc_app_extension.cc b/src/components/remote_control/src/rc_app_extension.cc
deleted file mode 100644
index 3431a713f9..0000000000
--- a/src/components/remote_control/src/rc_app_extension.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/rc_app_extension.h"
-
-namespace remote_control {
-RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid)
- : AppExtension(uid) {}
-
-void RCAppExtension::SubscribeToInteriorVehicleData(
- const Json::Value& module_type) {
- subscribed_interior_vehicle_data_.insert(module_type);
-}
-
-void RCAppExtension::UnsubscribeFromInteriorVehicleData(
- const Json::Value& module_type) {
- subscribed_interior_vehicle_data_.erase(module_type);
-}
-
-void RCAppExtension::UnsubscribeFromInteriorVehicleData() {
- subscribed_interior_vehicle_data_.clear();
-}
-
-bool RCAppExtension::IsSubscibedToInteriorVehicleData(
- const Json::Value& module_type) {
- std::set<Json::Value>::iterator it =
- subscribed_interior_vehicle_data_.find(module_type);
-
- return (it != subscribed_interior_vehicle_data_.end());
-}
-
-RCAppExtension::~RCAppExtension() {}
-} // namespace remote_control
diff --git a/src/components/remote_control/src/rc_command_factory.cc b/src/components/remote_control/src/rc_command_factory.cc
deleted file mode 100644
index 93b90b64ac..0000000000
--- a/src/components/remote_control/src/rc_command_factory.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "remote_control/rc_command_factory.h"
-#include "functional_module/function_ids.h"
-#include "remote_control/commands/get_interior_vehicle_data_request.h"
-#include "remote_control/commands/set_interior_vehicle_data_request.h"
-#include "remote_control/commands/button_press_request.h"
-#include "remote_control/commands/on_interior_vehicle_data_notification.h"
-#include "remote_control/commands/on_remote_control_settings_notification.h"
-
-namespace remote_control {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl")
-
-using functional_modules::RCFunctionID;
-
-utils::SharedPtr<commands::Command> RCCommandFactory::CreateCommand(
- const application_manager::MessagePtr& msg,
- RemotePluginInterface& rc_module) {
- switch (msg->function_id()) {
- case RCFunctionID::GET_INTERIOR_VEHICLE_DATA: {
- return utils::MakeShared<commands::GetInteriorVehicleDataRequest>(
- msg, rc_module);
- break;
- }
- case RCFunctionID::SET_INTERIOR_VEHICLE_DATA: {
- return utils::MakeShared<commands::SetInteriorVehicleDataRequest>(
- msg, rc_module);
- break;
- }
- case RCFunctionID::BUTTON_PRESS: {
- return utils::MakeShared<commands::ButtonPressRequest>(msg, rc_module);
- break;
- }
- case RCFunctionID::ON_INTERIOR_VEHICLE_DATA: {
- return utils::MakeShared<commands::OnInteriorVehicleDataNotification>(
- msg, rc_module);
- break;
- }
- case RCFunctionID::ON_REMOTE_CONTROL_SETTINGS: {
- return utils::MakeShared<commands::OnRemoteControlSettingsNotification>(
- msg, rc_module);
- break;
- }
- default: {
- utils::SharedPtr<commands::Command> invalid_command;
- LOG4CXX_DEBUG(logger_,
- "RSDL unable to proces function " << msg->function_id());
- return invalid_command;
- }
- }
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/remote_control_event.cc b/src/components/remote_control/src/remote_control_event.cc
deleted file mode 100644
index e4f887ffc6..0000000000
--- a/src/components/remote_control/src/remote_control_event.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/remote_control_event.h"
-
-namespace remote_control {
-
-RCPluginEvent::RCPluginEvent(application_manager::MessagePtr& message,
- const std::string& id)
- : rc_event_engine::Event<application_manager::MessagePtr, std::string>(
- message, id) {}
-
-RCPluginEvent::~RCPluginEvent() {}
-
-int32_t RCPluginEvent::event_message_function_id() const {
- return event_message_->function_id();
-}
-
-int32_t RCPluginEvent::event_message_correlation_id() const {
- return event_message_->correlation_id();
-}
-
-int32_t RCPluginEvent::event_message_type() const {
- return event_message_->type();
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc
deleted file mode 100644
index c885d724ad..0000000000
--- a/src/components/remote_control/src/remote_control_plugin.cc
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/remote_control_plugin.h"
-#include "remote_control/rc_command_factory.h"
-#include "remote_control/remote_control_event.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/message_helper.h"
-#include "utils/logger.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-#include "utils/make_shared.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace remote_control {
-
-using functional_modules::ProcessResult;
-using functional_modules::GenericModule;
-using functional_modules::PluginInfo;
-using functional_modules::RCFunctionID;
-namespace hmi_api = functional_modules::hmi_api;
-
-using namespace json_keys;
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl");
-
-EXPORT_FUNCTION_IMPL(remote_control::RemoteControlPlugin);
-
-RemoteControlPlugin::RemoteControlPlugin()
- : is_scan_started_(false), resource_allocation_manager_(*this) {
- plugin_info_.name = "RemoteControlPlugin";
- plugin_info_.version = 1;
- SubscribeOnFunctions();
-}
-
-void RemoteControlPlugin::SubscribeOnFunctions() {
- plugin_info_.rc_function_list.push_back(RCFunctionID::BUTTON_PRESS);
- plugin_info_.rc_function_list.push_back(
- RCFunctionID::GET_INTERIOR_VEHICLE_DATA);
- plugin_info_.rc_function_list.push_back(
- RCFunctionID::SET_INTERIOR_VEHICLE_DATA);
- plugin_info_.rc_function_list.push_back(
- RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
-
- plugin_info_.hmi_function_list.push_back(hmi_api::get_interior_vehicle_data);
- plugin_info_.hmi_function_list.push_back(hmi_api::set_interior_vehicle_data);
- plugin_info_.hmi_function_list.push_back(hmi_api::on_interior_vehicle_data);
- plugin_info_.hmi_function_list.push_back(hmi_api::button_press);
- plugin_info_.hmi_function_list.push_back(hmi_api::get_user_consent);
- plugin_info_.hmi_function_list.push_back(hmi_api::on_remote_control_settings);
-}
-
-RemoteControlPlugin::~RemoteControlPlugin() {
- RemoveAppExtensions();
-}
-
-functional_modules::PluginInfo RemoteControlPlugin::GetPluginInfo() const {
- return plugin_info_;
-}
-
-const std::string ExtractFunctionAndAddMetadata(
- const Json::Value& value, application_manager::Message& out_msg) {
- if (value.isMember(json_keys::kMethod)) {
- const std::string& function_name =
- value.get(json_keys::kMethod, "").asCString();
-
- // Existence of method name must be guaranteed by plugin manager
- DCHECK_OR_RETURN(!function_name.empty(), "");
-
- if (value.isMember(json_keys::kId)) {
- out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt());
- out_msg.set_message_type(application_manager::MessageType::kRequest);
- } else {
- out_msg.set_message_type(application_manager::MessageType::kNotification);
- }
- return function_name;
- }
-
- if (value.isMember(json_keys::kResult)) {
- const Json::Value& result = value.get(json_keys::kResult, Json::Value());
- const std::string& function_name =
- result.get(json_keys::kMethod, "").asCString();
- out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt());
-
- // Existence of method name must be guaranteed by plugin manager
- DCHECK_OR_RETURN(!function_name.empty(), "");
-
- out_msg.set_message_type(application_manager::MessageType::kResponse);
- return function_name;
- }
-
- if (value.isMember(json_keys::kError)) {
- const Json::Value& error = value.get(json_keys::kError, Json::Value());
- const Json::Value& data = error.get(json_keys::kData, Json::Value());
- const std::string& function_name =
- data.get(json_keys::kMethod, "").asCString();
-
- // Existence of method name must be guaranteed by plugin manager
- DCHECK_OR_RETURN(!function_name.empty(), "");
-
- out_msg.set_message_type(application_manager::MessageType::kErrorResponse);
- out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt());
- return function_name;
- }
- return std::string();
-}
-
-ProcessResult RemoteControlPlugin::ProcessMessage(
- application_manager::MessagePtr msg) {
- DCHECK_OR_RETURN(msg, ProcessResult::FAILED);
-
- const std::string& function_name = MessageHelper::GetMobileAPIName(
- static_cast<functional_modules::RCFunctionID>(msg->function_id()));
-
- LOG4CXX_DEBUG(logger_, "Function name to set : " << function_name);
- msg->set_function_name(function_name);
-
- LOG4CXX_DEBUG(logger_, "Mobile message: " << msg->json_message());
-
- request_controller::MobileRequestPtr command(
- RCCommandFactory::CreateCommand(msg, *this));
- if (command) {
- request_controller_.AddRequest(msg->correlation_id(), command);
- command->Run();
- } else {
- return ProcessResult::CANNOT_PROCESS;
- }
-
- return ProcessResult::PROCESSED;
-}
-
-ProcessResult RemoteControlPlugin::ProcessHMIMessage(
- application_manager::MessagePtr msg) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- Json::Value value;
- Json::Reader reader;
- reader.parse(msg->json_message(), value);
- LOG4CXX_TRACE(logger_, "Process " << msg->json_message());
- const std::string& function_name = ExtractFunctionAndAddMetadata(value, *msg);
-
- // Existence of method name must be guaranteed by plugin manager
- DCHECK_OR_RETURN(!function_name.empty(), ProcessResult::FAILED);
-
- LOG4CXX_DEBUG(logger_, "Process " << function_name);
-
- switch (msg->type()) {
- case application_manager::MessageType::kResponse:
- case application_manager::MessageType::kErrorResponse: {
- RCPluginEvent event(msg, function_name);
- LOG4CXX_DEBUG(logger_, "Response received");
- event_dispatcher_.raise_event(event);
- return ProcessResult::PROCESSED;
- }
- case application_manager::MessageType::kRequest:
- case application_manager::MessageType::kNotification: {
- if (hmi_api::on_interior_vehicle_data == function_name) {
- msg->set_function_id(functional_modules::ON_INTERIOR_VEHICLE_DATA);
- }
- if (hmi_api::on_remote_control_settings == function_name) {
- msg->set_function_id(functional_modules::ON_REMOTE_CONTROL_SETTINGS);
- }
- const application_manager::MessageValidationResult validation_result =
- service()->ValidateMessageBySchema(*msg);
- utils::SharedPtr<commands::Command> command =
- RCCommandFactory::CreateCommand(msg, *this);
- if ((validation_result ==
- application_manager::MessageValidationResult::SUCCESS) &&
- command) {
- command->Run();
- return ProcessResult::PROCESSED;
- }
- LOG4CXX_DEBUG(logger_, "Message validation failed");
- break;
- }
- default: { LOG4CXX_DEBUG(logger_, "Unknown message type"); }
- }
- return ProcessResult::CANNOT_PROCESS;
-}
-
-void RemoteControlPlugin::SendHmiStatusNotification(
- application_manager::ApplicationSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager::MessagePtr msg = new application_manager::Message(
- protocol_handler::MessagePriority::kDefault);
- Json::Value msg_params;
-
- msg->set_function_id(mobile_apis::FunctionID::OnHMIStatusID);
- msg->set_message_type(application_manager::MessageType::kNotification);
-
- msg->set_connection_key(app->app_id());
- msg->set_protocol_version(app->protocol_version());
-
- msg_params["hmiLevel"] = static_cast<uint32_t>(app->hmi_level());
-
- msg_params["audioStreamingState"] =
- static_cast<uint32_t>(app->audio_streaming_state());
-
- msg_params["systemContext"] = static_cast<uint32_t>(app->system_context());
-
- msg->set_json_message(MessageHelper::ValueToString(msg_params));
-
- service()->SendMessageToMobile(msg);
-}
-
-void RemoteControlPlugin::SendResponseToMobile(
- application_manager::MessagePtr msg) {
- LOG4CXX_DEBUG(logger_, "Response to mobile: " << msg->json_message());
- service()->SendMessageToMobile(msg);
- request_controller_.DeleteRequest(msg->correlation_id());
-}
-
-void RemoteControlPlugin::SendTimeoutResponseToMobile(
- application_manager::MessagePtr msg) {
- LOG4CXX_DEBUG(
- logger_,
- "Timeout is expired. Response to mobile: " << msg->json_message());
- service()->SendMessageToMobile(msg);
-}
-
-void RemoteControlPlugin::RemoveAppExtensions() {
- std::vector<application_manager::ApplicationSharedPtr> applications =
- service()->GetApplications(GetModuleID());
-
- std::vector<application_manager::ApplicationSharedPtr>::iterator it =
- applications.begin();
-
- for (; it != applications.end(); ++it) {
- application_manager::ApplicationSharedPtr app = *it;
- if (app) {
- app->RemoveExtension(GetModuleID());
- }
- }
-}
-
-void RemoteControlPlugin::RemoveAppExtension(uint32_t app_id) {
- application_manager::ApplicationSharedPtr app =
- service()->GetApplication(app_id);
-
- if (app) {
- app->RemoveExtension(GetModuleID());
- }
-}
-
-bool RemoteControlPlugin::IsAppForPlugin(
- application_manager::ApplicationSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager::AppExtensionPtr app_extension =
- app->QueryInterface(GetModuleID());
- if (app_extension) {
- return true;
- }
-
- if (service()->IsRemoteControlApplication(app)) {
- RCAppExtensionPtr rc_app_extension = new RCAppExtension(GetModuleID());
- app->AddExtension(rc_app_extension);
- return true;
- }
- return false;
-}
-
-void RemoteControlPlugin::OnAppHMILevelChanged(
- application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType) {
- LOG4CXX_DEBUG(logger_,
- "RSDL application " << app->name().AsMBString()
- << " has changed hmi level to "
- << app->hmi_level());
- service()->NotifyHMIAboutHMILevel(app, app->hmi_level());
-}
-
-void RemoteControlPlugin::OnPluginServiceChanged() {
- LOG4CXX_AUTO_TRACE(logger_);
- const functional_modules::TimeUnit timeout_msec =
- service()->GetSettings().default_timeout();
- request_controller_.SetRequestTimeout(timeout_msec / 1000);
-}
-
-void RemoteControlPlugin::set_service(application_manager::ServicePtr service) {
- RemotePluginInterface::set_service(service);
- OnPluginServiceChanged();
-}
-
-RCEventDispatcher& RemoteControlPlugin::event_dispatcher() {
- return event_dispatcher_;
-}
-
-ResourceAllocationManager& RemoteControlPlugin::resource_allocation_manager() {
- return resource_allocation_manager_;
-}
-
-void RemoteControlPlugin::OnApplicationEvent(
- functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (false == service()->IsRemoteControlApplication(application)) {
- LOG4CXX_DEBUG(logger_,
- "Application " << application->app_id()
- << " has no remote control functionality."
- << " Event will be ignored for RC plugin");
- return;
- }
- resource_allocation_manager_.OnApplicationEvent(event, application);
-}
-
-void RemoteControlPlugin::OnPolicyEvent(functional_modules::PolicyEvent event) {
- LOG4CXX_AUTO_TRACE(logger_);
- resource_allocation_manager_.OnPolicyEvent(event);
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/request_controller.cc b/src/components/remote_control/src/request_controller.cc
deleted file mode 100644
index 9ffc639898..0000000000
--- a/src/components/remote_control/src/request_controller.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/request_controller.h"
-#include "json/json.h"
-#include "utils/logger.h"
-
-namespace remote_control {
-namespace request_controller {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RCRequestController")
-
-RequestController::RequestController() {
- timer_.AddObserver(this);
- time_director_.RegisterTimer(timer_);
-}
-
-RequestController::~RequestController() {
- time_director_.UnregisterTimer(timer_);
- timer_.RemoveObserver(this);
-}
-
-void RequestController::AddRequest(const uint32_t mobile_correlation_id,
- MobileRequestPtr request) {
- // TODO(VS) Research and fix be problem with overlap correlation ids from two
- // different apllications(on two different mobile devices)
- sync_primitives::AutoLock lock(mobile_request_lock_);
- LOG4CXX_DEBUG(logger_,
- "Add request with correlation_id: " << mobile_correlation_id);
- mobile_request_list_[mobile_correlation_id] = request;
- // TODO(VS): add app id
- timer_.AddTrackable(TrackableMessage(0, mobile_correlation_id));
- time_director_.ResetTimer(timer_);
-}
-
-void RequestController::DeleteRequest(const uint32_t& mobile_correlation_id) {
- sync_primitives::AutoLock lock(mobile_request_lock_);
- LOG4CXX_DEBUG(
- logger_, "Delete request with correlation_id: " << mobile_correlation_id);
- mobile_request_list_.erase(mobile_correlation_id);
- // TODO(VS): add app id
- timer_.RemoveTrackable(TrackableMessage(0, mobile_correlation_id));
-}
-
-void RequestController::OnTimeoutTriggered(const TrackableMessage& expired) {
- sync_primitives::AutoLock lock(mobile_request_lock_);
- LOG4CXX_DEBUG(logger_,
- "Timeout is expired for request with correlation_id: "
- << expired.correlation_id());
- std::map<correlation_id, MobileRequestPtr>::iterator it =
- mobile_request_list_.find(expired.correlation_id());
- if (mobile_request_list_.end() == it) {
- // no corresponding request found, error.
- return;
- }
- it->second->OnTimeout();
- mobile_request_list_.erase(it);
-}
-
-void RequestController::SetRequestTimeout(
- const functional_modules::TimeUnit timeout_seconds) {
- LOG4CXX_DEBUG(logger_, "RC request timeout is set to " << timeout_seconds);
- timer_.set_period(timeout_seconds);
-}
-
-} // namespace request_controller
-} // namespace remote_control
diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc
deleted file mode 100644
index 233cc79764..0000000000
--- a/src/components/remote_control/src/resource_allocation_manager_impl.cc
+++ /dev/null
@@ -1,377 +0,0 @@
-#include "remote_control/resource_allocation_manager_impl.h"
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "remote_control/rc_module_constants.h"
-#include "json/json.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_app_extension.h"
-
-namespace remote_control {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
-
-ResourceAllocationManagerImpl::ResourceAllocationManagerImpl(
- RemotePluginInterface& rc_plugin)
- : current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW)
- , rc_plugin_(rc_plugin) {}
-
-ResourceAllocationManagerImpl::~ResourceAllocationManagerImpl() {}
-
-AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource(
- const std::string& module_type, const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- const application_manager::ApplicationSharedPtr acquiring_app =
- rc_plugin_.service()->GetApplication(app_id);
- if (!acquiring_app) {
- LOG4CXX_WARN(logger_, "App with app_id: " << app_id << "does not exist!");
- return AcquireResult::IN_USE;
- }
-
- sync_primitives::AutoLock lock(allocated_resources_lock_);
- const AllocatedResources::const_iterator allocated_it =
- allocated_resources_.find(module_type);
- if (allocated_resources_.end() == allocated_it) {
- allocated_resources_[module_type] = app_id;
- LOG4CXX_DEBUG(logger_,
- "Resource is not acquired yet. "
- << "App: " << app_id << " is allowed to acquire "
- << module_type);
- return AcquireResult::ALLOWED;
- }
-
- if (app_id == allocated_resources_[module_type]) {
- LOG4CXX_DEBUG(logger_,
- "App: " << app_id << " is already acquired resource "
- << module_type);
- return AcquireResult::ALLOWED;
- }
-
- if (IsModuleTypeRejected(module_type, app_id)) {
- LOG4CXX_DEBUG(logger_,
- "Driver disallowed app: " << app_id << " to acquire "
- << module_type);
- return AcquireResult::REJECTED;
- }
-
- const mobile_apis::HMILevel::eType acquiring_app_hmi_level =
- acquiring_app->hmi_level();
-
- if (mobile_apis::HMILevel::HMI_FULL != acquiring_app_hmi_level) {
- LOG4CXX_DEBUG(
- logger_,
- "Aquiring resources is not allowed in HMI level: "
- << application_manager::MessageHelper::StringifiedHMILevel(
- acquiring_app_hmi_level) << ". App: " << app_id
- << " is disallowed to acquire " << module_type);
- return AcquireResult::REJECTED;
- }
-
- switch (current_access_mode_) {
- case hmi_apis::Common_RCAccessMode::AUTO_DENY: {
- LOG4CXX_DEBUG(logger_,
- "Current access_mode is AUTO_DENY. "
- << "App: " << app_id << " is disallowed to acquire "
- << module_type);
- return AcquireResult::IN_USE;
- }
- case hmi_apis::Common_RCAccessMode::ASK_DRIVER: {
- LOG4CXX_DEBUG(logger_,
- "Current access_mode is ASK_DRIVER. "
- "Driver confirmation is required for app: "
- << app_id << " to acquire " << module_type);
- return AcquireResult::ASK_DRIVER;
- }
- case hmi_apis::Common_RCAccessMode::AUTO_ALLOW: {
- LOG4CXX_DEBUG(logger_,
- "Current access_mode is AUTO_ALLOW. "
- << "App: " << app_id << " is allowed to acquire "
- << module_type);
-
- allocated_resources_[module_type] = app_id;
- return AcquireResult::ALLOWED;
- }
- default: { DCHECK_OR_RETURN(false, AcquireResult::IN_USE); }
- }
-}
-
-void ResourceAllocationManagerImpl::ReleaseResource(
- const std::string& module_type, const uint32_t application_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Release " << module_type << " by " << application_id);
- AllocatedResources::const_iterator allocation =
- allocated_resources_.find(module_type);
- if (allocated_resources_.end() == allocation) {
- LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is not allocated.");
- return;
- }
-
- if (application_id != allocation->second) {
- LOG4CXX_DEBUG(logger_,
- "Resource " << module_type
- << " is allocated by different application "
- << allocation->second);
- return;
- }
-
- allocated_resources_.erase(allocation);
- LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is released.");
- return;
-}
-
-void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() {
- typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
- Apps app_list =
- rc_plugin_.service()->GetApplications(rc_plugin_.GetModuleID());
- Apps::const_iterator app = app_list.begin();
- for (; app_list.end() != app; ++app) {
- application_manager::ApplicationSharedPtr app_ptr = *app;
- const uint32_t application_id = app_ptr->app_id();
- Resources acquired_modules = GetAcquiredResources(application_id);
- std::sort(acquired_modules.begin(), acquired_modules.end());
-
- Resources allowed_modules;
- rc_plugin_.service()->GetModuleTypes((*app)->policy_app_id(),
- &allowed_modules);
- std::sort(allowed_modules.begin(), allowed_modules.end());
-
- LOG4CXX_DEBUG(logger_,
- "Acquired modules: " << acquired_modules.size()
- << " , allowed modules: "
- << allowed_modules.size());
-
- Resources disallowed_modules;
- std::set_difference(acquired_modules.begin(),
- acquired_modules.end(),
- allowed_modules.begin(),
- allowed_modules.end(),
- std::back_inserter(disallowed_modules));
-
- RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
- Resources::const_iterator module = disallowed_modules.begin();
- for (; disallowed_modules.end() != module; ++module) {
- ReleaseResource(*module, application_id);
- if (rc_extention) {
- rc_extention->UnsubscribeFromInteriorVehicleData(Json::Value(*module));
- }
- }
- }
-}
-
-RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention(
- application_manager::ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- RCAppExtensionPtr rc_app_extension;
- if (!application) {
- return rc_app_extension;
- }
-
- application_manager::AppExtensionPtr app_extension =
- application->QueryInterface(rc_plugin_.GetModuleID());
- if (!app_extension) {
- return rc_app_extension;
- }
-
- rc_app_extension =
- application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
- app_extension);
-
- return rc_app_extension;
-}
-
-void ResourceAllocationManagerImpl::RemoveAppsSubscriptions(const Apps& apps) {
- LOG4CXX_AUTO_TRACE(logger_);
- Apps::const_iterator app = apps.begin();
- for (; apps.end() != app; ++app) {
- application_manager::ApplicationSharedPtr app_ptr = *app;
- if (!app_ptr) {
- continue;
- }
- RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
- if (rc_extention) {
- rc_extention->UnsubscribeFromInteriorVehicleData();
- }
- }
-}
-
-std::vector<std::string> ResourceAllocationManagerImpl::GetAcquiredResources(
- const uint32_t application_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- Resources allocated_resources;
- AllocatedResources::const_iterator allocation = allocated_resources_.begin();
- for (; allocated_resources_.end() != allocation; ++allocation) {
- if (application_id == allocation->second) {
- allocated_resources.push_back(allocation->first);
- }
- }
-
- LOG4CXX_DEBUG(logger_,
- "Application " << application_id << " acquired "
- << allocated_resources.size()
- << " resource(s).");
-
- return allocated_resources;
-}
-
-void ResourceAllocationManagerImpl::SetResourceState(
- const std::string& module_type,
- const uint32_t app_id,
- const ResourceState::eType state) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "Setting state for " << module_type << " by app_id " << app_id
- << " to state " << state);
- {
- sync_primitives::AutoLock lock(allocated_resources_lock_);
- const AllocatedResources::const_iterator allocated_it =
- allocated_resources_.find(module_type);
-
- const bool acquired = allocated_resources_.end() != allocated_it;
- if (acquired) {
- LOG4CXX_DEBUG(logger_,
- "Resource " << module_type << " is already acquired."
- << " Owner application id is "
- << allocated_it->second
- << " Changing application id is " << app_id);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Resource " << module_type << " is not acquired yet");
- }
- }
-
- sync_primitives::AutoLock lock(resources_state_lock_);
- resources_state_[module_type] = state;
- LOG4CXX_DEBUG(logger_, "Resource " << module_type << " got state " << state);
-}
-
-bool ResourceAllocationManagerImpl::IsResourceFree(
- const std::string& module_type) const {
- LOG4CXX_AUTO_TRACE(logger_);
-
- sync_primitives::AutoLock lock(resources_state_lock_);
- const ResourcesState::const_iterator resource =
- resources_state_.find(module_type);
-
- if (resources_state_.end() == resource) {
- LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is free.");
- return true;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Resource " << module_type << " state is " << resource->second);
-
- return ResourceState::FREE == resource->second;
-}
-
-void ResourceAllocationManagerImpl::SetAccessMode(
- const hmi_apis::Common_RCAccessMode::eType access_mode) {
- if (hmi_apis::Common_RCAccessMode::ASK_DRIVER != access_mode) {
- sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
- rejected_resources_for_application_.clear();
- }
- current_access_mode_ = access_mode;
-}
-
-hmi_apis::Common_RCAccessMode::eType
-ResourceAllocationManagerImpl::GetAccessMode() const {
- return current_access_mode_;
-}
-
-void ResourceAllocationManagerImpl::ForceAcquireResource(
- const std::string& module_type, const uint32_t app_id) {
- LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type);
- sync_primitives::AutoLock lock(allocated_resources_lock_);
- allocated_resources_[module_type] = app_id;
-}
-
-bool ResourceAllocationManagerImpl::IsModuleTypeRejected(
- const std::string& module_type, const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
- RejectedResources::iterator it =
- rejected_resources_for_application_.find(app_id);
-
- if (rejected_resources_for_application_.end() == it) {
- return false;
- }
-
- const std::vector<std::string>& list_of_rejected_resources =
- rejected_resources_for_application_[app_id];
-
- return helpers::in_range(list_of_rejected_resources, module_type);
-}
-
-void ResourceAllocationManagerImpl::OnDriverDisallowed(
- const std::string& module_type, const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
- RejectedResources::iterator it =
- rejected_resources_for_application_.find(app_id);
-
- if (rejected_resources_for_application_.end() == it) {
- rejected_resources_for_application_[app_id] = std::vector<std::string>();
- }
- std::vector<std::string>& list_of_rejected_resources =
- rejected_resources_for_application_[app_id];
- list_of_rejected_resources.push_back(module_type);
-}
-
-void ResourceAllocationManagerImpl::OnApplicationEvent(
- functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "Event " << event << " came for " << application->app_id());
-
- if (functional_modules::ApplicationEvent::kApplicationExit == event ||
- functional_modules::ApplicationEvent::kApplicationUnregistered == event) {
- Resources acquired_modules = GetAcquiredResources(application->app_id());
- Resources::const_iterator module = acquired_modules.begin();
- for (; acquired_modules.end() != module; ++module) {
- ReleaseResource(*module, application->app_id());
- }
-
- Apps app_list;
- app_list.push_back(application);
- RemoveAppsSubscriptions(app_list);
- }
-}
-
-void ResourceAllocationManagerImpl::OnPolicyEvent(
- functional_modules::PolicyEvent event) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Event " << event);
-
- if (functional_modules::PolicyEvent::kApplicationPolicyUpdated == event) {
- ProcessApplicationPolicyUpdate();
- return;
- }
-
- if (functional_modules::PolicyEvent::kApplicationsDisabled == event) {
- ResetAllAllocations();
- application_manager::ServicePtr s = rc_plugin_.service();
- Apps app_list = s->GetApplications(rc_plugin_.GetModuleID());
- RemoveAppsSubscriptions(app_list);
- return;
- }
-}
-
-void ResourceAllocationManagerImpl::ResetAllAllocations() {
- LOG4CXX_AUTO_TRACE(logger_);
- {
- sync_primitives::AutoLock lock(resources_state_lock_);
- resources_state_.clear();
- }
- {
- sync_primitives::AutoLock lock(allocated_resources_lock_);
- allocated_resources_.clear();
- }
- {
- sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
- rejected_resources_for_application_.clear();
- }
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/test/CMakeLists.txt b/src/components/remote_control/test/CMakeLists.txt
deleted file mode 100644
index 6457b56397..0000000000
--- a/src/components/remote_control/test/CMakeLists.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-include_directories (
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${GMOCK_INCLUDE_DIRECTORY}
- ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/
- ${CMAKE_SOURCE_DIR}/src/components/functional_module/test/
- ${CMAKE_SOURCE_DIR}/src/components/remote_control/include/
- ${CMAKE_SOURCE_DIR}/src/components/remote_control/test/include/
- ${CMAKE_SOURCE_DIR}/src/components/include/
- ${CMAKE_SOURCE_DIR}/src/components/application_manager/test/include/
- ${CMAKE_SOURCE_DIR}/src/components/connection_handler/include/
- ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/
- ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/usage_statistics/include/
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${CMAKE_BINARY_DIR}/src/components/
- include/
-)
-
-set (SOURCES
- src/rc_module_test.cc
- src/rc_app_extension_test.cc
- src/resource_allocation_manager_impl_test.cc
- ${CMAKE_SOURCE_DIR}/src/components/application_manager/test/mock_message_helper.cc
-)
-
-set (LIBRARIES
- gtest
- gmock
- gmock_main
- RemoteControlModule
- SmartObjects
- gcov
- Policy
-)
-
-if (ENABLE_TEST_COV_COUNT)
- set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs")
-else()
- set(GCOV_FLAGS "")
-endif()
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCOV_FLAGS}")
-
-# use, i.e. don't skip the full RPATH for the build tree
-#SET(CMAKE_SKIP_BUILD_RPATH FALSE)
-
-# when building, don't use the install RPATH already
-# (but later on when installing)
-#SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
-
-#SET(RPATH_DIRECTORIES
-# ${CMAKE_BINARY_DIR}/src/components/remote_control/
-# /usr/local/lib
-# /usr/local
-# ${CMAKE_BINARY_DIR}/src/components/utils
-#)
-
-#SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}")
-
-add_custom_command(
-OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libPolicy.so
- COMMAND ${CMAKE_COMMAND} -E
- copy ${COMPONENTS_DIR}/policy/libPolicy.so ${CMAKE_CURRENT_BINARY_DIR})
- set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}")
-
-create_test("remote_control_test" "${SOURCES}" "${LIBRARIES}")
-add_subdirectory(commands)
diff --git a/src/components/remote_control/test/commands/CMakeLists.txt b/src/components/remote_control/test/commands/CMakeLists.txt
deleted file mode 100644
index 09c706fc2f..0000000000
--- a/src/components/remote_control/test/commands/CMakeLists.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (c) 2017, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
-include_directories(
- ${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/remote_control/include/
- ${COMPONENTS_DIR}/remote_control/include/remote_control/
- ${COMPONENTS_DIR}/remote_control/include/remote_control/commands/
- ${COMPONENTS_DIR}/remote_control/test/include
-)
-
-set(RC_COMMANDS_TEST_DIR ${RC_TEST_DIR}/commands)
-
-file(GLOB SOURCES
- ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
- ${RC_COMMANDS_TEST_DIR}/*
-)
-
-set(LIBRARIES
- gmock
- RemoteControlModule
- Utils
- SmartObjects
- jsoncpp
- HMI_API
- MOBILE_API
- ApplicationManager
- AMHMICommandsLibrary
- AMMobileCommandsLibrary
- connectionHandler
-)
-
-create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc
deleted file mode 100644
index 06a48fc077..0000000000
--- a/src/components/remote_control/test/commands/button_press_request_test.cc
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/button_press_request.h"
-#include "gtest/gtest.h"
-#include "mock_remote_control_plugin.h"
-#include "mock_application.h"
-#include "mock_resource_allocation_manager.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/remote_control_event.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_command_factory.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "remote_control/rc_module_constants.h"
-#include "functional_module/function_ids.h"
-#include "include/mock_service.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-
-using functional_modules::RCFunctionID;
-using application_manager::ServicePtr;
-
-using application_manager::MockService;
-using test::components::remote_control_test::MockApplication;
-
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SaveArg;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::protocol_handler::MessagePriority;
-using remote_control::RemotePluginInterface;
-using remote_control::MessageHelper;
-
-namespace {
-const int kModuleId = 153;
-
-const std::string kCorrectMobileRequest =
- "{\"moduleType\":\"CLIMATE\",\"buttonName\":\"AC\",\"buttonPressMode\":"
- "\"SHORT\"}";
-const std::string kWrongMobileRequest =
- "{\"moduleType\":\"RADIO\",\"buttonName\":\"AC\",\"buttonPressMode\":"
- "\"SHORT\"}";
-const std::string kValidHmiResponse =
- "{\"result\":{\"code\":0,\"method\":\"Buttons.ButtonPress\"},\"id\":31,"
- "\"jsonrpc\":\"2.0\"} ";
-const std::string KReadOnlyHmiResponse =
- "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":26,\"data\":{\"method\":"
- "\"Buttons.ButtonPress\"},\"message\":\"Read only parameters "
- "received\"},\"id\":31}";
-const uint32_t kAppId = 11u;
-}
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-namespace button_press_request_test {
-
-class ButtonPressRequestTest : public ::testing::Test {
- public:
- ButtonPressRequestTest()
- : rc_capabilities_(smart_objects::SmartType_Map)
- , mock_service_(utils::MakeShared<NiceMock<MockService> >())
- , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
- , rc_app_extention_(
- utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
- ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
- ON_CALL(mock_module_, resource_allocation_manager())
- .WillByDefault(ReturnRef(mock_allocation_manager_));
- ON_CALL(*mock_service_, GetApplication(kAppId))
- .WillByDefault(Return(mock_app_));
- EXPECT_CALL(mock_module_, event_dispatcher())
- .WillRepeatedly(ReturnRef(event_dispatcher_));
- ServicePtr exp_service(mock_service_);
- mock_module_.set_service(exp_service);
- }
-
- smart_objects::SmartObject ButtonCapability(
- const mobile_apis::ButtonName::eType button_name) {
- smart_objects::SmartObject button(smart_objects::SmartType_Map);
- button["name"] = button_name;
- return button;
- }
-
- void SetUp() OVERRIDE {
- using namespace remote_control;
- using namespace mobile_apis;
-
- std::vector<ButtonName::eType> button_names;
- button_names.push_back(ButtonName::AC_MAX);
- button_names.push_back(ButtonName::AC);
- button_names.push_back(ButtonName::RECIRCULATE);
- button_names.push_back(ButtonName::FAN_UP);
- button_names.push_back(ButtonName::FAN_DOWN);
- button_names.push_back(ButtonName::TEMP_UP);
- button_names.push_back(ButtonName::TEMP_DOWN);
- button_names.push_back(ButtonName::DEFROST_MAX);
- button_names.push_back(ButtonName::DEFROST);
- button_names.push_back(ButtonName::DEFROST_REAR);
- button_names.push_back(ButtonName::UPPER_VENT);
- button_names.push_back(ButtonName::LOWER_VENT);
- button_names.push_back(ButtonName::VOLUME_UP);
- button_names.push_back(ButtonName::VOLUME_DOWN);
- button_names.push_back(ButtonName::EJECT);
- button_names.push_back(ButtonName::SOURCE);
- button_names.push_back(ButtonName::SHUFFLE);
- button_names.push_back(ButtonName::REPEAT);
-
- smart_objects::SmartObject button_caps(smart_objects::SmartType_Array);
- for (size_t i = 0; i < button_names.size(); i++) {
- button_caps[i] = ButtonCapability(button_names[i]);
- }
- rc_capabilities_[strings::kbuttonCapabilities] = button_caps;
- ON_CALL(*mock_service_, GetRCCapabilities())
- .WillByDefault(Return(&rc_capabilities_));
- ON_CALL(*mock_service_, IsInterfaceAvailable(_))
- .WillByDefault(Return(true));
- ON_CALL(*mock_service_, IsRemoteControlApplication(_))
- .WillByDefault(Return(true));
- }
-
- remote_control::request_controller::MobileRequestPtr CreateCommand(
- application_manager::MessagePtr msg) {
- return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
- }
-
- application_manager::MessagePtr CreateBasicMessage() {
- application_manager::MessagePtr message = utils::MakeShared<Message>(
- MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
- message->set_function_id(RCFunctionID::BUTTON_PRESS);
- message->set_function_name(
- MessageHelper::GetMobileAPIName(functional_modules::BUTTON_PRESS));
- message->set_connection_key(kAppId);
- return message;
- }
-
- protected:
- smart_objects::SmartObject rc_capabilities_;
- utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
- utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
- testing::NiceMock<remote_control_test::MockRemotePluginInterface>
- mock_module_;
- testing::NiceMock<remote_control_test::MockResourceAllocationManager>
- mock_allocation_manager_;
- RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
-};
-
-TEST_F(ButtonPressRequestTest,
- Execute_ButtonNameMatchesModuleType_ExpectCorrectMessageSentToHMI) {
- namespace json_keys = remote_control::json_keys;
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kCorrectMobileRequest);
- // Expectations
- ON_CALL(*mock_app_, app_id())
- .WillByDefault(Return(mobile_message->connection_key()));
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(invalid_ext))
- .WillRepeatedly(Return(rc_app_extention_));
- application_manager::AppExtensionPtr app_extension;
- EXPECT_CALL(*mock_app_, AddExtension(_))
- .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
- EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
- EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1));
-
- const std::string resource = "CLIMATE";
-
- EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId))
- .WillOnce(Return(remote_control::AcquireResult::ALLOWED));
- EXPECT_CALL(
- mock_allocation_manager_,
- SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY));
-
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
- .WillOnce(SaveArg<0>(&result_msg));
-
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
- // Assertions
- EXPECT_EQ(kModuleId, app_extension->uid());
- EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
- result_msg->protocol_version());
- EXPECT_EQ(1, result_msg->correlation_id());
- EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
- const Json::Value& hmi_request_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_EQ(functional_modules::hmi_api::button_press,
- hmi_request_params[json_keys::kMethod].asString());
-}
-
-TEST_F(
- ButtonPressRequestTest,
- Execute_ButtonNameDoesNotMatchModuleType_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
- namespace json_keys = remote_control::json_keys;
- namespace result_codes = remote_control::result_codes;
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kWrongMobileRequest);
- // Expectations
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(invalid_ext))
- .WillRepeatedly(Return(rc_app_extention_));
- application_manager::AppExtensionPtr app_extension;
- EXPECT_CALL(*mock_app_, AddExtension(_))
- .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
- EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
- EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
- .WillOnce(Return(::remote_control::AcquireResult::ALLOWED));
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
- // Assertions
- const Json::Value& response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
- EXPECT_EQ(result_codes::kInvalidData,
- response_params[json_keys::kResultCode].asString());
-}
-
-TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) {
- namespace json_keys = remote_control::json_keys;
- namespace result_codes = remote_control::result_codes;
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kCorrectMobileRequest);
-
- application_manager::MessagePtr hmi_message = CreateBasicMessage();
- hmi_message->set_json_message(kValidHmiResponse);
- hmi_message->set_message_type(application_manager::MessageType::kResponse);
- // Expectations
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::RCPluginEvent event(
- hmi_message, functional_modules::hmi_api::button_press);
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->on_event(event);
- // Assertions
- const Json::Value& response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_TRUE(response_params[json_keys::kSuccess].asBool());
- EXPECT_EQ(result_codes::kSuccess,
- response_params[json_keys::kResultCode].asString());
-}
-
-TEST_F(ButtonPressRequestTest,
- OnEvent_ReadOnlyParamFromHMI_ExpectFalseSentToMobile) {
- namespace json_keys = remote_control::json_keys;
- namespace result_codes = remote_control::result_codes;
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kCorrectMobileRequest);
-
- application_manager::MessagePtr hmi_message = CreateBasicMessage();
- hmi_message->set_json_message(KReadOnlyHmiResponse);
- hmi_message->set_message_type(application_manager::MessageType::kResponse);
- // Expectations
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::RCPluginEvent event(
- hmi_message, functional_modules::hmi_api::button_press);
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->on_event(event);
- // Assertions
- const Json::Value& response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_FALSE(response_params[json_keys::kSuccess].asBool());
- EXPECT_EQ(result_codes::kGenericError,
- response_params[json_keys::kResultCode].asString());
-}
-
-} // namespace button_press_request_test
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
diff --git a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc
deleted file mode 100644
index 4ad833aa60..0000000000
--- a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/get_interior_vehicle_data_request.h"
-#include "gtest/gtest.h"
-#include "mock_remote_control_plugin.h"
-#include "mock_application.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/remote_control_event.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_command_factory.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "functional_module/function_ids.h"
-#include "include/mock_service.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-
-using functional_modules::RCFunctionID;
-using application_manager::ServicePtr;
-
-using application_manager::MockService;
-using test::components::remote_control_test::MockApplication;
-
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::StrictMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SaveArg;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::application_manager::ApplicationSharedPtr;
-using ::protocol_handler::MessagePriority;
-using remote_control::RemotePluginInterface;
-using remote_control::MessageHelper;
-using namespace remote_control;
-
-namespace {
-const int32_t kConnectionKey = 5;
-const int kModuleId = 153;
-const std::string kInvalidMobileRequest = "{{\"moduleTip\":\"LUXOFT\"}}";
-const std::string kValidMobileRequest =
- "{\"subscribe\":true,\"moduleDescription\":{\"moduleType\":\"CLIMATE\"}}";
-const std::string kValidHmiResponse =
- "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":0,\"method\":\"RC."
- "GetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
- "\"climateControlData\":{\"fanSpeed\":0,\"currentTemperature\":{\"unit\":"
- "\"CELSIUS\",\"value\":20},\"desiredTemperature\":{\"unit\":\"CELSIUS\","
- "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
- "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
- "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":"
- "true}}";
-const std::string kInvalidHmiResponse =
- "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":21,\"method\":\"RC."
- "GetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
- "\"ControlData\":{\"Speed\":0,\"outsideTemperature\":{\"unit\":"
- "\"CELSIUS\",\"value\":\"high\"},\"desiredTemperature\":{\"unit\":"
- "\"CELSIUS\","
- "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
- "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
- "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":"
- "false}}";
-}
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-namespace get_interior_vehicle_data_request_test {
-
-class GetInteriorVehicleDataRequestTest : public ::testing::Test {
- public:
- typedef utils::SharedPtr<remote_control::commands::BaseCommandRequest>
- GIVDRequestPtr;
- typedef rc_event_engine::Event<application_manager::MessagePtr, std::string>
- GIVD_HMI_Response;
- GetInteriorVehicleDataRequestTest()
- : mock_service_(utils::MakeShared<NiceMock<MockService> >())
- , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
- , rc_app_extention_(
- utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(app_id_));
- ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
- ON_CALL(*mock_service_, GetApplication(app_id_))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_service_, IsInterfaceAvailable(_))
- .WillByDefault(Return(true));
- ON_CALL(*mock_service_, IsRemoteControlApplication(_))
- .WillByDefault(Return(true));
- EXPECT_CALL(mock_module_, event_dispatcher())
- .WillRepeatedly(ReturnRef(event_dispatcher_));
- ServicePtr exp_service(mock_service_);
- mock_module_.set_service(exp_service);
- }
-
- remote_control::request_controller::MobileRequestPtr CreateCommand(
- application_manager::MessagePtr msg) {
- return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
- }
-
- application_manager::MessagePtr CreateBasicMessage() {
- application_manager::MessagePtr message = utils::MakeShared<Message>(
- MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
- message->set_connection_key(kConnectionKey);
- message->set_function_id(RCFunctionID::GET_INTERIOR_VEHICLE_DATA);
- message->set_function_name("GetInteriorVehicleData");
- return message;
- }
-
- protected:
- utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
- utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
- remote_control_test::MockRemotePluginInterface mock_module_;
- RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
- const uint32_t app_id_ = 11u;
-};
-
-TEST_F(GetInteriorVehicleDataRequestTest,
- Execute_MessageValidationOk_ExpectCorrectMessageSentToHMI) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kValidMobileRequest);
- // Expectations
- EXPECT_CALL(mock_module_, service()).Times(2).WillOnce(Return(mock_service_));
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(invalid_ext))
- .WillRepeatedly(Return(rc_app_extention_));
- application_manager::AppExtensionPtr app_extension;
- EXPECT_CALL(*mock_app_, AddExtension(_))
- .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
- EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
- EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
- // Assertions
- EXPECT_EQ(kModuleId, app_extension->uid());
- EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
- result_msg->protocol_version());
- EXPECT_EQ(1, result_msg->correlation_id());
- EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
- const Json::Value hmi_request_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_EQ(functional_modules::hmi_api::get_interior_vehicle_data,
- hmi_request_params[json_keys::kMethod].asString());
-}
-
-TEST_F(
- GetInteriorVehicleDataRequestTest,
- Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kInvalidMobileRequest);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(
- Return(application_manager::MessageValidationResult::INVALID_JSON));
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
- // Assertions
- const Json::Value response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
- EXPECT_EQ(result_codes::kInvalidData,
- response_params[json_keys::kResultCode].asString());
-}
-
-TEST_F(GetInteriorVehicleDataRequestTest,
- OnEvent_ValidHmiResponse_ExpectSuccessfullResponseSentToMobile) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kValidMobileRequest);
-
- application_manager::MessagePtr hmi_message = CreateBasicMessage();
- hmi_message->set_json_message(kValidHmiResponse);
- hmi_message->set_message_type(application_manager::MessageType::kResponse);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(rc_app_extention_));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::RCPluginEvent event(
- hmi_message, functional_modules::hmi_api::get_interior_vehicle_data);
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->on_event(event);
- // Assertions
- const Json::Value response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_TRUE(response_params[json_keys::kSuccess].asBool());
- EXPECT_EQ(result_codes::kSuccess,
- response_params[json_keys::kResultCode].asString());
-}
-
-TEST_F(GetInteriorVehicleDataRequestTest,
- OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kValidMobileRequest);
- application_manager::MessagePtr hmi_message = CreateBasicMessage();
- hmi_message->set_json_message(kInvalidHmiResponse);
- hmi_message->set_message_type(application_manager::MessageType::kResponse);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
- .WillOnce(
- Return(application_manager::MessageValidationResult::INVALID_JSON));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- remote_control::RCPluginEvent event(
- hmi_message, functional_modules::hmi_api::get_interior_vehicle_data);
- command->on_event(event);
- const Json::Value response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_FALSE(response_params[json_keys::kSuccess].asBool());
- EXPECT_EQ(result_codes::kGenericError,
- response_params[json_keys::kResultCode].asString());
- const Json::Value hmi_response =
- MessageHelper::StringToValue(hmi_message->json_message());
- EXPECT_EQ(hmi_response[json_keys::kInfo].asString(),
- response_params[json_keys::kInfo].asString());
-}
-
-} // namespace get_interior_vehicle_data_request_test
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
diff --git a/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc
deleted file mode 100644
index 7329890e94..0000000000
--- a/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/on_interior_vehicle_data_notification.h"
-#include "gtest/gtest.h"
-#include "mock_remote_control_plugin.h"
-#include "mock_application.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/remote_control_event.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_command_factory.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "functional_module/function_ids.h"
-#include "include/mock_service.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-
-using functional_modules::RCFunctionID;
-using application_manager::ServicePtr;
-
-using application_manager::MockService;
-using test::components::remote_control_test::MockApplication;
-
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::Return;
-using ::testing::SaveArg;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::application_manager::ApplicationSharedPtr;
-using ::protocol_handler::MessagePriority;
-using remote_control::RemotePluginInterface;
-using remote_control::MessageHelper;
-using namespace remote_control;
-
-namespace {
-const int kModuleId = 153;
-const std::string kJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnInteriorVehicleData\",\
- \"params\":{\"moduleData\":{\
- \"moduleType\": \"CLIMATE\",\"climateControlData\": {\"fanSpeed\": 100}}}}";
-const uint32_t kAppId_ = 11u;
-}
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-namespace on_interior_vehicle_data_notification_test {
-
-class OnInteriorVehicleDataNotificationTest : public ::testing::Test {
- public:
- OnInteriorVehicleDataNotificationTest()
- : mock_service_(utils::MakeShared<NiceMock<MockService> >())
- , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
- , rc_app_extention_(
- utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
- ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
- ServicePtr exp_service(mock_service_);
- mock_module_.set_service(exp_service);
- }
-
- remote_control::request_controller::MobileRequestPtr CreateCommand(
- application_manager::MessagePtr msg) {
- return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
- }
-
- application_manager::MessagePtr CreateBasicMessage() {
- application_manager::MessagePtr message = utils::MakeShared<Message>(
- MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
- message->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
- message->set_function_name("OnInteriorVehicleData");
- message->set_json_message(kJson);
- return message;
- }
-
- protected:
- utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
- utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
- remote_control_test::MockRemotePluginInterface mock_module_;
- std::vector<ApplicationSharedPtr> apps_;
-};
-
-TEST_F(OnInteriorVehicleDataNotificationTest,
- Execute_SendMessageToMobile_IfAppIsSubscribed) {
- // Arrange
- application_manager::MessagePtr message = CreateBasicMessage();
- Json::Value json_value = MessageHelper::StringToValue(kJson);
- Json::Value module_type =
- json_value[json_keys::kParams][message_params::kModuleData]
- [message_params::kModuleType];
- rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
- apps_.push_back(mock_app_);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
- .WillOnce(Return(apps_));
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(rc_app_extention_));
-
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId_));
- EXPECT_CALL(*mock_app_, protocol_version())
- .WillRepeatedly(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
- EXPECT_CALL(*mock_service_, GetApplication(kAppId_))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(_))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckModule(kAppId_, enums_value::kClimate))
- .WillOnce(Return(true));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(*mock_service_, SendMessageToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
- // Assertions
- EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3,
- result_msg->protocol_version());
- EXPECT_EQ(application_manager::MessageType::kNotification,
- result_msg->type());
- EXPECT_EQ(functional_modules::ON_INTERIOR_VEHICLE_DATA,
- result_msg->function_id());
- EXPECT_EQ(MessageHelper::GetMobileAPIName(
- functional_modules::ON_INTERIOR_VEHICLE_DATA),
- result_msg->function_name());
-}
-
-TEST_F(OnInteriorVehicleDataNotificationTest,
- Execute_NotSendMessageToMobile_IfAppUnsubscribed) {
- // Arrange
- application_manager::MessagePtr message = CreateBasicMessage();
- apps_.push_back(mock_app_);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
- .WillOnce(Return(apps_));
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(rc_app_extention_));
- EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
-}
-
-} // namespace on_interior_vehicle_data_notification_test
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
diff --git a/src/components/remote_control/test/commands/on_remote_control_settings_test.cc b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc
deleted file mode 100644
index 5c13ea63d5..0000000000
--- a/src/components/remote_control/test/commands/on_remote_control_settings_test.cc
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/on_remote_control_settings_notification.h"
-#include "gtest/gtest.h"
-#include "mock_remote_control_plugin.h"
-#include "mock_application.h"
-#include "mock_resource_allocation_manager.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/remote_control_event.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_command_factory.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "functional_module/function_ids.h"
-#include "include/mock_service.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-
-using functional_modules::RCFunctionID;
-using application_manager::ServicePtr;
-
-using application_manager::MockService;
-using test::components::remote_control_test::MockApplication;
-
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SaveArg;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::application_manager::ApplicationSharedPtr;
-using ::protocol_handler::MessagePriority;
-using remote_control::RemotePluginInterface;
-using remote_control::MessageHelper;
-using namespace remote_control;
-
-namespace {
-const int kModuleId = 153;
-const std::string kAllowedTrueAUTO_ALLOWJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
- \"params\":{\"accessMode\": \"AUTO_ALLOW\", \"allowed\":true}}";
-const std::string kAllowedTrueASK_DRIVERJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
- \"params\":{\"accessMode\": \"ASK_DRIVER\", \"allowed\":true}}";
-const std::string kAllowedTrueAUTO_DENYJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
- \"params\":{\"accessMode\": \"AUTO_DENY\", \"allowed\":true}}";
-const std::string kAllowedFalseAUTO_ALLOWJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
- \"params\":{\"accessMode\": \"AUTO_ALLOW\", \"allowed\":false}}";
-const std::string kAllowedFalseASK_DRIVERJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
- \"params\":{\"accessMode\": \"ASK_DRIVER\", \"allowed\":false}}";
-const std::string kAllowedFalseAUTO_DENYJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
- \"params\":{\"accessMode\": \"AUTO_DENY\", \"allowed\":false}}";
-const std::string kWithoutParamsJson =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\"}";
-}
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-namespace on_remote_control_settings_notification_test {
-
-class OnRemoteControlSettingsNotificationTest : public ::testing::Test {
- public:
- OnRemoteControlSettingsNotificationTest()
- : mock_service_(utils::MakeShared<NiceMock<MockService> >())
- , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
- , rc_app_extention_(
- utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
- ON_CALL(mock_module_, resource_allocation_manager())
- .WillByDefault(ReturnRef(mock_allocation_manager_));
- ON_CALL(*mock_service_, IsInterfaceAvailable(_))
- .WillByDefault(Return(true));
- ON_CALL(*mock_service_, IsRemoteControlApplication(_))
- .WillByDefault(Return(true));
- apps_.push_back(mock_app_);
- }
-
- remote_control::request_controller::MobileRequestPtr CreateCommand(
- application_manager::MessagePtr msg) {
- return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
- }
-
- application_manager::MessagePtr CreateBasicMessage(
- const std::string& json_message) {
- application_manager::MessagePtr message = utils::MakeShared<Message>(
- MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
- message->set_function_id(RCFunctionID::ON_REMOTE_CONTROL_SETTINGS);
- message->set_function_name(
- MessageHelper::GetMobileAPIName(functional_modules::BUTTON_PRESS));
- message->set_json_message(json_message);
- return message;
- }
-
- protected:
- utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
- utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
- remote_control_test::MockRemotePluginInterface mock_module_;
- std::vector<ApplicationSharedPtr> apps_;
- testing::NiceMock<remote_control_test::MockResourceAllocationManager>
- mock_allocation_manager_;
-};
-
-TEST_F(OnRemoteControlSettingsNotificationTest,
- Execute_SetAccessModeAUTO_ALLOW_IfAllowedTrue) {
- // Arrange
- const Json::Value value =
- MessageHelper::StringToValue(kAllowedTrueAUTO_ALLOWJson);
- const std::string access_mode =
- value[json_keys::kParams][message_params::kAccessMode].asString();
- const hmi_apis::Common_RCAccessMode::eType access_mode_ =
- MessageHelper::AccessModeFromString(access_mode);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_));
-
- application_manager::MessagePtr message =
- CreateBasicMessage(kAllowedTrueAUTO_ALLOWJson);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
-}
-
-TEST_F(OnRemoteControlSettingsNotificationTest,
- Execute_SetAccessModeAUTO_DENY_IfAllowedTrue) {
- // Arrange
- const Json::Value value =
- MessageHelper::StringToValue(kAllowedTrueAUTO_DENYJson);
- const std::string access_mode =
- value[json_keys::kParams][message_params::kAccessMode].asString();
- const hmi_apis::Common_RCAccessMode::eType access_mode_ =
- MessageHelper::AccessModeFromString(access_mode);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_));
-
- application_manager::MessagePtr message =
- CreateBasicMessage(kAllowedTrueAUTO_DENYJson);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
-}
-
-TEST_F(OnRemoteControlSettingsNotificationTest,
- Execute_SetAccessModeASK_DRIVER_IfAllowedTrue) {
- // Arrange
- const Json::Value value =
- MessageHelper::StringToValue(kAllowedTrueASK_DRIVERJson);
- const std::string access_mode =
- value[json_keys::kParams][message_params::kAccessMode].asString();
- const hmi_apis::Common_RCAccessMode::eType access_mode_ =
- MessageHelper::AccessModeFromString(access_mode);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_));
- application_manager::MessagePtr message =
- CreateBasicMessage(kAllowedTrueASK_DRIVERJson);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
-}
-
-TEST_F(OnRemoteControlSettingsNotificationTest,
- Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeAUTO_ALLOW) {
- // Arrange
- const Json::Value module_type(enums_value::kClimate);
- rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
- const Json::Value value =
- MessageHelper::StringToValue(kAllowedFalseAUTO_ALLOWJson);
- const std::string access_mode =
- value[json_keys::kParams][message_params::kAccessMode].asString();
- const hmi_apis::Common_RCAccessMode::eType access_mode_ =
- MessageHelper::AccessModeFromString(access_mode);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0);
- EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
- .WillOnce(Return(apps_));
- EXPECT_CALL(
- *mock_service_,
- ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE));
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(rc_app_extention_));
- EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
- true);
- application_manager::MessagePtr message =
- CreateBasicMessage(kAllowedFalseAUTO_ALLOWJson);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
- // Assertions
- EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
- false);
-}
-
-TEST_F(OnRemoteControlSettingsNotificationTest,
- Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeASK_DRIVER) {
- // Arrange
- const Json::Value module_type(enums_value::kRadio);
- rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
- const Json::Value value =
- MessageHelper::StringToValue(kAllowedFalseASK_DRIVERJson);
- const std::string access_mode =
- value[json_keys::kParams][message_params::kAccessMode].asString();
- const hmi_apis::Common_RCAccessMode::eType access_mode_ =
- MessageHelper::AccessModeFromString(access_mode);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0);
- EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
- .WillOnce(Return(apps_));
- EXPECT_CALL(
- *mock_service_,
- ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE));
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(rc_app_extention_));
- EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
- true);
- application_manager::MessagePtr message =
- CreateBasicMessage(kAllowedFalseASK_DRIVERJson);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
- // Assertions
- EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
- false);
-}
-
-TEST_F(OnRemoteControlSettingsNotificationTest,
- Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeAUTO_DENY) {
- // Arrange
- const Json::Value module_type(enums_value::kClimate);
- rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
- const Json::Value value =
- MessageHelper::StringToValue(kAllowedFalseAUTO_DENYJson);
- const std::string access_mode =
- value[json_keys::kParams][message_params::kAccessMode].asString();
- const hmi_apis::Common_RCAccessMode::eType access_mode_ =
- MessageHelper::AccessModeFromString(access_mode);
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0);
- EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
- .WillOnce(Return(apps_));
- EXPECT_CALL(
- *mock_service_,
- ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE));
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(rc_app_extention_));
- EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
- true);
- application_manager::MessagePtr message =
- CreateBasicMessage(kAllowedFalseAUTO_DENYJson);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
- // Assertions
- EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
- false);
-}
-
-TEST_F(OnRemoteControlSettingsNotificationTest,
- Execute_NothingHappens_IfParamsOmitted) {
- // Expectations
- EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
- EXPECT_CALL(mock_allocation_manager_, SetAccessMode(_)).Times(0);
- EXPECT_CALL(*mock_service_, GetApplications(kModuleId)).Times(0);
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)).Times(0);
- EXPECT_CALL(*mock_service_,
- ChangeNotifyHMILevel(
- apps_[0], mobile_apis::HMILevel::eType::HMI_NONE)).Times(0);
-
- application_manager::MessagePtr message =
- CreateBasicMessage(kWithoutParamsJson);
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(message);
- command->Run();
-}
-
-} // namespace on_remote_control_settings_notification_test
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
diff --git a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc
deleted file mode 100644
index a219bc086d..0000000000
--- a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/commands/set_interior_vehicle_data_request.h"
-#include "gtest/gtest.h"
-#include "mock_remote_control_plugin.h"
-#include "mock_application.h"
-#include "mock_resource_allocation_manager.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/remote_control_event.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "remote_control/rc_command_factory.h"
-#include "remote_control/event_engine/event_dispatcher.h"
-#include "functional_module/function_ids.h"
-#include "include/mock_service.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-
-using functional_modules::RCFunctionID;
-using application_manager::ServicePtr;
-
-using application_manager::MockService;
-using test::components::remote_control_test::MockApplication;
-
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::StrictMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SaveArg;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::application_manager::ApplicationSharedPtr;
-using ::protocol_handler::MessagePriority;
-using remote_control::RemotePluginInterface;
-using remote_control::MessageHelper;
-using namespace remote_control;
-
-namespace {
-const uint32_t kAppId = 11u;
-const int32_t kConnectionKey = 5;
-const int kModuleId = 153;
-const uint32_t kCorrelationId = 1u;
-const std::string kValidMobileRequestWithOnlySettableParams =
- "{\"moduleData\":{\"moduleType\":\"CLIMATE\", "
- "\"climateControlData\":{\"defrostZone\":"
- "\"FRONT\", \"fanSpeed\":10}}}";
-const std::string kValidMobileRequestWithSettableAndReadOnlyParams =
- "{\"moduleData\":{\"moduleType\":\"CLIMATE\", "
- "\"climateControlData\":{\"defrostZone\":"
- "\"FRONT\", \"fanSpeed\":10, \"currentTemperature\":{\"unit\":\"CELSIUS\", "
- "\"value\":17.5}}}}";
-const std::string kValidMobileRequestWithoutSettableAndWithReadOnlyParams =
- "{\"moduleData\":{\"moduleType\":\"CLIMATE\", \"climateControlData\":"
- "{\"currentTemperature\":{\"unit\":\"CELSIUS\", \"value\":17.5}}}}";
-const std::string kInvalidMobileRequest = "{{\"moduleTip\":\"LUXOFT\"}}";
-const std::string kValidHmiResponse =
- "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":0,\"method\":\"RC."
- "SetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
- "\"climateControlData\":{\"fanSpeed\":0,\"desiredTemperature\":{\"unit\":"
- "\"CELSIUS\","
- "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
- "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
- "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}}}}";
-const std::string kInvalidHmiResponse =
- "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":21,\"method\":\"RC."
- "SetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
- "\"ControlData\":{\"Speed\":0,\"outsideTemperature\":{\"unit\":"
- "\"CELSIUS\",\"value\":\"high\"},\"desiredTemperature\":{\"unit\":"
- "\"CELSIUS\","
- "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
- "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
- "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":"
- "false}}";
-}
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-namespace set_interior_vehicle_data_request_test {
-
-class SetInteriorVehicleDataRequestTest : public ::testing::Test {
- public:
- SetInteriorVehicleDataRequestTest()
- : mock_service_(utils::MakeShared<NiceMock<MockService> >())
- , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
- , rc_app_extention_(
- utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
- ON_CALL(mock_module_, resource_allocation_manager())
- .WillByDefault(ReturnRef(mock_allocation_manager_));
- ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
- ON_CALL(*mock_service_, GetApplication(_)).WillByDefault(Return(mock_app_));
- ON_CALL(*mock_service_, IsInterfaceAvailable(_))
- .WillByDefault(Return(true));
- ON_CALL(*mock_service_, IsRemoteControlApplication(_))
- .WillByDefault(Return(true));
- ON_CALL(mock_module_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ServicePtr exp_service(mock_service_);
- }
-
- remote_control::request_controller::MobileRequestPtr CreateCommand(
- application_manager::MessagePtr msg) {
- return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
- }
-
- application_manager::MessagePtr CreateBasicMessage() {
- application_manager::MessagePtr message = utils::MakeShared<Message>(
- MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
- message->set_connection_key(kConnectionKey);
- message->set_function_id(RCFunctionID::SET_INTERIOR_VEHICLE_DATA);
- message->set_function_name(MessageHelper::GetMobileAPIName(
- functional_modules::SET_INTERIOR_VEHICLE_DATA));
- return message;
- }
-
- protected:
- utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
- utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
- testing::NiceMock<remote_control_test::MockRemotePluginInterface>
- mock_module_;
- testing::NiceMock<remote_control_test::MockResourceAllocationManager>
- mock_allocation_manager_;
- RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
-};
-
-TEST_F(SetInteriorVehicleDataRequestTest,
- Execute_ValidWithoutReadOnlyParams_ExpectResendToHMI) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams);
-
- // Expectations
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(invalid_ext))
- .WillRepeatedly(Return(rc_app_extention_));
-
- application_manager::AppExtensionPtr app_extension;
- EXPECT_CALL(*mock_app_, AddExtension(_))
- .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
- EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
- EXPECT_CALL(*mock_service_, GetNextCorrelationID())
- .WillOnce(Return(kCorrelationId));
-
- const std::string resource = "CLIMATE";
-
- EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId))
- .WillOnce(Return(remote_control::AcquireResult::ALLOWED));
- EXPECT_CALL(
- mock_allocation_manager_,
- SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY));
-
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
- .WillOnce(SaveArg<0>(&result_msg));
-
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
-
- // Assertions
- EXPECT_EQ(kModuleId, app_extension->uid());
- EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
- result_msg->protocol_version());
- EXPECT_EQ(1, result_msg->correlation_id());
- EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
- const Json::Value hmi_request_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_EQ(functional_modules::hmi_api::set_interior_vehicle_data,
- hmi_request_params[json_keys::kMethod].asString());
- const Json::Value hmi_request_climate_control_data =
- hmi_request_params[json_keys::kParams][message_params::kModuleData]
- [message_params::kClimateControlData];
- EXPECT_EQ(2u, hmi_request_climate_control_data.size());
- const Json::Value hmi_request_module_data_fan_speed =
- hmi_request_climate_control_data[message_params::kFanSpeed];
- const Json::Value hmi_request_module_data_defrost_zone =
- hmi_request_climate_control_data[message_params::kDefrostZone];
- EXPECT_EQ("FRONT", hmi_request_module_data_defrost_zone.asString());
- EXPECT_EQ(10, hmi_request_module_data_fan_speed.asInt());
-}
-
-TEST_F(
- SetInteriorVehicleDataRequestTest,
- Execute_ValidWithSettableAndReadOnlyParams_ExpectCutReadOnlyAndResendToHMI) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(
- kValidMobileRequestWithSettableAndReadOnlyParams);
-
- // Expectations
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
-
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(invalid_ext))
- .WillRepeatedly(Return(rc_app_extention_));
-
- application_manager::AppExtensionPtr app_extension;
- EXPECT_CALL(*mock_app_, AddExtension(_))
- .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
- EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
- EXPECT_CALL(*mock_service_, GetNextCorrelationID())
- .WillOnce(Return(kCorrelationId));
-
- const std::string resource = "CLIMATE";
-
- EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId))
- .WillOnce(Return(remote_control::AcquireResult::ALLOWED));
- EXPECT_CALL(
- mock_allocation_manager_,
- SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY));
-
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
- .WillOnce(SaveArg<0>(&result_msg));
-
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
-
- // Assertions
- EXPECT_EQ(kModuleId, app_extension->uid());
- EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
- result_msg->protocol_version());
- EXPECT_EQ(1, result_msg->correlation_id());
- EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
- const Json::Value hmi_request_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_EQ(functional_modules::hmi_api::set_interior_vehicle_data,
- hmi_request_params[json_keys::kMethod].asString());
- const Json::Value hmi_request_climate_control_data =
- hmi_request_params[json_keys::kParams][message_params::kModuleData]
- [message_params::kClimateControlData];
- EXPECT_EQ(2u, hmi_request_climate_control_data.size());
- const Json::Value hmi_request_module_data_fan_speed =
- hmi_request_climate_control_data[message_params::kFanSpeed];
- const Json::Value hmi_request_module_data_defrost_zone =
- hmi_request_climate_control_data[message_params::kDefrostZone];
- EXPECT_EQ("FRONT", hmi_request_module_data_defrost_zone.asString());
- EXPECT_EQ(10, hmi_request_module_data_fan_speed.asInt());
-}
-
-TEST_F(SetInteriorVehicleDataRequestTest,
- Execute_ValidWithOnlyParamsReadOnly_ExpectResponseReadOnly) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(
- kValidMobileRequestWithoutSettableAndWithReadOnlyParams);
-
- // Expectations
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
- EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
- .WillOnce(Return(::remote_control::AcquireResult::ALLOWED));
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
- .WillOnce(Return(invalid_ext))
- .WillRepeatedly(Return(rc_app_extention_));
-
- application_manager::AppExtensionPtr app_extension;
- EXPECT_CALL(*mock_app_, AddExtension(_))
- .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
- EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
-
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
-
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
-
- // Assertions
- const Json::Value response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
- EXPECT_EQ(result_codes::kReadOnly,
- response_params[json_keys::kResultCode].asString());
-}
-
-TEST_F(
- SetInteriorVehicleDataRequestTest,
- Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kInvalidMobileRequest);
-
- // Expectations
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
- .WillOnce(
- Return(application_manager::MessageValidationResult::INVALID_JSON));
- EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
-
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->Run();
-
- // Assertions
- const Json::Value response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
- EXPECT_EQ(result_codes::kInvalidData,
- response_params[json_keys::kResultCode].asString());
-}
-
-TEST_F(SetInteriorVehicleDataRequestTest,
- OnEvent_ValidHmiResponse_ExpectSuccessfulResponseSentToMobile) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams);
-
- application_manager::MessagePtr hmi_message = CreateBasicMessage();
- hmi_message->set_json_message(kValidHmiResponse);
- hmi_message->set_message_type(application_manager::MessageType::kResponse);
-
- // Expectations
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
-
- // Act
- remote_control::RCPluginEvent event(
- hmi_message, functional_modules::hmi_api::set_interior_vehicle_data);
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- command->on_event(event);
-
- // Assertions
- const Json::Value response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_TRUE(response_params[json_keys::kSuccess].asBool());
- EXPECT_EQ(result_codes::kSuccess,
- response_params[json_keys::kResultCode].asString());
-}
-
-TEST_F(SetInteriorVehicleDataRequestTest,
- OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) {
- // Arrange
- application_manager::MessagePtr mobile_message = CreateBasicMessage();
- mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams);
- application_manager::MessagePtr hmi_message = CreateBasicMessage();
- hmi_message->set_json_message(kInvalidHmiResponse);
- hmi_message->set_message_type(application_manager::MessageType::kResponse);
-
- // Expectations
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
- .WillOnce(
- Return(application_manager::MessageValidationResult::INVALID_JSON));
- application_manager::MessagePtr result_msg;
- EXPECT_CALL(mock_module_, SendResponseToMobile(_))
- .WillOnce(SaveArg<0>(&result_msg));
-
- // Act
- remote_control::request_controller::MobileRequestPtr command =
- CreateCommand(mobile_message);
- remote_control::RCPluginEvent event(
- hmi_message, functional_modules::hmi_api::set_interior_vehicle_data);
- command->on_event(event);
- const Json::Value response_params =
- MessageHelper::StringToValue(result_msg->json_message());
- EXPECT_FALSE(response_params[json_keys::kSuccess].asBool());
- EXPECT_EQ(result_codes::kGenericError,
- response_params[json_keys::kResultCode].asString());
- const Json::Value hmi_response =
- MessageHelper::StringToValue(hmi_message->json_message());
- EXPECT_EQ(hmi_response[json_keys::kInfo].asString(),
- response_params[json_keys::kInfo].asString());
-}
-
-} // namespace set_interior_vehicle_data_request_test
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
diff --git a/src/components/remote_control/test/include/mock_application.h b/src/components/remote_control/test/include/mock_application.h
deleted file mode 100644
index a46b48673d..0000000000
--- a/src/components/remote_control/test/include/mock_application.h
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_
-
-#include <string>
-
-#include <string>
-#include "gmock/gmock.h"
-#include "application_manager/application.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/app_extension.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/usage_statistics.h"
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-
-namespace am = application_manager;
-namespace mobile_api = mobile_apis;
-namespace custom_str = utils::custom_string;
-
-namespace custom_str = utils::custom_string;
-class MockApplication : public ::application_manager::Application {
- public:
- MockApplication() {}
- MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(curHash, const std::string&());
- MOCK_METHOD0(UpdateHash, void());
- DEPRECATED MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
- DEPRECATED MOCK_METHOD1(set_flag_sending_hash_change_after_awake,
- void(bool flag));
- MOCK_CONST_METHOD0(IsHashChangedDuringSuspend, bool());
- MOCK_METHOD1(SetHashChangedDuringSuspend, void(const bool state));
- MOCK_CONST_METHOD0(is_application_data_changed, bool());
- MOCK_METHOD1(set_is_application_data_changed,
- void(bool state_application_data));
- MOCK_METHOD0(CloseActiveMessage, void());
- MOCK_CONST_METHOD0(IsFullscreen, bool());
- MOCK_METHOD0(ChangeSupportingAppHMIType, void());
- MOCK_CONST_METHOD0(is_navi, bool());
- MOCK_METHOD1(set_is_navi, void(bool allow));
- MOCK_CONST_METHOD0(video_streaming_approved, bool());
- MOCK_METHOD1(set_video_streaming_approved, void(bool state));
- MOCK_CONST_METHOD0(audio_streaming_approved, bool());
- MOCK_METHOD1(set_audio_streaming_approved, void(bool state));
- MOCK_CONST_METHOD0(video_streaming_allowed, bool());
- MOCK_METHOD1(set_video_streaming_allowed, void(bool state));
- MOCK_CONST_METHOD0(audio_streaming_allowed, bool());
- MOCK_METHOD1(set_audio_streaming_allowed, void(bool state));
- MOCK_CONST_METHOD0(is_audio, bool());
- MOCK_METHOD2(SetVideoConfig,
- bool(protocol_handler::ServiceType service_type,
- const smart_objects::SmartObject& params));
- MOCK_METHOD1(StartStreaming,
- void(protocol_handler::ServiceType service_type));
- MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
- MOCK_METHOD1(StopStreamingForce,
- void(protocol_handler::ServiceType service_type));
- MOCK_METHOD1(SuspendStreaming,
- void(protocol_handler::ServiceType service_type));
- MOCK_METHOD1(WakeUpStreaming,
- void(protocol_handler::ServiceType service_type));
- MOCK_CONST_METHOD0(is_voice_communication_supported, bool());
- MOCK_METHOD1(set_voice_communication_supported,
- void(bool is_voice_communication_supported));
- MOCK_CONST_METHOD0(app_allowed, bool());
- MOCK_CONST_METHOD0(has_been_activated, bool());
- MOCK_METHOD1(set_activated, bool(bool is_active));
- MOCK_CONST_METHOD0(version, const ::application_manager::Version&());
- MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id));
- MOCK_CONST_METHOD0(hmi_app_id, uint32_t());
- MOCK_CONST_METHOD0(name, const custom_str::CustomString&());
- MOCK_METHOD1(set_folder_name, void(const std::string& folder_name));
- MOCK_CONST_METHOD0(folder_name, const std::string());
- MOCK_CONST_METHOD0(is_media_application, bool());
- MOCK_CONST_METHOD0(hmi_level, const mobile_apis::HMILevel::eType());
- MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t());
- MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType());
- MOCK_CONST_METHOD0(audio_streaming_state,
- const mobile_apis::AudioStreamingState::eType());
- MOCK_CONST_METHOD0(app_icon_path, const std::string&());
- MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
- MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
- MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
- MOCK_CONST_METHOD0(PostponedHmiState,
- const application_manager::HmiStatePtr());
- MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
- MOCK_METHOD0(tts_properties_in_none, bool());
- MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
- MOCK_METHOD0(tts_properties_in_full, bool());
- MOCK_METHOD1(set_version,
- void(const ::application_manager::Version& version));
- MOCK_METHOD1(set_name, void(const custom_str::CustomString& name));
- MOCK_METHOD1(set_is_media_application, void(bool is_media));
- MOCK_METHOD0(increment_put_file_in_none_count, void());
- MOCK_METHOD0(increment_delete_file_in_none_count, void());
- MOCK_METHOD0(increment_list_files_in_none_count, void());
- MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
- MOCK_METHOD1(set_app_allowed, void(const bool allowed));
- MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
- MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
- MOCK_METHOD1(set_grammar_id, void(uint32_t value));
- MOCK_METHOD1(
- set_protocol_version,
- void(const ::protocol_handler::MajorProtocolVersion& protocol_version));
- MOCK_CONST_METHOD0(protocol_version,
- ::protocol_handler::MajorProtocolVersion());
- MOCK_METHOD1(set_is_resuming, void(bool));
- MOCK_CONST_METHOD0(is_resuming, bool());
- MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file));
- MOCK_CONST_METHOD0(getAppFiles, const ::application_manager::AppFilesMap&());
- MOCK_METHOD1(UpdateFile, bool(const ::application_manager::AppFile& file));
- MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
- MOCK_METHOD1(
- GetFile,
- const ::application_manager::AppFile*(const std::string& file_name));
- MOCK_METHOD1(SubscribeToButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(IsSubscribedToButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(UnsubscribeFromButton,
- bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type));
- MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type));
- MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type));
- MOCK_METHOD0(ResetDataInNone, void());
- MOCK_METHOD2(AreCommandLimitsExceeded,
- bool(mobile_apis::FunctionID::eType cmd_id,
- ::application_manager::TLimitSource source));
- MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
- MOCK_METHOD1(SetInitialState, void(::application_manager::HmiStatePtr state));
- MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
- MOCK_METHOD1(SetPostponedState,
- void(::application_manager::HmiStatePtr state));
- MOCK_METHOD0(RemovePostponedState, void());
- MOCK_METHOD1(AddHMIState, void(::application_manager::HmiStatePtr state));
- MOCK_METHOD1(RemoveHMIState,
- void(::application_manager::HmiState::StateID state_id));
- MOCK_METHOD2(SubscribeToSoftButtons,
- void(int32_t cmd_id,
- const ::application_manager::SoftButtonID& softbuttons_id));
- MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
- MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
- MOCK_CONST_METHOD0(IsAudioApplication, bool());
- MOCK_METHOD0(LoadPersistentFiles, void());
- // InitialApplicationData methods
- MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(policy_app_id, std::string());
- MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(ngn_media_screen_name,
- const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(language, const mobile_apis::Language::eType&());
- MOCK_CONST_METHOD0(ui_language, const mobile_apis::Language::eType&());
- MOCK_METHOD1(set_app_types,
- void(const smart_objects::SmartObject& app_types));
- MOCK_METHOD1(set_vr_synonyms,
- void(const smart_objects::SmartObject& vr_synonyms));
- MOCK_METHOD1(set_policy_app_id, void(const std::string& policy_app_id));
- MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name));
- MOCK_METHOD1(set_ngn_media_screen_name,
- void(const smart_objects::SmartObject& ngn_name));
- MOCK_METHOD1(set_language,
- void(const mobile_apis::Language::eType& language));
- MOCK_METHOD1(set_ui_language,
- void(const mobile_apis::Language::eType& ui_language));
- // DynamicApplicationData methods
- MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(vr_help, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(tbt_state, const mobile_apis::TBTState::eType&());
- MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(
- SubscribedButtons,
- DataAccessor< ::application_manager::ButtonSubscriptions>());
- MOCK_CONST_METHOD0(
- SubscribedIVI,
- DataAccessor< ::application_manager::VehicleInfoSubscriptions>());
- MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
- MOCK_METHOD1(load_global_properties,
- void(const smart_objects::SmartObject& so));
- MOCK_METHOD1(set_help_prompt,
- void(const smart_objects::SmartObject& help_prompt));
- MOCK_METHOD1(set_timeout_prompt,
- void(const smart_objects::SmartObject& timeout_prompt));
- MOCK_METHOD1(set_vr_help_title,
- void(const smart_objects::SmartObject& vr_help_title));
- MOCK_METHOD0(reset_vr_help_title, void());
- MOCK_METHOD1(set_vr_help, void(const smart_objects::SmartObject& vr_help));
- MOCK_METHOD0(reset_vr_help, void());
- MOCK_METHOD1(set_tbt_state,
- void(const mobile_apis::TBTState::eType& tbt_state));
- MOCK_METHOD1(set_show_command,
- void(const smart_objects::SmartObject& show_command));
- MOCK_METHOD1(set_tbt_show_command,
- void(const smart_objects::SmartObject& tbt_show));
- MOCK_METHOD1(set_keyboard_props,
- void(const smart_objects::SmartObject& keyboard_props));
- MOCK_METHOD1(set_menu_title,
- void(const smart_objects::SmartObject& menu_title));
- MOCK_METHOD1(set_menu_icon,
- void(const smart_objects::SmartObject& menu_icon));
- MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t());
- MOCK_METHOD1(set_audio_stream_retry_number,
- void(const uint32_t& audio_stream_retry_number));
- MOCK_CONST_METHOD0(video_stream_retry_number, uint32_t());
- MOCK_METHOD1(set_video_stream_retry_number,
- void(const uint32_t& video_stream_retry_number));
- MOCK_METHOD2(AddCommand,
- void(uint32_t cmd_id,
- const smart_objects::SmartObject& command));
- MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id));
- MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id));
- MOCK_METHOD2(AddSubMenu,
- void(uint32_t menu_id, const smart_objects::SmartObject& menu));
- MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id));
- MOCK_CONST_METHOD1(FindSubMenu,
- smart_objects::SmartObject*(uint32_t menu_id));
- MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name));
- MOCK_METHOD2(AddChoiceSet,
- void(uint32_t choice_set_id,
- const smart_objects::SmartObject& choice_set));
- MOCK_METHOD1(RemoveChoiceSet, void(uint32_t choice_set_id));
- MOCK_METHOD1(FindChoiceSet,
- smart_objects::SmartObject*(uint32_t choice_set_id));
- MOCK_METHOD3(AddPerformInteractionChoiceSet,
- void(uint32_t correlation_id,
- uint32_t choice_set_id,
- const smart_objects::SmartObject& choice_set));
- MOCK_METHOD1(DeletePerformInteractionChoiceSet,
- void(uint32_t correlation_id));
- MOCK_CONST_METHOD0(
- performinteraction_choice_set_map,
- DataAccessor< ::application_manager::PerformChoiceSetMap>());
- MOCK_CONST_METHOD0(commands_map,
- DataAccessor< ::application_manager::CommandsMap>());
- MOCK_CONST_METHOD0(sub_menu_map,
- DataAccessor< ::application_manager::SubMenuMap>());
- MOCK_CONST_METHOD0(choice_set_map,
- DataAccessor< ::application_manager::ChoiceSetMap>());
- MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active));
- MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t());
- MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode));
- MOCK_CONST_METHOD0(perform_interaction_mode, int32_t());
- MOCK_METHOD1(set_perform_interaction_layout,
- void(mobile_apis::LayoutMode::eType mode));
- MOCK_CONST_METHOD0(perform_interaction_layout,
- mobile_apis::LayoutMode::eType());
- MOCK_METHOD1(set_reset_global_properties_active, void(bool active));
- MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
- MOCK_CONST_METHOD0(app_id, uint32_t());
- MOCK_CONST_METHOD0(mac_address, const std::string&());
- MOCK_CONST_METHOD0(bundle_id, const std::string&());
- MOCK_METHOD1(set_bundle_id, void(const std::string& bundle_id));
- MOCK_METHOD0(GetAvailableDiskSpace, uint32_t());
-
- MOCK_METHOD1(set_mobile_projection_enabled, void(bool));
- MOCK_CONST_METHOD0(mobile_projection_enabled, bool());
-
- MOCK_METHOD1(set_mobile_app_id, void(const std::string& policy_app_id));
- MOCK_CONST_METHOD0(is_foreground, bool());
- MOCK_METHOD1(set_foreground, void(bool is_foreground));
- MOCK_CONST_METHOD0(IsRegistered, bool());
- MOCK_CONST_METHOD0(SchemaUrl, std::string());
- MOCK_CONST_METHOD0(PackageName, std::string());
- MOCK_METHOD1(PushMobileMessage, void(smart_objects::SmartObjectSPtr message));
- MOCK_METHOD1(
- SwapMobileMessageQueue,
- void(::application_manager::MobileMessageQueue& mobile_messages));
-
-#ifdef SDL_REMOTE_CONTROL
- MOCK_METHOD1(
- set_system_context,
- void(const application_manager::mobile_api::SystemContext::eType&));
- MOCK_METHOD1(
- set_audio_streaming_state,
- void(const application_manager::mobile_api::AudioStreamingState::eType&
- state));
- MOCK_METHOD1(IsSubscribedToInteriorVehicleData,
- bool(smart_objects::SmartObject module));
- MOCK_METHOD1(SubscribeToInteriorVehicleData,
- bool(smart_objects::SmartObject module));
- MOCK_METHOD1(UnsubscribeFromInteriorVehicleData,
- bool(smart_objects::SmartObject module));
- MOCK_METHOD1(
- set_hmi_level,
- void(const application_manager::mobile_api::HMILevel::eType& hmi_level));
- MOCK_METHOD1(QueryInterface,
- application_manager::AppExtensionPtr(
- application_manager::AppExtensionUID uid));
- MOCK_METHOD1(AddExtension,
- bool(application_manager::AppExtensionPtr extention));
- MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid));
- MOCK_METHOD0(RemoveExtensions, void());
- MOCK_CONST_METHOD0(SubscribesIVI,
- const application_manager::VehicleInfoSubscriptions&());
-
-#endif // SDL_REMOTE_CONTROL
-};
-
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_
diff --git a/src/components/remote_control/test/include/mock_remote_control_plugin.h b/src/components/remote_control/test/include/mock_remote_control_plugin.h
deleted file mode 100644
index a8143f448c..0000000000
--- a/src/components/remote_control/test/include/mock_remote_control_plugin.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_
-
-#include <stdint.h>
-#include "remote_control/remote_plugin_interface.h"
-#include "remote_control/resource_allocation_manager.h"
-#include "application_manager/message.h"
-#include "mock_application.h"
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-
-class RCAppExtension;
-typedef utils::SharedPtr<RCAppExtension> RCAppExtensionPtr;
-
-class MockRemotePluginInterface : public remote_control::RemotePluginInterface {
- public:
- MOCK_CONST_METHOD0(GetPluginInfo, functional_modules::PluginInfo());
- MOCK_METHOD1(
- ProcessMessage,
- functional_modules::ProcessResult(application_manager::MessagePtr msg));
- MOCK_METHOD1(
- ProcessHMIMessage,
- functional_modules::ProcessResult(application_manager::MessagePtr msg));
- MOCK_METHOD1(SendResponseToMobile, void(application_manager::MessagePtr msg));
- MOCK_METHOD1(SendTimeoutResponseToMobile,
- void(application_manager::MessagePtr msg));
- MOCK_METHOD1(RemoveAppExtension, void(uint32_t app_id));
- MOCK_METHOD1(IsAppForPlugin,
- bool(application_manager::ApplicationSharedPtr app));
- MOCK_METHOD2(OnAppHMILevelChanged,
- void(application_manager::ApplicationSharedPtr app,
- mobile_apis::HMILevel::eType old_level));
- MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id));
- MOCK_METHOD1(SendHmiStatusNotification,
- void(application_manager::ApplicationSharedPtr app));
- MOCK_METHOD0(event_dispatcher, RCPluginEventDispatcher&());
- MOCK_METHOD0(RemoveAppExtensions, void());
- MOCK_METHOD0(service, application_manager::ServicePtr());
- MOCK_CONST_METHOD0(GetModuleID, functional_modules::ModuleID());
- MOCK_METHOD0(resource_allocation_manager,
- remote_control::ResourceAllocationManager&());
- MOCK_METHOD2(OnApplicationEvent,
- void(functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application));
- MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
-};
-
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_
diff --git a/src/components/remote_control/test/include/mock_resource_allocation_manager.h b/src/components/remote_control/test/include/mock_resource_allocation_manager.h
deleted file mode 100644
index 6337d8a32a..0000000000
--- a/src/components/remote_control/test/include/mock_resource_allocation_manager.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
-
-#include "gmock/gmock.h"
-#include "remote_control/resource_allocation_manager.h"
-
-namespace test {
-namespace components {
-namespace remote_control_test {
-
-class MockResourceAllocationManager
- : public remote_control::ResourceAllocationManager {
- public:
- MOCK_METHOD2(AcquireResource,
- remote_control::AcquireResult::eType(
- const std::string& module_type, const uint32_t app_id));
- MOCK_METHOD2(ForceAcquireResource,
- void(const std::string& module_type, const uint32_t app_id));
- MOCK_METHOD2(OnDriverDisallowed,
- void(const std::string& module_type, const uint32_t app_id));
- MOCK_METHOD2(OnApplicationEvent,
- void(functional_modules::ApplicationEvent event,
- application_manager::ApplicationSharedPtr application));
- MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
- MOCK_METHOD1(SetAccessMode,
- void(const hmi_apis::Common_RCAccessMode::eType access_mode));
- MOCK_CONST_METHOD0(GetAccessMode, hmi_apis::Common_RCAccessMode::eType());
- MOCK_METHOD3(SetResourceState,
- void(const std::string& module_type,
- const uint32_t app_id,
- const remote_control::ResourceState::eType state));
- MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type));
- MOCK_METHOD0(ResetAllAllocations, void());
-};
-
-} // namespace remote_control_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/remote_control/test/src/rc_app_extension_test.cc b/src/components/remote_control/test/src/rc_app_extension_test.cc
deleted file mode 100644
index 78388ccbf1..0000000000
--- a/src/components/remote_control/test/src/rc_app_extension_test.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "remote_control/rc_app_extension.h"
-
-namespace remote_control {
-
-TEST(CanAppExtensionTest, Create) {
- RCAppExtension extension(7);
- ASSERT_TRUE(extension.uid() == 7);
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/test/src/rc_library_test.cc b/src/components/remote_control/test/src/rc_library_test.cc
deleted file mode 100644
index 77a57c4c3f..0000000000
--- a/src/components/remote_control/test/src/rc_library_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <dlfcn.h>
-#include "gtest/gtest.h"
-#include "remote_control/remote_control_plugin.h"
-#include "mock_service.h"
-
-using functional_modules::PluginInfo;
-using application_manager::MockService;
-
-using ::testing::Return;
-
-namespace remote_control {
-
-::testing::AssertionResult IsError(void* error) {
- if (error) {
- return ::testing::AssertionSuccess() << static_cast<const char*>(error);
- } else {
- return ::testing::AssertionFailure() << error;
- }
-}
-
-TEST(CanLibraryTest, Load) {
- const std::string kLibraryPath = "libRemoteControlModule.so";
-
- void* handle = dlopen(kLibraryPath.c_str(), RTLD_LAZY);
- EXPECT_FALSE(IsError(dlerror()));
- ASSERT_TRUE(handle != NULL);
-
- const std::string kSymbol = "Create";
- void* symbol = dlsym(handle, kSymbol.c_str());
- EXPECT_FALSE(IsError(dlerror()));
- ASSERT_TRUE(symbol != NULL);
-
- typedef CANModule* (*Create)();
- Create create_manager = reinterpret_cast<Create>(symbol);
- CANModule* module = create_manager();
- ASSERT_TRUE(module != NULL);
-
- PluginInfo plugin = module->GetPluginInfo();
- EXPECT_EQ(plugin.name, "RemoteControlPlugin");
- EXPECT_EQ(plugin.version, 1);
-
- MockService* service = new MockService();
- module->set_service(service);
- std::vector<application_manager::ApplicationSharedPtr> apps;
- EXPECT_CALL(*service, GetApplications(module->GetModuleID()))
- .Times(1)
- .WillOnce(Return(apps));
-
- // in order for all sub-threads to start before shutting them down
- // The logic conditions must be chosen to insure that the "signal" is
- // executed if the "wait" is ever processed.
- // (see http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html)
- sleep(3);
- // CANModule::destroy();
- int ret = dlclose(handle);
- EXPECT_FALSE(ret);
- EXPECT_FALSE(IsError(dlerror()));
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/test/src/rc_module_test.cc b/src/components/remote_control/test/src/rc_module_test.cc
deleted file mode 100644
index 7bdf9fb9dd..0000000000
--- a/src/components/remote_control/test/src/rc_module_test.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "remote_control/remote_control_plugin.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "functional_module/module_observer.h"
-#include "application_manager/mock_application.h"
-#include "include/mock_service.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager_settings.h"
-
-using functional_modules::PluginInfo;
-using functional_modules::ProcessResult;
-using functional_modules::RCFunctionID;
-using application_manager::ServicePtr;
-
-using application_manager::MockService;
-using application_manager::MockMessageHelper;
-using test::components::application_manager_test::MockApplication;
-using test::components::application_manager_test::
- MockApplicationManagerSettings;
-
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::StrictMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::Eq;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::application_manager::ApplicationSharedPtr;
-using ::protocol_handler::MessagePriority;
-
-namespace {
-const bool kDeviceHandle = 1u;
-const std::string kDeviceId = "1";
-const std::string kDeviceName = "1";
-const uint32_t kDefaultTimeout = 10000;
-}
-
-namespace remote_control {
-
-class RCModuleTest : public ::testing::Test {
- public:
- RCModuleTest()
- : mock_service_(utils::MakeShared<NiceMock<MockService> >())
- , mock_settings_(
- utils::MakeShared<NiceMock<MockApplicationManagerSettings> >())
- , mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , app0_(utils::MakeShared<NiceMock<MockApplication> >())
- , app1_(utils::MakeShared<NiceMock<MockApplication> >())
- , message_(utils::MakeShared<Message>(MessagePriority::FromServiceType(
- protocol_handler::ServiceType::kRpc)))
- , rc_app_extention_(
- utils::MakeShared<RCAppExtension>(module_.GetModuleID())) {}
-
- void HandleMessage() {
- module_.ProcessHMIMessage(message_);
- }
-
- protected:
- RemoteControlPlugin module_;
- utils::SharedPtr<NiceMock<MockService> > mock_service_;
- utils::SharedPtr<NiceMock<MockApplicationManagerSettings> > mock_settings_;
- MockMessageHelper& mock_message_helper_;
- std::vector<ApplicationSharedPtr> apps_;
- utils::SharedPtr<NiceMock<MockApplication> > app0_;
- utils::SharedPtr<NiceMock<MockApplication> > app1_;
- application_manager::MessagePtr message_;
- utils::SharedPtr<RCAppExtension> rc_app_extention_;
-
- void SetUp() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
- ON_CALL(*mock_service_, GetSettings())
- .WillByDefault(ReturnRef(*mock_settings_));
- ON_CALL(*mock_settings_, default_timeout())
- .WillByDefault(ReturnRef(kDefaultTimeout));
- ServicePtr exp_service(mock_service_);
- module_.set_service(exp_service);
- ServicePtr out_service = module_.service();
- EXPECT_EQ(exp_service.get(), out_service.get());
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
- EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID()))
- .WillOnce(Return(apps_));
- }
-};
-
-TEST_F(RCModuleTest, Create) {
- EXPECT_EQ(153, module_.GetModuleID());
- PluginInfo plugin = module_.GetPluginInfo();
- EXPECT_EQ(plugin.name, "RemoteControlPlugin");
- EXPECT_EQ(plugin.version, 1);
-}
-
-TEST_F(RCModuleTest, ProcessMessageWrongMessage) {
- message_->set_function_id(-1);
- EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0);
- EXPECT_EQ(ProcessResult::CANNOT_PROCESS, module_.ProcessMessage(message_));
-}
-
-TEST_F(RCModuleTest, ProcessMessageEmptyapps_List) {
- message_->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
- message_->set_function_name("OnInteriorVehicleData");
-
- std::string json =
- "{\"jsonrpc\": \"2.0\", \"method\": \"RC.OnInteriorVehicleData\",\
- \"params\": {\"moduleData\": {\"moduleType\": \"CLIMATE\",\
- \"climateControlData\": {\"fanSpeed\": 100} }}}";
- message_->set_json_message(json);
-
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(_))
- .WillOnce(Return(
- application_manager::MessageValidationResult::SCHEMA_MISMATCH));
- EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0);
-
- // EXPECT_EQ(ProcessResult::PROCESSED, module_.ProcessMessage(message_));
- EXPECT_EQ(ProcessResult::CANNOT_PROCESS, module_.ProcessHMIMessage(message_));
-}
-
-TEST_F(RCModuleTest, ProcessMessagePass) {
- message_->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
-
- std::string json =
- "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnInteriorVehicleData\",\
- \"params\":{\"moduleData\":{\
- \"moduleType\": \"CLIMATE\",\"climateControlData\": {\"fanSpeed\": 100}}}}";
-
- message_->set_json_message(json);
-
- application_manager::BinaryData buf;
- application_manager::BinaryData* data = &buf;
- data->push_back(1);
-
- message_->set_binary_data(
- static_cast<const application_manager::BinaryData*>(data));
-
- Json::Value json_value = MessageHelper::StringToValue(json);
- Json::Value module_type =
- json_value[json_keys::kParams][message_params::kModuleData]
- [message_params::kModuleType];
- apps_.push_back(app0_);
- rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
- EXPECT_CALL(*mock_service_, ValidateMessageBySchema(_))
- .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
- EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
- .WillOnce(Return(rc_app_extention_));
- EXPECT_CALL(*app0_, app_id()).WillRepeatedly(Return(1));
- EXPECT_CALL(*app0_, protocol_version())
- .WillRepeatedly(
- Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
- EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID()))
- .WillOnce(Return(apps_));
- EXPECT_CALL(*mock_service_, GetApplication(1)).WillOnce(Return(app0_));
- EXPECT_CALL(*mock_service_, CheckPolicyPermissions(_))
- .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
- EXPECT_CALL(*mock_service_, CheckModule(1, "CLIMATE")).WillOnce(Return(true));
- EXPECT_CALL(*mock_service_, SendMessageToMobile(_));
-
- EXPECT_EQ(ProcessResult::PROCESSED, module_.ProcessHMIMessage(message_));
-}
-
-TEST_F(RCModuleTest, RemoveAppExtensionPassWay) {
- EXPECT_CALL(*mock_service_, GetApplication(1)).WillOnce(Return(app0_));
- EXPECT_CALL(*app0_, RemoveExtension(module_.GetModuleID()));
-
- module_.RemoveAppExtension(1);
-}
-
-TEST_F(RCModuleTest, RemoveAppExtensionIfAppNoExist) {
- ApplicationSharedPtr invalid_app;
-
- EXPECT_CALL(*mock_service_, GetApplication(_)).WillOnce(Return(invalid_app));
-
- module_.RemoveAppExtension(1);
-}
-
-TEST_F(RCModuleTest, SendResponseToMobile) {
- EXPECT_CALL(*mock_service_, SendMessageToMobile(message_));
-
- module_.SendResponseToMobile(message_);
-}
-
-TEST_F(RCModuleTest, IsAppForPluginSuccess) {
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
- .WillOnce(Return(invalid_ext))
- .WillRepeatedly(Return(rc_app_extention_));
- EXPECT_CALL(*app0_, AddExtension(_)).WillOnce(Return(true));
- mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL;
- EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi));
- ON_CALL(*app0_, device()).WillByDefault(Return(1));
- EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_)))
- .WillOnce(Return(true));
- ASSERT_TRUE(module_.IsAppForPlugin(app0_));
-}
-
-TEST_F(RCModuleTest, IsAppForPluginNotNew) {
- EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
- .WillOnce(Return(rc_app_extention_));
- EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)).Times(0);
- ASSERT_TRUE(module_.IsAppForPlugin(app0_));
-}
-
-TEST_F(RCModuleTest, IsAppForPluginFail) {
- application_manager::AppExtensionPtr invalid_ext;
- EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
- .WillOnce(Return(invalid_ext));
- EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_)))
- .Times(1)
- .WillOnce(Return(false));
- ASSERT_FALSE(module_.IsAppForPlugin(app0_));
-}
-
-TEST_F(RCModuleTest, OnAppHMILevelChanged) {
- const application_manager::custom_str::CustomString name("name");
- ON_CALL(*app0_, name()).WillByDefault(ReturnRef(name));
- mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_NONE;
- EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi));
- EXPECT_CALL(*mock_service_,
- NotifyHMIAboutHMILevel(Eq(app0_),
- mobile_apis::HMILevel::eType::HMI_NONE));
- module_.OnAppHMILevelChanged(app0_, mobile_apis::HMILevel::eType::HMI_FULL);
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc
deleted file mode 100644
index a69702d424..0000000000
--- a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE. */
-
-#include "gtest/gtest.h"
-#include <algorithm>
-#include "remote_control/resource_allocation_manager_impl.h"
-#include "mock_resource_allocation_manager.h"
-#include "mock_remote_control_plugin.h"
-#include "remote_control/rc_app_extension.h"
-#include "remote_control/rc_module_constants.h"
-#include "remote_control/message_helper.h"
-#include "functional_module/module_observer.h"
-#include "application_manager/mock_application.h"
-#include "include/mock_service.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-
-using functional_modules::PluginInfo;
-using functional_modules::ProcessResult;
-using functional_modules::RCFunctionID;
-using application_manager::ServicePtr;
-
-using application_manager::MockService;
-using namespace test::components;
-using application_manager_test::MockApplication;
-
-using ::testing::_;
-using ::testing::Mock;
-using ::testing::NiceMock;
-using ::testing::StrictMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SaveArg;
-using ::testing::Eq;
-using ::testing::DoAll;
-using ::testing::SetArgPointee;
-using ::application_manager::Message;
-using ::application_manager::MessageType;
-using ::application_manager::ApplicationSharedPtr;
-using ::protocol_handler::MessagePriority;
-
-namespace {
-const bool kDeviceHandle = 1u;
-const std::string kModuleType1 = "CLIMATE";
-const std::string kModuleType2 = "RADIO";
-const int32_t kConnectionKey = 5;
-const int32_t kCorrelationId = 5;
-const uint32_t kAppId1 = 11u;
-const uint32_t kAppId2 = 22u;
-const std::string policy_app_id_1_ = "policy_id_1";
-const functional_modules::ModuleID kDefaultModuleID = 0;
-}
-
-namespace remote_control {
-
-class RAManagerTest : public ::testing::Test {
- public:
- RAManagerTest()
- : mock_service_(utils::MakeShared<NiceMock<MockService> >())
- , mock_app_1_(utils::MakeShared<NiceMock<MockApplication> >())
- , mock_app_2_(utils::MakeShared<NiceMock<MockApplication> >())
- , message_(utils::MakeShared<Message>(MessagePriority::FromServiceType(
- protocol_handler::ServiceType::kRpc))) {
- EXPECT_CALL(mock_module_, service()).WillRepeatedly(Return(mock_service_));
- EXPECT_CALL(mock_module_, GetModuleID())
- .WillRepeatedly(Return(kDefaultModuleID));
- }
-
- void CheckResultWithHMILevelAndAccessMode(
- ResourceAllocationManagerImpl& ra_manager,
- mobile_apis::HMILevel::eType app_level,
- const remote_control::AcquireResult::eType expected_result,
- const hmi_apis::Common_RCAccessMode::eType access_mode) {
- // Arrange
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(mock_app_1_));
- ra_manager.SetAccessMode(access_mode);
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillOnce(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level()).WillOnce(Return(app_level));
- // Second app tries to get already acquired resource by 1st app
- EXPECT_EQ(expected_result,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
- }
-
- protected:
- utils::SharedPtr<NiceMock<MockService> > mock_service_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_1_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_2_;
- application_manager::MessagePtr message_;
- remote_control_test::MockRemotePluginInterface mock_module_;
- RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
-};
-
-TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) {
- // Arrange
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(ApplicationSharedPtr()));
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- // Act & Assert
- EXPECT_EQ(remote_control::AcquireResult::IN_USE,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-}
-
-TEST_F(RAManagerTest,
- AcquireResource_AppRegisteredAnyHmiLevelResourceFree_Expect_Allowed) {
- // Arrange
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(mock_app_1_));
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- // Act & Assert
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-}
-
-TEST_F(
- RAManagerTest,
- AcquireResource_AppInAnyHmiLevelWantsToAcquireSameResourceTwice_Expect_Allowed) {
- // Arrange
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(mock_app_1_));
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(mock_app_1_));
- // Same app tries to get already acquired resource
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-}
-
-TEST_F(
- RAManagerTest,
- AcquireResource_App2_NotInFULLWantsToGetAcquiredResource_Expect_Rejected) {
- using namespace mobile_apis;
- using namespace hmi_apis;
- using namespace remote_control;
- const HMILevel::eType app_level = HMILevel::eType::HMI_BACKGROUND;
- const AcquireResult::eType expected_result = AcquireResult::REJECTED;
- const Common_RCAccessMode::eType access_mode =
- Common_RCAccessMode::eType::AUTO_ALLOW;
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- CheckResultWithHMILevelAndAccessMode(
- ra_manager, app_level, expected_result, access_mode);
-}
-
-TEST_F(
- RAManagerTest,
- AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_DENY_Expect_InUse) {
- using namespace mobile_apis;
- using namespace hmi_apis;
- using namespace remote_control;
- const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
- const AcquireResult::eType expected_result = AcquireResult::IN_USE;
- const Common_RCAccessMode::eType access_mode =
- Common_RCAccessMode::eType::AUTO_DENY;
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- CheckResultWithHMILevelAndAccessMode(
- ra_manager, app_level, expected_result, access_mode);
-}
-
-TEST_F(
- RAManagerTest,
- AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_ALLOW_Expect_Allowed) {
- using namespace mobile_apis;
- using namespace hmi_apis;
- using namespace remote_control;
- const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
- const AcquireResult::eType expected_result = AcquireResult::ALLOWED;
- const Common_RCAccessMode::eType access_mode =
- Common_RCAccessMode::eType::AUTO_ALLOW;
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- CheckResultWithHMILevelAndAccessMode(
- ra_manager, app_level, expected_result, access_mode);
-}
-
-TEST_F(
- RAManagerTest,
- AcquireResource_App2_InFULLWantsToGetAcquiredResource_ASK_DRIVER_Expect_AskDriver) {
- using namespace mobile_apis;
- using namespace hmi_apis;
- using namespace remote_control;
- const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
- const AcquireResult::eType expected_result = AcquireResult::ASK_DRIVER;
- const Common_RCAccessMode::eType access_mode =
- Common_RCAccessMode::eType::ASK_DRIVER;
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- CheckResultWithHMILevelAndAccessMode(
- ra_manager, app_level, expected_result, access_mode);
-}
-
-TEST_F(RAManagerTest,
- AcquireResource_AcquiredModuleIsRejectedForApp2_ExpectApp2Rejected) {
- // Arrange
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(mock_app_1_));
- EXPECT_EQ(AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-
- // Act
- ra_manager.OnDriverDisallowed(kModuleType1, kAppId2);
-
- // Assert
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillOnce(Return(mock_app_2_));
- EXPECT_EQ(AcquireResult::REJECTED,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
-}
-
-TEST_F(RAManagerTest, AppExit_ReleaseResource) {
- // Arrange
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillRepeatedly(Return(mock_app_1_));
-
- RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
- application_manager::AppExtensionUID(kDefaultModuleID));
-
- EXPECT_CALL(*mock_app_1_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-
- // Act
- application_manager::ApplicationSharedPtr app_ptr(mock_app_1_);
- EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
-
- ra_manager.OnApplicationEvent(
- functional_modules::ApplicationEvent::kApplicationExit, app_ptr);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillRepeatedly(Return(mock_app_2_));
-
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
-}
-
-TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
- // Arrange
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(mock_app_1_));
-
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillRepeatedly(Return(mock_app_2_));
-
- RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
- application_manager::AppExtensionUID(kDefaultModuleID));
-
- EXPECT_CALL(*mock_app_2_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
- // Act
- application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
- EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
- ra_manager.OnApplicationEvent(
- functional_modules::ApplicationEvent::kApplicationExit, app_ptr);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillOnce(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
- EXPECT_EQ(remote_control::AcquireResult::IN_USE,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
-}
-
-TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) {
- // Arrange
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
-
- RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
- application_manager::AppExtensionUID(kDefaultModuleID));
-
- EXPECT_CALL(*mock_app_1_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillRepeatedly(Return(mock_app_1_));
-
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-
- // Act
- application_manager::ApplicationSharedPtr app_ptr(mock_app_1_);
- EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
-
- ra_manager.OnApplicationEvent(
- functional_modules::ApplicationEvent::kApplicationUnregistered, app_ptr);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillOnce(Return(mock_app_2_));
-
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
-}
-
-TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) {
- // Arrange
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillOnce(Return(mock_app_1_));
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillRepeatedly(Return(mock_app_2_));
-
- RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
- application_manager::AppExtensionUID(kDefaultModuleID));
-
- EXPECT_CALL(*mock_app_2_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
- // Act
- application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
- EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
-
- ra_manager.OnApplicationEvent(
- functional_modules::ApplicationEvent::kApplicationUnregistered, app_ptr);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillOnce(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
- EXPECT_EQ(remote_control::AcquireResult::IN_USE,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
-}
-
-TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
- // Arrange
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillRepeatedly(Return(mock_app_1_));
-
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType2, kAppId1));
-
- std::vector<ApplicationSharedPtr> apps;
- apps.push_back(mock_app_1_);
- EXPECT_CALL(*mock_service_, GetApplications(_)).WillRepeatedly(Return(apps));
-
- RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
- application_manager::AppExtensionUID(kDefaultModuleID));
-
- EXPECT_CALL(*mock_app_1_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
- // Act
- ra_manager.OnPolicyEvent(
- functional_modules::PolicyEvent::kApplicationsDisabled);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillRepeatedly(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType2, kAppId2));
-}
-
-TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
- // Arrange
- ResourceAllocationManagerImpl ra_manager(mock_module_);
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillRepeatedly(Return(mock_app_1_));
-
- RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
- application_manager::AppExtensionUID(kDefaultModuleID));
-
- EXPECT_CALL(*mock_app_1_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
- .WillRepeatedly(Return(mock_app_1_));
-
- EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
-
- EXPECT_CALL(*mock_app_1_, policy_app_id())
- .WillRepeatedly(Return(policy_app_id_1_));
-
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType1, kAppId1));
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType2, kAppId1));
-
- std::vector<application_manager::ApplicationSharedPtr> apps;
- apps.push_back(mock_app_1_);
- EXPECT_CALL(*mock_service_, GetApplications(_)).WillOnce(Return(apps));
-
- Resources allowed_modules;
- allowed_modules.push_back(kModuleType1);
-
- EXPECT_CALL(*mock_service_, GetModuleTypes(policy_app_id_1_, _))
- .WillOnce(DoAll(SetArgPointee<1>(allowed_modules), Return(true)));
-
- // Act
- ra_manager.OnPolicyEvent(
- functional_modules::PolicyEvent::kApplicationPolicyUpdated);
-
- EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
- .WillRepeatedly(Return(mock_app_2_));
- EXPECT_CALL(*mock_app_2_, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
- EXPECT_EQ(remote_control::AcquireResult::IN_USE,
- ra_manager.AcquireResource(kModuleType1, kAppId2));
- EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
- ra_manager.AcquireResource(kModuleType2, kAppId2));
-}
-
-TEST_F(RAManagerTest, GetAccessMode_ExpectedSameAsHadSet) {
- ResourceAllocationManagerImpl ra_manager(mock_module_);
-
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_DENY);
- EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_DENY,
- ra_manager.GetAccessMode());
-
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER);
- EXPECT_EQ(hmi_apis::Common_RCAccessMode::ASK_DRIVER,
- ra_manager.GetAccessMode());
-
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_ALLOW);
- EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_ALLOW,
- ra_manager.GetAccessMode());
-
- ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::INVALID_ENUM);
- EXPECT_EQ(hmi_apis::Common_RCAccessMode::INVALID_ENUM,
- ra_manager.GetAccessMode());
-}
-
-} // namespace remote_control
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base.h b/src/components/rpc_base/include/rpc_base/rpc_base.h
index 6792f47732..10b494465c 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base.h
@@ -42,11 +42,6 @@ namespace Json {
class Value;
} // namespace Json
-namespace dbus {
-class MessageReader;
-class MessageWriter;
-} // namespace dbus
-
namespace rpc {
class ValidationReport;
@@ -173,12 +168,10 @@ class Boolean : public PrimitiveType {
Boolean();
explicit Boolean(bool value);
explicit Boolean(const Json::Value* value);
- explicit Boolean(dbus::MessageReader* reader);
Boolean(const Json::Value* value, bool def_value);
Boolean& operator=(bool new_val);
operator bool() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
// Fields
@@ -197,7 +190,6 @@ class Integer : public PrimitiveType {
explicit Integer(IntType value);
Integer(const Integer& value);
explicit Integer(const Json::Value* value);
- explicit Integer(dbus::MessageReader* reader);
Integer(const Json::Value* value, IntType def_value);
Integer& operator=(IntType new_val);
Integer& operator=(const Integer& new_val);
@@ -205,7 +197,6 @@ class Integer : public PrimitiveType {
Integer& operator+=(int value);
operator IntType() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
IntType value_;
@@ -219,12 +210,10 @@ class Float : public PrimitiveType {
Float();
explicit Float(double value);
explicit Float(const Json::Value* value);
- explicit Float(dbus::MessageReader* reader);
Float(const Json::Value* value, double def_value);
Float& operator=(double new_val);
operator double() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
double value_;
@@ -239,7 +228,6 @@ class String : public PrimitiveType {
explicit String(const std::string& value);
explicit String(const char* value);
explicit String(const Json::Value* value);
- explicit String(dbus::MessageReader* reader);
String(const Json::Value* value, const std::string& def_value);
bool operator<(const String& new_val) const;
String& operator=(const std::string& new_val);
@@ -247,7 +235,6 @@ class String : public PrimitiveType {
bool operator==(const String& rhs) const;
operator const std::string&() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
std::string value_;
@@ -265,12 +252,10 @@ class Enum : public PrimitiveType {
Enum();
explicit Enum(EnumType value);
explicit Enum(const Json::Value* value);
- explicit Enum(dbus::MessageReader* reader);
Enum(const Json::Value* value, EnumType def_value);
Enum& operator=(const EnumType& new_val);
operator EnumType() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
// Fields
@@ -289,7 +274,6 @@ class Array : public std::vector<T>, public CompositeType {
// Need const and non-const versions to beat all-type accepting constructor
explicit Array(Json::Value* value);
explicit Array(const Json::Value* value);
- explicit Array(dbus::MessageReader* reader);
template <typename U>
explicit Array(const U& value);
template <typename U>
@@ -298,7 +282,6 @@ class Array : public std::vector<T>, public CompositeType {
template <typename U>
void push_back(const U& value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
virtual bool is_valid() const;
bool is_initialized() const;
@@ -320,7 +303,6 @@ class Map : public std::map<std::string, T>, public CompositeType {
// Need const and non-const versions to beat all-type accepting constructor
explicit Map(Json::Value* value);
explicit Map(const Json::Value* value);
- explicit Map(dbus::MessageReader* reader);
template <typename U>
explicit Map(const U& value);
template <typename U>
@@ -329,7 +311,6 @@ class Map : public std::map<std::string, T>, public CompositeType {
template <typename U>
void insert(const std::pair<std::string, U>& value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
bool is_valid() const;
bool is_initialized() const;
@@ -343,7 +324,6 @@ class Nullable : public T {
public:
// Methods
Nullable();
- explicit Nullable(dbus::MessageReader* reader);
// Need const and non-const versions to beat all-type accepting constructor
explicit Nullable(Json::Value* value);
explicit Nullable(const Json::Value* value);
@@ -370,7 +350,6 @@ class Stringifyable : public T {
public:
// Methods
Stringifyable();
- explicit Stringifyable(dbus::MessageReader* reader);
// Need const and non-const versions to beat all-type accepting constructor
explicit Stringifyable(Json::Value* value);
explicit Stringifyable(const Json::Value* value);
@@ -398,15 +377,12 @@ class Optional {
public:
// Methods
Optional();
- explicit Optional(dbus::MessageReader* reader);
template <typename U>
explicit Optional(const U& value);
template <typename U>
Optional(const Json::Value* value, const U& def_value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
-
// Pointer semantics
T& operator*();
const T& operator*() const;
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
deleted file mode 100644
index aae1a34ac2..0000000000
--- a/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
-#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
-
-#include "dbus/dbus_message.h"
-#include "json/value.h"
-#include "rpc_base/rpc_base.h"
-
-namespace rpc {
-
-// static
-inline PrimitiveType::ValueState PrimitiveType::InitHelper(bool is_next) {
- return is_next ? kValid : kInvalid;
-}
-
-// static
-inline CompositeType::InitializationState CompositeType::InitHelper(
- bool is_next) {
- return is_next ? kInitialized : kUninitialized;
-}
-
-namespace impl {
-
-// Helper functions to statically map int types to appropriate
-// MessageReader functions
-
-// Non-specialized versions doesn't have implementation
-
-// Tells if next element of reader is of type T
-template <typename T>
-inline bool NextIs(const dbus::MessageReader& reader);
-// Takes next element of type T from reader
-template <typename T>
-inline T Take(dbus::MessageReader* reader);
-
-template <>
-inline bool NextIs<int8_t>(const dbus::MessageReader& reader) {
- return reader.NextIsByte();
-}
-
-template <>
-inline int8_t Take<int8_t>(dbus::MessageReader* reader) {
- return static_cast<int8_t>(reader->TakeByte());
-}
-
-inline void Put(int8_t val, dbus::MessageWriter* writer) {
- writer->PutByte(static_cast<uint8_t>(val));
-}
-
-template <>
-inline bool NextIs<uint8_t>(const dbus::MessageReader& reader) {
- return reader.NextIsByte();
-}
-
-template <>
-inline uint8_t Take<uint8_t>(dbus::MessageReader* reader) {
- return reader->TakeByte();
-}
-
-inline void Put(uint8_t val, dbus::MessageWriter* writer) {
- writer->PutByte(val);
-}
-
-template <>
-inline bool NextIs<int16_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt16();
-}
-
-template <>
-inline int16_t Take<int16_t>(dbus::MessageReader* reader) {
- return reader->TakeInt16();
-}
-
-inline void Put(int16_t val, dbus::MessageWriter* writer) {
- writer->PutInt16(val);
-}
-
-template <>
-inline bool NextIs<uint16_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint16();
-}
-
-template <>
-inline uint16_t Take<uint16_t>(dbus::MessageReader* reader) {
- return reader->TakeUint16();
-}
-
-inline void Put(uint16_t val, dbus::MessageWriter* writer) {
- writer->PutUint16(val);
-}
-
-template <>
-inline bool NextIs<int32_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt32();
-}
-
-template <>
-inline int32_t Take<int32_t>(dbus::MessageReader* reader) {
- return reader->TakeInt32();
-}
-
-inline void Put(int32_t val, dbus::MessageWriter* writer) {
- writer->PutInt32(val);
-}
-
-template <>
-inline bool NextIs<uint32_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint32();
-}
-
-template <>
-inline uint32_t Take<uint32_t>(dbus::MessageReader* reader) {
- return reader->TakeUint32();
-}
-
-inline void Put(uint32_t val, dbus::MessageWriter* writer) {
- writer->PutUint32(val);
-}
-
-template <>
-inline bool NextIs<int64_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt64();
-}
-
-template <>
-inline int64_t Take<int64_t>(dbus::MessageReader* reader) {
- return reader->TakeInt64();
-}
-
-inline void Put(int64_t val, dbus::MessageWriter* writer) {
- writer->PutInt64(val);
-}
-
-template <>
-inline bool NextIs<uint64_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint64();
-}
-
-template <>
-inline uint64_t Take<uint64_t>(dbus::MessageReader* reader) {
- return reader->TakeUint64();
-}
-
-inline void Put(uint64_t val, dbus::MessageWriter* writer) {
- writer->PutUint64(val);
-}
-
-template <>
-inline std::string Take<std::string>(dbus::MessageReader* reader) {
- return reader->TakeString();
-}
-
-inline void Put(const std::string val, dbus::MessageWriter* writer) {
- writer->PutString(val);
-}
-
-// Type to DBus type id mappers
-template <typename T>
-char DbusTypeCode();
-template <>
-inline char DbusTypeCode<bool>() {
- return DBUS_TYPE_BOOLEAN;
-}
-// There is no dbus type for signed byte, map to unsigned
-template <>
-inline char DbusTypeCode<int8_t>() {
- return DBUS_TYPE_BYTE;
-}
-template <>
-inline char DbusTypeCode<uint8_t>() {
- return DBUS_TYPE_BYTE;
-}
-template <>
-inline char DbusTypeCode<int16_t>() {
- return DBUS_TYPE_INT16;
-}
-template <>
-inline char DbusTypeCode<uint16_t>() {
- return DBUS_TYPE_UINT16;
-}
-template <>
-inline char DbusTypeCode<int32_t>() {
- return DBUS_TYPE_INT32;
-}
-template <>
-inline char DbusTypeCode<uint32_t>() {
- return DBUS_TYPE_UINT32;
-}
-template <>
-inline char DbusTypeCode<int64_t>() {
- return DBUS_TYPE_INT64;
-}
-template <>
-inline char DbusTypeCode<uint64_t>() {
- return DBUS_TYPE_UINT64;
-}
-template <>
-inline char DbusTypeCode<double>() {
- return DBUS_TYPE_DOUBLE;
-}
-template <>
-inline char DbusTypeCode<std::string>() {
- return DBUS_TYPE_STRING;
-}
-template <>
-inline char DbusTypeCode<const std::string>() {
- return DBUS_TYPE_STRING;
-}
-
-// Non-specialized template supposes there is static
-// void GetDbusSignature(std::string*) method in T
-template <typename T>
-struct DbusSignatureHelper {
- static void DbusSignature(std::string* signature) {
- T::GetDbusSignature(signature);
- }
-};
-
-template <>
-struct DbusSignatureHelper<Boolean> {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- }
-};
-
-template <typename T, T minval, T maxval>
-struct DbusSignatureHelper<Integer<T, minval, maxval> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<T>();
- }
-};
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-struct DbusSignatureHelper<Float<minnum, maxnum, minden, maxden> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<double>();
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Enum<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<int32_t>();
- }
-};
-
-template <size_t minlen, size_t maxlen>
-struct DbusSignatureHelper<String<minlen, maxlen> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<std::string>();
- }
-};
-
-template <typename K, typename V>
-struct DbusSignatureHelper<std::pair<K, V> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_DICT_ENTRY_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<K>();
- rpc::impl::DbusSignatureHelper<V>::DbusSignature(signature);
- (*signature) += DBUS_DICT_ENTRY_END_CHAR;
- }
-};
-
-template <typename T, size_t minsize, size_t maxsize>
-struct DbusSignatureHelper<Array<T, minsize, maxsize> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_TYPE_ARRAY;
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- }
-};
-
-template <typename T, size_t minsize, size_t maxsize>
-struct DbusSignatureHelper<Map<T, minsize, maxsize> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_TYPE_ARRAY;
- rpc::impl::DbusSignatureHelper<typename Map<T, minsize, maxsize>::
- value_type>::DbusSignature(signature);
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Optional<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_STRUCT_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- (*signature) += DBUS_STRUCT_END_CHAR;
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Nullable<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_STRUCT_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- (*signature) += DBUS_STRUCT_END_CHAR;
- }
-};
-
-// Helper Optional type initialization functipon
-template <typename T>
-T TakeOptional(dbus::MessageReader* reader) {
- dbus::MessageReader struct_reader = reader->TakeStructReader();
- bool available = struct_reader.TakeBool();
- T value(&struct_reader);
- return available ? value : T();
-}
-
-// Helper Nullable type initialization functipon
-template <typename T>
-bool TakeNullable(dbus::MessageReader* reader) {
- dbus::MessageReader struct_reader = reader->TakeStructReader();
- bool is_null = struct_reader.TakeBool();
- return is_null;
-}
-
-} // namespace impl
-
-// Helper function that outputs dbus signature for type T
-template <typename T>
-void DbusSignature(std::string* signature) {
- impl::DbusSignatureHelper<T>::DbusSignature(signature);
-}
-
-// Type constructors
-inline Boolean::Boolean(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsBool()))
- , value_(reader->TakeBool()) {}
-
-template <typename T, T minval, T maxval>
-inline Integer<T, minval, maxval>::Integer(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(impl::NextIs<IntType>(*reader)))
- , value_(impl::Take<IntType>(reader)) {
- if (is_valid()) {
- value_state_ = range_.Includes(value_) ? kValid : kInvalid;
- }
-}
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-inline Float<minnum, maxnum, minden, maxden>::Float(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsDouble()))
- , value_(reader->TakeDouble()) {
- if (is_valid()) {
- value_state_ = range_.Includes(value_) ? kValid : kInvalid;
- }
-}
-
-template <size_t minlen, size_t maxlen>
-inline String<minlen, maxlen>::String(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsString()))
- , value_(reader->TakeString()) {
- if (is_valid()) {
- value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
- }
-}
-
-template <typename T>
-inline Enum<T>::Enum(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsInt32()))
- , value_(EnumType(reader->TakeInt32())) {
- if (is_valid()) {
- value_state_ = IsValidEnum(value_) ? kValid : kInvalid;
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline Array<T, minsize, maxsize>::Array(dbus::MessageReader* reader)
- : CompositeType(InitHelper(reader->NextIsArray())) {
- dbus::MessageReader array_reader = reader->TakeArrayReader();
- if (array_reader.has_failed()) {
- push_back(T());
- } else {
- while (array_reader.HasNext()) {
- push_back(T(&array_reader));
- }
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline Map<T, minsize, maxsize>::Map(dbus::MessageReader* reader)
- : CompositeType(InitHelper(reader->NextIsStruct())) {
- // Map key-value pairs are serialized into array
- dbus::MessageReader array_reader = reader->TakeArrayReader();
- if (array_reader.has_failed()) {
- this->insert(typename MapType::value_type("", T()));
- } else {
- while (array_reader.HasNext()) {
- dbus::MessageReader dictvalue_reader = array_reader.TakeDictEntryReader();
- typename MapType::key_type key =
- impl::Take<typename MapType::key_type>(&dictvalue_reader);
- this->insert(typename MapType::value_type(key, T(&dictvalue_reader)));
- }
- }
-}
-
-template <typename T>
-inline Nullable<T>::Nullable(dbus::MessageReader* reader)
- : T(reader), marked_null_(impl::TakeNullable<T>(reader)) {}
-
-template <typename T>
-inline Optional<T>::Optional(dbus::MessageReader* reader)
- : value_(impl::TakeOptional<T>(reader)) {}
-
-// MessageWriter serializers
-inline void Boolean::ToDbusWriter(dbus::MessageWriter* writer) const {
- writer->PutBool(value_);
-}
-
-template <typename T, T minval, T maxval>
-inline void Integer<T, minval, maxval>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- impl::Put(value_, writer);
-}
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-inline void Float<minnum, maxnum, minden, maxden>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- writer->PutDouble(value_);
-}
-
-template <size_t minlen, size_t maxlen>
-inline void String<minlen, maxlen>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- writer->PutString(value_);
-}
-
-template <typename T>
-inline void Enum<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
- writer->PutInt32(static_cast<int32_t>(value_));
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline void Array<T, minsize, maxsize>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- std::string array_signature;
- DbusSignature<typename ArrayType::value_type>(&array_signature);
- dbus::MessageWriter array_writer(
- writer, dbus::kArray, array_signature.c_str());
- for (typename ArrayType::const_iterator i = this->begin(); i != this->end();
- ++i) {
- i->ToDbusWriter(&array_writer);
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline void Map<T, minsize, maxsize>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- std::string array_signature;
- DbusSignature<typename MapType::value_type>(&array_signature);
- dbus::MessageWriter array_writer(
- writer, dbus::kArray, array_signature.c_str());
- for (typename MapType::const_iterator i = this->begin(); i != this->end();
- ++i) {
- dbus::MessageWriter dictentry_writer(&array_writer, dbus::kDictEntry, NULL);
- impl::Put(i->first, &dictentry_writer);
- i->second.ToDbusWriter(&dictentry_writer);
- }
-}
-
-template <typename T>
-inline void Optional<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
- dbus::MessageWriter struct_writer(writer, dbus::kStruct, NULL);
- struct_writer.PutBool(value_.is_initialized());
- value_.ToDbusWriter(&struct_writer);
-}
-
-} // namespace rpc
-
-#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
diff --git a/src/components/rpc_base/test/CMakeLists.txt b/src/components/rpc_base/test/CMakeLists.txt
index ca4f41fe76..ae87bb71b7 100644
--- a/src/components/rpc_base/test/CMakeLists.txt
+++ b/src/components/rpc_base/test/CMakeLists.txt
@@ -31,8 +31,6 @@
include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- ${COMPONENTS_DIR}/dbus/include
- ${COMPONENTS_DIR}/dbus/src
${COMPONENTS_DIR}/rpc_base/include
${GMOCK_INCLUDE_DIRECTORY}
${JSONCPP_INCLUDE_DIRECTORY}
@@ -43,16 +41,5 @@ set(LIBRARIES
jsoncpp
)
-if(${HMI_DBUS_API})
- include_directories(${DBUS_INCLUDE_DIRS})
- list(APPEND LIBRARIES
- DBus
- )
-else()
- set(EXCLUDE_PATHS
- rpc_base_dbus_test.cc
- )
-endif()
-
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
create_test(rpc_base_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/rpc_base/test/rpc_base_dbus_test.cc b/src/components/rpc_base/test/rpc_base_dbus_test.cc
deleted file mode 100644
index 4a22e111a3..0000000000
--- a/src/components/rpc_base/test/rpc_base_dbus_test.cc
+++ /dev/null
@@ -1,682 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "dbus/dbus_message.h"
-#include "rpc_base/rpc_base.h"
-#include "rpc_base/rpc_base_dbus_inl.h"
-
-namespace test {
-namespace components {
-namespace rpc_base_test {
-
-using namespace rpc;
-using namespace dbus;
-
-enum TestEnum { kValue0, kValue1, kInvalidValue };
-
-bool IsValidEnum(TestEnum val) {
- return val == kValue0 || val == kValue1;
-}
-
-bool EnumFromJsonString(const std::string& value, TestEnum* enm) {
- if (value == "kValue0") {
- *enm = kValue0;
- return true;
- } else if (value == "kValue1") {
- *enm = kValue1;
- return true;
- } else {
- return false;
- }
-}
-
-const char* EnumToJsonString(TestEnum enm) {
- switch (enm) {
- case kValue0:
- return "kValue0";
- case kValue1:
- return "kValue1";
- default:
- return "UNKNOWN";
- }
-}
-
-struct DbusDeserialization : public testing::Test {
- dbus::MessageRef msgref;
- DbusDeserialization()
- : msgref(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {}
-};
-
-TEST_F(DbusDeserialization, DeserializeBool) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutBool(true);
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean booln(&reader);
- ASSERT_TRUE(booln);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeByte) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutByte(200);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<uint8_t, 1, 220> byte(&reader);
- ASSERT_TRUE(byte.is_initialized());
- ASSERT_TRUE(byte.is_valid());
- ASSERT_EQ(byte, 200);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeInt64) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutInt64(-1);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int64_t, -5, 220> int64(&reader);
- ASSERT_TRUE(int64.is_initialized());
- ASSERT_TRUE(int64.is_valid());
- ASSERT_EQ(int64, -1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeFloat) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutDouble(3.14);
- }
- {
- dbus::MessageReader reader(msgref);
- Float<3, 4> pi(&reader);
- ASSERT_TRUE(pi.is_initialized());
- ASSERT_TRUE(pi.is_valid());
- ASSERT_DOUBLE_EQ(pi, 3.14);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeString) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello");
- }
- {
- dbus::MessageReader reader(msgref);
- String<3, 10> hello(&reader);
- ASSERT_TRUE(hello.is_initialized());
- ASSERT_TRUE(hello.is_valid());
- ASSERT_EQ(std::string(hello), "Hello");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeEnum) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutInt32(kValue1);
- }
- {
- dbus::MessageReader reader(msgref);
- Enum<TestEnum> enm(&reader);
- ASSERT_TRUE(enm.is_initialized());
- ASSERT_TRUE(enm.is_valid());
- ASSERT_EQ(enm, kValue1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeArray) {
- {
- dbus::MessageWriter writer(msgref);
- std::string array_signature;
- rpc::DbusSignature<Integer<int32_t, 1, 50> >(&array_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, array_signature.c_str());
- array_writer.PutInt32(5);
- array_writer.PutInt32(33);
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Integer<int32_t, 1, 50>, 1, 100> array(&reader);
- ASSERT_TRUE(array.is_initialized());
- ASSERT_TRUE(array.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(array.size(), 2u);
- ASSERT_EQ(array[0], 5);
- ASSERT_EQ(array[1], 33);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeArrayOfArrays) {
- {
- dbus::MessageWriter writer(msgref);
- std::string array_signature;
- rpc::DbusSignature<Array<Integer<int32_t, 1, 50>, 1, 5> >(&array_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, array_signature.c_str());
- int val = 5;
- for (int i = 0; i < 2; ++i) {
- std::string subarray_signature;
- rpc::DbusSignature<Integer<int32_t, 1, 50> >(&subarray_signature);
- dbus::MessageWriter subarray_wirter(
- &array_writer, dbus::kArray, subarray_signature.c_str());
-
- subarray_wirter.PutInt32(val++);
- subarray_wirter.PutInt32(val++);
- }
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Array<Integer<int32_t, 1, 50>, 1, 5>, 1, 5> array(&reader);
- ASSERT_TRUE(array.is_initialized());
- ASSERT_TRUE(array.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(array.size(), 2u);
- ASSERT_EQ(array[0].size(), 2u);
- ASSERT_EQ(array[1].size(), 2u);
- ASSERT_EQ(array[0][0], 5);
- ASSERT_EQ(array[0][1], 6);
- ASSERT_EQ(array[1][0], 7);
- ASSERT_EQ(array[1][1], 8);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeMap) {
- {
- dbus::MessageWriter writer(msgref);
- std::string dict_signature;
- rpc::DbusSignature<Map<Enum<TestEnum>, 1, 5>::value_type>(&dict_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, dict_signature.c_str());
- const char* keys[] = {"Hello", "World"};
- int val = 0;
- for (int i = 0; i < 2; ++i) {
- dbus::MessageWriter dictval_wirter(&array_writer, dbus::kDictEntry, NULL);
- dictval_wirter.PutString(keys[val]);
- dictval_wirter.PutInt32(val++);
- }
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Enum<TestEnum>, 1, 5> amap(&reader);
- ASSERT_TRUE(amap.is_initialized());
- ASSERT_TRUE(amap.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(amap.size(), 2u);
- ASSERT_EQ(amap["Hello"], kValue0);
- ASSERT_EQ(amap["World"], kValue1);
- }
-}
-
-TEST_F(DbusDeserialization, InconsistentTypesTest) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello");
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean badbool(&reader);
- ASSERT_TRUE(badbool.is_initialized());
- ASSERT_FALSE(badbool.is_valid());
- ASSERT_TRUE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeOptionalString) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter optwriter(&writer, dbus::kStruct, NULL);
- optwriter.PutBool(true);
- optwriter.PutString("Hello dear");
- }
- {
- dbus::MessageReader reader(msgref);
- Optional<String<1, 100> > readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(std::string(*readback), "Hello dear");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeOptionalInt) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter optwriter(&writer, dbus::kStruct, NULL);
- optwriter.PutBool(false);
- optwriter.PutInt32(42);
- }
- {
- dbus::MessageReader reader(msgref);
- Optional<Integer<int32_t, 1, 90> > readback(&reader);
- ASSERT_FALSE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeBool) {
- {
- Boolean true_bool(true);
- dbus::MessageWriter writer(msgref);
- true_bool.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, true);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeInt8t) {
- {
- Integer<int8_t, 1, 100> int8(42);
- dbus::MessageWriter writer(msgref);
- int8.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int8_t, 1, 100> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, 42);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, BadSerializeDeserializeInt8t) {
- {
- Integer<int8_t, 1, 12> int8(42);
- dbus::MessageWriter writer(msgref);
- int8.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int8_t, 1, 12> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_FALSE(readback.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeInt64t) {
- {
- Integer<int64_t, 1, 0xFFFFFFFFFF> int64(0xFFFFFFFFF1);
- dbus::MessageWriter writer(msgref);
- int64.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int64_t, 1, 0xFFFFFFFFFF> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, 0xFFFFFFFFF1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeDouble) {
- {
- Float<1, 5> flt(3.14);
- dbus::MessageWriter writer(msgref);
- flt.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Float<1, 5> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_DOUBLE_EQ(readback, 3.14);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeString) {
- {
- String<1, 12> hello("Hello");
- dbus::MessageWriter writer(msgref);
- hello.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- String<1, 12> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(std::string(readback), "Hello");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeEnum) {
- {
- Enum<TestEnum> te(kValue1);
- dbus::MessageWriter writer(msgref);
- te.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Enum<TestEnum> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, kValue1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeArray) {
- {
- Array<Integer<int32_t, 1, 100>, 1, 90> ints;
- ints.push_back(42);
- ints.push_back(17);
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Integer<int32_t, 1, 100>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback[0], 42);
- ASSERT_EQ(readback[1], 17);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeMap) {
- {
- Map<Integer<int32_t, 1, 100>, 1, 90> ints;
- ints["first"] = 42;
- ints["second"] = 17;
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Integer<int32_t, 1, 100>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback["first"], 42);
- ASSERT_EQ(readback["second"], 17);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeMapOfArrays) {
- {
- Map<Array<Integer<int32_t, 1, 100>, 1, 5>, 1, 90> ints;
- ints["first"].push_back(1);
- ints["first"].push_back(42);
- ints["second"].push_back(17);
- ints["second"].push_back(3);
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Array<Integer<int32_t, 1, 100>, 1, 5>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback.size(), 2u);
- ASSERT_EQ(readback["first"].size(), 2u);
- ASSERT_EQ(readback["second"].size(), 2u);
- ASSERT_EQ(readback["first"][0], 1);
- ASSERT_EQ(readback["first"][1], 42);
- ASSERT_EQ(readback["second"][0], 17);
- ASSERT_EQ(readback["second"][1], 3);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST(ValidatedTypes, TestBooleanDbusSignature) {
- std::string sign;
- DbusSignature<Boolean>(&sign);
- ASSERT_EQ(sign, "b");
-}
-
-TEST(ValidatedTypes, TestIntDbusSignature) {
- std::string sign;
- DbusSignature<Integer<int32_t, 1, 2> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestFloatDbusSignature) {
- std::string sign;
- DbusSignature<Float<1, 2> >(&sign);
- ASSERT_EQ(sign, "d");
-}
-
-TEST(ValidatedTypes, TestStringDbusSignature) {
- std::string sign;
- DbusSignature<String<1, 2> >(&sign);
- ASSERT_EQ(sign, "s");
-}
-
-TEST(ValidatedTypes, TestEnumDbusSignature) {
- std::string sign;
- DbusSignature<Enum<TestEnum> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestIntArrayDbusSignature) {
- std::string sign;
- DbusSignature<Array<Integer<int32_t, 1, 2>, 1, 3> >(&sign);
- ASSERT_EQ(sign, "ai");
-}
-
-TEST(ValidatedTypes, TestIntArrayArrayDbusSignature) {
- std::string sign;
- DbusSignature<Array<Array<Integer<int32_t, 1, 2>, 1, 3>, 4, 5> >(&sign);
- ASSERT_EQ(sign, "aai");
-}
-
-TEST(ValidatedTypes, TestMapDbusSignature) {
- std::string sign;
- DbusSignature<Map<Integer<int32_t, 1, 2>, 3, 4> >(&sign);
- ASSERT_EQ(sign, "a{si}");
-}
-
-TEST(ValidatedTypes, TestMandatoryEnumDbusSignature) {
- std::string sign;
- DbusSignature<Enum<TestEnum> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestOptionalEnumDbusSignature) {
- std::string sign;
- DbusSignature<Optional<Enum<TestEnum> > >(&sign);
- ASSERT_EQ(sign, "(bi)");
-}
-
-TEST(ValidatedTypes, TestOptionalFloatArrayDbusSignature) {
- std::string sign;
- DbusSignature<Optional<Array<Float<1, 2>, 3, 4> > >(&sign);
- ASSERT_EQ(sign, "(bad)");
-}
-
-TEST(DbusMessageConstructionTest, DbusMessageConstruction) {
- DBusMessage* rawmsg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL);
- dbus::MessageRef msgref(rawmsg);
-}
-
-class DbusTest : public testing::Test {
- public:
- dbus::MessageRef msgref;
- DbusTest() : msgref(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {}
-};
-
-TEST_F(DbusTest, DbusWriterConstructionTest) {
- dbus::MessageWriter writer(msgref);
-}
-
-TEST_F(DbusTest, DbusEmptyMessageReaderTest) {
- dbus::MessageReader reader(msgref);
- ASSERT_TRUE(reader.has_failed());
-}
-
-TEST_F(DbusTest, DbusMessageWriterBoolWriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutBool(true);
- dbus::MessageReader reader(msgref);
- bool redback_value = reader.TakeBool();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_TRUE(redback_value);
-}
-
-TEST_F(DbusTest, DbusMessageWriterInt32WriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutInt32(42);
- dbus::MessageReader reader(msgref);
- int32_t readback_value = reader.TakeInt32();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_value, 42);
-}
-
-TEST_F(DbusTest, DbusMessageWriterStringWriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello DBus!");
- dbus::MessageReader reader(msgref);
- std::string readback_value = reader.TakeString();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_value, "Hello DBus!");
-}
-
-TEST_F(DbusTest, DbusMultipleParamsReadWrite) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello DBus!");
- writer.PutInt16(42);
- writer.PutDouble(3.14);
- }
- {
- dbus::MessageReader reader(msgref);
- std::string readback_string = reader.TakeString();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_string, "Hello DBus!");
- int16_t readback_int = reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_int, 42);
- double readback_double = reader.TakeDouble();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_DOUBLE_EQ(readback_double, 3.14);
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusTest, DbusArrayTest) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, DBUS_TYPE_INT16_AS_STRING);
- array_writer.PutInt16(3);
- array_writer.PutInt16(4);
- array_writer.PutInt16(5);
- }
- {
- dbus::MessageReader reader(msgref);
- dbus::MessageReader array_reader = reader.TakeArrayReader();
- int16_t readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 3);
- readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 4);
- readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 5);
- ASSERT_FALSE(array_reader.HasNext());
- }
-}
-
-class DbusFailuresTest : public testing::Test {
- public:
- dbus::MessageRef int_msg;
- DbusFailuresTest()
- : int_msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {
- dbus::MessageWriter writer(int_msg);
- writer.PutInt64(42);
- }
-};
-
-TEST_F(DbusFailuresTest, DbusInconsistentTypeReadFailureTest) {
- dbus::MessageReader reader(int_msg);
- std::string str = reader.TakeString();
- ASSERT_EQ(str, std::string(""));
- ASSERT_TRUE(reader.has_failed());
-}
-
-TEST_F(DbusFailuresTest, DbusNonExistentArrayReadTest) {
- dbus::MessageReader reader(int_msg);
- ASSERT_FALSE(reader.has_failed());
- dbus::MessageReader array_reader = reader.TakeArrayReader();
- ASSERT_TRUE(array_reader.has_failed());
- ASSERT_TRUE(reader.has_failed());
- int64_t val = array_reader.TakeInt64();
- ASSERT_TRUE(array_reader.has_failed());
- ASSERT_EQ(val, 0);
-}
-
-} // namespace rpc_base_test
-} // namespace components
-} // namespace test
diff --git a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox b/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox
deleted file mode 100644
index 42da2364d3..0000000000
--- a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox
+++ /dev/null
@@ -1,241 +0,0 @@
-/**
-\page security_manager Security Manager Detailed Design
-## Table of contents
-- \subpage security_manager_intoduction
- + \ref security_manager_rationale "1.1 Rationale"
- + \ref security_manager_scope "1.2 Scope"
- + \ref security_manager_abbreviations "1.3 Abbreviations"
-- \subpage security_manager_detail_design
- + \ref security_manager_design_solutions "2.1 Design solutions"
- + \ref security_manager_class_structure "2.2 Class Structure"
- + \ref security_manager_sequence_diagram "2.3 Sequence diagram"
- + \ref security_manager_state_chart "2.4 State chart diagram"
-- \subpage security_manager_interfaces
- + \ref security_manager_public_interfaces "3.1 Public interfaces description"
- + \ref security_manager_internal_interfaces "3.2 Internal interfaces description"
- + \ref security_manager_derived_interfaces "3.3 Derived interfaces and dependencies"
-- \subpage security_manager_data_structure_resources
- + \ref security_manager_data_structure "4.1 Element Data Structure"
- + \ref security_manager_resources "4.2 Resource usage"
-- \subpage security_manager_references_and_history
- + \ref security_manager_references "5.1 References"
- + \ref security_manager_history "5.2 Document history change and approve"
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_intoduction 1 Introduction
-The document is intended to support software developers,
-maintenance and integration engineers with sufficient,
-detailed information concerning the design, development and
-deployment concepts, to accomplish their respective tasks without reliance on the authors.
-
-\anchor security_manager_rationale
-## 1.1 Rationale
-Security Manager implements SDL Architectural Solution according to:
-- https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#security-manager
-
-\anchor security_manager_scope
-## 1.2 Scope
-Security Manager component extracted as a separate module for
-Ford channel data protection.
-This components is used to:
-- Provide security communications
-- Protect income and outcome business layer data from interception
-- Verify the relation between a mobile application certificate and its owner
-
-\anchor security_manager_abbreviations
-## 1.3 Abbreviations
-Abbreviations used in this document please find in the table below.
-| Abbreviation | Expansion |
-|------------------|----------------------------------|
-| SSL | Secure Sockets Layer cryptographic protocol |
-| TLS | Transport Layer Security cryptographic protocol |
-| DTLS | Datagram TLS cryptographic protocol |
-
-Definitions used in this document are in the table below.
-
-| Definition | Description |
-|---------------------------|-----------------------------------|
-| SSL/TLS/DTL | Cryptographic protocols that provide communications security over a computer network |
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_detail_design 2 Component detail design
-\anchor security_manager_design_solutions
-### 2.1 Design solutions
-The following design approaches and pattern was used for Security Manager:
-- Protection, creation and business logic is spitted to separates interfaces
- + SecurityManager for handling Security queries from mobile side
- + SSLContext provides for SSL connection establishing, encryption and decryption
- + CryptoManager provides a factory for SSLContext
-- [Abstract Factory pattern design](https://sourcemaking.com/design_patterns/abstract_factory)
- used for SSLContext objects creation
- + It also guaranty correctness of SSLContext destruction by the
- same Compiled SecurityManager object
-
-#### Design description
-security_manager::SSLContext is an interface for TLS connection establishing, data encryption and
-decryption within this connection.
-security_manager::SSLContextImpl implements SSLContext and wraps OpenSSL library handshake procedure,
-encryption and decryption, contains handshake procedure error handling.
-_Note:_ security_manager::SSLContext objects are stored in connection_handler::ConnectionHandlerImpl,
-which implements protocol_handler::SessionObserver interface.
-
-security_manager::CryptoManager is an interface for SSLContext creation and destruction,
-CA certificate update and last SSL error providing.
-security_manager::CryptoManagerImpl implements security_manager::CryptoManager and hides
-all OpenSSL initialization logics and SSL internal structures creation.
-
-security_manager::SecurityManager is a Facade of security_manager component and provides
-external interface for security_manager::SSLContext creation and sending security error
-via control service.
-security_manager::SecurityManagerImpl implements security_manager::SecurityManager and
-encapsulates control service data (security internal errors, handshake data) handling.
-
-security_manager::SecurityManagerListener is an interface for protection result notification
-to other components.
-security_manager::SecurityManagerListener is implemented in a protocol_handler::ProtocolHandlerImpl for sending
-protocol layer response on handshake procedure finish.
-
-
-\anchor security_manager_class_structure
-### 2.2 Class Structure
-The following UML class digram shows the component structure.
-![Security Manager class diagram](sm_class_digram.png)
-For more information about class digram follow:
-- http://www.uml-diagrams.org/class-diagrams-overview.htqml
-- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
-
-\anchor security_manager_sequence_diagram
-### 2.3 Sequence diagram
-The following UML sequence digram shows the component dynamic behavior.
-For more information about sequence digram follow:
-- http://www.uml-diagrams.org/sequence-diagrams.html
-- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
-
-Security first initialization on session:
-![Start encryption](sm_sequence_digram_init.png)
-
-Security initialization for service on session with already initialized security:
-![Initialization](sm_sequence_digram_verify.png)
-
-Decryption procedure:
-![Decryption](sm_sequence_digram_decryption.png)
-
-Encryption procedure:
-![Encryption](sm_sequence_digram_encryption.png)
-
-\anchor security_manager_state_chart
-### 2.4 State chart diagram
-Not applicable for Security Manager.
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_interfaces 3 Component Interfaces
-\anchor security_manager_public_interfaces
-### 3.1 Public interfaces description
-Security Manager provides functionality with following interfaces:
-- security_manager::SecurityManager
-- security_manager::SecurityManagerListener
-- security_manager::SSLContext
-
-\anchor security_manager_internal_interfaces
-### 3.2 Internal interfaces description
-The following interfaces are provided by component for internal usage only:
- - security_manager::CryptoManager
- - security_manager::CryptoManagerSettings
-
-\anchor security_manager_derived_interfaces
-### 3.3 Derived interfaces and dependencies
-Security Manager required following 3d-party libraries:
- - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
-
-The following interfaces are required by component:
-- \ref src/components/include/utils Utils
-- protocol_handler::ProtocolObserver for getting Protocol notifications
-- implements protocol_handler::SessionObserver for providing SSLContext object managing
-- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
- + [SSL_library_init()](https://www.openssl.org/docs/manmaster/ssl/SSL_library_init.html)
- - registers the available SSL/TLS ciphers and digests.
- + [SSL_METHOD](https://www.openssl.org/docs/manmaster/ssl/ssl.html)
- - That's a dispatch structure describing the internal ssl library methods/functions which implement the various protocol versions (SSLv3 TLSv1, ...). It's needed to create an SSL_CTX.
- + [(D)TLSv1(_1/2)_(server/client)_method, ]
- (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
- - TLS/SSL connections established with these methods will understand the TLSv1 protocol.
- - A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages.
- + [SSL_CTX_new](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
- - creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections.
- + [SSL_CTX_free](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_free.html)
- - decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0.
- + [SSL_CTX_use_certificate_file, SSL_CTX_use_PrivateKey_file, SSL_CTX_check_private_key]
- (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html)
- - load certificate and key data
- + [SSL_CTX_set_cipher_list](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_cipher_list.html)
- - choose list of available [cipher suites](https://en.wikipedia.org/wiki/Cipher_suite)
- + [SSL_new](https://www.openssl.org/docs/manmaster/ssl/SSL_new.html)
- - creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context ctx: connection method, options, verification settings, timeout settings.
- + [SSL_CTX_set_verify](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_verify.html)
- - sets the verification flags for ctx to be mode and specifies the verify_callback function to be used.
- + [SSL_CTX_load_verify_locations](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html)
- - specifies the locations for ctx, at which CA certificates for verification purposes are located.
- + [X509_STORE_CTX_get_error, X509_STORE_CTX_set_error](https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_set_error.html)
- - get or set certificate verification status information
- + [SSL_do_handshake](https://www.openssl.org/docs/manmaster/ssl/SSL_do_handshake.html)
- - waits for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started.
- - The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state.
- + [SSL_shutdown](https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html)
- - shuts down an active TLS/SSL connection. It sends the "close notify" shutdown alert to the peer.
- + [SSL_free](https://www.openssl.org/docs/manmaster/ssl/SSL_free.html)
- - decrements the reference count of ssl, and removes the SSL structure pointed to by ssl
- - frees up the allocated memory if the reference count has reached 0.
- +[BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all](https://www.openssl.org/docs/manmaster/crypto/bio.html)
- - BIO allocation and freeing functions
- + [BIO_read, BIO_write, BIO_gets, BIO_puts](https://www.openssl.org/docs/manmaster/crypto/BIO_read.html)
- - BIO I/O functions
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_data_structure_resources 4 Component data and resources
-\anchor security_manager_data_structure
-### 4.1 Element Data Structure
-The following data types are used by the Component:
- - security_manager::SecurityQuery
- - protocol_handler::ProtocolPacket
-
-The format of certificate data exchange is:
- - PEM certificates according to [APPLINK-21512](https://adc.luxoft.com/jira/browse/APPLINK-21512)
-
-\anchor security_manager_resources
-### 4.2 Resource usage
-Security Manager get an assess to certificate and private key
-data using OpenSSl API.
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_references_and_history 5 References and history
-\anchor security_manager_references
-### 5.1 References
-- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
-- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
-- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346)
-- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246)
-- [DTLS RFC](https://tools.ietf.org/html/rfc4347)
-
-\anchor security_manager_history
-### 5.2 Document history
-Document change history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|----------------------------------------|---------------------|
-| 0.1 | 08/11/2016 | [EZamakhov](https://github.com/pestOO) | Initial version from the previous [SDL SDD](https://adc.luxoft.com/confluence/pages/viewpage.action?pageId=279677125) |
-
-Document approve history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|-----------------------------|---------------------|
-| | | | |
-
-For more precise document change history follow github history -
-- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/security_manager_software_detailed_design.dox
-- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/security_manager_software_detailed_design.dox
-*/ \ No newline at end of file
diff --git a/src/components/security_manager/docs/SDL.SDD.Security.dox b/src/components/security_manager/docs/SDL.SDD.Security.dox
new file mode 100644
index 0000000000..ba35bc116e
--- /dev/null
+++ b/src/components/security_manager/docs/SDL.SDD.Security.dox
@@ -0,0 +1,241 @@
+/**
+\page security_manager Security Manager Detailed Design
+## Table of contents
+- \subpage security_manager_intoduction
+ + \ref security_manager_rationale "1.1 Rationale"
+ + \ref security_manager_scope "1.2 Scope"
+ + \ref security_manager_abbreviations "1.3 Abbreviations"
+- \subpage security_manager_detail_design
+ + \ref security_manager_design_solutions "2.1 Design solutions"
+ + \ref security_manager_class_structure "2.2 Class Structure"
+ + \ref security_manager_sequence_diagram "2.3 Sequence diagram"
+ + \ref security_manager_state_chart "2.4 State chart diagram"
+- \subpage security_manager_interfaces
+ + \ref security_manager_public_interfaces "3.1 Public interfaces description"
+ + \ref security_manager_internal_interfaces "3.2 Internal interfaces description"
+ + \ref security_manager_derived_interfaces "3.3 Derived interfaces and dependencies"
+- \subpage security_manager_data_structure_resources
+ + \ref security_manager_data_structure "4.1 Element Data Structure"
+ + \ref security_manager_resources "4.2 Resource usage"
+- \subpage security_manager_references_and_history
+ + \ref security_manager_references "5.1 References"
+ + \ref security_manager_history "5.2 Document history change and approve"
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_intoduction 1 Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+
+\anchor security_manager_rationale
+## 1.1 Rationale
+Security Manager implements SDL Architectural Solution according to:
+- https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/components-view/#security-manager
+
+\anchor security_manager_scope
+## 1.2 Scope
+Security Manager component extracted as a separate module for
+SDL channel data protection.
+This components is used to:
+- Provide security communications
+- Protect income and outcome business layer data from interception
+- Verify the relation between a mobile application certificate and its owner
+
+\anchor security_manager_abbreviations
+## 1.3 Abbreviations
+Abbreviations used in this document please find in the table below.
+| Abbreviation | Expansion |
+|------------------|----------------------------------|
+| SSL | Secure Sockets Layer cryptographic protocol |
+| TLS | Transport Layer Security cryptographic protocol |
+| DTLS | Datagram TLS cryptographic protocol |
+
+Definitions used in this document are in the table below.
+
+| Definition | Description |
+|---------------------------|-----------------------------------|
+| SSL/TLS/DTL | Cryptographic protocols that provide communications security over a computer network |
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_detail_design 2 Component detail design
+\anchor security_manager_design_solutions
+### 2.1 Design solutions
+The following design approaches and pattern was used for Security Manager:
+- Protection, creation and business logic is spitted to separates interfaces
+ + SecurityManager for handling Security queries from mobile side
+ + SSLContext provides for SSL connection establishing, encryption and decryption
+ + CryptoManager provides a factory for SSLContext
+- [Abstract Factory pattern design](https://sourcemaking.com/design_patterns/abstract_factory)
+ used for SSLContext objects creation
+ + It also guaranty correctness of SSLContext destruction by the
+ same Compiled SecurityManager object
+
+#### Design description
+security_manager::SSLContext is an interface for TLS connection establishing, data encryption and
+decryption within this connection.
+security_manager::SSLContextImpl implements SSLContext and wraps OpenSSL library handshake procedure,
+encryption and decryption, contains handshake procedure error handling.
+_Note:_ security_manager::SSLContext objects are stored in connection_handler::ConnectionHandlerImpl,
+which implements protocol_handler::SessionObserver interface.
+
+security_manager::CryptoManager is an interface for SSLContext creation and destruction,
+CA certificate update and last SSL error providing.
+security_manager::CryptoManagerImpl implements security_manager::CryptoManager and hides
+all OpenSSL initialization logics and SSL internal structures creation.
+
+security_manager::SecurityManager is a Facade of security_manager component and provides
+external interface for security_manager::SSLContext creation and sending security error
+via control service.
+security_manager::SecurityManagerImpl implements security_manager::SecurityManager and
+encapsulates control service data (security internal errors, handshake data) handling.
+
+security_manager::SecurityManagerListener is an interface for protection result notification
+to other components.
+security_manager::SecurityManagerListener is implemented in a protocol_handler::ProtocolHandlerImpl for sending
+protocol layer response on handshake procedure finish.
+
+
+\anchor security_manager_class_structure
+### 2.2 Class Structure
+The following UML class diagram shows the component structure.
+![Security Manager class diagram](sm_class_diagram.png)
+For more information about class diagram follow:
+- http://www.uml-diagrams.org/class-diagrams-overview.htqml
+- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
+
+\anchor security_manager_sequence_diagram
+### 2.3 Sequence diagram
+The following UML sequence diagram shows the component dynamic behavior.
+For more information about sequence diagram follow:
+- http://www.uml-diagrams.org/sequence-diagrams.html
+- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
+
+Security first initialization on session:
+![Start encryption](sm_sequence_diagram_init.png)
+
+Security initialization for service on session with already initialized security:
+![Initialization](sm_sequence_diagram_verify.png)
+
+Decryption procedure:
+![Decryption](sm_sequence_diagram_decryption.png)
+
+Encryption procedure:
+![Encryption](sm_sequence_diagram_encryption.png)
+
+\anchor security_manager_state_chart
+### 2.4 State chart diagram
+Not applicable for Security Manager.
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_interfaces 3 Component Interfaces
+\anchor security_manager_public_interfaces
+### 3.1 Public interfaces description
+Security Manager provides functionality with following interfaces:
+- security_manager::SecurityManager
+- security_manager::SecurityManagerListener
+- security_manager::SSLContext
+
+\anchor security_manager_internal_interfaces
+### 3.2 Internal interfaces description
+The following interfaces are provided by component for internal usage only:
+ - security_manager::CryptoManager
+ - security_manager::CryptoManagerSettings
+
+\anchor security_manager_derived_interfaces
+### 3.3 Derived interfaces and dependencies
+Security Manager required following 3d-party libraries:
+ - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
+
+The following interfaces are required by component:
+- \ref src/components/include/utils Utils
+- protocol_handler::ProtocolObserver for getting Protocol notifications
+- implements protocol_handler::SessionObserver for providing SSLContext object managing
+- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+ + [SSL_library_init()](https://www.openssl.org/docs/manmaster/ssl/SSL_library_init.html)
+ - registers the available SSL/TLS ciphers and digests.
+ + [SSL_METHOD](https://www.openssl.org/docs/manmaster/ssl/ssl.html)
+ - That's a dispatch structure describing the internal ssl library methods/functions which implement the various protocol versions (SSLv3 TLSv1, ...). It's needed to create an SSL_CTX.
+ + [(D)TLSv1(_1/2)_(server/client)_method, ]
+ (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
+ - TLS/SSL connections established with these methods will understand the TLSv1 protocol.
+ - A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages.
+ + [SSL_CTX_new](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
+ - creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections.
+ + [SSL_CTX_free](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_free.html)
+ - decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0.
+ + [SSL_CTX_use_certificate_file, SSL_CTX_use_PrivateKey_file, SSL_CTX_check_private_key]
+ (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html)
+ - load certificate and key data
+ + [SSL_CTX_set_cipher_list](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_cipher_list.html)
+ - choose list of available [cipher suites](https://en.wikipedia.org/wiki/Cipher_suite)
+ + [SSL_new](https://www.openssl.org/docs/manmaster/ssl/SSL_new.html)
+ - creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context ctx: connection method, options, verification settings, timeout settings.
+ + [SSL_CTX_set_verify](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_verify.html)
+ - sets the verification flags for ctx to be mode and specifies the verify_callback function to be used.
+ + [SSL_CTX_load_verify_locations](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html)
+ - specifies the locations for ctx, at which CA certificates for verification purposes are located.
+ + [X509_STORE_CTX_get_error, X509_STORE_CTX_set_error](https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_set_error.html)
+ - get or set certificate verification status information
+ + [SSL_do_handshake](https://www.openssl.org/docs/manmaster/ssl/SSL_do_handshake.html)
+ - waits for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started.
+ - The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state.
+ + [SSL_shutdown](https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html)
+ - shuts down an active TLS/SSL connection. It sends the "close notify" shutdown alert to the peer.
+ + [SSL_free](https://www.openssl.org/docs/manmaster/ssl/SSL_free.html)
+ - decrements the reference count of ssl, and removes the SSL structure pointed to by ssl
+ - frees up the allocated memory if the reference count has reached 0.
+ +[BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all](https://www.openssl.org/docs/manmaster/crypto/bio.html)
+ - BIO allocation and freeing functions
+ + [BIO_read, BIO_write, BIO_gets, BIO_puts](https://www.openssl.org/docs/manmaster/crypto/BIO_read.html)
+ - BIO I/O functions
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_data_structure_resources 4 Component data and resources
+\anchor security_manager_data_structure
+### 4.1 Element Data Structure
+The following data types are used by the Component:
+ - security_manager::SecurityQuery
+ - protocol_handler::ProtocolPacket
+
+The format of certificate data exchange is:
+ - PEM certificates according to [APPLINK-21512](https://adc.luxoft.com/jira/browse/APPLINK-21512)
+
+\anchor security_manager_resources
+### 4.2 Resource usage
+Security Manager get an assess to certificate and private key
+data using OpenSSl API.
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_references_and_history 5 References and history
+\anchor security_manager_references
+### 5.1 References
+- [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
+- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346)
+- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246)
+- [DTLS RFC](https://tools.ietf.org/html/rfc4347)
+
+\anchor security_manager_history
+### 5.2 Document history
+Document change history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|----------------------------------------|---------------------|
+| 0.1 | 08/11/2016 | [EZamakhov](https://github.com/pestOO) | Initial version from the previous [SDL SDD](https://adc.luxoft.com/confluence/pages/viewpage.action?pageId=279677125) |
+
+Document approve history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+| | | | |
+
+For more precise document change history follow github history -
+- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/SDL.SDD.Security.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/SDL.SDD.Security.dox
+*/ \ No newline at end of file
diff --git a/src/components/security_manager/docs/assets/sm_class_digram.png b/src/components/security_manager/docs/assets/sm_class_diagram.png
index 61e300f4e7..61e300f4e7 100644
--- a/src/components/security_manager/docs/assets/sm_class_digram.png
+++ b/src/components/security_manager/docs/assets/sm_class_diagram.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png
index 849fe45b88..849fe45b88 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png
index 66dffd265e..66dffd265e 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png
index 334b42b258..334b42b258 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png
index cb040c918b..cb040c918b 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png
Binary files differ
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
index 4e48858e5c..5fd7a95155 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
@@ -46,7 +46,6 @@
#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
namespace security_manager {
class CryptoManagerImpl : public CryptoManager {
@@ -71,6 +70,8 @@ class CryptoManagerImpl : public CryptoManager {
size_t* out_data_size) OVERRIDE;
bool IsInitCompleted() const OVERRIDE;
bool IsHandshakePending() const OVERRIDE;
+ bool GetCertificateDueDate(time_t& due_date) const OVERRIDE;
+ bool HasCertificate() const OVERRIDE;
size_t get_max_block_size(size_t mtu) const OVERRIDE;
std::string LastError() const OVERRIDE;
void ResetConnection() OVERRIDE;
@@ -101,6 +102,22 @@ class CryptoManagerImpl : public CryptoManager {
std::string GetTextBy(X509_NAME* name, int object) const;
+ /**
+ * @brief Pulls number stored in buffer of chars
+ * and returns it as integer
+ * @param buf where symbols stored
+ * @param idx index of required char to be converted
+ * @return number in integer representation
+ */
+ int get_number_from_char_buf(char* buf, int* idx) const;
+ /**
+ * @brief Converts time from ASN1 format (used in OpenSSL)
+ * to time_t data type
+ * @param time_to_convert time to be converted
+ * @return time in time_t format
+ */
+ time_t convert_asn1_time_to_time_t(ASN1_TIME* time_to_convert) const;
+
SSL* connection_;
BIO* bioIn_;
BIO* bioOut_;
@@ -120,7 +137,7 @@ class CryptoManagerImpl : public CryptoManager {
public:
explicit CryptoManagerImpl(
- const utils::SharedPtr<const CryptoManagerSettings> set);
+ const std::shared_ptr<const CryptoManagerSettings> set);
~CryptoManagerImpl();
bool Init() OVERRIDE;
@@ -128,23 +145,65 @@ class CryptoManagerImpl : public CryptoManager {
SSLContext* CreateSSLContext() OVERRIDE;
void ReleaseSSLContext(SSLContext* context) OVERRIDE;
std::string LastError() const OVERRIDE;
- virtual bool IsCertificateUpdateRequired() const OVERRIDE;
+ bool IsCertificateUpdateRequired(
+ const time_t system_time, const time_t certificates_time) const OVERRIDE;
virtual const CryptoManagerSettings& get_settings() const OVERRIDE;
private:
+ bool AreForceProtectionSettingsCorrect() const;
bool set_certificate(const std::string& cert_data);
- int pull_number_from_buf(char* buf, int* idx);
- void asn1_time_to_tm(ASN1_TIME* time);
+ /**
+ * @brief Saves new certificate data on the file system
+ * @param cert_data certificate data in PEM format
+ * @return true if new certificate data was successfully saved on the file
+ * system, otherwise returns false
+ */
+ bool SaveCertificateData(const std::string& cert_data) const;
+
+ /**
+ * @brief Updates certificate and private key for the current SSL context
+ * @param certificate new certificate to update
+ * @param key new private key to update
+ * @return true if certificate and private key were updated successfully,
+ * otherwise returns false
+ */
+ bool UpdateModuleCertificateData(X509* certificate, EVP_PKEY* key);
+
+ /**
+ * @brief Loads X509 certificate from file specified in CryptoManagerSettings
+ * @return returns pointer to the loaded X509 certificate in case of success
+ * otherwise returns NULL
+ */
+ X509* LoadModuleCertificateFromFile();
+
+ /**
+ * @brief Loads private key from file specified in CryptoManagerSettings
+ * @return returns pointer to the loaded private key in case of success
+ * otherwise returns NULL
+ */
+ EVP_PKEY* LoadModulePrivateKeyFromFile();
+
+ /**
+ * @brief Saves new X509 certificate data to file specified in
+ * CryptoManagerSettings
+ * @param certificate new X509 certificate data
+ * @return true if certificate data was saved to the file system otherwise
+ * returns false
+ */
+ bool SaveModuleCertificateToFile(X509* certificate) const;
/**
- * @brief Sets initial certificate datetime
+ * @brief Saves new private key data to file specified in
+ * CryptoManagerSettings
+ * @param key new private key data
+ * @return true if private key data was saved to the file system otherwise
+ * returns false
*/
- void InitCertExpTime();
+ bool SaveModuleKeyToFile(EVP_PKEY* key) const;
- const utils::SharedPtr<const CryptoManagerSettings> settings_;
+ const std::shared_ptr<const CryptoManagerSettings> settings_;
SSL_CTX* context_;
- mutable struct tm expiration_time_;
static uint32_t instance_count_;
static sync_primitives::Lock instance_lock_;
DISALLOW_COPY_AND_ASSIGN(CryptoManagerImpl);
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
index 1e4699b77a..f20d3e4034 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
@@ -17,6 +17,7 @@ class CryptoManagerSettingsImpl : public CryptoManagerSettings {
return profile_.ssl_mode() == "SERVER" ? security_manager::SERVER
: security_manager::CLIENT;
}
+
Protocol security_manager_protocol_name() const OVERRIDE {
CREATE_LOGGERPTR_LOCAL(logger_, "SecurityManager")
@@ -33,33 +34,59 @@ class CryptoManagerSettingsImpl : public CryptoManagerSettings {
if (protocol_str == "SSLv3") {
return security_manager::SSLv3;
}
+ if (protocol_str == "DTLSv1.0") {
+ return security_manager::DTLSv1;
+ }
+
LOG4CXX_ERROR(
logger_,
"Unknown protocol: " << profile_.security_manager_protocol_name());
return static_cast<security_manager::Protocol>(-1);
}
+
bool verify_peer() const OVERRIDE {
return profile_.verify_peer();
}
+
const std::string& certificate_data() const OVERRIDE {
return certificate_data_;
}
+
const std::string& ciphers_list() const OVERRIDE {
return profile_.ciphers_list();
}
+
const std::string& ca_cert_path() const OVERRIDE {
return profile_.ca_cert_path();
}
+
+ const std::string& module_cert_path() const OVERRIDE {
+ return profile_.cert_path();
+ }
+
+ const std::string& module_key_path() const OVERRIDE {
+ return profile_.key_path();
+ }
+
size_t update_before_hours() const OVERRIDE {
return profile_.update_before_hours();
}
+
size_t maximum_payload_size() const OVERRIDE {
return profile_.maximum_payload_size();
}
+ const std::vector<int>& force_protected_service() const {
+ return profile_.force_protected_service();
+ }
+
+ const std::vector<int>& force_unprotected_service() const {
+ return profile_.force_unprotected_service();
+ }
+
private:
const profile::Profile& profile_;
const std::string certificate_data_;
};
-}
+} // namespace security_manager
#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_SETTINGS_IMPL_H_
diff --git a/src/components/security_manager/include/security_manager/security_manager_impl.h b/src/components/security_manager/include/security_manager/security_manager_impl.h
index 469b97d1e1..c53d39ba87 100644
--- a/src/components/security_manager/include/security_manager/security_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/security_manager_impl.h
@@ -35,6 +35,8 @@
#include <list>
#include <string>
+#include <set>
+#include <memory>
#include "utils/macro.h"
#include "utils/message_queue.h"
@@ -44,6 +46,7 @@
#include "security_manager/security_query.h"
#include "protocol_handler/protocol_handler.h"
#include "protocol/common.h"
+#include "utils/system_time_handler.h"
namespace security_manager {
/**
@@ -67,12 +70,21 @@ typedef threads::MessageLoopThread<SecurityMessageQueue> SecurityMessageLoop;
* \brief SecurityManagerImpl class implements SecurityManager interface
*/
class SecurityManagerImpl : public SecurityManager,
- public SecurityMessageLoop::Handler {
+ public SecurityMessageLoop::Handler,
+ public utils::SystemTimeListener {
public:
/**
* \brief Constructor
+ * \param system_time_handler allows to work with system time.
*/
- SecurityManagerImpl();
+ explicit SecurityManagerImpl(
+ std::unique_ptr<utils::SystemTimeHandler>&& system_time_handler);
+
+ /**
+ * \brief Destructor
+ */
+ ~SecurityManagerImpl();
+
/**
* \brief Add received from Mobile Application message
* Overriden ProtocolObserver::OnMessageReceived method
@@ -131,9 +143,11 @@ class SecurityManagerImpl : public SecurityManager,
* Do not notify listeners, send security error on occure
* \param connection_key Unique key used by other components as session
* identifier
+ * @param cc_strategy - SSL context creation strategy
* @return new \c SSLContext or \c NULL on any error
*/
- SSLContext* CreateSSLContext(const uint32_t& connection_key) OVERRIDE;
+ SSLContext* CreateSSLContext(const uint32_t& connection_key,
+ ContextCreationStrategy cc_strategy) OVERRIDE;
/**
* \brief Start handshake as SSL client
@@ -141,16 +155,33 @@ class SecurityManagerImpl : public SecurityManager,
void StartHandshake(uint32_t connection_key) OVERRIDE;
/**
+ * @brief PostponeHandshake allows to postpone handshake. It notifies
+ * cryptomanager that certificate should be updated and adds specified
+ * connection key to the list of the certificate awaiting connections.
+ * @param connection_key the identifier for connection to postpone handshake.
+ */
+ void PostponeHandshake(const uint32_t connection_key) OVERRIDE;
+
+ /**
* @brief Checks whether certificate should be updated
+ * @param connection_key the connection identifier to check certificate for.
* @return true if certificate should be updated otherwise false
*/
- bool IsCertificateUpdateRequired() OVERRIDE;
+ bool IsCertificateUpdateRequired(const uint32_t connection_key) OVERRIDE;
+
+ /**
+ * @brief Checks whether system time ready notification
+ * was received from hmi
+ * @return true if received otherwise false
+ */
+ bool IsSystemTimeProviderReady() const OVERRIDE;
/**
* \brief Add/Remove for SecurityManagerListener
*/
void AddListener(SecurityManagerListener* const listener) OVERRIDE;
void RemoveListener(SecurityManagerListener* const listener) OVERRIDE;
+
/**
* \brief Notifiers for listeners
* \param connection_key Unique key used by other components as session
@@ -164,13 +195,12 @@ class SecurityManagerImpl : public SecurityManager,
* @brief Notifiers for listeners.
* Allows to notify that certificate should be updated
*/
- DEPRECATED void NotifyOnCertififcateUpdateRequired();
+ void NotifyOnCertificateUpdateRequired() OVERRIDE;
/**
- * @brief Notifiers for listeners.
- * Allows to notify that certificate should be updated
+ * @brief Notify all listeners that handshake was failed
*/
- void NotifyOnCertificateUpdateRequired() OVERRIDE;
+ void NotifyListenersOnHandshakeFailed() OVERRIDE;
/**
* @brief Check is policy certificate data is empty
@@ -217,6 +247,39 @@ class SecurityManagerImpl : public SecurityManager,
*/
void SendQuery(const SecurityQuery& query, const uint32_t connection_key);
+ /**
+ * @brief OnCertificateUpdated allows to obtain notification when certificate
+ * has been updated with policy table update. Pass this certificate to crypto
+ * manager for further processing. Also process postopnes handshake for the
+ * certain connection key.
+ *
+ * @param data the certificates content.
+ * @return always true.
+ */
+ bool OnCertificateUpdated(const std::string& data) OVERRIDE;
+
+ /**
+ * @brief ResumeHandshake allows to resume handshake after certificate has
+ * been updated.
+ * @param connection_key the connection identifier to start handshake.
+ */
+ void ResumeHandshake(uint32_t connection_key);
+
+ /**
+ * @brief ProceedHandshake starts the handshake process.
+ * @param ssl_context ssl context for the handshake. COntains certificate,
+ * keys, etc.
+ * @param connection_key the connection identifier to process handshake.
+ */
+ void ProceedHandshake(SSLContext* ssl_context, uint32_t connection_key);
+
+ /**
+ * @brief OnSystemTimeArrived method which notifies
+ * crypto manager with updated time in order to check certificate validity
+ * @param utc_time the current system time.
+ */
+ void OnSystemTimeArrived(const time_t utc_time) OVERRIDE;
+
// Thread that pumps handshake data
SecurityMessageLoop security_messages_;
@@ -235,7 +298,17 @@ class SecurityManagerImpl : public SecurityManager,
/**
*\brief List of listeners for notify handshake done result
*/
+
std::list<SecurityManagerListener*> listeners_;
+
+ std::unique_ptr<utils::SystemTimeHandler> system_time_handler_;
+ sync_primitives::Lock connections_lock_;
+ std::set<uint32_t> awaiting_certificate_connections_;
+ std::set<uint32_t> awaiting_time_connections_;
+
+ mutable sync_primitives::Lock waiters_lock_;
+ volatile bool waiting_for_certificate_;
+ volatile bool waiting_for_time_;
DISALLOW_COPY_AND_ASSIGN(SecurityManagerImpl);
};
} // namespace security_manager
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index 6bee28a976..90ae0177ec 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -41,6 +41,7 @@
#include <iostream>
#include <stdio.h>
#include <ctime>
+#include <algorithm>
#include "security_manager/security_manager.h"
#include "utils/logger.h"
@@ -63,7 +64,12 @@ namespace {
int debug_callback(int preverify_ok, X509_STORE_CTX* ctx) {
if (!preverify_ok) {
const int error = X509_STORE_CTX_get_error(ctx);
- UNUSED(error);
+ if (error == X509_V_ERR_CERT_NOT_YET_VALID ||
+ error == X509_V_ERR_CERT_HAS_EXPIRED) {
+ // return success result code instead of error because start
+ // and expiration cert dates will be checked by SDL
+ return 1;
+ }
LOG4CXX_WARN(logger_,
"Certificate verification failed with error "
<< error << " \"" << X509_verify_cert_error_string(error)
@@ -81,7 +87,7 @@ void free_ctx(SSL_CTX** ctx) {
}
CryptoManagerImpl::CryptoManagerImpl(
- const utils::SharedPtr<const CryptoManagerSettings> set)
+ const std::shared_ptr<const CryptoManagerSettings> set)
: settings_(set), context_(NULL) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(instance_lock_);
@@ -93,7 +99,6 @@ CryptoManagerImpl::CryptoManagerImpl(
OpenSSL_add_all_algorithms();
SSL_library_init();
}
- InitCertExpTime();
}
CryptoManagerImpl::~CryptoManagerImpl() {
@@ -113,10 +118,35 @@ CryptoManagerImpl::~CryptoManagerImpl() {
}
}
+bool CryptoManagerImpl::AreForceProtectionSettingsCorrect() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::vector<int>& forced_unprotected_services =
+ get_settings().force_unprotected_service();
+ const std::vector<int>& forced_protected_services =
+ get_settings().force_protected_service();
+
+ for (auto& item : forced_protected_services) {
+ if (0 == item) {
+ continue;
+ }
+
+ if (std::find(forced_unprotected_services.begin(),
+ forced_unprotected_services.end(),
+ item) != forced_unprotected_services.end()) {
+ return false;
+ }
+ }
+ return true;
+}
+
bool CryptoManagerImpl::Init() {
LOG4CXX_AUTO_TRACE(logger_);
const Mode mode = get_settings().security_manager_mode();
+ if (!AreForceProtectionSettingsCorrect()) {
+ LOG4CXX_DEBUG(logger_, "Force protection settings of ini file are wrong!");
+ return false;
+ }
const bool is_server = (mode == SERVER);
if (is_server) {
LOG4CXX_DEBUG(logger_, "Server mode");
@@ -133,16 +163,24 @@ bool CryptoManagerImpl::Init() {
#if OPENSSL_VERSION_NUMBER < CONST_SSL_METHOD_MINIMAL_VERSION
SSL_METHOD* method;
#else
- const SSL_METHOD* method;
+ const SSL_METHOD* method = NULL;
#endif
switch (get_settings().security_manager_protocol_name()) {
case SSLv3:
+#ifdef OPENSSL_NO_SSL3
+ LOG4CXX_WARN(logger_, "OpenSSL does not support SSL3 protocol");
+ return false;
+#else
+ LOG4CXX_DEBUG(logger_, "SSLv3 is used");
method = is_server ? SSLv3_server_method() : SSLv3_client_method();
break;
+#endif
case TLSv1:
+ LOG4CXX_DEBUG(logger_, "TLSv1 is used");
method = is_server ? TLSv1_server_method() : TLSv1_client_method();
break;
case TLSv1_1:
+ LOG4CXX_DEBUG(logger_, "TLSv1_1 is used");
#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
LOG4CXX_WARN(
logger_,
@@ -153,6 +191,7 @@ bool CryptoManagerImpl::Init() {
#endif
break;
case TLSv1_2:
+ LOG4CXX_DEBUG(logger_, "TLSv1_2 is used");
#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
LOG4CXX_WARN(
logger_,
@@ -162,6 +201,10 @@ bool CryptoManagerImpl::Init() {
method = is_server ? TLSv1_2_server_method() : TLSv1_2_client_method();
#endif
break;
+ case DTLSv1:
+ LOG4CXX_DEBUG(logger_, "DTLSv1 is used");
+ method = is_server ? DTLSv1_server_method() : DTLSv1_client_method();
+ break;
default:
LOG4CXX_ERROR(logger_,
"Unknown protocol: "
@@ -178,7 +221,7 @@ bool CryptoManagerImpl::Init() {
// Disable SSL2 as deprecated
SSL_CTX_set_options(context_, SSL_OP_NO_SSLv2);
- set_certificate(get_settings().certificate_data());
+ SaveCertificateData(get_settings().certificate_data());
if (get_settings().ciphers_list().empty()) {
LOG4CXX_WARN(logger_, "Empty ciphers list");
@@ -211,6 +254,21 @@ bool CryptoManagerImpl::Init() {
<< '"');
}
+ LOG4CXX_DEBUG(logger_, "Setting up module certificate and private key");
+
+ X509* module_certificate = LoadModuleCertificateFromFile();
+ utils::ScopeGuard certificate_guard =
+ utils::MakeGuard(X509_free, module_certificate);
+ UNUSED(certificate_guard);
+
+ EVP_PKEY* module_key = LoadModulePrivateKeyFromFile();
+ utils::ScopeGuard key_guard = utils::MakeGuard(EVP_PKEY_free, module_key);
+ UNUSED(key_guard);
+
+ if (!UpdateModuleCertificateData(module_certificate, module_key)) {
+ LOG4CXX_WARN(logger_, "Failed to update module key and certificate");
+ }
+
guard.Dismiss();
const int verify_mode =
@@ -230,17 +288,33 @@ bool CryptoManagerImpl::OnCertificateUpdated(const std::string& data) {
return false;
}
- return set_certificate(data);
+ if (!SaveCertificateData(data)) {
+ LOG4CXX_ERROR(logger_, "Failed to save certificate data");
+ return false;
+ }
+
+ X509* module_certificate = LoadModuleCertificateFromFile();
+ EVP_PKEY* module_key = LoadModulePrivateKeyFromFile();
+
+ utils::ScopeGuard certificate_guard =
+ utils::MakeGuard(X509_free, module_certificate);
+ UNUSED(certificate_guard);
+
+ utils::ScopeGuard key_guard = utils::MakeGuard(EVP_PKEY_free, module_key);
+ UNUSED(key_guard);
+
+ return UpdateModuleCertificateData(module_certificate, module_key);
}
SSLContext* CryptoManagerImpl::CreateSSLContext() {
- if (context_ == NULL) {
+ if (NULL == context_) {
return NULL;
}
SSL* conn = SSL_new(context_);
- if (conn == NULL)
+ if (NULL == conn) {
return NULL;
+ }
if (get_settings().security_manager_mode() == SERVER) {
SSL_set_accept_state(conn);
@@ -264,38 +338,32 @@ std::string CryptoManagerImpl::LastError() const {
return std::string(reason ? reason : "");
}
-bool CryptoManagerImpl::IsCertificateUpdateRequired() const {
+bool CryptoManagerImpl::IsCertificateUpdateRequired(
+ const time_t system_time, const time_t certificates_time) const {
LOG4CXX_AUTO_TRACE(logger_);
- const time_t cert_date = mktime(&expiration_time_);
+ const double seconds = difftime(certificates_time, system_time);
- if (cert_date == -1) {
- LOG4CXX_WARN(logger_,
- "The certifiacte expiration time cannot be represented.");
- return false;
- }
- const time_t now = time(NULL);
- const double seconds = difftime(cert_date, now);
+ LOG4CXX_DEBUG(
+ logger_, "Certificate UTC time: " << asctime(gmtime(&certificates_time)));
- LOG4CXX_DEBUG(logger_,
- "Certificate expiration time: " << asctime(&expiration_time_));
- LOG4CXX_DEBUG(logger_,
- "Host time: " << asctime(localtime(&now))
- << ". Seconds before expiration: " << seconds);
+ LOG4CXX_DEBUG(logger_, "Host UTC time: " << asctime(gmtime(&system_time)));
+ LOG4CXX_DEBUG(logger_, "Seconds before expiration: " << seconds);
if (seconds < 0) {
LOG4CXX_WARN(logger_, "Certificate is already expired.");
return true;
}
- return seconds <= (get_settings().update_before_hours() *
- date_time::DateTime::SECONDS_IN_HOUR);
+ return seconds <=
+ (get_settings().update_before_hours() * date_time::SECONDS_IN_HOUR);
}
const CryptoManagerSettings& CryptoManagerImpl::get_settings() const {
return *settings_;
}
-bool CryptoManagerImpl::set_certificate(const std::string& cert_data) {
+bool CryptoManagerImpl::SaveCertificateData(
+ const std::string& cert_data) const {
LOG4CXX_AUTO_TRACE(logger_);
if (cert_data.empty()) {
@@ -310,100 +378,162 @@ bool CryptoManagerImpl::set_certificate(const std::string& cert_data) {
UNUSED(bio_guard)
X509* cert = NULL;
- PEM_read_bio_X509(bio_cert, &cert, 0, 0);
+ if (!PEM_read_bio_X509(bio_cert, &cert, 0, 0)) {
+ LOG4CXX_WARN(logger_, "Could not read certificate data: " << LastError());
+ return false;
+ }
- EVP_PKEY* pkey = NULL;
- if (1 == BIO_reset(bio_cert)) {
- PEM_read_bio_PrivateKey(bio_cert, &pkey, 0, 0);
- } else {
+ utils::ScopeGuard cert_guard = utils::MakeGuard(X509_free, cert);
+ UNUSED(cert_guard);
+
+ if (1 != BIO_reset(bio_cert)) {
LOG4CXX_WARN(logger_,
"Unabled to reset BIO in order to read private key, "
<< LastError());
}
- if (NULL == cert || NULL == pkey) {
- LOG4CXX_WARN(logger_, "Either certificate or key not valid.");
+ EVP_PKEY* pkey = NULL;
+ if (!PEM_read_bio_PrivateKey(bio_cert, &pkey, 0, 0)) {
+ LOG4CXX_WARN(logger_, "Could not read private key data: " << LastError());
return false;
}
- if (!SSL_CTX_use_certificate(context_, cert)) {
- LOG4CXX_WARN(logger_, "Could not use certificate: " << LastError());
- return false;
- }
+ utils::ScopeGuard key_guard = utils::MakeGuard(EVP_PKEY_free, pkey);
+ UNUSED(key_guard);
- asn1_time_to_tm(X509_get_notAfter(cert));
+ return SaveModuleCertificateToFile(cert) && SaveModuleKeyToFile(pkey);
+}
- if (!SSL_CTX_use_PrivateKey(context_, pkey)) {
- LOG4CXX_ERROR(logger_, "Could not use key: " << LastError());
- return false;
+bool CryptoManagerImpl::UpdateModuleCertificateData(X509* certificate,
+ EVP_PKEY* key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (certificate) {
+ if (!SSL_CTX_use_certificate(context_, certificate)) {
+ LOG4CXX_WARN(logger_, "Could not use certificate: " << LastError());
+ return false;
+ }
}
- if (!SSL_CTX_check_private_key(context_)) {
- LOG4CXX_ERROR(logger_, "Could not use certificate: " << LastError());
- return false;
- }
+ if (key) {
+ if (!SSL_CTX_use_PrivateKey(context_, key)) {
+ LOG4CXX_ERROR(logger_, "Could not use key: " << LastError());
+ return false;
+ }
- X509_STORE* store = SSL_CTX_get_cert_store(context_);
- if (store) {
- X509* extra_cert = NULL;
- while ((extra_cert = PEM_read_bio_X509(bio_cert, NULL, 0, 0))) {
- if (extra_cert != cert) {
- LOG4CXX_DEBUG(logger_,
- "Added new certificate to store: " << extra_cert);
- X509_STORE_add_cert(store, extra_cert);
- }
+ if (!SSL_CTX_check_private_key(context_)) {
+ LOG4CXX_ERROR(logger_, "Private key is invalid: " << LastError());
+ return false;
}
}
- LOG4CXX_DEBUG(logger_, "Certificate and key successfully updated");
+ LOG4CXX_DEBUG(logger_, "Certificate and key are successfully updated");
return true;
}
-int CryptoManagerImpl::pull_number_from_buf(char* buf, int* idx) {
- if (!idx) {
- return 0;
+X509* CryptoManagerImpl::LoadModuleCertificateFromFile() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::string cert_path = get_settings().module_cert_path();
+ BIO* bio_cert = BIO_new_file(cert_path.c_str(), "r");
+ if (!bio_cert) {
+ LOG4CXX_WARN(logger_,
+ "Failed to open " << cert_path << " file: " << LastError());
+ return NULL;
}
- const int val = ((buf[*idx] - '0') * 10) + buf[(*idx) + 1] - '0';
- *idx = *idx + 2;
- return val;
+
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert);
+ UNUSED(bio_guard);
+
+ X509* module_certificate = NULL;
+ if (!PEM_read_bio_X509(bio_cert, &module_certificate, NULL, NULL)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to read certificate data from file: " << LastError());
+ return NULL;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Module certificate was loaded: " << module_certificate);
+
+ return module_certificate;
}
-void CryptoManagerImpl::asn1_time_to_tm(ASN1_TIME* time) {
- char* buf = (char*)time->data;
- int index = 0;
- const int year = pull_number_from_buf(buf, &index);
- if (V_ASN1_GENERALIZEDTIME == time->type) {
- expiration_time_.tm_year =
- (year * 100 - 1900) + pull_number_from_buf(buf, &index);
- } else {
- expiration_time_.tm_year = year < 50 ? year + 100 : year;
+EVP_PKEY* CryptoManagerImpl::LoadModulePrivateKeyFromFile() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::string key_path = get_settings().module_key_path();
+ BIO* bio_key = BIO_new_file(key_path.c_str(), "r");
+ if (!bio_key) {
+ LOG4CXX_WARN(logger_,
+ "Failed to open " << key_path << " file: " << LastError());
+ return NULL;
}
- const int mon = pull_number_from_buf(buf, &index);
- const int day = pull_number_from_buf(buf, &index);
- const int hour = pull_number_from_buf(buf, &index);
- const int mn = pull_number_from_buf(buf, &index);
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_key);
+ UNUSED(bio_guard);
- expiration_time_.tm_mon = mon - 1;
- expiration_time_.tm_mday = day;
- expiration_time_.tm_hour = hour;
- expiration_time_.tm_min = mn;
+ EVP_PKEY* module_key = NULL;
+ if (!PEM_read_bio_PrivateKey(bio_key, &module_key, NULL, NULL)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to read private key data from file: " << LastError());
+ return NULL;
+ }
+ LOG4CXX_DEBUG(logger_, "Module private key was loaded: " << module_key);
+
+ return module_key;
+}
+
+bool CryptoManagerImpl::SaveModuleCertificateToFile(X509* certificate) const {
+ LOG4CXX_AUTO_TRACE(logger_);
- if (buf[index] == 'Z') {
- expiration_time_.tm_sec = 0;
+ if (!certificate) {
+ LOG4CXX_WARN(logger_, "Empty certificate. Saving will be skipped");
+ return false;
}
- if ((buf[index] == '+') || (buf[index] == '-')) {
- const int mn = pull_number_from_buf(buf, &index);
- const int mn1 = pull_number_from_buf(buf, &index);
- expiration_time_.tm_sec = (mn * 3600) + (mn1 * 60);
- } else {
- const int sec = pull_number_from_buf(buf, &index);
- expiration_time_.tm_sec = sec;
+
+ const std::string cert_path = get_settings().module_cert_path();
+ BIO* bio_cert = BIO_new_file(cert_path.c_str(), "w");
+ if (!bio_cert) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to open " << cert_path << " file: " << LastError());
+ return false;
+ }
+
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert);
+ UNUSED(bio_guard);
+
+ if (!PEM_write_bio_X509(bio_cert, certificate)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to write certificate to file: " << LastError());
+ return false;
}
+
+ return true;
}
-void CryptoManagerImpl::InitCertExpTime() {
- strptime("1 Jan 1970 00:00:00", "%d %b %Y %H:%M:%S", &expiration_time_);
+bool CryptoManagerImpl::SaveModuleKeyToFile(EVP_PKEY* key) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!key) {
+ LOG4CXX_WARN(logger_, "Empty private key. Saving will be skipped");
+ return false;
+ }
+
+ const std::string key_path = get_settings().module_key_path();
+ BIO* bio_key = BIO_new_file(key_path.c_str(), "w");
+ if (!bio_key) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to open " << key_path << " file: " << LastError());
+ return false;
+ }
+
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_key);
+ UNUSED(bio_guard);
+
+ if (!PEM_write_bio_PrivateKey(bio_key, key, NULL, NULL, 0, NULL, NULL)) {
+ LOG4CXX_ERROR(logger_, "Failed to write key to file: " << LastError());
+ return false;
+ }
+
+ return true;
}
} // namespace security_manager
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index 1853b218b4..70f835fb93 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,11 +31,13 @@
*/
#include "security_manager/security_manager_impl.h"
+#include <functional>
#include "security_manager/crypto_manager_impl.h"
#include "protocol_handler/protocol_packet.h"
#include "utils/logger.h"
#include "utils/byte_order.h"
#include "json/json.h"
+#include "utils/helpers.h"
namespace security_manager {
@@ -44,11 +46,22 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "SecurityManager")
static const char* kErrId = "id";
static const char* kErrText = "text";
-SecurityManagerImpl::SecurityManagerImpl()
+SecurityManagerImpl::SecurityManagerImpl(
+ std::unique_ptr<utils::SystemTimeHandler>&& system_time_handler)
: security_messages_("SecurityManager", this)
, session_observer_(NULL)
, crypto_manager_(NULL)
- , protocol_handler_(NULL) {}
+ , protocol_handler_(NULL)
+ , system_time_handler_(std::move(system_time_handler))
+ , waiting_for_certificate_(false)
+ , waiting_for_time_(false) {
+ DCHECK(system_time_handler_);
+ system_time_handler_->SubscribeOnSystemTime(this);
+}
+
+SecurityManagerImpl::~SecurityManagerImpl() {
+ system_time_handler_->UnsubscribeFromSystemTime(this);
+}
void SecurityManagerImpl::OnMessageReceived(
const ::protocol_handler::RawMessagePtr message) {
@@ -56,7 +69,7 @@ void SecurityManagerImpl::OnMessageReceived(
return;
}
- SecurityMessage securityMessagePtr(new SecurityQuery());
+ SecurityMessage securityMessagePtr(std::make_shared<SecurityQuery>());
const bool result =
securityMessagePtr->SerializeQuery(message->data(), message->data_size());
if (!result) {
@@ -136,19 +149,23 @@ void SecurityManagerImpl::Handle(const SecurityMessage message) {
}
security_manager::SSLContext* SecurityManagerImpl::CreateSSLContext(
- const uint32_t& connection_key) {
+ const uint32_t& connection_key, ContextCreationStrategy cc_strategy) {
LOG4CXX_INFO(logger_, "ProtectService processing");
DCHECK(session_observer_);
DCHECK(crypto_manager_);
- security_manager::SSLContext* ssl_context = session_observer_->GetSSLContext(
- connection_key, protocol_handler::kControl);
- // return exists SSLCOntext for current connection/session
- if (ssl_context) {
- return ssl_context;
+ if (kUseExisting == cc_strategy) {
+ security_manager::SSLContext* ssl_context =
+ session_observer_->GetSSLContext(connection_key,
+ protocol_handler::kControl);
+ // If SSLContext for current connection/session exists - return it
+ if (ssl_context) {
+ return ssl_context;
+ }
}
- ssl_context = crypto_manager_->CreateSSLContext();
+ security_manager::SSLContext* ssl_context =
+ crypto_manager_->CreateSSLContext();
if (!ssl_context) {
const std::string error_text("CryptoManager could not create SSL context.");
LOG4CXX_ERROR(logger_, error_text);
@@ -172,6 +189,40 @@ security_manager::SSLContext* SecurityManagerImpl::CreateSSLContext(
return ssl_context;
}
+void SecurityManagerImpl::PostponeHandshake(const uint32_t connection_key) {
+ LOG4CXX_TRACE(logger_, "Handshake postponed");
+ sync_primitives::AutoLock lock(connections_lock_);
+ if (waiting_for_certificate_) {
+ awaiting_certificate_connections_.insert(connection_key);
+ }
+ if (waiting_for_time_) {
+ awaiting_time_connections_.insert(connection_key);
+ }
+}
+
+void SecurityManagerImpl::ResumeHandshake(uint32_t connection_key) {
+ LOG4CXX_TRACE(logger_, "Handshake resumed");
+
+ security_manager::SSLContext* ssl_context =
+ CreateSSLContext(connection_key, kForceRecreation);
+
+ if (!ssl_context) {
+ LOG4CXX_WARN(logger_,
+ "Unable to resume handshake. No SSL context for key "
+ << connection_key);
+ return;
+ }
+
+ ssl_context->ResetConnection();
+ if (!waiting_for_certificate_ && !ssl_context->HasCertificate()) {
+ NotifyListenersOnHandshakeDone(connection_key,
+ SSLContext::Handshake_Result_Fail);
+ return;
+ }
+
+ ProceedHandshake(ssl_context, connection_key);
+}
+
void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
DCHECK(session_observer_);
LOG4CXX_INFO(logger_, "StartHandshake: connection_key " << connection_key);
@@ -187,6 +238,35 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
SSLContext::Handshake_Result_Fail);
return;
}
+ if (!ssl_context->HasCertificate()) {
+ LOG4CXX_ERROR(logger_, "Security certificate is absent");
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_certificate_ = true;
+ NotifyOnCertificateUpdateRequired();
+ }
+
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_time_ = true;
+ }
+
+ PostponeHandshake(connection_key);
+ system_time_handler_->QuerySystemTime();
+}
+
+bool SecurityManagerImpl::IsSystemTimeProviderReady() const {
+ return system_time_handler_->system_time_can_be_received();
+}
+
+void SecurityManagerImpl::ProceedHandshake(
+ security_manager::SSLContext* ssl_context, uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!ssl_context) {
+ LOG4CXX_WARN(logger_,
+ "Unable to process handshake. No SSL context for key "
+ << connection_key);
+ return;
+ }
if (ssl_context->IsInitCompleted()) {
NotifyListenersOnHandshakeDone(connection_key,
@@ -194,8 +274,33 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
return;
}
- ssl_context->SetHandshakeContext(
- session_observer_->GetHandshakeContext(connection_key));
+ time_t cert_due_date;
+ if (!ssl_context->GetCertificateDueDate(cert_due_date)) {
+ LOG4CXX_ERROR(logger_, "Failed to get certificate due date!");
+ return;
+ }
+
+ if (crypto_manager_->IsCertificateUpdateRequired(
+ system_time_handler_->GetUTCTime(), cert_due_date)) {
+ LOG4CXX_DEBUG(logger_, "Host certificate update required");
+ if (helpers::in_range(awaiting_certificate_connections_, connection_key)) {
+ NotifyListenersOnHandshakeDone(connection_key,
+ SSLContext::Handshake_Result_CertExpired);
+ return;
+ }
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_certificate_ = true;
+ }
+ PostponeHandshake(connection_key);
+ NotifyOnCertificateUpdateRequired();
+ return;
+ }
+
+ SSLContext::HandshakeContext handshake_context =
+ session_observer_->GetHandshakeContext(connection_key);
+ handshake_context.system_time = system_time_handler_->GetUTCTime();
+ ssl_context->SetHandshakeContext(handshake_context);
size_t data_size = 0;
const uint8_t* data = NULL;
@@ -216,9 +321,21 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
}
}
-bool SecurityManagerImpl::IsCertificateUpdateRequired() {
+bool SecurityManagerImpl::IsCertificateUpdateRequired(
+ const uint32_t connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
- return crypto_manager_->IsCertificateUpdateRequired();
+ security_manager::SSLContext* ssl_context =
+ CreateSSLContext(connection_key, kUseExisting);
+ DCHECK_OR_RETURN(ssl_context, true);
+ LOG4CXX_DEBUG(logger_,
+ "Set SSL context to connection_key " << connection_key);
+ time_t cert_due_date;
+ if (!ssl_context->GetCertificateDueDate(cert_due_date)) {
+ LOG4CXX_ERROR(logger_, "Failed to get certificate due date!");
+ return true;
+ }
+ return crypto_manager_->IsCertificateUpdateRequired(
+ system_time_handler_->GetUTCTime(), cert_due_date);
}
void SecurityManagerImpl::AddListener(SecurityManagerListener* const listener) {
@@ -227,7 +344,6 @@ void SecurityManagerImpl::AddListener(SecurityManagerListener* const listener) {
"Invalid (NULL) pointer to SecurityManagerListener.");
return;
}
- LOG4CXX_DEBUG(logger_, "Adding listener " << listener);
listeners_.push_back(listener);
}
@@ -241,6 +357,37 @@ void SecurityManagerImpl::RemoveListener(
listeners_.remove(listener);
}
+bool SecurityManagerImpl::OnCertificateUpdated(const std::string& data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_certificate_ = false;
+ }
+ crypto_manager_->OnCertificateUpdated(data);
+ std::for_each(
+ awaiting_certificate_connections_.begin(),
+ awaiting_certificate_connections_.end(),
+ std::bind1st(std::mem_fun(&SecurityManagerImpl::ResumeHandshake), this));
+
+ awaiting_certificate_connections_.clear();
+ return true;
+}
+
+void SecurityManagerImpl::OnSystemTimeArrived(const time_t utc_time) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_time_ = false;
+ }
+
+ std::for_each(
+ awaiting_time_connections_.begin(),
+ awaiting_time_connections_.end(),
+ std::bind1st(std::mem_fun(&SecurityManagerImpl::ResumeHandshake), this));
+
+ awaiting_time_connections_.clear();
+}
+
void SecurityManagerImpl::NotifyListenersOnHandshakeDone(
const uint32_t& connection_key, SSLContext::HandshakeResult error) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -256,10 +403,6 @@ void SecurityManagerImpl::NotifyListenersOnHandshakeDone(
}
}
-void SecurityManagerImpl::NotifyOnCertififcateUpdateRequired() {
- NotifyOnCertificateUpdateRequired();
-}
-
void SecurityManagerImpl::NotifyOnCertificateUpdateRequired() {
LOG4CXX_AUTO_TRACE(logger_);
std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
@@ -269,6 +412,20 @@ void SecurityManagerImpl::NotifyOnCertificateUpdateRequired() {
}
}
+void SecurityManagerImpl::NotifyListenersOnHandshakeFailed() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
+ while (it != listeners_.end()) {
+ if ((*it)->OnHandshakeFailed()) {
+ LOG4CXX_DEBUG(logger_, "Destroying listener: " << *it);
+ delete (*it);
+ it = listeners_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+}
+
bool SecurityManagerImpl::IsPolicyCertificateDataEmpty() {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc
index 5be5ff8363..67be17db63 100644
--- a/src/components/security_manager/src/ssl_context_impl.cc
+++ b/src/components/security_manager/src/ssl_context_impl.cc
@@ -36,6 +36,7 @@
#include <map>
#include <algorithm>
#include <vector>
+#include <time.h>
#include <openssl/bio.h>
#include <openssl/ssl.h>
@@ -77,6 +78,7 @@ bool CryptoManagerImpl::SSLContextImpl::IsInitCompleted() const {
SSLContext::HandshakeResult CryptoManagerImpl::SSLContextImpl::StartHandshake(
const uint8_t** const out_data, size_t* out_data_size) {
+ LOG4CXX_AUTO_TRACE(logger_);
is_handshake_pending_ = true;
return DoHandshakeStep(NULL, 0, out_data, out_data_size);
}
@@ -112,6 +114,12 @@ size_t des_cbc3_sha_max_block_size(size_t mtu) {
return 0;
return ((mtu - 29) & 0xfffffff8) - 5;
}
+time_t get_time_zone_offset(time_t in_time) {
+ tm gmt_cert_tm = *gmtime(&in_time);
+ tm local_cert_tm = *localtime(&in_time);
+
+ return mktime(&local_cert_tm) - mktime(&gmt_cert_tm);
+}
} // namespace
std::map<std::string, CryptoManagerImpl::SSLContextImpl::BlockSizeGetter>
@@ -174,6 +182,7 @@ const std::string CryptoManagerImpl::SSLContextImpl::RemoveDisallowedInfo(
void CryptoManagerImpl::SSLContextImpl::PrintCertData(
X509* cert, const std::string& cert_owner) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (!cert) {
LOG4CXX_DEBUG(logger_, "Empty certificate data");
return;
@@ -206,6 +215,7 @@ void CryptoManagerImpl::SSLContextImpl::PrintCertData(
}
void CryptoManagerImpl::SSLContextImpl::PrintCertInfo() {
+ LOG4CXX_AUTO_TRACE(logger_);
PrintCertData(SSL_get_certificate(connection_), "HU's");
STACK_OF(X509)* peer_certs = SSL_get_peer_cert_chain(connection_);
@@ -217,26 +227,47 @@ void CryptoManagerImpl::SSLContextImpl::PrintCertInfo() {
SSLContext::HandshakeResult
CryptoManagerImpl::SSLContextImpl::CheckCertContext() {
+ LOG4CXX_AUTO_TRACE(logger_);
X509* cert = SSL_get_peer_certificate(connection_);
if (!cert) {
// According to the openssl documentation the peer certificate
// might be ommitted for the SERVER but required for the cient.
return CLIENT == mode_ ? Handshake_Result_Fail : Handshake_Result_Success;
}
+ ASN1_TIME* notBefore = X509_get_notBefore(cert);
+ ASN1_TIME* notAfter = X509_get_notAfter(cert);
- X509_NAME* subj_name = X509_get_subject_name(cert);
+ time_t start = convert_asn1_time_to_time_t(notBefore);
+ time_t end = convert_asn1_time_to_time_t(notAfter);
- const std::string& cn = GetTextBy(subj_name, NID_commonName);
- const std::string& sn = GetTextBy(subj_name, NID_serialNumber);
+ const double start_seconds = difftime(hsh_context_.system_time, start);
+ const double end_seconds = difftime(end, hsh_context_.system_time);
- if (!(hsh_context_.expected_cn.CompareIgnoreCase(cn.c_str()))) {
+ if (start_seconds < 0) {
LOG4CXX_ERROR(logger_,
- "Trying to run handshake with wrong app name: "
- << cn << ". Expected app name: "
- << hsh_context_.expected_cn.AsMBString());
- return Handshake_Result_AppNameMismatch;
+ "Certificate is not yet valid. Time before validity "
+ << start_seconds << " seconds");
+ return Handshake_Result_NotYetValid;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Time since certificate validity " << start_seconds
+ << "seconds");
}
+ if (end_seconds < 0) {
+ LOG4CXX_ERROR(logger_,
+ "Certificate already expired. Time after expiration "
+ << end_seconds << " seconds");
+ return Handshake_Result_CertExpired;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Time until expiration " << end_seconds << "seconds");
+ }
+
+ X509_NAME* subj_name = X509_get_subject_name(cert);
+
+ const std::string& sn = GetTextBy(subj_name, NID_serialNumber);
+
if (!(hsh_context_.expected_sn.CompareIgnoreCase(sn.c_str()))) {
LOG4CXX_ERROR(logger_,
"Trying to run handshake with wrong app id: "
@@ -247,6 +278,60 @@ CryptoManagerImpl::SSLContextImpl::CheckCertContext() {
return Handshake_Result_Success;
}
+int CryptoManagerImpl::SSLContextImpl::get_number_from_char_buf(
+ char* buf, int* idx) const {
+ if (!idx) {
+ return 0;
+ }
+ const int val = ((buf[*idx] - '0') * 10) + buf[(*idx) + 1] - '0';
+ *idx = *idx + 2;
+ return val;
+}
+
+time_t CryptoManagerImpl::SSLContextImpl::convert_asn1_time_to_time_t(
+ ASN1_TIME* time_to_convert) const {
+ struct tm cert_time;
+ memset(&cert_time, 0, sizeof(struct tm));
+ // the minimum value for day of month is 1, otherwise exception will be thrown
+ cert_time.tm_mday = 1;
+ char* buf = reinterpret_cast<char*>(time_to_convert->data);
+ int index = 0;
+ const int year = get_number_from_char_buf(buf, &index);
+ if (V_ASN1_GENERALIZEDTIME == time_to_convert->type) {
+ cert_time.tm_year =
+ (year * 100 - 1900) + get_number_from_char_buf(buf, &index);
+ } else {
+ cert_time.tm_year = year < 50 ? year + 100 : year;
+ }
+
+ const int mon = get_number_from_char_buf(buf, &index);
+ const int day = get_number_from_char_buf(buf, &index);
+ const int hour = get_number_from_char_buf(buf, &index);
+ const int mn = get_number_from_char_buf(buf, &index);
+
+ cert_time.tm_mon = mon - 1;
+ cert_time.tm_mday = day;
+ cert_time.tm_hour = hour;
+ cert_time.tm_min = mn;
+
+ if (buf[index] == 'Z') {
+ cert_time.tm_sec = 0;
+ }
+ if ((buf[index] == '+') || (buf[index] == '-')) {
+ const int mn = get_number_from_char_buf(buf, &index);
+ const int mn1 = get_number_from_char_buf(buf, &index);
+ cert_time.tm_sec = (mn * 3600) + (mn1 * 60);
+ } else {
+ const int sec = get_number_from_char_buf(buf, &index);
+ cert_time.tm_sec = sec;
+ }
+
+ const time_t local_cert_time = mktime(&cert_time);
+ const time_t time_offset = get_time_zone_offset(local_cert_time);
+
+ return local_cert_time + time_offset;
+}
+
bool CryptoManagerImpl::SSLContextImpl::ReadHandshakeData(
const uint8_t** const out_data, size_t* out_data_size) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -280,7 +365,7 @@ bool CryptoManagerImpl::SSLContextImpl::WriteHandshakeData(
if (ret <= 0) {
is_handshake_pending_ = false;
ResetConnection();
- return Handshake_Result_AbnormalFail;
+ return false;
}
}
return true;
@@ -288,7 +373,9 @@ bool CryptoManagerImpl::SSLContextImpl::WriteHandshakeData(
SSLContext::HandshakeResult
CryptoManagerImpl::SSLContextImpl::PerformHandshake() {
+ LOG4CXX_AUTO_TRACE(logger_);
const int handshake_result = SSL_do_handshake(connection_);
+ LOG4CXX_TRACE(logger_, "Handshake result: " << handshake_result);
if (handshake_result == 1) {
const HandshakeResult result = CheckCertContext();
if (result != Handshake_Result_Success) {
@@ -307,6 +394,7 @@ CryptoManagerImpl::SSLContextImpl::PerformHandshake() {
is_handshake_pending_ = false;
} else if (handshake_result == 0) {
+ LOG4CXX_DEBUG(logger_, "SSL handshake failed");
SSL_clear(connection_);
is_handshake_pending_ = false;
return Handshake_Result_Fail;
@@ -403,25 +491,32 @@ bool CryptoManagerImpl::SSLContextImpl::Decrypt(const uint8_t* const in_data,
size_t in_data_size,
const uint8_t** const out_data,
size_t* out_data_size) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock locker(bio_locker);
if (!SSL_is_init_finished(connection_)) {
+ LOG4CXX_ERROR(logger_, "SSL initilization is not finished");
return false;
}
- if (!in_data || !in_data_size) {
+ if (!in_data || (0 == in_data_size)) {
+ LOG4CXX_ERROR(logger_, "IN data ptr or IN data size is 0");
return false;
}
+
BIO_write(bioIn_, in_data, in_data_size);
int len = BIO_ctrl_pending(bioFilter_);
+
ptrdiff_t offset = 0;
*out_data_size = 0;
- while (len) {
+ *out_data = NULL;
+ while (len > 0) {
EnsureBufferSizeEnough(len + offset);
len = BIO_read(bioFilter_, buffer_ + offset, len);
// TODO(EZamakhov): investigate BIO_read return 0, -1 and -2 meanings
if (len <= 0) {
// Reset filter and connection deinitilization instead
+ LOG4CXX_ERROR(logger_, "Read error occured. Read data lenght : " << len);
BIO_ctrl(bioFilter_, BIO_CTRL_RESET, 0, NULL);
return false;
}
@@ -447,6 +542,25 @@ bool CryptoManagerImpl::SSLContextImpl::IsHandshakePending() const {
return is_handshake_pending_;
}
+bool CryptoManagerImpl::SSLContextImpl::GetCertificateDueDate(
+ time_t& due_date) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ X509* cert = SSL_get_certificate(connection_);
+ if (!cert) {
+ LOG4CXX_DEBUG(logger_, "Get certificate failed.");
+ return false;
+ }
+
+ due_date = convert_asn1_time_to_time_t(X509_get_notAfter(cert));
+
+ return true;
+}
+
+bool CryptoManagerImpl::SSLContextImpl::HasCertificate() const {
+ return SSL_get_certificate(connection_) != NULL;
+}
+
CryptoManagerImpl::SSLContextImpl::~SSLContextImpl() {
SSL_shutdown(connection_);
SSL_free(connection_);
diff --git a/src/components/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc
index b30684e5f6..5e096194f3 100644
--- a/src/components/security_manager/test/crypto_manager_impl_test.cc
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -39,7 +39,6 @@
#include <fstream>
#include <sstream>
-#include "utils/make_shared.h"
#include "gtest/gtest.h"
#include "security_manager/crypto_manager_impl.h"
#include "security_manager/mock_security_manager_settings.h"
@@ -52,6 +51,10 @@ namespace {
const size_t kUpdatesBeforeHour = 24;
const std::string kAllCiphers = "ALL";
const std::string kCaCertPath = "";
+const uint32_t kServiceNumber = 2u;
+const size_t kMaxSizeVector = 1u;
+const std::string kCertPath = "certificate.crt";
+const std::string kPrivateKeyPath = "private.key";
#ifdef __QNXNTO__
const std::string kFordCipher = SSL3_TXT_RSA_DES_192_CBC3_SHA;
@@ -86,9 +89,11 @@ class CryptoManagerTest : public testing::Test {
void SetUp() OVERRIDE {
ASSERT_FALSE(certificate_data_base64_.empty());
mock_security_manager_settings_ =
- utils::MakeShared<MockCryptoManagerSettings>();
+ std::make_shared<MockCryptoManagerSettings>();
crypto_manager_ =
- utils::MakeShared<CryptoManagerImpl>(mock_security_manager_settings_);
+ std::make_shared<CryptoManagerImpl>(mock_security_manager_settings_);
+ forced_protected_services_.reserve(kMaxSizeVector);
+ forced_unprotected_services_.reserve(kMaxSizeVector);
}
void InitSecurityManager() {
@@ -101,6 +106,10 @@ class CryptoManagerTest : public testing::Test {
void SetInitialValues(security_manager::Mode mode,
security_manager::Protocol protocol,
const std::string& cipher) {
+ ON_CALL(*mock_security_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_services_));
+ ON_CALL(*mock_security_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_services_));
ON_CALL(*mock_security_manager_settings_, security_manager_mode())
.WillByDefault(Return(mode));
ON_CALL(*mock_security_manager_settings_, security_manager_protocol_name())
@@ -111,14 +120,21 @@ class CryptoManagerTest : public testing::Test {
.WillByDefault(ReturnRef(cipher));
ON_CALL(*mock_security_manager_settings_, ca_cert_path())
.WillByDefault(ReturnRef(kCaCertPath));
+ ON_CALL(*mock_security_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kCertPath));
+ ON_CALL(*mock_security_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kPrivateKeyPath));
ON_CALL(*mock_security_manager_settings_, verify_peer())
.WillByDefault(Return(false));
}
- utils::SharedPtr<CryptoManagerImpl> crypto_manager_;
- utils::SharedPtr<MockCryptoManagerSettings> mock_security_manager_settings_;
+ std::shared_ptr<CryptoManagerImpl> crypto_manager_;
+ std::shared_ptr<MockCryptoManagerSettings> mock_security_manager_settings_;
static std::string certificate_data_base64_;
+ std::vector<int> forced_protected_services_;
+ std::vector<int> forced_unprotected_services_;
};
+
std::string CryptoManagerTest::certificate_data_base64_;
TEST_F(CryptoManagerTest, UsingBeforeInit) {
@@ -133,16 +149,15 @@ TEST_F(CryptoManagerTest, WrongInit) {
// Unknown protocol version
security_manager::Protocol UNKNOWN =
static_cast<security_manager::Protocol>(-1);
+ // Unexistent cipher value
+ const std::string invalid_cipher = "INVALID_UNKNOWN_CIPHER";
+ const security_manager::Mode mode = security_manager::SERVER;
- EXPECT_CALL(*mock_security_manager_settings_, security_manager_mode())
- .WillRepeatedly(Return(security_manager::SERVER));
- EXPECT_CALL(*mock_security_manager_settings_,
- security_manager_protocol_name()).WillOnce(Return(UNKNOWN));
- EXPECT_FALSE(crypto_manager_->Init());
+ SetInitialValues(mode, UNKNOWN, invalid_cipher);
+ EXPECT_FALSE(crypto_manager_->Init());
EXPECT_NE(std::string(), crypto_manager_->LastError());
- // Unexistent cipher value
- const std::string invalid_cipher = "INVALID_UNKNOWN_CIPHER";
+
EXPECT_CALL(*mock_security_manager_settings_,
security_manager_protocol_name())
.WillOnce(Return(security_manager::TLSv1_2));
@@ -151,7 +166,6 @@ TEST_F(CryptoManagerTest, WrongInit) {
EXPECT_CALL(*mock_security_manager_settings_, ciphers_list())
.WillRepeatedly(ReturnRef(invalid_cipher));
EXPECT_FALSE(crypto_manager_->Init());
-
EXPECT_NE(std::string(), crypto_manager_->LastError());
}
@@ -176,10 +190,18 @@ TEST_F(CryptoManagerTest, CorrectInit) {
security_manager::CLIENT, security_manager::TLSv1_1, kFordCipher);
EXPECT_TRUE(crypto_manager_->Init());
+ SetInitialValues(
+ security_manager::CLIENT, security_manager::DTLSv1, kFordCipher);
+ EXPECT_TRUE(crypto_manager_->Init());
+
// Cipher value
SetInitialValues(
security_manager::SERVER, security_manager::TLSv1_2, kAllCiphers);
EXPECT_TRUE(crypto_manager_->Init());
+
+ SetInitialValues(
+ security_manager::SERVER, security_manager::DTLSv1, kAllCiphers);
+ EXPECT_TRUE(crypto_manager_->Init());
}
// #endif // __QNX__
@@ -198,7 +220,6 @@ TEST_F(CryptoManagerTest, CreateReleaseSSLContext) {
EXPECT_CALL(*mock_security_manager_settings_, maximum_payload_size())
.Times(1)
.WillRepeatedly(Return(max_payload_size));
-
security_manager::SSLContext* context = crypto_manager_->CreateSSLContext();
EXPECT_TRUE(context);
EXPECT_NO_THROW(crypto_manager_->ReleaseSSLContext(context));
@@ -210,7 +231,10 @@ TEST_F(CryptoManagerTest, OnCertificateUpdated) {
}
TEST_F(CryptoManagerTest, OnCertificateUpdated_UpdateNotRequired) {
+ time_t system_time = 0;
+ time_t certificates_time = 1;
size_t updates_before = 0;
+
SetInitialValues(
security_manager::CLIENT, security_manager::TLSv1_2, kAllCiphers);
ASSERT_TRUE(crypto_manager_->Init());
@@ -218,7 +242,8 @@ TEST_F(CryptoManagerTest, OnCertificateUpdated_UpdateNotRequired) {
EXPECT_CALL(*mock_security_manager_settings_, update_before_hours())
.WillOnce(Return(updates_before));
- EXPECT_FALSE(crypto_manager_->IsCertificateUpdateRequired());
+ EXPECT_FALSE(crypto_manager_->IsCertificateUpdateRequired(system_time,
+ certificates_time));
size_t max_updates_ = std::numeric_limits<size_t>::max();
SetInitialValues(
@@ -227,7 +252,8 @@ TEST_F(CryptoManagerTest, OnCertificateUpdated_UpdateNotRequired) {
.WillOnce(Return(max_updates_));
ASSERT_TRUE(crypto_manager_->Init());
- EXPECT_TRUE(crypto_manager_->IsCertificateUpdateRequired());
+ EXPECT_TRUE(crypto_manager_->IsCertificateUpdateRequired(system_time,
+ certificates_time));
}
TEST_F(CryptoManagerTest, OnCertificateUpdated_NotInitialized) {
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
index b334e78e19..aff7cbca2d 100644
--- a/src/components/security_manager/test/security_manager_test.cc
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -44,7 +44,8 @@
#include "security_manager/mock_ssl_context.h"
#include "security_manager/mock_crypto_manager.h"
#include "security_manager/mock_security_manager_listener.h"
-#include "utils/make_shared.h"
+#include "utils/mock_system_time_handler.h"
+
#include "utils/test_async_waiter.h"
namespace test {
@@ -76,11 +77,11 @@ using ::testing::_;
namespace {
// Sample data for handshake data emulation
-const int32_t key = 0x1;
-const int32_t seq_number = 0x2;
-const ServiceType secureServiceType = kControl;
-const uint32_t protocolVersion = PROTOCOL_VERSION_2;
-const bool is_final = false;
+const int32_t kKey = 0x1;
+const int32_t kSeqNumber = 0x2;
+const ServiceType kSecureServiceType = kControl;
+const uint32_t kProtocolVersion = PROTOCOL_VERSION_2;
+const bool kIsFinal = false;
const uint8_t handshake_data[] = {0x1, 0x2, 0x3, 0x4, 0x5};
const size_t handshake_data_size =
@@ -95,8 +96,12 @@ const uint32_t kAsyncExpectationsTimeout = 10000u;
class SecurityManagerTest : public ::testing::Test {
protected:
+ SecurityManagerTest()
+ : mock_system_time_handler(
+ std::unique_ptr<MockSystemTimeHandler>(new MockSystemTimeHandler()))
+ , security_manager_(
+ new SecurityManagerImpl(std::move(mock_system_time_handler))) {}
void SetUp() OVERRIDE {
- security_manager_.reset(new SecurityManagerImpl());
security_manager_->set_session_observer(&mock_session_observer);
security_manager_->set_protocol_handler(&mock_protocol_handler);
mock_sm_listener.reset(new testing::StrictMock<
@@ -105,7 +110,7 @@ class SecurityManagerTest : public ::testing::Test {
}
void SetMockCryptoManager() {
- EXPECT_CALL(mock_crypto_manager, IsCertificateUpdateRequired())
+ EXPECT_CALL(mock_crypto_manager, IsCertificateUpdateRequired(_, _))
.WillRepeatedly(Return(false));
security_manager_->set_crypto_manager(&mock_crypto_manager);
}
@@ -115,8 +120,8 @@ class SecurityManagerTest : public ::testing::Test {
void call_OnMessageReceived(const uint8_t* const data,
uint32_t dataSize,
const ServiceType serviceType) {
- const RawMessagePtr rawMessagePtr(utils::MakeShared<RawMessage>(
- key, protocolVersion, data, dataSize, serviceType));
+ const RawMessagePtr rawMessagePtr(std::make_shared<RawMessage>(
+ kKey, kProtocolVersion, data, dataSize, serviceType));
security_manager_->OnMessageReceived(rawMessagePtr);
}
/*
@@ -147,13 +152,14 @@ class SecurityManagerTest : public ::testing::Test {
const int repeat_count = 1) {
const SecurityQuery::QueryHeader header(SecurityQuery::NOTIFICATION,
SecurityQuery::SEND_HANDSHAKE_DATA,
- seq_number);
+ kSeqNumber);
for (int c = 0; c < repeat_count; ++c) {
EmulateMobileMessage(header, data, data_size);
}
}
- ::utils::SharedPtr<SecurityManagerImpl> security_manager_;
+
// Strict mocks (same as all methods EXPECT_CALL().Times(0))
+
testing::StrictMock<protocol_handler_test::MockSessionObserver>
mock_session_observer;
testing::StrictMock<protocol_handler_test::MockProtocolHandler>
@@ -166,6 +172,8 @@ class SecurityManagerTest : public ::testing::Test {
mock_ssl_context_exists;
std::unique_ptr<testing::StrictMock<
security_manager_test::MockSecurityManagerListener> > mock_sm_listener;
+ std::unique_ptr<MockSystemTimeHandler> mock_system_time_handler;
+ std::shared_ptr<SecurityManagerImpl> security_manager_;
};
// Test Bodies
@@ -174,7 +182,6 @@ class SecurityManagerTest : public ::testing::Test {
* and shall not call any methodes
*/
TEST_F(SecurityManagerTest, SetNULL_Intefaces) {
- security_manager_.reset(new SecurityManagerImpl());
security_manager_->set_session_observer(NULL);
security_manager_->set_protocol_handler(NULL);
security_manager_->set_crypto_manager(NULL);
@@ -209,9 +216,9 @@ TEST_F(SecurityManagerTest, Listeners_NoListeners) {
security_manager_->RemoveListener(&mock_listener2);
security_manager_->NotifyListenersOnHandshakeDone(
- key, SSLContext::Handshake_Result_Success);
+ kKey, SSLContext::Handshake_Result_Success);
security_manager_->NotifyListenersOnHandshakeDone(
- key, SSLContext::Handshake_Result_Fail);
+ kKey, SSLContext::Handshake_Result_Fail);
}
/*
* Notifying two listeners
@@ -228,11 +235,11 @@ TEST_F(SecurityManagerTest, Listeners_Notifying) {
const SSLContext::HandshakeResult first_call_value =
SSLContext::Handshake_Result_Success;
// Expect call both listeners on 1st call
- EXPECT_CALL(*mock_listener1, OnHandshakeDone(key, first_call_value))
+ EXPECT_CALL(*mock_listener1, OnHandshakeDone(kKey, first_call_value))
.
// Emulate false (reject) result
WillOnce(Return(false));
- EXPECT_CALL(*mock_listener2, OnHandshakeDone(key, first_call_value))
+ EXPECT_CALL(*mock_listener2, OnHandshakeDone(kKey, first_call_value))
.
// Emulate true (accept) result
WillOnce(Return(true));
@@ -244,7 +251,7 @@ TEST_F(SecurityManagerTest, Listeners_Notifying) {
const SSLContext::HandshakeResult second_call_value =
SSLContext::Handshake_Result_Fail;
// Expect call last listener on 2d call
- EXPECT_CALL(*mock_listener1, OnHandshakeDone(key, second_call_value))
+ EXPECT_CALL(*mock_listener1, OnHandshakeDone(kKey, second_call_value))
.
// Emulate false (reject) result
WillOnce(Return(true));
@@ -254,14 +261,14 @@ TEST_F(SecurityManagerTest, Listeners_Notifying) {
security_manager_->AddListener(mock_listener1);
security_manager_->AddListener(mock_listener2);
// 1st call
- security_manager_->NotifyListenersOnHandshakeDone(key, first_call_value);
+ security_manager_->NotifyListenersOnHandshakeDone(kKey, first_call_value);
security_manager_->NotifyOnCertificateUpdateRequired();
// 2nd call
- security_manager_->NotifyListenersOnHandshakeDone(key, second_call_value);
+ security_manager_->NotifyListenersOnHandshakeDone(kKey, second_call_value);
security_manager_->NotifyOnCertificateUpdateRequired();
// 3nd call
security_manager_->NotifyListenersOnHandshakeDone(
- key, SSLContext::Handshake_Result_Fail);
+ kKey, SSLContext::Handshake_Result_Fail);
security_manager_->NotifyOnCertificateUpdateRequired();
}
@@ -275,7 +282,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
uint8_t session_id = 0;
TestAsyncWaiter waiter;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -283,7 +290,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
EXPECT_CALL(mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_NOT_SUPPORTED),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
// It could be any query id
SecurityQuery::INVALID_QUERY_ID);
@@ -298,7 +305,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
TEST_F(SecurityManagerTest, OnMobileMessageSent) {
const uint8_t* data_param = NULL;
const RawMessagePtr rawMessagePtr(
- utils::MakeShared<RawMessage>(key, protocolVersion, data_param, 0));
+ std::make_shared<RawMessage>(kKey, kProtocolVersion, data_param, 0));
security_manager_->OnMobileMessageSent(rawMessagePtr);
}
/*
@@ -319,7 +326,7 @@ TEST_F(SecurityManagerTest, GetEmptyQuery) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -328,9 +335,9 @@ TEST_F(SecurityManagerTest, GetEmptyQuery) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- is_final));
+ kIsFinal));
// Call with NULL data
- call_OnMessageReceived(NULL, 0, secureServiceType);
+ call_OnMessageReceived(NULL, 0, kSecureServiceType);
}
/*
* Shall send InternallError on null data recieved
@@ -340,7 +347,7 @@ TEST_F(SecurityManagerTest, GetWrongJSONSize) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -349,7 +356,7 @@ TEST_F(SecurityManagerTest, GetWrongJSONSize) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- is_final));
+ kIsFinal));
SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
SecurityQuery::INVALID_QUERY_ID);
header.json_size = 0x0FFFFFFF;
@@ -365,7 +372,7 @@ TEST_F(SecurityManagerTest, GetInvalidQueryId) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
EXPECT_CALL(mock_session_observer,
@@ -378,7 +385,7 @@ TEST_F(SecurityManagerTest, GetInvalidQueryId) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_ID),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
SecurityQuery::INVALID_QUERY_ID);
@@ -395,10 +402,12 @@ TEST_F(SecurityManagerTest, CreateSSLContext_ServiceAlreadyProtected) {
SetMockCryptoManager();
// Return mock SSLContext
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(Return(&mock_ssl_context_new));
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::kUseExisting);
EXPECT_EQ(&mock_ssl_context_new, result);
}
/*
@@ -410,21 +419,23 @@ TEST_F(SecurityManagerTest, CreateSSLContext_ErrorCreateSSL) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
- InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
+ InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), kIsFinal));
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(ReturnNull());
EXPECT_CALL(mock_crypto_manager, CreateSSLContext()).WillOnce(ReturnNull());
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::kUseExisting);
EXPECT_EQ(NULL, result);
}
/*
@@ -437,7 +448,7 @@ TEST_F(SecurityManagerTest, CreateSSLContext_SetSSLContextError) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -446,18 +457,20 @@ TEST_F(SecurityManagerTest, CreateSSLContext_SetSSLContextError) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_UNKNOWN_INTERNAL_ERROR),
- is_final));
+ kIsFinal));
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(ReturnNull());
EXPECT_CALL(mock_crypto_manager, CreateSSLContext())
.WillOnce(Return(&mock_ssl_context_new));
EXPECT_CALL(mock_crypto_manager, ReleaseSSLContext(&mock_ssl_context_new));
- EXPECT_CALL(mock_session_observer, SetSSLContext(key, &mock_ssl_context_new))
+ EXPECT_CALL(mock_session_observer, SetSSLContext(kKey, &mock_ssl_context_new))
.WillOnce(Return(SecurityManager::ERROR_UNKNOWN_INTERNAL_ERROR));
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::kUseExisting);
EXPECT_EQ(NULL, result);
}
/*
@@ -469,17 +482,17 @@ TEST_F(SecurityManagerTest, CreateSSLContext_Success) {
// Expect no notifying listeners - it will be done after handshake
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .WillOnce(ReturnNull())
- .
- // additional check for debug code
- WillOnce(Return(&mock_ssl_context_exists));
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
+ .WillOnce(Return(&mock_ssl_context_exists));
EXPECT_CALL(mock_crypto_manager, CreateSSLContext())
.WillOnce(Return(&mock_ssl_context_new));
- EXPECT_CALL(mock_session_observer, SetSSLContext(key, &mock_ssl_context_new))
+ EXPECT_CALL(mock_session_observer, SetSSLContext(kKey, &mock_ssl_context_new))
.WillOnce(Return(SecurityManager::ERROR_SUCCESS));
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::
+ kForceRecreation);
EXPECT_EQ(&mock_ssl_context_new, result);
}
/*
@@ -490,7 +503,7 @@ TEST_F(SecurityManagerTest, StartHandshake_ServiceStillUnprotected) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -498,17 +511,17 @@ TEST_F(SecurityManagerTest, StartHandshake_ServiceStillUnprotected) {
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
- InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
+ InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), kIsFinal));
// Expect notifying listeners (unsuccess)
EXPECT_CALL(*mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(Return(true));
// Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(ReturnNull());
- security_manager_->StartHandshake(key);
+ security_manager_->StartHandshake(kKey);
// Listener was destroyed after OnHandshakeDone call
mock_sm_listener.release();
@@ -521,109 +534,27 @@ TEST_F(SecurityManagerTest, StartHandshake_SSLInternalError) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
- EXPECT_CALL(mock_session_observer, GetHandshakeContext(key))
- .WillOnce(Return(SSLContext::HandshakeContext()));
+
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
-
+ // Expect notifying listeners (unsuccess)
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
+ .WillOnce(ReturnNull());
// Expect InternalError with ERROR_ID
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
- InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
- // Expect notifying listeners (unsuccess)
- EXPECT_CALL(*mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
- .WillOnce(Return(true));
-
- // Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .WillOnce(Return(&mock_ssl_context_exists));
- EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
- .WillOnce(Return(false));
- EXPECT_CALL(mock_ssl_context_exists, SetHandshakeContext(_));
- EXPECT_CALL(mock_ssl_context_exists, StartHandshake(_, _))
- .WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
- SetArgPointee<1>(handshake_data_out_size),
- Return(SSLContext::Handshake_Result_Fail)));
-
- security_manager_->StartHandshake(key);
+ InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), kIsFinal));
- // Listener was destroyed after OnHandshakeDone call
+ security_manager_->StartHandshake(kKey);
mock_sm_listener.release();
}
-/*
- * Shall send data on call StartHandshake
- */
-TEST_F(SecurityManagerTest, StartHandshake_SSLInitIsNotComplete) {
- SetMockCryptoManager();
- uint32_t connection_id = 0;
- uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
- EXPECT_CALL(mock_session_observer, GetHandshakeContext(key))
- .Times(3)
- .WillRepeatedly(Return(SSLContext::HandshakeContext()));
- EXPECT_CALL(mock_session_observer,
- ProtocolVersionUsed(connection_id, session_id, _))
- .WillOnce(Return(true));
-
- // Expect send one message (with correct pointer and size data)
- EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(_, is_final));
-
- // Return mock SSLContext
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .Times(3)
- .WillRepeatedly(Return(&mock_ssl_context_exists));
- // Expect initialization check on each call StartHandshake
- EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
- .Times(3)
- .WillRepeatedly(Return(false));
- EXPECT_CALL(mock_ssl_context_exists, SetHandshakeContext(_)).Times(3);
-
- // Emulate SSLContext::StartHandshake with different parameters
- // Only on both correct - data and size shall be send message to mobile app
- EXPECT_CALL(mock_ssl_context_exists, StartHandshake(_, _))
- .WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
- SetArgPointee<1>(0),
- Return(SSLContext::Handshake_Result_Success)))
- .WillOnce(DoAll(SetArgPointee<0>((uint8_t*)NULL),
- SetArgPointee<1>(handshake_data_out_size),
- Return(SSLContext::Handshake_Result_Success)))
- .WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
- SetArgPointee<1>(handshake_data_out_size),
- Return(SSLContext::Handshake_Result_Success)));
-
- security_manager_->StartHandshake(key);
- security_manager_->StartHandshake(key);
- security_manager_->StartHandshake(key);
-}
-/*
- * Shall notify listeners on call StartHandshake after SSLContext initialization
- * complete
- */
-TEST_F(SecurityManagerTest, StartHandshake_SSLInitIsComplete) {
- SetMockCryptoManager();
- // Expect no message send
- // Expect notifying listeners (success)
- EXPECT_CALL(*mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Success))
- .WillOnce(Return(true));
-
- // Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .WillOnce(Return(&mock_ssl_context_exists));
- EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
- .WillOnce(Return(true));
-
- security_manager_->StartHandshake(key);
- // Listener was destroyed after OnHandshakeDone call
- mock_sm_listener.release();
-}
/*
* Shall send InternallError on
* getting SEND_HANDSHAKE_DATA with NULL data
@@ -634,7 +565,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
uint8_t session_id = 0;
TestAsyncWaiter waiter;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -644,7 +575,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
EmulateMobileMessageHandshake(NULL, 0);
@@ -664,7 +595,7 @@ TEST_F(SecurityManagerTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
EXPECT_CALL(mock_session_observer,
@@ -675,17 +606,17 @@ TEST_F(SecurityManagerTest,
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_SERVICE_NOT_PROTECTED),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
// Expect notifying listeners (unsuccess)
EXPECT_CALL(*mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
// Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
times++;
@@ -713,7 +644,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
@@ -728,18 +659,18 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_SSL_INVALID_DATA),
- is_final))
+ kIsFinal))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
// Expect notifying listeners (unsuccess)
EXPECT_CALL(*mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.Times(handshake_emulates)
.WillRepeatedly(Return(&mock_ssl_context_exists));
@@ -794,7 +725,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
@@ -808,14 +739,14 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
const size_t raw_message_size = 15;
EXPECT_CALL(
mock_protocol_handler,
- SendMessageToMobileApp(RawMessageEqSize(raw_message_size), is_final))
+ SendMessageToMobileApp(RawMessageEqSize(raw_message_size), kIsFinal))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
// Expect notifying listeners (unsuccess)
EXPECT_CALL(*mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
@@ -824,7 +755,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
.Times(handshake_emulates)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(false)));
times += handshake_emulates;
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.Times(handshake_emulates)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter),
Return(&mock_ssl_context_exists)));
@@ -870,12 +801,12 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
// Expect no errors
// Expect notifying listeners (success)
EXPECT_CALL(*mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Success))
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Success))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.Times(handshake_emulates)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter),
Return(&mock_ssl_context_exists)));
@@ -928,14 +859,14 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _)).Times(2);
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _)).Times(2);
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.Times(2)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times += 2; // matches to the number above
- EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(_, is_final))
+ EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(_, kIsFinal))
.Times(2)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += 2; // matches to the number above
diff --git a/src/components/security_manager/test/ssl_certificate_handshake_test.cc b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
index dc335c8da2..1034bb3c83 100644
--- a/src/components/security_manager/test/ssl_certificate_handshake_test.cc
+++ b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
@@ -56,6 +56,10 @@ namespace custom_str = utils::custom_string;
namespace {
const std::string server_ca_cert_filename = "server";
const std::string client_ca_cert_filename = "client";
+const std::string client_cert_filename = "client.crt";
+const std::string server_cert_filename = "server.crt";
+const std::string client_key_filename = "client_private.key";
+const std::string server_key_filename = "server_private.key";
const std::string client_certificate = "client/client_credential.pem";
const std::string server_certificate = "server/spt_credential.pem";
const std::string server_unsigned_cert_file =
@@ -66,36 +70,42 @@ const std::string server_expired_cert_file =
const bool verify_peer = true;
const bool skip_peer_verification = false;
-const size_t updates_before_hour = 24;
-
} // namespace
+struct Protocol {
+ security_manager::Protocol server_protocol;
+ security_manager::Protocol client_protocol;
+
+ Protocol(security_manager::Protocol s_protocol,
+ security_manager::Protocol c_protocol)
+ : server_protocol(s_protocol), client_protocol(c_protocol) {}
+};
-class SSLHandshakeTest : public testing::Test {
+class SSLHandshakeTest : public testing::TestWithParam<Protocol> {
protected:
void SetUp() OVERRIDE {
- mock_server_manager_settings = new testing::NiceMock<
+ mock_server_manager_settings_ = new testing::NiceMock<
security_manager_test::MockCryptoManagerSettings>();
- server_manager = new security_manager::CryptoManagerImpl(
- utils::SharedPtr<security_manager::CryptoManagerSettings>(
- mock_server_manager_settings));
- ASSERT_TRUE(server_manager);
- mock_client_manager_settings = new testing::NiceMock<
+ server_manager_ = new security_manager::CryptoManagerImpl(
+ std::shared_ptr<security_manager::CryptoManagerSettings>(
+ mock_server_manager_settings_));
+ ASSERT_TRUE(server_manager_);
+ mock_client_manager_settings_ = new testing::NiceMock<
security_manager_test::MockCryptoManagerSettings>();
- client_manager = new security_manager::CryptoManagerImpl(
- utils::SharedPtr<security_manager::CryptoManagerSettings>(
- mock_client_manager_settings));
- ASSERT_TRUE(client_manager);
- server_ctx = NULL;
- client_ctx = NULL;
+ client_manager_ = new security_manager::CryptoManagerImpl(
+ std::shared_ptr<security_manager::CryptoManagerSettings>(
+ mock_client_manager_settings_));
+ ASSERT_TRUE(client_manager_);
+ server_ctx_ = NULL;
+ client_ctx_ = NULL;
}
void TearDown() OVERRIDE {
- server_manager->ReleaseSSLContext(server_ctx);
- delete server_manager;
- client_manager->ReleaseSSLContext(client_ctx);
- delete client_manager;
+ server_manager_->ReleaseSSLContext(server_ctx_);
+ delete server_manager_;
+ client_manager_->ReleaseSSLContext(client_ctx_);
+ delete client_manager_;
}
void SetServerInitialValues(const security_manager::Protocol protocol,
@@ -106,18 +116,25 @@ class SSLHandshakeTest : public testing::Test {
server_certificate_ = cert;
server_ciphers_list_ = server_ciphers_list;
server_ca_certificate_path_ = ca_certificate_path;
-
- ON_CALL(*mock_server_manager_settings, security_manager_mode())
+ ON_CALL(*mock_server_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_server_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_server_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::SERVER));
- ON_CALL(*mock_server_manager_settings, security_manager_protocol_name())
+ ON_CALL(*mock_server_manager_settings_, security_manager_protocol_name())
.WillByDefault(Return(protocol));
- ON_CALL(*mock_server_manager_settings, certificate_data())
+ ON_CALL(*mock_server_manager_settings_, certificate_data())
.WillByDefault(ReturnRef(server_certificate_));
- ON_CALL(*mock_server_manager_settings, ciphers_list())
+ ON_CALL(*mock_server_manager_settings_, ciphers_list())
.WillByDefault(ReturnRef(server_ciphers_list_));
- ON_CALL(*mock_server_manager_settings, ca_cert_path())
+ ON_CALL(*mock_server_manager_settings_, ca_cert_path())
.WillByDefault(ReturnRef(server_ca_certificate_path_));
- ON_CALL(*mock_server_manager_settings, verify_peer())
+ ON_CALL(*mock_server_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(server_cert_filename));
+ ON_CALL(*mock_server_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(server_key_filename));
+ ON_CALL(*mock_server_manager_settings_, verify_peer())
.WillByDefault(Return(verify_peer));
}
void SetClientInitialValues(const security_manager::Protocol protocol,
@@ -129,17 +146,25 @@ class SSLHandshakeTest : public testing::Test {
client_ciphers_list_ = client_ciphers_list;
client_ca_certificate_path_ = ca_certificate_path;
- ON_CALL(*mock_client_manager_settings, security_manager_mode())
+ ON_CALL(*mock_client_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_client_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_client_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::CLIENT));
- ON_CALL(*mock_client_manager_settings, security_manager_protocol_name())
+ ON_CALL(*mock_client_manager_settings_, security_manager_protocol_name())
.WillByDefault(Return(protocol));
- ON_CALL(*mock_client_manager_settings, certificate_data())
+ ON_CALL(*mock_client_manager_settings_, certificate_data())
.WillByDefault(ReturnRef(client_certificate_));
- ON_CALL(*mock_client_manager_settings, ciphers_list())
+ ON_CALL(*mock_client_manager_settings_, ciphers_list())
.WillByDefault(ReturnRef(client_ciphers_list_));
- ON_CALL(*mock_client_manager_settings, ca_cert_path())
+ ON_CALL(*mock_client_manager_settings_, ca_cert_path())
.WillByDefault(ReturnRef(client_ca_certificate_path_));
- ON_CALL(*mock_client_manager_settings, verify_peer())
+ ON_CALL(*mock_client_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(client_cert_filename));
+ ON_CALL(*mock_client_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(client_key_filename));
+ ON_CALL(*mock_client_manager_settings_, verify_peer())
.WillByDefault(Return(verify_peer));
}
@@ -156,19 +181,19 @@ class SSLHandshakeTest : public testing::Test {
cert.close();
SetServerInitialValues(
protocol, ss.str(), ciphers_list, verify_peer, ca_certificate_path);
- const bool initialized = server_manager->Init();
+ const bool initialized = server_manager_->Init();
if (!initialized) {
return false;
}
- server_ctx = server_manager->CreateSSLContext();
+ server_ctx_ = server_manager_->CreateSSLContext();
- if (!server_ctx) {
+ if (!server_ctx_) {
return false;
}
- server_ctx->SetHandshakeContext(
+ server_ctx_->SetHandshakeContext(
security_manager::SSLContext::HandshakeContext(
custom_str::CustomString("SPT"),
custom_str::CustomString("client")));
@@ -192,17 +217,17 @@ class SSLHandshakeTest : public testing::Test {
ciphers_list,
verify_peer,
ca_certificate_path);
- const bool initialized = client_manager->Init();
+ const bool initialized = client_manager_->Init();
if (!initialized) {
return false;
}
- client_ctx = client_manager->CreateSSLContext();
- if (!client_ctx) {
+ client_ctx_ = client_manager_->CreateSSLContext();
+ if (!client_ctx_) {
return false;
}
- client_ctx->SetHandshakeContext(
+ client_ctx_->SetHandshakeContext(
security_manager::SSLContext::HandshakeContext(
custom_str::CustomString("SPT"),
custom_str::CustomString("server")));
@@ -211,17 +236,17 @@ class SSLHandshakeTest : public testing::Test {
}
void ResetConnections() {
- ASSERT_NO_THROW(server_ctx->ResetConnection());
- ASSERT_NO_THROW(client_ctx->ResetConnection());
+ ASSERT_NO_THROW(server_ctx_->ResetConnection());
+ ASSERT_NO_THROW(client_ctx_->ResetConnection());
}
void StartHandshake() {
using security_manager::SSLContext;
ASSERT_EQ(SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&client_buf, &client_buf_len));
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ client_ctx_->StartHandshake(&client_buf_, &client_buf_len_));
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
void HandshakeProcedure_Success() {
@@ -229,23 +254,25 @@ class SSLHandshakeTest : public testing::Test {
StartHandshake();
while (true) {
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
- client_buf, client_buf_len, &server_buf, &server_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ server_ctx_->DoHandshakeStep(
+ client_buf_, client_buf_len_, &server_buf_, &server_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- ASSERT_FALSE(server_buf == NULL);
- ASSERT_GT(server_buf_len, 0u);
+ ASSERT_FALSE(server_buf_ == NULL);
+ ASSERT_GT(server_buf_len_, 0u);
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- client_ctx->DoHandshakeStep(
- server_buf, server_buf_len, &client_buf, &client_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ client_ctx_->DoHandshakeStep(
+ server_buf_, server_buf_len_, &client_buf_, &client_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- if (server_ctx->IsInitCompleted()) {
+ if (server_ctx_->IsInitCompleted()) {
break;
}
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
}
@@ -255,9 +282,9 @@ class SSLHandshakeTest : public testing::Test {
StartHandshake();
while (true) {
- const SSLContext::HandshakeResult result = server_ctx->DoHandshakeStep(
- client_buf, client_buf_len, &server_buf, &server_buf_len);
- ASSERT_FALSE(server_ctx->IsInitCompleted())
+ const SSLContext::HandshakeResult result = server_ctx_->DoHandshakeStep(
+ client_buf_, client_buf_len_, &server_buf_, &server_buf_len_);
+ ASSERT_FALSE(server_ctx_->IsInitCompleted())
<< "Expected server side handshake fail";
// First few handshake will be successful
@@ -265,18 +292,19 @@ class SSLHandshakeTest : public testing::Test {
// Test successfully passed with handshake fail
return;
}
- ASSERT_FALSE(server_buf == NULL);
- ASSERT_GT(server_buf_len, 0u);
+ ASSERT_FALSE(server_buf_ == NULL);
+ ASSERT_GT(server_buf_len_, 0u);
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- client_ctx->DoHandshakeStep(
- server_buf, server_buf_len, &client_buf, &client_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ client_ctx_->DoHandshakeStep(
+ server_buf_, server_buf_len_, &client_buf_, &client_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- ASSERT_FALSE(client_ctx->IsInitCompleted())
+ ASSERT_FALSE(client_ctx_->IsInitCompleted())
<< "Expected server side handshake fail";
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
FAIL() << "Expected server side handshake fail";
}
@@ -288,17 +316,18 @@ class SSLHandshakeTest : public testing::Test {
StartHandshake();
while (true) {
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
- client_buf, client_buf_len, &server_buf, &server_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ server_ctx_->DoHandshakeStep(
+ client_buf_, client_buf_len_, &server_buf_, &server_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- ASSERT_FALSE(server_buf == NULL);
- ASSERT_GT(server_buf_len, 0u);
+ ASSERT_FALSE(server_buf_ == NULL);
+ ASSERT_GT(server_buf_len_, 0u);
- const SSLContext::HandshakeResult result = client_ctx->DoHandshakeStep(
- server_buf, server_buf_len, &client_buf, &client_buf_len);
- ASSERT_FALSE(client_ctx->IsInitCompleted())
+ const SSLContext::HandshakeResult result = client_ctx_->DoHandshakeStep(
+ server_buf_, server_buf_len_, &client_buf_, &client_buf_len_);
+ ASSERT_FALSE(client_ctx_->IsInitCompleted())
<< "Expected client side handshake fail";
// First few handsahke will be successful
@@ -308,25 +337,25 @@ class SSLHandshakeTest : public testing::Test {
return;
}
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
FAIL() << "Expected client side handshake fail";
}
- security_manager::CryptoManager* server_manager;
- security_manager::CryptoManager* client_manager;
- security_manager::SSLContext* server_ctx;
- security_manager::SSLContext* client_ctx;
+ security_manager::CryptoManager* server_manager_;
+ security_manager::CryptoManager* client_manager_;
+ security_manager::SSLContext* server_ctx_;
+ security_manager::SSLContext* client_ctx_;
testing::NiceMock<security_manager_test::MockCryptoManagerSettings>*
- mock_server_manager_settings;
+ mock_server_manager_settings_;
testing::NiceMock<security_manager_test::MockCryptoManagerSettings>*
- mock_client_manager_settings;
+ mock_client_manager_settings_;
- const uint8_t* server_buf;
- const uint8_t* client_buf;
- size_t server_buf_len;
- size_t client_buf_len;
+ const uint8_t* server_buf_;
+ const uint8_t* client_buf_;
+ size_t server_buf_len_;
+ size_t client_buf_len_;
std::string server_certificate_;
std::string server_ciphers_list_;
@@ -335,188 +364,175 @@ class SSLHandshakeTest : public testing::Test {
std::string client_certificate_;
std::string client_ciphers_list_;
std::string client_ca_certificate_path_;
+
+ const std::vector<int> forced_protected_service_;
+ const std::vector<int> forced_unprotected_service_;
};
-TEST_F(SSLHandshakeTest, NoVerification) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+INSTANTIATE_TEST_CASE_P(
+ CorrectProtocol,
+ SSLHandshakeTest,
+ ::testing::Values(
+ Protocol(security_manager::TLSv1, security_manager::TLSv1),
+ Protocol(security_manager::TLSv1_1, security_manager::TLSv1_1),
+ Protocol(security_manager::TLSv1_2, security_manager::TLSv1_2),
+ Protocol(security_manager::DTLSv1, security_manager::DTLSv1)));
+
+TEST_P(SSLHandshakeTest, NoVerification) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_ServerSide) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_ServerSide) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_ServerSide_NoCACertificate) {
+TEST_P(SSLHandshakeTest, CAVerification_ServerSide_NoCACertificate) {
ASSERT_TRUE(InitServerManagers(
- security_manager::TLSv1_2, "", "ALL", verify_peer, "unex"))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ GetParam().server_protocol, "", "ALL", verify_peer, "unex"))
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ServerSideFail());
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
+ << server_manager_->LastError();
GTEST_TRACE(ResetConnections());
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_ClientSide) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
- server_certificate,
- "ALL",
- verify_peer,
- client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
- client_certificate,
- "ALL",
- verify_peer,
- server_ca_cert_filename))
- << client_manager->LastError();
-
- GTEST_TRACE(HandshakeProcedure_Success());
-}
-
-TEST_F(SSLHandshakeTest, CAVerification_ClientSide_NoCACertificate) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_ClientSide_NoCACertificate) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
"",
"ALL",
verify_peer,
"client_ca_cert_filename"))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ClientSideFail(
security_manager::SSLContext::Handshake_Result_Fail));
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(ResetConnections());
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_BothSides) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_BothSides) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, UnsignedCert) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, UnsignedCert) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_unsigned_cert_file,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ClientSideFail(
security_manager::SSLContext::Handshake_Result_CertNotSigned));
}
-TEST_F(SSLHandshakeTest, ExpiredCert) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, ExpiredCert) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_expired_cert_file,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ClientSideFail(
security_manager::SSLContext::Handshake_Result_CertExpired));
}
-TEST_F(SSLHandshakeTest, AppNameAndAppIDInvalid) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, AppNameAndAppIDInvalid) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
- client_ctx->SetHandshakeContext(
- security_manager::SSLContext::HandshakeContext(
- custom_str::CustomString("server"),
- custom_str::CustomString("Wrong")));
-
- GTEST_TRACE(HandshakeProcedure_ClientSideFail(
- security_manager::SSLContext::Handshake_Result_AppNameMismatch));
-
- ResetConnections();
- client_ctx->SetHandshakeContext(
+ client_ctx_->SetHandshakeContext(
security_manager::SSLContext::HandshakeContext(
custom_str::CustomString("Wrong"),
custom_str::CustomString("server")));
@@ -525,19 +541,19 @@ TEST_F(SSLHandshakeTest, AppNameAndAppIDInvalid) {
security_manager::SSLContext::Handshake_Result_AppIDMismatch));
}
-TEST_F(SSLHandshakeTest, NoVerification_ResetConnection) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, NoVerification_ResetConnection) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
const int times = 100;
for (int i = 0; i < times; ++i) {
@@ -549,19 +565,19 @@ TEST_F(SSLHandshakeTest, NoVerification_ResetConnection) {
}
}
-TEST_F(SSLHandshakeTest, CAVerification_BothSides_ResetConnection) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_BothSides_ResetConnection) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
const int times = 100;
for (int i = 0; i < times; ++i) {
@@ -572,7 +588,6 @@ TEST_F(SSLHandshakeTest, CAVerification_BothSides_ResetConnection) {
GTEST_TRACE(ResetConnections());
}
}
-
// TODO(EZamakhov): add fail tests -broken or not full ca certificate chain
} // namespace ssl_handshake_test
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index 945059e58c..05eeb802ad 100644
--- a/src/components/security_manager/test/ssl_context_test.cc
+++ b/src/components/security_manager/test/ssl_context_test.cc
@@ -41,16 +41,17 @@
#include "security_manager/ssl_context.h"
#include "utils/custom_string.h"
#include "security_manager/mock_security_manager_settings.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
namespace {
-const size_t kUpdatesBeforeHour = 24;
const std::string kCaPath = "";
+const std::string kClientCertPath = "client_certificate.crt";
+const std::string kClientPrivateKeyPath = "client_private.key";
+const std::string kServerCertPath = "server_certificate.crt";
+const std::string kServerPrivateKeyPath = "server_private.key";
const uint8_t* kServerBuf;
const uint8_t* kClientBuf;
const std::string kAllCiphers = "ALL";
@@ -70,19 +71,19 @@ namespace ssl_context_test {
namespace custom_str = utils::custom_string;
struct ProtocolAndCipher {
- security_manager::Protocol server_protocol;
- security_manager::Protocol client_protocol;
- std::string server_ciphers_list;
- std::string client_ciphers_list;
+ security_manager::Protocol server_protocol_;
+ security_manager::Protocol client_protocol_;
+ std::string server_ciphers_list_;
+ std::string client_ciphers_list_;
ProtocolAndCipher(security_manager::Protocol s_protocol,
security_manager::Protocol c_protocol,
std::string s_ciphers_list,
std::string c_ciphers_list)
- : server_protocol(s_protocol)
- , client_protocol(c_protocol)
- , server_ciphers_list(s_ciphers_list)
- , client_ciphers_list(c_ciphers_list) {}
+ : server_protocol_(s_protocol)
+ , client_protocol_(c_protocol)
+ , server_ciphers_list_(s_ciphers_list)
+ , client_ciphers_list_(c_ciphers_list) {}
};
class SSLTest : public testing::Test {
@@ -108,9 +109,9 @@ class SSLTest : public testing::Test {
}
virtual void SetUp() OVERRIDE {
- mock_crypto_manager_settings_ = utils::MakeShared<
+ mock_crypto_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> crypto_set(
+ std::shared_ptr<security_manager::CryptoManagerSettings> crypto_set(
mock_crypto_manager_settings_);
crypto_manager_ = new security_manager::CryptoManagerImpl(crypto_set);
@@ -127,12 +128,22 @@ class SSLTest : public testing::Test {
.WillRepeatedly(ReturnRef(kCaPath));
EXPECT_CALL(*mock_crypto_manager_settings_, verify_peer())
.WillOnce(Return(false));
+
+ ON_CALL(*mock_crypto_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_crypto_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_crypto_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kServerCertPath));
+ ON_CALL(*mock_crypto_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kServerPrivateKeyPath));
+
const bool crypto_manager_initialization = crypto_manager_->Init();
EXPECT_TRUE(crypto_manager_initialization);
- mock_client_manager_settings_ = utils::MakeShared<
+ mock_client_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
client_manager_ = new security_manager::CryptoManagerImpl(client_crypto);
@@ -150,6 +161,16 @@ class SSLTest : public testing::Test {
.WillRepeatedly(ReturnRef(kCaPath));
EXPECT_CALL(*mock_client_manager_settings_, verify_peer())
.WillOnce(Return(false));
+
+ ON_CALL(*mock_client_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_client_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_client_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kClientCertPath));
+ ON_CALL(*mock_client_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kClientPrivateKeyPath));
+
const bool client_manager_initialization = client_manager_->Init();
EXPECT_TRUE(client_manager_initialization);
@@ -159,19 +180,19 @@ class SSLTest : public testing::Test {
.WillByDefault(Return(kMaximumPayloadSize));
EXPECT_CALL(*mock_crypto_manager_settings_, security_manager_mode())
.WillRepeatedly(Return(security_manager::SERVER));
- server_ctx = crypto_manager_->CreateSSLContext();
+ server_ctx_ = crypto_manager_->CreateSSLContext();
EXPECT_CALL(*mock_client_manager_settings_, security_manager_mode())
.Times(2)
.WillRepeatedly(Return(security_manager::CLIENT));
- client_ctx = client_manager_->CreateSSLContext();
+ client_ctx_ = client_manager_->CreateSSLContext();
using custom_str::CustomString;
security_manager::SSLContext::HandshakeContext ctx(CustomString("SPT"),
CustomString("client"));
- server_ctx->SetHandshakeContext(ctx);
+ server_ctx_->SetHandshakeContext(ctx);
ctx.expected_cn = "server";
- client_ctx->SetHandshakeContext(ctx);
+ client_ctx_->SetHandshakeContext(ctx);
kServerBuf = NULL;
kClientBuf = NULL;
@@ -180,8 +201,8 @@ class SSLTest : public testing::Test {
}
void TearDown() OVERRIDE {
- crypto_manager_->ReleaseSSLContext(server_ctx);
- client_manager_->ReleaseSSLContext(client_ctx);
+ crypto_manager_->ReleaseSSLContext(server_ctx_);
+ client_manager_->ReleaseSSLContext(client_ctx_);
delete crypto_manager_;
delete client_manager_;
@@ -190,15 +211,18 @@ class SSLTest : public testing::Test {
const size_t kMaximumPayloadSize = 1000u;
security_manager::CryptoManager* crypto_manager_;
security_manager::CryptoManager* client_manager_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
- security_manager::SSLContext* server_ctx;
- security_manager::SSLContext* client_ctx;
+ security_manager::SSLContext* server_ctx_;
+ security_manager::SSLContext* client_ctx_;
static std::string client_certificate_data_base64_;
static std::string server_certificate_data_base64_;
+
+ const std::vector<int> forced_unprotected_service_;
+ const std::vector<int> forced_protected_service_;
};
std::string SSLTest::client_certificate_data_base64_;
std::string SSLTest::server_certificate_data_base64_;
@@ -218,41 +242,42 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
ASSERT_FALSE(certificate.empty()) << "Certificate data file is empty";
certificate_data_base64_ = certificate;
- mock_crypto_manager_settings_ = utils::MakeShared<
+ mock_crypto_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> server_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> server_crypto(
mock_crypto_manager_settings_);
- crypto_manager = new security_manager::CryptoManagerImpl(server_crypto);
+ crypto_manager_ = new security_manager::CryptoManagerImpl(server_crypto);
- SetServerInitialValues(GetParam().server_protocol,
- GetParam().server_ciphers_list);
+ SetServerInitialValues(GetParam().server_protocol_,
+ GetParam().server_ciphers_list_);
- const bool crypto_manager_initialization = crypto_manager->Init();
+ const bool crypto_manager_initialization = crypto_manager_->Init();
EXPECT_TRUE(crypto_manager_initialization);
- mock_client_manager_settings_ = utils::MakeShared<
+ mock_client_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
- client_manager = new security_manager::CryptoManagerImpl(client_crypto);
+ client_manager_ = new security_manager::CryptoManagerImpl(client_crypto);
- SetClientInitialValues(GetParam().client_protocol,
- GetParam().client_ciphers_list);
+ SetClientInitialValues(GetParam().client_protocol_,
+ GetParam().client_ciphers_list_);
- const bool client_manager_initialization = client_manager->Init();
+ const bool client_manager_initialization = client_manager_->Init();
EXPECT_TRUE(client_manager_initialization);
- server_ctx = crypto_manager->CreateSSLContext();
- client_ctx = client_manager->CreateSSLContext();
+ server_ctx_ = crypto_manager_->CreateSSLContext();
+ client_ctx_ = client_manager_->CreateSSLContext();
using custom_str::CustomString;
- security_manager::SSLContext::HandshakeContext ctx(CustomString("SPT"),
- CustomString("client"));
- server_ctx->SetHandshakeContext(ctx);
- ctx.expected_cn = "server";
- client_ctx->SetHandshakeContext(ctx);
+ server_ctx_->SetHandshakeContext(
+ security_manager::SSLContext::HandshakeContext(CustomString("SPT"),
+ CustomString("client")));
+ client_ctx_->SetHandshakeContext(
+ security_manager::SSLContext::HandshakeContext(CustomString("SPT"),
+ CustomString("server")));
kServerBuf = NULL;
kClientBuf = NULL;
@@ -261,15 +286,19 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
}
void TearDown() OVERRIDE {
- crypto_manager->ReleaseSSLContext(server_ctx);
- client_manager->ReleaseSSLContext(client_ctx);
+ crypto_manager_->ReleaseSSLContext(server_ctx_);
+ client_manager_->ReleaseSSLContext(client_ctx_);
- delete crypto_manager;
- delete client_manager;
+ delete crypto_manager_;
+ delete client_manager_;
}
void SetServerInitialValues(security_manager::Protocol protocol,
const std::string& server_ciphers_list) {
+ ON_CALL(*mock_crypto_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_crypto_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
ON_CALL(*mock_crypto_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::SERVER));
ON_CALL(*mock_crypto_manager_settings_, security_manager_protocol_name())
@@ -282,9 +311,18 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
.WillByDefault(ReturnRef(kCaPath));
ON_CALL(*mock_crypto_manager_settings_, verify_peer())
.WillByDefault(Return(false));
+ ON_CALL(*mock_crypto_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kServerCertPath));
+ ON_CALL(*mock_crypto_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kServerPrivateKeyPath));
}
+
void SetClientInitialValues(security_manager::Protocol protocol,
const std::string& client_ciphers_list) {
+ ON_CALL(*mock_client_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_client_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
ON_CALL(*mock_client_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::CLIENT));
ON_CALL(*mock_client_manager_settings_, security_manager_protocol_name())
@@ -297,17 +335,23 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
.WillByDefault(ReturnRef(kCaPath));
ON_CALL(*mock_client_manager_settings_, verify_peer())
.WillByDefault(Return(false));
+ ON_CALL(*mock_client_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kClientCertPath));
+ ON_CALL(*mock_client_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kClientPrivateKeyPath));
}
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
- security_manager::CryptoManager* crypto_manager;
- security_manager::CryptoManager* client_manager;
- security_manager::SSLContext* server_ctx;
- security_manager::SSLContext* client_ctx;
+ security_manager::CryptoManager* crypto_manager_;
+ security_manager::CryptoManager* client_manager_;
+ security_manager::SSLContext* server_ctx_;
+ security_manager::SSLContext* client_ctx_;
std::string certificate_data_base64_;
+ const std::vector<int> forced_unprotected_service_;
+ const std::vector<int> forced_protected_service_;
};
class SSLTestForTLS1_2 : public SSLTestParam {};
@@ -316,17 +360,25 @@ class SSLTestForTLS1_2 : public SSLTestParam {};
INSTANTIATE_TEST_CASE_P(
CorrectProtocolAndCiphers,
SSLTestParam,
- ::testing::Values(ProtocolAndCipher(security_manager::TLSv1,
+ ::testing::Values(ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1,
kFordCipher,
kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1_1,
kFordCipher,
- kFordCipher),
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
ProtocolAndCipher(security_manager::SSLv3,
security_manager::SSLv3,
kFordCipher,
+ kFordCipher)
+#endif
+ ,
+ ProtocolAndCipher(security_manager::DTLSv1,
+ security_manager::DTLSv1,
+ kFordCipher,
kFordCipher)));
INSTANTIATE_TEST_CASE_P(
@@ -336,27 +388,45 @@ INSTANTIATE_TEST_CASE_P(
security_manager::TLSv1_1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1,
- security_manager::SSLv3,
+ ProtocolAndCipher(security_manager::TLSv1_1,
+ security_manager::TLSv1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1_1,
+ ProtocolAndCipher(security_manager::TLSv1_2,
security_manager::TLSv1,
kFordCipher,
kFordCipher),
+ ProtocolAndCipher(security_manager::TLSv1_2,
+ security_manager::TLSv1_1,
+ kFordCipher,
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
+ ProtocolAndCipher(security_manager::TLSv1,
+ security_manager::SSLv3,
+ kFordCipher,
+ kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::SSLv3,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1_2,
- security_manager::TLSv1,
+ ProtocolAndCipher(security_manager::TLSv1,
+ security_manager::DTLSv1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1_2,
+ ProtocolAndCipher(security_manager::DTLSv1,
security_manager::TLSv1_1,
kFordCipher,
kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_2,
+ security_manager::DTLSv1,
+ kFordCipher,
+ kFordCipher),
+ ProtocolAndCipher(security_manager::TLSv1_1,
+ security_manager::DTLSv1,
+ kFordCipher,
+ kFordCipher),
+ ProtocolAndCipher(security_manager::TLSv1_2,
security_manager::SSLv3,
kFordCipher,
kFordCipher),
@@ -367,11 +437,14 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::SSLv3,
security_manager::TLSv1_1,
kFordCipher,
- kFordCipher)));
+ kFordCipher)
+#endif
+ ));
TEST_F(SSLTest, OnTSL2Protocol_BrokenHandshake) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
+
ASSERT_FALSE(NULL == kClientBuf);
ASSERT_LT(0u, client_buf_len);
// Broke 3 bytes for get abnormal fail of handshake
@@ -379,26 +452,26 @@ TEST_F(SSLTest, OnTSL2Protocol_BrokenHandshake) {
const_cast<uint8_t*>(kClientBuf)[client_buf_len / 2] ^= 0xFF;
const_cast<uint8_t*>(kClientBuf)[client_buf_len - 1] ^= 0xFF;
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_AbnormalFail,
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
- EXPECT_EQ("Initialization is not completed", server_ctx->LastError());
- EXPECT_EQ("Initialization is not completed", client_ctx->LastError());
+ EXPECT_EQ("Initialization is not completed", server_ctx_->LastError());
+ EXPECT_EQ("Initialization is not completed", client_ctx_->LastError());
}
// TODO {AKozoriz} : Unexpected uncomplited init of SSL component.
// In this and next tests.
// Must be fixed after merge to develop.
TEST_F(SSLTest, OnTSL2Protocol_Positive) {
- ASSERT_EQ(client_ctx->StartHandshake(&kClientBuf, &client_buf_len),
+ ASSERT_EQ(client_ctx_->StartHandshake(&kClientBuf, &client_buf_len),
security_manager::SSLContext::Handshake_Result_Success);
- EXPECT_FALSE(server_ctx->IsInitCompleted());
+ EXPECT_FALSE(server_ctx_->IsInitCompleted());
while (true) {
ASSERT_TRUE(NULL != kClientBuf);
ASSERT_LT(0u, client_buf_len);
const security_manager::SSLContext::HandshakeResult server_result =
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
server_result);
@@ -406,11 +479,11 @@ TEST_F(SSLTest, OnTSL2Protocol_Positive) {
ASSERT_LT(0u, server_buf_len);
const security_manager::SSLContext::HandshakeResult client_result =
- client_ctx->DoHandshakeStep(
+ client_ctx_->DoHandshakeStep(
kServerBuf, server_buf_len, &kClientBuf, &client_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
client_result);
- if (server_ctx->IsInitCompleted()) {
+ if (server_ctx_->IsInitCompleted()) {
break;
}
@@ -421,22 +494,22 @@ TEST_F(SSLTest, OnTSL2Protocol_Positive) {
ASSERT_TRUE(NULL == kClientBuf);
ASSERT_EQ(0u, client_buf_len);
// expect both side initialization complete
- EXPECT_TRUE(client_ctx->IsInitCompleted());
- EXPECT_TRUE(server_ctx->IsInitCompleted());
+ EXPECT_TRUE(client_ctx_->IsInitCompleted());
+ EXPECT_TRUE(server_ctx_->IsInitCompleted());
// Encrypt text on client side
const uint8_t* text = reinterpret_cast<const uint8_t*>("abra");
const uint8_t* encrypted_text = 0;
size_t text_len = 4;
size_t encrypted_text_len;
- EXPECT_TRUE(client_ctx->Encrypt(
+ EXPECT_TRUE(client_ctx_->Encrypt(
text, text_len, &encrypted_text, &encrypted_text_len));
ASSERT_NE(reinterpret_cast<void*>(NULL), encrypted_text);
ASSERT_LT(0u, encrypted_text_len);
// Decrypt text on server side
- EXPECT_TRUE(server_ctx->Decrypt(
+ EXPECT_TRUE(server_ctx_->Decrypt(
encrypted_text, encrypted_text_len, &text, &text_len));
ASSERT_NE(reinterpret_cast<void*>(NULL), text);
ASSERT_LT(0u, text_len);
@@ -446,34 +519,34 @@ TEST_F(SSLTest, OnTSL2Protocol_Positive) {
TEST_F(SSLTest, OnTSL2Protocol_EcncryptionFail) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
- while (!server_ctx->IsInitCompleted()) {
+ while (!server_ctx_->IsInitCompleted()) {
ASSERT_FALSE(NULL == kClientBuf);
ASSERT_LT(0u, client_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
ASSERT_FALSE(NULL == kServerBuf);
ASSERT_LT(0u, server_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->DoHandshakeStep(
+ client_ctx_->DoHandshakeStep(
kServerBuf, server_buf_len, &kClientBuf, &client_buf_len));
}
// Expect empty buffers after init complete
ASSERT_TRUE(NULL == kClientBuf);
ASSERT_EQ(0u, client_buf_len);
// Expect both side initialization complete
- EXPECT_TRUE(client_ctx->IsInitCompleted());
- EXPECT_TRUE(server_ctx->IsInitCompleted());
+ EXPECT_TRUE(client_ctx_->IsInitCompleted());
+ EXPECT_TRUE(server_ctx_->IsInitCompleted());
// Encrypt text on client side
const uint8_t* text = reinterpret_cast<const uint8_t*>("abra");
const uint8_t* encrypted_text = 0;
size_t text_len = 4;
size_t encrypted_text_len;
- EXPECT_TRUE(client_ctx->Encrypt(
+ EXPECT_TRUE(client_ctx_->Encrypt(
text, text_len, &encrypted_text, &encrypted_text_len));
ASSERT_NE(reinterpret_cast<void*>(NULL), encrypted_text);
ASSERT_LT(0u, encrypted_text_len);
@@ -486,29 +559,30 @@ TEST_F(SSLTest, OnTSL2Protocol_EcncryptionFail) {
const uint8_t* out_text;
size_t out_text_size;
// Decrypt broken text on server side
- EXPECT_FALSE(server_ctx->Decrypt(
+ EXPECT_FALSE(server_ctx_->Decrypt(
&broken[0], broken.size(), &out_text, &out_text_size));
// Check after broken message that server encryption and decryption fail
// Encrypte message on server side
- EXPECT_FALSE(server_ctx->Decrypt(
+ EXPECT_FALSE(server_ctx_->Decrypt(
encrypted_text, encrypted_text_len, &out_text, &out_text_size));
- EXPECT_FALSE(server_ctx->Encrypt(
+ EXPECT_FALSE(server_ctx_->Encrypt(
text, text_len, &encrypted_text, &encrypted_text_len));
}
TEST_P(SSLTestParam, ClientAndServerNotTLSv1_2_HandshakeFailed) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_AbnormalFail,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
+
EXPECT_TRUE(NULL == kClientBuf);
EXPECT_EQ(0u, client_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
EXPECT_TRUE(NULL == kServerBuf);
EXPECT_EQ(0u, server_buf_len);
- EXPECT_FALSE(server_ctx->IsInitCompleted());
+ EXPECT_FALSE(server_ctx_->IsInitCompleted());
}
INSTANTIATE_TEST_CASE_P(
@@ -521,24 +595,31 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1_2,
kFordCipher,
- kFordCipher),
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
ProtocolAndCipher(security_manager::SSLv3,
security_manager::TLSv1_2,
kFordCipher,
- kFordCipher)));
+ kFordCipher)
+#endif
+ ));
TEST_P(SSLTestForTLS1_2, HandshakeFailed) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
EXPECT_FALSE(NULL == kClientBuf);
ASSERT_LT(0u, client_buf_len);
+
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_AbnormalFail,
- server_ctx->DoHandshakeStep(
- kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
+ server_ctx_->DoHandshakeStep(
+ kClientBuf, client_buf_len, &kServerBuf, &server_buf_len))
+ << ERR_reason_error_string(ERR_get_error());
+
EXPECT_TRUE(NULL == kServerBuf);
EXPECT_EQ(0u, server_buf_len);
- EXPECT_FALSE(server_ctx->IsInitCompleted());
+ EXPECT_FALSE(server_ctx_->IsInitCompleted());
}
} // namespace ssl_context_test
diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
index cdddcfed55..bfa39af10a 100644
--- a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
@@ -33,11 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Always false schema item.
**/
@@ -47,27 +46,24 @@ class CAlwaysFalseSchemaItem : public ISchemaItem {
* @brief Create a new schema item.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CAlwaysFalseSchemaItem> create();
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return Errors::ERROR
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ static std::shared_ptr<CAlwaysFalseSchemaItem> create();
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return Errors::ERROR
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
CAlwaysFalseSchemaItem();
DISALLOW_COPY_AND_ASSIGN(CAlwaysFalseSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
index e078ae3240..4750c280e5 100644
--- a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
@@ -33,11 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Always true schema item.
**/
@@ -47,27 +46,24 @@ class CAlwaysTrueSchemaItem : public ISchemaItem {
* @brief Create a new schema item.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CAlwaysTrueSchemaItem> create();
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ static std::shared_ptr<CAlwaysTrueSchemaItem> create();
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
CAlwaysTrueSchemaItem();
DISALLOW_COPY_AND_ASSIGN(CAlwaysTrueSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h
index 937979f2fa..a81fdd637e 100644
--- a/src/components/smart_objects/include/smart_objects/array_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h
@@ -34,13 +34,14 @@
#include <stddef.h>
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
#include "smart_objects/always_true_schema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include "utils/semantic_version.h"
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Array schema item.
**/
@@ -55,7 +56,7 @@ class CArraySchemaItem : public ISchemaItem {
*
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CArraySchemaItem> create(
+ static std::shared_ptr<CArraySchemaItem> create(
const ISchemaItemPtr ElementSchemaItem = CAlwaysTrueSchemaItem::create(),
const TSchemaItemParameter<size_t>& MinSize =
TSchemaItemParameter<size_t>(),
@@ -63,27 +64,16 @@ class CArraySchemaItem : public ISchemaItem {
TSchemaItemParameter<size_t>());
/**
- * @deprecated
- *
* @brief Validate smart object.
- *
- * @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
-
- /**
- * @brief Validate smart object.
- *
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * message if an error occurs
- *
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Apply schema.
@@ -94,7 +84,9 @@ class CArraySchemaItem : public ISchemaItem {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
@@ -138,7 +130,7 @@ class CArraySchemaItem : public ISchemaItem {
const TSchemaItemParameter<size_t> mMaxSize;
DISALLOW_COPY_AND_ASSIGN(CArraySchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/bool_schema_item.h b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
index eca5a0e063..3a9f6c929d 100644
--- a/src/components/smart_objects/include/smart_objects/bool_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
@@ -33,12 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
-
#include "smart_objects/default_shema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Bool schema item.
**/
@@ -49,7 +47,7 @@ class CBoolSchemaItem : public CDefaultSchemaItem<bool> {
* @param DefaultValue Default value of a parameter.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CBoolSchemaItem> create(
+ static std::shared_ptr<CBoolSchemaItem> create(
const TSchemaItemParameter<bool>& DefaultValue =
TSchemaItemParameter<bool>());
@@ -61,6 +59,6 @@ class CBoolSchemaItem : public CDefaultSchemaItem<bool> {
private:
DISALLOW_COPY_AND_ASSIGN(CBoolSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h
index 56952dbac1..5978fcb282 100644
--- a/src/components/smart_objects/include/smart_objects/default_shema_item.h
+++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h
@@ -33,14 +33,13 @@
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Default schema item.
@@ -50,20 +49,16 @@ class CDefaultSchemaItem : public ISchemaItem {
public:
typedef TSchemaItemParameter<Type> ParameterType;
/**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return Errors::ERROR
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
- /**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return Errors::ERROR
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Set default value to an object.
@@ -107,23 +102,19 @@ CDefaultSchemaItem<Type>::CDefaultSchemaItem(const ParameterType& DefaultValue)
: mDefaultValue(DefaultValue) {}
template <typename Type>
-Errors::eType CDefaultSchemaItem<Type>::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-template <typename Type>
-Errors::eType CDefaultSchemaItem<Type>::validate(
- const SmartObject& Object, rpc::ValidationReport* report__) {
+errors::eType CDefaultSchemaItem<Type>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (getSmartType() != Object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(getSmartType()) +
", got: " +
SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
} else {
- return Errors::OK;
+ return errors::OK;
}
}
@@ -149,6 +140,6 @@ void CDefaultSchemaItem<Type>::BuildObjectBySchema(
}
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
index 524d966188..cbba5bd7cd 100644
--- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
@@ -39,11 +39,36 @@
#include <set>
#include <string>
-#include "utils/shared_ptr.h"
#include "smart_objects/default_shema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include "utils/semantic_version.h"
+#include <boost/optional.hpp>
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+
+struct ElementSignature {
+ boost::optional<utils::SemanticVersion> mSince;
+ boost::optional<utils::SemanticVersion> mUntil;
+ bool mRemoved;
+
+ ElementSignature(std::string since = "",
+ std::string until = "",
+ bool removed = false) {
+ utils::SemanticVersion since_struct(since);
+ utils::SemanticVersion until_struct(until);
+
+ if (since_struct.isValid()) {
+ mSince = since_struct;
+ }
+
+ if (until_struct.isValid()) {
+ mUntil = until_struct;
+ }
+
+ mRemoved = removed;
+ }
+};
template <typename EnumType>
class EnumConversionHelper;
@@ -60,25 +85,44 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<TEnumSchemaItem> create(
+ static std::shared_ptr<TEnumSchemaItem> create(
const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue =
TSchemaItemParameter<EnumType>());
+
/**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @brief Create a new schema item.
+ * @param AllowedElements Set of allowed enumeration elements.
+ * @param DefaultValue Default value.
+ * @return Shared pointer to a new schema item.
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ static std::shared_ptr<TEnumSchemaItem> createWithSignatures(
+ const std::set<EnumType>& AllowedElements,
+ const std::map<EnumType, std::vector<ElementSignature> >&
+ ElementSignatures,
+ const TSchemaItemParameter<EnumType>& DefaultValue =
+ TSchemaItemParameter<EnumType>());
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
+ /**
+ * @brief Return the correct history signature based on message version.
+ * @param signatures Vector reference of enums history items.
+ * @param MessageVersion RPC Version of mobile app.
+ **/
+ const ElementSignature getSignature(
+ const std::vector<ElementSignature>& signatures,
+ const utils::SemanticVersion& MessageVersion);
+
/**
* @brief Apply schema.
* This implementation checks if enumeration is represented as string
@@ -89,7 +133,9 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
@@ -104,12 +150,18 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
**/
TEnumSchemaItem(const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue);
+
+ TEnumSchemaItem(const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue,
+ const std::map<EnumType, std::vector<ElementSignature> >&
+ ElementSignatures);
SmartType getSmartType() const OVERRIDE;
EnumType getDefaultValue() const OVERRIDE;
/**
* @brief Set of allowed enumeration elements.
**/
const std::set<EnumType> mAllowedElements;
+ std::map<EnumType, std::vector<ElementSignature> > mElementSignatures;
/**
* @brief Default value.
**/
@@ -208,21 +260,54 @@ class EnumConversionHelper {
};
template <typename EnumType>
-utils::SharedPtr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
+std::shared_ptr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue) {
- return new TEnumSchemaItem<EnumType>(AllowedElements, DefaultValue);
+ return std::shared_ptr<TEnumSchemaItem<EnumType> >(
+ new TEnumSchemaItem<EnumType>(AllowedElements, DefaultValue));
}
template <typename EnumType>
-Errors::eType TEnumSchemaItem<EnumType>::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
+std::shared_ptr<TEnumSchemaItem<EnumType> >
+TEnumSchemaItem<EnumType>::createWithSignatures(
+ const std::set<EnumType>& AllowedElements,
+ const std::map<EnumType, std::vector<ElementSignature> >& ElementSignatures,
+ const TSchemaItemParameter<EnumType>& DefaultValue) {
+ return std::shared_ptr<TEnumSchemaItem<EnumType> >(
+ new TEnumSchemaItem<EnumType>(
+ AllowedElements, DefaultValue, ElementSignatures));
+}
+
+template <typename EnumType>
+const ElementSignature TEnumSchemaItem<EnumType>::getSignature(
+ const std::vector<ElementSignature>& signatures,
+ const utils::SemanticVersion& MessageVersion) {
+ for (uint i = 0; i < signatures.size(); i++) {
+ ElementSignature signature = signatures[i];
+ // Check if signature matches message version
+ if (signature.mSince != boost::none &&
+ MessageVersion < signature.mSince.get()) {
+ // Msg version predates 'since' field, check next entry
+ continue;
+ }
+ if (signature.mUntil != boost::none &&
+ (MessageVersion >= signature.mUntil.get())) {
+ continue; // Msg version newer than `until` field, check next entry
+ }
+ // Found correct signature
+ return signature;
+ }
+
+ // Could not match msg version to element siganture
+ ElementSignature ret;
+ return ret;
}
template <typename EnumType>
-Errors::eType TEnumSchemaItem<EnumType>::validate(
- const SmartObject& Object, rpc::ValidationReport* report__) {
+errors::eType TEnumSchemaItem<EnumType>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Integer != Object.getType()) {
std::string validation_info;
if (SmartType_String == Object.getType()) {
@@ -234,22 +319,55 @@ Errors::eType TEnumSchemaItem<EnumType>::validate(
SmartObject::typeToString(Object.getType());
}
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
- if (mAllowedElements.find(static_cast<EnumType>(Object.asInt())) ==
- mAllowedElements.end()) {
+
+ auto elements_it =
+ mAllowedElements.find(static_cast<EnumType>(Object.asInt()));
+
+ if (elements_it == mAllowedElements.end()) {
std::stringstream stream;
stream << "Invalid enum value: " << Object.asInt();
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
+ }
+
+ // Element exists in schema. Check if version is also valid.
+ if (MessageVersion.isValid()) {
+ EnumType value = *elements_it;
+ auto signatures_it = mElementSignatures.find(value);
+ if (signatures_it != mElementSignatures.end()) {
+ if (!signatures_it->second.empty()) {
+ ElementSignature signature =
+ getSignature(signatures_it->second, MessageVersion);
+ if (signature.mRemoved) {
+ // Element was removed for this version
+ std::string validation_info = "Enum value : " + Object.asString() +
+ " removed for SyncMsgVersion " +
+ MessageVersion.toString();
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ } else if (signature.mSince == boost::none &&
+ signature.mUntil == boost::none) {
+ // Element does not exist for this version
+ std::string validation_info = "Enum value : " + Object.asString() +
+ " does not exist for SyncMsgVersion " +
+ MessageVersion.toString();
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ }
+ }
+ }
}
- return Errors::OK;
+ return errors::OK;
}
template <typename EnumType>
-void TEnumSchemaItem<EnumType>::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void TEnumSchemaItem<EnumType>::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_String == Object.getType()) {
EnumType enum_val = static_cast<EnumType>(-1);
if (ConversionHelper::StringToEnum(Object.asString(), &enum_val)) {
@@ -285,6 +403,15 @@ TEnumSchemaItem<EnumType>::TEnumSchemaItem(
: CDefaultSchemaItem<EnumType>(DefaultValue)
, mAllowedElements(AllowedElements) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+template <typename EnumType>
+TEnumSchemaItem<EnumType>::TEnumSchemaItem(
+ const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue,
+ const std::map<EnumType, std::vector<ElementSignature> >& ElementSignatures)
+ : CDefaultSchemaItem<EnumType>(DefaultValue)
+ , mAllowedElements(AllowedElements)
+ , mElementSignatures(ElementSignatures) {}
+
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ENUM_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/errors.h b/src/components/smart_objects/include/smart_objects/errors.h
index 5d22d2386e..8fc73be049 100644
--- a/src/components/smart_objects/include/smart_objects/errors.h
+++ b/src/components/smart_objects/include/smart_objects/errors.h
@@ -31,9 +31,9 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-namespace Errors {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+namespace errors {
/**
* @brief Enumeration that provides information about SmartObject validation
*errors
@@ -64,8 +64,8 @@ enum eType {
**/
ERROR
};
-} // namespace Errors
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace errors
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h
index d549b9891a..6481605daf 100644
--- a/src/components/smart_objects/include/smart_objects/number_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h
@@ -35,13 +35,14 @@
#include <typeinfo>
#include <limits>
-#include "utils/shared_ptr.h"
+
#include "smart_objects/default_shema_item.h"
#include "smart_objects/schema_item_parameter.h"
#include "utils/convert_utils.h"
+#include "utils/helpers.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Number schema item.
* @tparam NumberType Number type.
@@ -56,7 +57,7 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<TNumberSchemaItem> create(
+ static std::shared_ptr<TNumberSchemaItem> create(
const TSchemaItemParameter<NumberType>& MinValue =
TSchemaItemParameter<NumberType>(),
const TSchemaItemParameter<NumberType>& MaxValue =
@@ -65,20 +66,16 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
TSchemaItemParameter<NumberType>());
/**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return Errors::ERROR
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
- /**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return Errors::ERROR
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
/**
@@ -111,11 +108,12 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
};
template <typename NumberType>
-utils::SharedPtr<TNumberSchemaItem<NumberType> > TNumberSchemaItem<
+std::shared_ptr<TNumberSchemaItem<NumberType> > TNumberSchemaItem<
NumberType>::create(const TSchemaItemParameter<NumberType>& MinValue,
const TSchemaItemParameter<NumberType>& MaxValue,
const TSchemaItemParameter<NumberType>& DefaultValue) {
- return new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue);
+ return std::shared_ptr<TNumberSchemaItem<NumberType> >(
+ new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue));
}
template <typename NumberType>
@@ -123,27 +121,23 @@ bool TNumberSchemaItem<NumberType>::isValidNumberType(SmartType type) {
NumberType value(0);
if ((SmartType_Double == type) && (typeid(double) == typeid(value))) {
return true;
- } else if ((SmartType_Integer == type) &&
- (typeid(int32_t) == typeid(value) ||
- typeid(uint32_t) == typeid(value) ||
- typeid(int64_t) == typeid(value) ||
- typeid(double) == typeid(value))) {
+ } else if (((SmartType_Integer == type) || (SmartType_UInteger == type)) &&
+ helpers::Compare<const std::type_info&, helpers::EQ, helpers::ONE>(
+ typeid(value),
+ typeid(int32_t),
+ typeid(uint32_t),
+ typeid(int64_t),
+ typeid(double))) {
return true;
- } else {
- return false;
}
+ return false;
}
template <typename NumberType>
-Errors::eType TNumberSchemaItem<NumberType>::validate(
- const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-template <typename NumberType>
-Errors::eType TNumberSchemaItem<NumberType>::validate(
- const SmartObject& Object, rpc::ValidationReport* report__) {
+errors::eType TNumberSchemaItem<NumberType>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (!isValidNumberType(Object.getType())) {
SmartType expectedType = (typeid(double) == typeid(Object.getType()))
? SmartType_Double
@@ -152,7 +146,7 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
"Incorrect type, expected: " + SmartObject::typeToString(expectedType) +
", got: " + SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
NumberType value(0);
if (typeid(int32_t) == typeid(value)) {
@@ -176,7 +170,7 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
<< ", minimum allowed: " << rangeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
if (mMaxValue.getValue(rangeLimit) && (value > rangeLimit)) {
@@ -185,9 +179,9 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
<< ", maximum allowed: " << rangeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
- return Errors::OK;
+ return errors::OK;
}
template <typename NumberType>
@@ -225,6 +219,6 @@ SmartType TNumberSchemaItem<int64_t>::getSmartType() const;
template <>
SmartType TNumberSchemaItem<double>::getSmartType() const;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h
index 8922caba45..45d161320b 100644
--- a/src/components/smart_objects/include/smart_objects/object_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/object_schema_item.h
@@ -37,13 +37,14 @@
#include <set>
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+#include "utils/semantic_version.h"
+#include <boost/optional.hpp>
#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Object schema item.
**/
@@ -63,7 +64,21 @@ class CObjectSchemaItem : public ISchemaItem {
* @param IsMandatory true if member is mandatory, false
* otherwise. Defaults to true.
**/
- SMember(const ISchemaItemPtr SchemaItem, const bool IsMandatory = true);
+
+ SMember(const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory = true,
+ const std::string& Since = "",
+ const std::string& Until = "",
+ const bool IsDeprecated = false,
+ const bool IsRemoved = false,
+ const std::vector<CObjectSchemaItem::SMember>& history_vector = {});
+ /**
+ * @brief Checks the version a parameter was removed (until)
+ * If the mobile's msg version is greater than or
+ **/
+ bool CheckHistoryFieldVersion(
+ const utils::SemanticVersion& MessageVersion) const;
+
/**
* @brief Member schema item.
**/
@@ -72,6 +87,11 @@ class CObjectSchemaItem : public ISchemaItem {
* @brief true if member is mandatory, false otherwise.
**/
bool mIsMandatory;
+ boost::optional<utils::SemanticVersion> mSince;
+ boost::optional<utils::SemanticVersion> mUntil;
+ bool mIsDeprecated;
+ bool mIsRemoved;
+ std::vector<CObjectSchemaItem::SMember> mHistoryVector;
};
typedef std::map<std::string, SMember> Members;
/**
@@ -82,22 +102,19 @@ class CObjectSchemaItem : public ISchemaItem {
*
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CObjectSchemaItem> create(const Members& Members);
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ static std::shared_ptr<CObjectSchemaItem> create(const Members& Members);
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Apply schema.
* @param Object Object to apply schema.
@@ -105,7 +122,9 @@ class CObjectSchemaItem : public ISchemaItem {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
@@ -137,7 +156,16 @@ class CObjectSchemaItem : public ISchemaItem {
* @brief Removes fake parameters from object.
* @param Object Object to remove fake parameters.
**/
- void RemoveFakeParams(SmartObject& Object);
+ void RemoveFakeParams(SmartObject& Object,
+ const utils::SemanticVersion& MessageVersion);
+
+ /**
+ * @brief Returns the correct schema item based on message version.
+ * @param member Schema member
+ * @param MmessageVersion Semantic Version of mobile message.
+ **/
+ const CObjectSchemaItem::SMember& GetCorrectMember(
+ const SMember& member, const utils::SemanticVersion& messageVersion);
/**
* @brief Map of member name to SMember structure describing the object
@@ -146,6 +174,6 @@ class CObjectSchemaItem : public ISchemaItem {
const Members mMembers;
DISALLOW_COPY_AND_ASSIGN(CObjectSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_OBJECT_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/schema_item.h b/src/components/smart_objects/include/smart_objects/schema_item.h
index 446c7fa65f..24c642c0ba 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -33,13 +33,18 @@
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
#include <stdlib.h>
-#include "utils/shared_ptr.h"
+
#include "rpc_base/validation_report.h"
#include "smart_objects/errors.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include <memory>
+#include <vector>
+#include "utils/macro.h"
+#include "utils/semantic_version.h"
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
class SmartObject;
/**
@@ -48,27 +53,18 @@ class SmartObject;
class ISchemaItem {
public:
/**
- * @deprecated
- *
- * @brief Validate smart object.
- *
- * @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
- **/
- DEPRECATED virtual Errors::eType validate(const SmartObject& Object);
-
- /**
* @brief Validate smart object.
*
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
* message if an error occurs
- *
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec Histor
+ * @return ns_smart_objects::errors::eType
**/
- virtual Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__);
+ virtual errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Set default value to an object.
@@ -96,8 +92,9 @@ class ISchemaItem {
* from smart object otherwise contains false.
**/
virtual void applySchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& Object,
- const bool RemoveFakeParameters);
+ ns_smart_device_link::ns_smart_objects::SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Unapply schema.
@@ -105,7 +102,7 @@ class ISchemaItem {
* @param Object Object to unapply schema.
**/
virtual void unapplySchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& Object);
+ ns_smart_device_link::ns_smart_objects::SmartObject& Object);
/**
* @brief Build smart object by smart schema having copied matched
@@ -126,7 +123,7 @@ class ISchemaItem {
virtual ~ISchemaItem() {}
};
-typedef utils::SharedPtr<ISchemaItem> ISchemaItemPtr;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+typedef std::shared_ptr<ISchemaItem> ISchemaItemPtr;
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/schema_item_parameter.h b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
index 49fdb9541b..f747b0ae89 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
@@ -34,8 +34,8 @@
#include "utils/macro.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief SchemaItem parameter.
* Container for schema item parameter such as min/max value, size,
@@ -95,6 +95,6 @@ bool TSchemaItemParameter<ParameterType>::getValue(ParameterType& Value) const {
}
return mIsSpecified;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_PARAMETER_H_
diff --git a/src/components/smart_objects/include/smart_objects/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h
index cc2bc7e22c..2abc221972 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -35,6 +35,7 @@
#include <set>
#include <string>
+#include <sstream>
#include <vector>
#include <map>
@@ -42,8 +43,8 @@
#include "utils/custom_string.h"
#include "rpc_base/validation_report.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace custom_str = utils::custom_string;
@@ -126,7 +127,7 @@ typedef std::map<std::string, SmartObject> SmartMap;
**/
typedef std::vector<uint8_t> SmartBinary;
-typedef utils::SharedPtr<SmartObject> SmartObjectSPtr;
+typedef std::shared_ptr<SmartObject> SmartObjectSPtr;
/**
* @brief List of SmartObjects
@@ -671,20 +672,15 @@ class SmartObject FINAL {
bool isValid() const;
/**
- * @deprecated
- * @brief Validates object according to attached schema.
- *
- * @return Result of validation.
- */
- DEPRECATED Errors::eType validate();
-
- /**
* @brief Validates object according to attached schema.
*
* @param report__ object for reporting errors during validation
+ * @param messageVersion of the mobile app to check against RPC Spec Schema
* @return Result of validation.
*/
- Errors::eType validate(rpc::ValidationReport* report__);
+ errors::eType validate(
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Sets new schema
@@ -704,7 +700,7 @@ class SmartObject FINAL {
/**
* @brief Returns current object type
*
- * @return NsSmartObjects::SmartType
+ * @return ns_smart_objects::SmartType
**/
SmartType getType() const;
@@ -1053,9 +1049,9 @@ static SmartObject invalid_object_value(SmartType_Invalid);
* @brief Value that is used as invalid value for object type
**/
static const SmartBinary invalid_binary_value;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+namespace smart_objects = ns_smart_device_link::ns_smart_objects;
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
diff --git a/src/components/smart_objects/include/smart_objects/smart_schema.h b/src/components/smart_objects/include/smart_objects/smart_schema.h
index ada5646043..5e1497fdde 100644
--- a/src/components/smart_objects/include/smart_objects/smart_schema.h
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -35,8 +35,8 @@
#include "utils/macro.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
class SmartObject;
/**
@@ -61,26 +61,17 @@ class CSmartSchema FINAL {
explicit CSmartSchema(const ISchemaItemPtr SchemaItem);
/**
- * @deprecated
- *
- * @brief Validate smart object.
- *
- * @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
- **/
- DEPRECATED Errors::eType validate(const SmartObject& Object) const;
-
- /**
* @brief Validate smart object.
*
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- *
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) const;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& messageVersion =
+ utils::SemanticVersion()) const;
/**
* @brief Set new root schema item.
@@ -97,7 +88,10 @@ class CSmartSchema FINAL {
* @param RemoveFakeParameters contains true if need to remove fake parameters
* from smart object otherwise contains false.
**/
- void applySchema(SmartObject& Object, const bool RemoveFakeParameters);
+ void applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief The reverse SmartObject conversion using schema.
@@ -124,6 +118,6 @@ class CSmartSchema FINAL {
*/
ISchemaItemPtr mSchemaItem;
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h
index 6c98dcc3b3..5b37db584d 100644
--- a/src/components/smart_objects/include/smart_objects/string_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h
@@ -36,13 +36,11 @@
#include <stddef.h>
#include <string>
-#include "utils/shared_ptr.h"
-
#include "smart_objects/default_shema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief String schema item.
**/
@@ -54,28 +52,25 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CStringSchemaItem> create(
+ static std::shared_ptr<CStringSchemaItem> create(
const TSchemaItemParameter<size_t>& MinLength =
TSchemaItemParameter<size_t>(),
const TSchemaItemParameter<size_t>& MaxLength =
TSchemaItemParameter<size_t>(),
const TSchemaItemParameter<std::string>& DefaultValue =
TSchemaItemParameter<std::string>());
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
/**
@@ -95,6 +90,6 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
const TSchemaItemParameter<size_t> mMaxLength;
DISALLOW_COPY_AND_ASSIGN(CStringSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_STRING_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/src/always_false_schema_item.cc b/src/components/smart_objects/src/always_false_schema_item.cc
index 1893ed24d1..ca247eed09 100644
--- a/src/components/smart_objects/src/always_false_schema_item.cc
+++ b/src/components/smart_objects/src/always_false_schema_item.cc
@@ -32,24 +32,22 @@
#include "smart_objects/always_false_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CAlwaysFalseSchemaItem::CAlwaysFalseSchemaItem() {}
-utils::SharedPtr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
- return new CAlwaysFalseSchemaItem();
+std::shared_ptr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
+ return std::shared_ptr<CAlwaysFalseSchemaItem>(new CAlwaysFalseSchemaItem());
}
-Errors::eType CAlwaysFalseSchemaItem::validate(const SmartObject& object) {
- rpc::ValidationReport report("RPC");
- return validate(object, &report);
-}
-
-Errors::eType CAlwaysFalseSchemaItem::validate(
- const SmartObject& object, rpc::ValidationReport* report__) {
+errors::eType CAlwaysFalseSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
report__->set_validation_info("Generic error");
- return Errors::ERROR;
+ return errors::ERROR;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/always_true_schema_item.cc b/src/components/smart_objects/src/always_true_schema_item.cc
index 1e7115316d..983733165c 100644
--- a/src/components/smart_objects/src/always_true_schema_item.cc
+++ b/src/components/smart_objects/src/always_true_schema_item.cc
@@ -30,23 +30,21 @@
#include "smart_objects/always_true_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CAlwaysTrueSchemaItem::CAlwaysTrueSchemaItem() {}
-utils::SharedPtr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
- return new CAlwaysTrueSchemaItem();
+std::shared_ptr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
+ return std::shared_ptr<CAlwaysTrueSchemaItem>(new CAlwaysTrueSchemaItem());
}
-Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object) {
- return Errors::OK;
+errors::eType CAlwaysTrueSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return errors::OK;
}
-Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object,
- rpc::ValidationReport* report__) {
- return Errors::OK;
-}
-
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index dca0a815e0..7d5f8bcf84 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -31,30 +31,28 @@
#include "smart_objects/array_schema_item.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-utils::SharedPtr<CArraySchemaItem> CArraySchemaItem::create(
+std::shared_ptr<CArraySchemaItem> CArraySchemaItem::create(
const ISchemaItemPtr ElementSchemaItem,
const TSchemaItemParameter<size_t>& MinSize,
const TSchemaItemParameter<size_t>& MaxSize) {
- return new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize);
+ return std::shared_ptr<CArraySchemaItem>(
+ new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize));
}
-Errors::eType CArraySchemaItem::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-Errors::eType CArraySchemaItem::validate(const SmartObject& Object,
- rpc::ValidationReport* report__) {
+errors::eType CArraySchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Array != Object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(SmartType_Array) +
", got: " +
SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
size_t sizeLimit;
const size_t array_len = Object.length();
@@ -65,7 +63,7 @@ Errors::eType CArraySchemaItem::validate(const SmartObject& Object,
<< ", minimum allowed: " << sizeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
if (mMaxSize.getValue(sizeLimit) && (array_len > sizeLimit)) {
std::stringstream stream;
@@ -73,26 +71,31 @@ Errors::eType CArraySchemaItem::validate(const SmartObject& Object,
<< ", maximum allowed: " << sizeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
for (size_t i = 0u; i < array_len; ++i) {
std::stringstream strVal;
strVal << i;
- const Errors::eType result = mElementSchemaItem->validate(
- Object.getElement(i), &report__->ReportSubobject(strVal.str()));
- if (Errors::OK != result) {
+ const errors::eType result =
+ mElementSchemaItem->validate(Object.getElement(i),
+ &report__->ReportSubobject(strVal.str()),
+ MessageVersion);
+ if (errors::OK != result) {
return result;
}
}
- return Errors::OK;
+ return errors::OK;
}
-void CArraySchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void CArraySchemaItem::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Array == Object.getType()) {
for (size_t i = 0U; i < Object.length(); ++i) {
- mElementSchemaItem->applySchema(Object[i], RemoveFakeParameters);
+ mElementSchemaItem->applySchema(
+ Object[i], RemoveFakeParameters, MessageVersion);
}
}
}
@@ -128,5 +131,5 @@ CArraySchemaItem::CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem,
, mMinSize(MinSize)
, mMaxSize(MaxSize) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/bool_schema_item.cc b/src/components/smart_objects/src/bool_schema_item.cc
index c1da95528a..a4875a1b24 100644
--- a/src/components/smart_objects/src/bool_schema_item.cc
+++ b/src/components/smart_objects/src/bool_schema_item.cc
@@ -32,12 +32,12 @@
#include "smart_objects/bool_schema_item.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-utils::SharedPtr<CBoolSchemaItem> CBoolSchemaItem::create(
+std::shared_ptr<CBoolSchemaItem> CBoolSchemaItem::create(
const TSchemaItemParameter<bool>& DefaultValue) {
- return new CBoolSchemaItem(DefaultValue);
+ return std::shared_ptr<CBoolSchemaItem>(new CBoolSchemaItem(DefaultValue));
}
CBoolSchemaItem::CBoolSchemaItem(const TSchemaItemParameter<bool>& DefaultValue)
@@ -51,5 +51,5 @@ bool CBoolSchemaItem::getDefaultValue() const {
return false;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/number_schema_item.cc b/src/components/smart_objects/src/number_schema_item.cc
index 78be9fe85d..c383f6ecca 100644
--- a/src/components/smart_objects/src/number_schema_item.cc
+++ b/src/components/smart_objects/src/number_schema_item.cc
@@ -31,8 +31,8 @@
*/
#include "smart_objects/number_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
SmartType TNumberSchemaItem<int32_t>::getSmartType() const {
@@ -41,7 +41,7 @@ SmartType TNumberSchemaItem<int32_t>::getSmartType() const {
template <>
SmartType TNumberSchemaItem<uint32_t>::getSmartType() const {
- return SmartType_Integer;
+ return SmartType_UInteger;
}
template <>
@@ -54,5 +54,5 @@ SmartType TNumberSchemaItem<double>::getSmartType() const {
return SmartType_Double;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
index 2bed3d9a26..742c2ec353 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -41,35 +41,83 @@ const char connection_key[] = "connection_key";
const char binary_data[] = "binary_data";
const char app_id[] = "appID";
}
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CObjectSchemaItem::SMember::SMember()
- : mSchemaItem(CAlwaysFalseSchemaItem::create()), mIsMandatory(true) {}
+ : mSchemaItem(CAlwaysFalseSchemaItem::create())
+ , mIsMandatory(true)
+ , mIsDeprecated(false)
+ , mIsRemoved(false) {}
-CObjectSchemaItem::SMember::SMember(const ISchemaItemPtr SchemaItem,
- const bool IsMandatory)
- : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {}
+CObjectSchemaItem::SMember::SMember(
+ const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory,
+ const std::string& Since,
+ const std::string& Until,
+ const bool IsDeprecated,
+ const bool IsRemoved,
+ const std::vector<CObjectSchemaItem::SMember>& history_vector)
+ : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {
+ if (Since.size() > 0) {
+ utils::SemanticVersion since_struct(Since);
+ if (since_struct.isValid()) {
+ mSince = since_struct;
+ }
+ }
+ if (Until.size() > 0) {
+ utils::SemanticVersion until_struct(Until);
+ if (until_struct.isValid()) {
+ mUntil = until_struct;
+ }
+ }
+ mIsDeprecated = IsDeprecated;
+ mIsRemoved = IsRemoved;
+ mHistoryVector = history_vector;
+}
-utils::SharedPtr<CObjectSchemaItem> CObjectSchemaItem::create(
- const Members& members) {
- return new CObjectSchemaItem(members);
+bool CObjectSchemaItem::SMember::CheckHistoryFieldVersion(
+ const utils::SemanticVersion& MessageVersion) const {
+ if (MessageVersion.isValid()) {
+ if (mSince != boost::none) {
+ if (MessageVersion < mSince.get()) {
+ return false; // Msg version predates `since` field
+ } else {
+ if (mUntil != boost::none && (MessageVersion >= mUntil.get())) {
+ return false; // Msg version newer than `until` field
+ } else {
+ return true; // Mobile msg version falls within specified version
+ // range
+ }
+ }
+ }
+
+ if (mUntil != boost::none && (MessageVersion >= mUntil.get())) {
+ return false; // Msg version newer than `until` field
+ } else {
+ return true; // Mobile msg version falls within specified version range
+ }
+ }
+
+ return true; // Not enough version information. Default true.
}
-Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
- rpc::ValidationReport report("RPC");
- return validate(object, &report);
+std::shared_ptr<CObjectSchemaItem> CObjectSchemaItem::create(
+ const Members& members) {
+ return std::shared_ptr<CObjectSchemaItem>(new CObjectSchemaItem(members));
}
-Errors::eType CObjectSchemaItem::validate(const SmartObject& object,
- rpc::ValidationReport* report__) {
+errors::eType CObjectSchemaItem::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Map != object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(SmartType_Map) +
", got: " +
SmartObject::typeToString(object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
std::set<std::string> object_keys = object.enumerate();
@@ -78,35 +126,42 @@ Errors::eType CObjectSchemaItem::validate(const SmartObject& object,
++it) {
const std::string& key = it->first;
const SMember& member = it->second;
+ const SMember& correct_member = GetCorrectMember(member, MessageVersion);
std::set<std::string>::const_iterator key_it = object_keys.find(key);
if (object_keys.end() == key_it) {
- if (member.mIsMandatory) {
+ if (correct_member.mIsMandatory == true &&
+ correct_member.mIsRemoved == false) {
std::string validation_info = "Missing mandatory parameter: " + key;
report__->set_validation_info(validation_info);
- return Errors::MISSING_MANDATORY_PARAMETER;
+ return errors::MISSING_MANDATORY_PARAMETER;
}
continue;
}
const SmartObject& field = object.getElement(key);
- const Errors::eType result =
- member.mSchemaItem->validate(field, &report__->ReportSubobject(key));
- if (Errors::OK != result) {
+
+ errors::eType result = errors::OK;
+ // Check if MessageVersion matches schema version
+ result = correct_member.mSchemaItem->validate(
+ field, &report__->ReportSubobject(key), MessageVersion);
+ if (errors::OK != result) {
return result;
}
object_keys.erase(key_it);
}
- return Errors::OK;
+ return errors::OK;
}
-void CObjectSchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void CObjectSchemaItem::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Map != Object.getType()) {
return;
}
if (RemoveFakeParameters) {
- RemoveFakeParams(Object);
+ RemoveFakeParams(Object, MessageVersion);
}
SmartObject default_value;
@@ -117,10 +172,12 @@ void CObjectSchemaItem::applySchema(SmartObject& Object,
if (!Object.keyExists(key)) {
if (member.mSchemaItem->setDefaultValue(default_value)) {
Object[key] = default_value;
- member.mSchemaItem->applySchema(Object[key], RemoveFakeParameters);
+ member.mSchemaItem->applySchema(
+ Object[key], RemoveFakeParameters, MessageVersion);
}
} else {
- member.mSchemaItem->applySchema(Object[key], RemoveFakeParameters);
+ member.mSchemaItem->applySchema(
+ Object[key], RemoveFakeParameters, MessageVersion);
}
}
}
@@ -173,22 +230,49 @@ size_t CObjectSchemaItem::GetMemberSize() {
CObjectSchemaItem::CObjectSchemaItem(const Members& members)
: mMembers(members) {}
-void CObjectSchemaItem::RemoveFakeParams(SmartObject& Object) {
+void CObjectSchemaItem::RemoveFakeParams(
+ SmartObject& Object, const utils::SemanticVersion& MessageVersion) {
for (SmartMap::const_iterator it = Object.map_begin();
it != Object.map_end();) {
const std::string& key = it->first;
- if (mMembers.end() == mMembers.find(key)
+ std::map<std::string, SMember>::const_iterator members_it =
+ mMembers.find(key);
+ if (mMembers.end() == members_it
// FIXME(EZamakhov): Remove illegal usage of filed in AM
&&
key.compare(connection_key) != 0 && key.compare(binary_data) != 0 &&
key.compare(app_id) != 0) {
++it;
Object.erase(key);
+
+ } else if (mMembers.end() != members_it &&
+ GetCorrectMember(members_it->second, MessageVersion)
+ .mIsRemoved) {
+ ++it;
+ Object.erase(key);
} else {
- it++;
+ ++it;
+ }
+ }
+}
+
+const CObjectSchemaItem::SMember& CObjectSchemaItem::GetCorrectMember(
+ const SMember& member, const utils::SemanticVersion& messageVersion) {
+ // Check if member is the correct version
+ if (member.CheckHistoryFieldVersion(messageVersion)) {
+ return member;
+ }
+ // Check for history tag items
+ if (!member.mHistoryVector.empty()) {
+ for (uint i = 0; i < member.mHistoryVector.size(); i++) {
+ if (member.mHistoryVector[i].CheckHistoryFieldVersion(messageVersion)) {
+ return member.mHistoryVector[i];
+ }
}
}
+ // Return member as default
+ return member;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
index 22735d40d5..5e9358092a 100644
--- a/src/components/smart_objects/src/schema_item.cc
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -32,16 +32,14 @@
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-Errors::eType ISchemaItem::validate(const SmartObject& Object) {
- return Errors::ERROR;
-}
-
-Errors::eType ISchemaItem::validate(const SmartObject& object,
- rpc::ValidationReport* report__) {
- return Errors::ERROR;
+errors::eType ISchemaItem::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return errors::ERROR;
}
bool ISchemaItem::setDefaultValue(SmartObject& Object) {
@@ -53,7 +51,8 @@ bool ISchemaItem::hasDefaultValue(SmartObject& Object) {
}
void ISchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {}
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {}
void ISchemaItem::unapplySchema(SmartObject& Object) {}
@@ -64,5 +63,5 @@ size_t ISchemaItem::GetMemberSize() {
return 0;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
index a0925eef05..1322757ab1 100644
--- a/src/components/smart_objects/src/smart_object.cc
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -42,8 +42,8 @@
#include <iterator>
#include <limits>
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Value that is used as invalid value for string type
@@ -491,7 +491,7 @@ std::string SmartObject::convert_string() const {
default:
break;
}
- return NsSmartDeviceLink::NsSmartObjects::invalid_cstr_value;
+ return ns_smart_device_link::ns_smart_objects::invalid_cstr_value;
}
custom_str::CustomString SmartObject::convert_custom_string() const {
@@ -870,16 +870,13 @@ bool SmartObject::erase(const std::string& Key) {
bool SmartObject::isValid() const {
rpc::ValidationReport report("RPC");
- return (Errors::OK == m_schema.validate(*this, &report));
+ return (errors::OK == m_schema.validate(*this, &report));
}
-Errors::eType SmartObject::validate() {
- rpc::ValidationReport report("RPC");
- return validate(&report);
-}
-
-Errors::eType SmartObject::validate(rpc::ValidationReport* report__) {
- return m_schema.validate(*this, report__);
+errors::eType SmartObject::validate(
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return m_schema.validate(*this, report__, MessageVersion);
}
void SmartObject::setSchema(const CSmartSchema& schema) {
@@ -890,5 +887,5 @@ CSmartSchema SmartObject::getSchema() {
return m_schema;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc
index 7509ea80f1..f7cd22c4bc 100644
--- a/src/components/smart_objects/src/smart_schema.cc
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -32,22 +32,19 @@
#include "smart_objects/smart_schema.h"
#include "smart_objects/always_true_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CSmartSchema::CSmartSchema() : mSchemaItem(CAlwaysTrueSchemaItem::create()) {}
CSmartSchema::CSmartSchema(const ISchemaItemPtr SchemaItem)
: mSchemaItem(SchemaItem) {}
-Errors::eType CSmartSchema::validate(const SmartObject& Object) const {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-Errors::eType CSmartSchema::validate(const SmartObject& object,
- rpc::ValidationReport* report__) const {
- return mSchemaItem->validate(object, report__);
+errors::eType CSmartSchema::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) const {
+ return mSchemaItem->validate(object, report__, MessageVersion);
}
void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
@@ -55,8 +52,9 @@ void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
}
void CSmartSchema::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
- mSchemaItem->applySchema(Object, RemoveFakeParameters);
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
+ mSchemaItem->applySchema(Object, RemoveFakeParameters, MessageVersion);
}
void CSmartSchema::unapplySchema(SmartObject& Object) {
@@ -68,5 +66,5 @@ void CSmartSchema::BuildObjectBySchema(const SmartObject& pattern_object,
mSchemaItem->BuildObjectBySchema(pattern_object, result_object);
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc
index 1e4c8372f0..0288ad85e8 100644
--- a/src/components/smart_objects/src/string_schema_item.cc
+++ b/src/components/smart_objects/src/string_schema_item.cc
@@ -33,32 +33,30 @@
#include "smart_objects/string_schema_item.h"
#include "utils/custom_string.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace custom_str = utils::custom_string;
-utils::SharedPtr<CStringSchemaItem> CStringSchemaItem::create(
+std::shared_ptr<CStringSchemaItem> CStringSchemaItem::create(
const TSchemaItemParameter<size_t>& MinLength,
const TSchemaItemParameter<size_t>& MaxLength,
const TSchemaItemParameter<std::string>& DefaultValue) {
- return new CStringSchemaItem(MinLength, MaxLength, DefaultValue);
+ return std::shared_ptr<CStringSchemaItem>(
+ new CStringSchemaItem(MinLength, MaxLength, DefaultValue));
}
-Errors::eType CStringSchemaItem::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-Errors::eType CStringSchemaItem::validate(const SmartObject& Object,
- rpc::ValidationReport* report__) {
+errors::eType CStringSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_String != Object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(SmartType_String) +
", got: " +
SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
const custom_str::CustomString value = Object.asCustomString();
@@ -70,7 +68,7 @@ Errors::eType CStringSchemaItem::validate(const SmartObject& Object,
<< ", minimum allowed: " << length;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
if (mMaxLength.getValue(length) && (value.size() > length)) {
std::stringstream stream;
@@ -78,9 +76,9 @@ Errors::eType CStringSchemaItem::validate(const SmartObject& Object,
<< ", maximum allowed: " << length;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
- return Errors::OK;
+ return errors::OK;
}
SmartType CStringSchemaItem::getSmartType() const {
@@ -99,5 +97,5 @@ CStringSchemaItem::CStringSchemaItem(
, mMinLength(MinLength)
, mMaxLength(MaxLength) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
index 9d88178598..1f514672fd 100644
--- a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
@@ -41,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
/**
* Test AlwaysFalseSchemaItem
@@ -54,38 +54,38 @@ TEST(test_AlwaysFalseSchemaItemTest, simple_test) {
obj = 5;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
resultType = item->validate(obj["First"], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj["Second"], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(std::string("Some string"), obj["First"].asString());
EXPECT_EQ(555, obj["Second"].asInt());
obj[0] = true;
obj[1] = false;
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
diff --git a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
index 40c827e17b..7f26a4968a 100644
--- a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
@@ -41,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
/**
* Test AlwaysTrueSchemaItem
@@ -54,38 +54,38 @@ TEST(test_AlwaysTrueSchemaItemTest, simple_test) {
obj = 5;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
resultType = item->validate(obj["First"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["Second"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Some string"), obj["First"].asString());
EXPECT_EQ(555, obj["Second"].asInt());
obj[0] = true;
obj[1] = false;
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
diff --git a/src/components/smart_objects/test/ArraySchemaItem_test.cc b/src/components/smart_objects/test/ArraySchemaItem_test.cc
index 9831f08442..28f435ee43 100644
--- a/src/components/smart_objects/test/ArraySchemaItem_test.cc
+++ b/src/components/smart_objects/test/ArraySchemaItem_test.cc
@@ -46,7 +46,7 @@ namespace smart_object_test {
* Test ArraySchemaItem no schema item, no min and max size
**/
TEST(test_no_default_value, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item =
@@ -68,28 +68,28 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(38, obj[0].asInt());
EXPECT_TRUE(obj[1].asBool());
@@ -103,19 +103,19 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
ASSERT_EQ(std::string("New valid string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Obj - bool
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Object - number
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
@@ -125,7 +125,7 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
* only if all array elements are valid schema item objects
**/
TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(); // No min and max size
@@ -140,24 +140,24 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -172,21 +172,21 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[3][3] = "Another very very loooooong String";
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test ArraySchemaItem with min size
**/
TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -197,17 +197,17 @@ TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[2] = "New String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -218,7 +218,7 @@ TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
* Test ArraySchemaItem with min size
**/
TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -231,22 +231,22 @@ TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[1] = "true";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[2] = "New String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[3] = "Another String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -258,7 +258,7 @@ TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
* Test ArraySchemaItem with min and max size
**/
TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -271,27 +271,27 @@ TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[2] = "New String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[3] = "Another String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[4] = "Out of array";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -301,7 +301,7 @@ TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
}
TEST(test_map_validate, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -314,29 +314,29 @@ TEST(test_map_validate, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj["array"][1] = "true";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][2] = "New String";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][3] = "Another String";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][4] = "Out of array";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj["array"][0].asString());
EXPECT_EQ(std::string("true"), obj["array"][1].asString());
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc
index 8d67aa59b2..ed0043925b 100644
--- a/src/components/smart_objects/test/BoolSchemaItem_test.cc
+++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc
@@ -34,8 +34,6 @@
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
#include "smart_objects/smart_object.h"
#include "smart_objects/bool_schema_item.h"
@@ -43,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+using ns_smart_device_link::ns_smart_objects::ISchemaItemPtr;
/**
* Test BoolSchemaItem no default value
@@ -53,26 +51,26 @@ using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
* and leave SmartObject in previous state.
**/
TEST(test_no_default_value, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(); // No
- // default
- // value
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(); // No
+ // default
+ // value
obj = 5;
ASSERT_EQ(5, obj.asInt());
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -81,12 +79,12 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
@@ -100,11 +98,11 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
*value.
**/
TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
- NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(
+ ns_smart_device_link::ns_smart_objects::TSchemaItemParameter<bool>(
false)); // Default value = false
obj = 5;
@@ -112,14 +110,14 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
@@ -128,22 +126,22 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
EXPECT_FALSE(obj.asBool());
}
TEST(test_map_validate, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
- NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(
+ ns_smart_device_link::ns_smart_objects::TSchemaItemParameter<bool>(
false)); // Default value = false
obj["aa"] = true;
@@ -151,10 +149,10 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["aa"], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj["aa"]);
@@ -166,18 +164,18 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
EXPECT_FALSE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
obj["ind"] = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
TEST(test_array_validate, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create();
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create();
obj[0] = true;
obj[1] = false;
@@ -187,13 +185,13 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -205,13 +203,13 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
EXPECT_FALSE(obj[1].asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = false;
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/CObjectSchemaItem_test.cc b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
index 523b25a8d8..646e60bf61 100644
--- a/src/components/smart_objects/test/CObjectSchemaItem_test.cc
+++ b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
@@ -44,12 +44,13 @@
#include "smart_objects/object_schema_item.h"
#include "formatters/generic_json_formatter.h"
#include "formatters/CSmartFactory.h"
+#include "utils/semantic_version.h"
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace smartobj = ns_smart_device_link::ns_smart_objects;
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
namespace test {
namespace components {
@@ -136,6 +137,36 @@ class ObjectSchemaItemTest : public ::testing::Test {
schemaMembersMap[Keys::SUCCESS] =
CObjectSchemaItem::SMember(CBoolSchemaItem::create(), false);
+ // Create fake param that has breaking history changes
+ std::vector<CObjectSchemaItem::SMember> fake_param_history_vector;
+
+ std::shared_ptr<ISchemaItem> fake_param_SchemaItem =
+ CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(99),
+ TSchemaItemParameter<std::string>()),
+ TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(100));
+
+ std::shared_ptr<ISchemaItem> fake_param_history_v1_SchemaItem =
+ CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(99),
+ TSchemaItemParameter<std::string>()),
+ TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(100));
+
+ fake_param_history_vector.push_back(CObjectSchemaItem::SMember(
+ fake_param_history_v1_SchemaItem, true, "", "4.5.0", false, false));
+ schemaMembersMap["fakeParam"] =
+ CObjectSchemaItem::SMember(fake_param_SchemaItem,
+ false,
+ "4.5.0",
+ "",
+ false,
+ false,
+ fake_param_history_vector);
+
CObjectSchemaItem::Members rootMembersMap;
rootMembersMap[S_PARAMS] = CObjectSchemaItem::SMember(
CObjectSchemaItem::create(paramsMembersMap), true);
@@ -156,10 +187,40 @@ TEST_F(ObjectSchemaItemTest, validation_correct) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_correct_with_new_version) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF0;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 0;
+ obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ utils::SemanticVersion messageVersion(4, 5, 0);
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report, messageVersion));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
+TEST_F(ObjectSchemaItemTest, validation_invalid_data_with_old_version) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF0;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 0;
+ obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ utils::SemanticVersion messageVersion(3, 0, 0);
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report, messageVersion));
+}
+
TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
SmartObject obj;
obj[S_PARAMS][S_FUNCTION_ID] = 1;
@@ -170,7 +231,7 @@ TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -180,7 +241,7 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
obj[S_MSG_PARAMS] = "some message parameters";
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = "some function";
@@ -190,33 +251,33 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = 0xABC;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = -0xFF1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
@@ -230,24 +291,24 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = 0x10;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = true;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = SmartObject();
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::INFO] = "info";
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -261,27 +322,27 @@ TEST_F(ObjectSchemaItemTest, validation_missing_mandatory) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 2;
// S_CORRELATION_ID and S_PROTOCOL_VERSION is still missed
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = 0XFF2;
// S_PROTOCOL_VERSION is still missed
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -301,19 +362,19 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param) {
obj[fake1] = SmartObject(static_cast<int64_t>(0));
// any fake parameter is OK
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][fake2] = SmartObject("123");
// any fake parameters are OK
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][fake3] = true;
// any fake parameters are OK
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -341,7 +402,7 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_TRUE(obj[S_PARAMS].keyExists(fake2));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(fake3));
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// Check apply schema, remove fake parameter
@@ -356,7 +417,7 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::INFO));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::SUCCESS));
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[fake1] = SmartObject(static_cast<int64_t>(0));
@@ -372,7 +433,7 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_FALSE(obj[S_MSG_PARAMS].keyExists(fake3));
// Invalide state after enum convertion
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
@@ -388,18 +449,18 @@ TEST_F(ObjectSchemaItemTest, validation_empty_params) {
obj[S_MSG_PARAMS]["FAKE_PARAM3"] = SmartObject("2");
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(obj, false);
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->unapplySchema(obj);
// Invalide state after enum convertion
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
@@ -436,12 +497,12 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
// S_FUNCTION_ID and RESULT_CODE are not converted to int
rpc::ValidationReport report("RPC");
- EXPECT_NE(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(errors::OK, schema_item->validate(object, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(object, false);
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(object, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// check conversion result
@@ -451,7 +512,7 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
schema_item->unapplySchema(object);
// S_FUNCTION_ID and RESULT_CODE are string
report = rpc::ValidationReport("RPC");
- EXPECT_NE(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(errors::OK, schema_item->validate(object, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// check conversion result
@@ -466,8 +527,8 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace FunctionID = test::components::smart_object_test::FunctionID;
typedef EnumConversionHelper<FunctionID::eType> FunctionConvertor;
@@ -541,5 +602,5 @@ const ResultType::eType ResultTypeConvertor::enum_values_[] = {
ResultType::USER_DISALLOWED,
ResultType::GENERIC_ERROR,
ResultType::DISALLOWED};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/EnumSchemaItem_test.cc b/src/components/smart_objects/test/EnumSchemaItem_test.cc
index 9914167e5a..edfa563336 100644
--- a/src/components/smart_objects/test/EnumSchemaItem_test.cc
+++ b/src/components/smart_objects/test/EnumSchemaItem_test.cc
@@ -42,7 +42,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace TestType {
enum eType {
INVALID_ENUM = -1,
@@ -94,7 +94,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
obj = TestType::BLUETOOTH_OFF;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
@@ -103,7 +103,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
@@ -112,7 +112,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -121,7 +121,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - string
obj = "Some string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -145,7 +145,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
obj = TestType::BLUETOOTH_OFF;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_EQ(TestType::BLUETOOTH_OFF, obj.asInt());
@@ -154,7 +154,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -163,7 +163,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -172,7 +172,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - string
obj = "Some string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -181,12 +181,12 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - int in range of enum
obj = 6;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object - int out of enum range
obj = 15;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
@@ -203,31 +203,31 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
obj = TestType::BLUETOOTH_OFF;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
item->unapplySchema(obj);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("FACTORY_DEFAULTS"), obj.asString());
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
obj = "TOO_MANY_REQUESTS";
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(TestType::TOO_MANY_REQUESTS, obj.asInt());
obj = "ENOUGH_REQUESTS";
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("ENOUGH_REQUESTS"), obj.asString());
}
@@ -235,8 +235,8 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const EnumConversionHelper<test::components::SmartObjects::SchemaItem::
diff --git a/src/components/smart_objects/test/NumberSchemaItem_test.cc b/src/components/smart_objects/test/NumberSchemaItem_test.cc
index 0315bcedb3..eb227e4e9b 100644
--- a/src/components/smart_objects/test/NumberSchemaItem_test.cc
+++ b/src/components/smart_objects/test/NumberSchemaItem_test.cc
@@ -40,7 +40,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+using ns_smart_device_link::ns_smart_objects::ISchemaItemPtr;
/**
* Test NumberSchemaItem as INT with no default value
@@ -50,7 +50,7 @@ using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
* and leave SmartObject in previous state.
**/
TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -63,20 +63,20 @@ TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
// Obj string
@@ -84,18 +84,18 @@ TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
* Test NumberSchemaItem as INT with setted min value
**/
TEST(test_int_min_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -108,28 +108,28 @@ TEST(test_int_min_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 9;
ASSERT_EQ(9, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 10;
ASSERT_EQ(10, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as INT with setted max value
**/
TEST(test_int_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -143,28 +143,28 @@ TEST(test_int_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -750;
ASSERT_EQ(-750, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as INT with setted min and max value
**/
TEST(test_int_min_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -178,35 +178,35 @@ TEST(test_int_min_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -949;
ASSERT_EQ(-949, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = -950;
ASSERT_EQ(-950, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
* Test NumberSchemaItem as INT with correct default value
**/
TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -221,44 +221,44 @@ TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = -12001;
ASSERT_EQ(-12001, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
}
@@ -266,7 +266,7 @@ TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
* Test NumberSchemaItem as INT with default value out of range
**/
TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -281,49 +281,49 @@ TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 89;
ASSERT_EQ(89, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
}
TEST(test_int_map_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -339,15 +339,15 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["max"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["out_of_min"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["out_of_max"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj["aa"]);
@@ -359,17 +359,17 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_int_array_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -385,21 +385,21 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -411,14 +411,14 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
@@ -430,7 +430,7 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
* and leave SmartObject in previous state.
**/
TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -443,20 +443,20 @@ TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
// Obj string
@@ -464,20 +464,20 @@ TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with setted min value
**/
TEST(test_double_min_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -490,28 +490,28 @@ TEST(test_double_min_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 9.999999;
ASSERT_EQ(9.999999, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
/*
//Object int
obj = 10;
ASSERT_EQ(10, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);*/
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);*/
}
/**
* Test NumberSchemaItem as DOUBLE with setted max value
**/
TEST(test_double_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -525,28 +525,28 @@ TEST(test_double_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 749.0001;
ASSERT_EQ(749.0001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -750.0;
ASSERT_EQ(-750.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with setted min and max value
**/
TEST(test_double_min_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -560,35 +560,35 @@ TEST(test_double_min_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 749.001;
ASSERT_EQ(749.001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -949.0;
ASSERT_EQ(-949.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = -949.00001;
ASSERT_EQ(-949.00001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with correct default value
**/
TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -603,44 +603,44 @@ TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = -12000.01;
ASSERT_EQ(-12000.01, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
}
@@ -648,7 +648,7 @@ TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
* Test NumberSchemaItem as DOUBLE with default value out of range
**/
TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -663,49 +663,49 @@ TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 89.999;
ASSERT_EQ(89.999, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
}
TEST(test_double_map_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -721,15 +721,15 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["max"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["out_of_min"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["out_of_max"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["aa"]);
EXPECT_TRUE(resDefault);
@@ -740,17 +740,17 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_double_array_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -766,21 +766,21 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -792,19 +792,19 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
TEST(test_int_double_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
ISchemaItemPtr item = TNumberSchemaItem<int>::create(
TSchemaItemParameter<int>(10),
@@ -817,11 +817,11 @@ TEST(test_int_double_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_double_int_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
ISchemaItemPtr item = TNumberSchemaItem<double>::create(
TSchemaItemParameter<double>(10.0),
@@ -834,7 +834,7 @@ TEST(test_double_int_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
index b11560914e..7d95a40b26 100644
--- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
+++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
@@ -36,8 +36,6 @@
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
#include "smart_objects/schema_item.h"
@@ -58,8 +56,8 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace TestType {
enum eType {
@@ -98,7 +96,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// SmartObjects --> JSON
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv2::
toString(srcObj, jsonString);
clock_gettime(CLOCK_REALTIME, &convertionEndTime);
@@ -116,7 +114,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// JSON --> SmartObjects
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv2::
fromString<FunctionIdTest::eType, MessageTypeTest::eType>(
jsonString,
dstObj,
@@ -138,7 +136,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// SmartObjects --> JSON
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv1::
toString(srcObj, jsonString);
clock_gettime(CLOCK_REALTIME, &convertionEndTime);
@@ -155,7 +153,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// JSON --> SmartObjects
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv1::
fromString<FunctionIdTest::eType, MessageTypeTest::eType>(jsonString,
dstObj);
@@ -255,17 +253,18 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
messageType_allowedEnumSubsetValues);
CObjectSchemaItem::Members paramsMembersMap;
- paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] =
- CObjectSchemaItem::SMember(functionId_SchemaItem, true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] =
+ CObjectSchemaItem::SMember(functionId_SchemaItem, true);
+ paramsMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] =
CObjectSchemaItem::SMember(messageType_SchemaItem, true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ [ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
true);
@@ -331,35 +330,37 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
CObjectSchemaItem::SMember(tryAgainTime_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
- paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] =
- CObjectSchemaItem::SMember(
- TEnumSchemaItem<FunctionIdTest::eType>::create(
- functionId_allowedEnumSubsetValues),
- true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] =
+ CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(
+ functionId_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] =
CObjectSchemaItem::SMember(
TEnumSchemaItem<MessageTypeTest::eType>::create(
messageType_allowedEnumSubsetValues),
true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ [ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] =
+ [ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] =
CObjectSchemaItem::SMember(
TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
TSchemaItemParameter<int>(2)),
true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] =
- CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap),
- true);
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ rootMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] =
+ CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schemaMembersMap), true);
+ rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
true);
return CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
@@ -640,8 +641,8 @@ TEST_F(SmartObjectConvertionTimeTest, test_object_without_enum_convertion) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const EnumConversionHelper<test::components::SmartObjects::
diff --git a/src/components/smart_objects/test/SmartObjectDraft_test.cc b/src/components/smart_objects/test/SmartObjectDraft_test.cc
index de8103771c..cfb6785db7 100644
--- a/src/components/smart_objects/test/SmartObjectDraft_test.cc
+++ b/src/components/smart_objects/test/SmartObjectDraft_test.cc
@@ -44,8 +44,8 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::SmartObject;
-using NsSmartDeviceLink::NsSmartObjects::SmartType;
+using ns_smart_device_link::ns_smart_objects::SmartObject;
+using ns_smart_device_link::ns_smart_objects::SmartType;
TEST(SmartObjectsDraftTest, primitive_types) {
SmartObject obj;
@@ -126,7 +126,7 @@ TEST(SmartObjectsDraftTest, test_public_interface) {
ASSERT_EQ(std::string("Hello, world"), obj.asString());
// ---- Binary ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
@@ -203,7 +203,7 @@ TEST(SmartObjectsDraftTest, test_helper_methods) {
ASSERT_EQ(std::string("Hello, world"), obj.asString());
// ---- Binary ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
diff --git a/src/components/smart_objects/test/SmartObjectInvalid_test.cc b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
index 68afbb6237..ff5949df6a 100644
--- a/src/components/smart_objects/test/SmartObjectInvalid_test.cc
+++ b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
@@ -40,7 +40,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
TEST(test_SmartObjectInvalidTest, simple_type_can_be_set_in_constructor) {
SmartObject objMap(SmartType_Map);
@@ -116,7 +116,7 @@ TEST(test_SmartObjectInvalidTest, invalid_object_remains_invalid) {
ASSERT_EQ(invalid_string_value, obj.asString());
// ---- BINARY ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
diff --git a/src/components/smart_objects/test/SmartObjectStress_test.cc b/src/components/smart_objects/test/SmartObjectStress_test.cc
index 698bd0415a..4c0234589f 100644
--- a/src/components/smart_objects/test/SmartObjectStress_test.cc
+++ b/src/components/smart_objects/test/SmartObjectStress_test.cc
@@ -40,7 +40,7 @@
namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
class StressTestHelper : public ::testing::Test {
private:
@@ -184,8 +184,8 @@ class StressTestHelper : public ::testing::Test {
std::string strVal("c:");
strVal += strDataVal;
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryVal(dataSize,
- randomChar);
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryVal(
+ dataSize, randomChar);
obj = binaryVal; // string with binary data filled with random chars
mVerifyMap[key_path] = strVal;
@@ -259,10 +259,10 @@ TEST_F(StressTestHelper, StressTest) {
if (!value.compare(0, 2, "c:")) {
std::string etalonData = value.substr(2);
- ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ ASSERT_EQ(ns_smart_device_link::ns_smart_objects::SmartType_Binary,
obj.getType());
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData =
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData =
obj.asBinary();
ASSERT_EQ(etalonData.size(), binaryData.size());
@@ -270,10 +270,10 @@ TEST_F(StressTestHelper, StressTest) {
{
std::string etalonData = value.substr(2);
- ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ ASSERT_EQ(ns_smart_device_link::ns_smart_objects::SmartType_Binary,
obj.getType());
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData =
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData =
obj.asBinary();
ASSERT_EQ(etalonData.size(), binaryData.size());
diff --git a/src/components/smart_objects/test/SmartObjectUnit_test.cc b/src/components/smart_objects/test/SmartObjectUnit_test.cc
index 0a67b7e922..2c03d8a329 100644
--- a/src/components/smart_objects/test/SmartObjectUnit_test.cc
+++ b/src/components/smart_objects/test/SmartObjectUnit_test.cc
@@ -37,7 +37,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
class TestHelper : public ::testing::Test {
protected:
diff --git a/src/components/smart_objects/test/StringSchemaItem_test.cc b/src/components/smart_objects/test/StringSchemaItem_test.cc
index 4e4688d354..7bf0d0ed89 100644
--- a/src/components/smart_objects/test/StringSchemaItem_test.cc
+++ b/src/components/smart_objects/test/StringSchemaItem_test.cc
@@ -49,7 +49,7 @@ namespace smart_object_test {
* and leave SmartObject in previous state.
**/
TEST(test_no_default_value, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item =
@@ -61,7 +61,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_EQ(std::string("New valid string"), obj.asString());
@@ -70,7 +70,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -79,12 +79,12 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(3.1415926, obj.asDouble());
}
@@ -98,7 +98,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
*default value.
**/
TEST(test_item_with_default_value, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -113,7 +113,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -122,7 +122,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -131,12 +131,12 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Default string"), obj.asString());
}
@@ -144,7 +144,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
* Test StringSchemaItem with max length
**/
TEST(test_item_with_max_length, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -158,7 +158,7 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -168,17 +168,17 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
ASSERT_EQ(std::string("New very very loooooong string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
TEST(test_map_validate, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -193,19 +193,19 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["str"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["long"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["bool"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj["num"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["str"]);
EXPECT_TRUE(resDefault);
@@ -220,27 +220,27 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
EXPECT_EQ(std::string("Default string"), obj["num"].asString());
resultType = item->validate(obj["str"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["long"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["bool"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["num"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
TEST(test_array_validate, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -256,22 +256,22 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[4], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj[0]);
EXPECT_TRUE(resDefault);
@@ -290,24 +290,24 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
EXPECT_EQ(std::string("Default string"), obj[5].asString());
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[4], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[5], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/smart_object_performance_test.cc b/src/components/smart_objects/test/smart_object_performance_test.cc
index 503652dcda..11273e332f 100644
--- a/src/components/smart_objects/test/smart_object_performance_test.cc
+++ b/src/components/smart_objects/test/smart_object_performance_test.cc
@@ -37,7 +37,7 @@
#include "smart_objects/smart_object.h"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/CMakeLists.txt b/src/components/telemetry_monitor/CMakeLists.txt
index bb419a92e9..bb33857ecd 100644
--- a/src/components/telemetry_monitor/CMakeLists.txt
+++ b/src/components/telemetry_monitor/CMakeLists.txt
@@ -39,11 +39,9 @@ include_directories (
${COMPONENTS_DIR}/connection_handler/include/
${COMPONENTS_DIR}/transport_manager/include/
${COMPONENTS_DIR}/application_manager/include/
- ${COMPONENTS_DIR}/remote_control/include/
${POLICY_PATH}/include/
${POLICY_GLOBAL_INCLUDE_PATH}/
${COMPONENTS_DIR}/rpc_base/include/
- ${COMPONENTS_DIR}/functional_module/include/
${COMPONENTS_DIR}/hmi_message_handler/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/media_manager/include/
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
index 3c3de20e0e..eabaf0a5e4 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
@@ -44,7 +44,7 @@ class ApplicationManagerObserver;
class ApplicationManagerMetricWrapper : public MetricWrapper {
public:
- utils::SharedPtr<application_manager::AMTelemetryObserver::MessageMetric>
+ std::shared_ptr<application_manager::AMTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
index ecb9c8002a..31a3ceea12 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
@@ -45,7 +45,7 @@ class ApplicationManagerObserver
: public application_manager::AMTelemetryObserver {
public:
explicit ApplicationManagerObserver(TelemetryMonitor* telemetry_monitor);
- virtual void OnMessage(utils::SharedPtr<MessageMetric> metric);
+ virtual void OnMessage(std::shared_ptr<MessageMetric> metric);
private:
TelemetryMonitor* telemetry_monitor_;
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
index daf602e9ca..dfe7f4b964 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_METRIC_WRAPPER_H_
#include <string>
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/metric_wrapper.h"
#include "protocol_handler_observer.h"
@@ -42,7 +42,7 @@ namespace telemetry_monitor {
class ProtocolHandlerMecticWrapper : public MetricWrapper {
public:
- utils::SharedPtr<protocol_handler::PHTelemetryObserver::MessageMetric>
+ std::shared_ptr<protocol_handler::PHTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
index 69e5658382..27a4fda868 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
@@ -45,13 +45,13 @@ class ProtocolHandlerObserver : public protocol_handler::PHTelemetryObserver {
explicit ProtocolHandlerObserver(TelemetryMonitor* telemetry_monitor);
virtual void StartMessageProcess(uint32_t message_id,
- const TimevalStruct& start_time);
+ const date_time::TimeDuration& start_time);
- virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m);
+ virtual void EndMessageProcess(std::shared_ptr<MessageMetric> m);
private:
TelemetryMonitor* telemetry_monitor_;
- std::map<uint32_t, TimevalStruct> time_starts;
+ std::map<uint32_t, date_time::TimeDuration> time_starts;
};
} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_OBSERVER_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
index 618901ffa8..ff7b9da9d6 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
@@ -46,11 +46,6 @@
#include "protocol_handler_observer.h"
#include "protocol_handler/protocol_handler_impl.h"
-namespace utils {
-template <typename T>
-class SharedPtr;
-}
-
namespace telemetry_monitor {
using ::utils::MessageQueue;
@@ -62,7 +57,7 @@ class Streamer : public threads::ThreadDelegate {
void threadMain() OVERRIDE;
void exitThreadMain() OVERRIDE;
- virtual void PushMessage(utils::SharedPtr<MetricWrapper> metric);
+ virtual void PushMessage(std::shared_ptr<MetricWrapper> metric);
volatile bool is_client_connected_;
private:
@@ -75,7 +70,7 @@ class Streamer : public threads::ThreadDelegate {
int32_t server_socket_fd_;
int32_t client_socket_fd_;
volatile bool stop_flag_;
- MessageQueue<utils::SharedPtr<MetricWrapper> > messages_;
+ MessageQueue<std::shared_ptr<MetricWrapper> > messages_;
DISALLOW_COPY_AND_ASSIGN(Streamer);
};
@@ -91,9 +86,8 @@ class TelemetryMonitor {
transport_manager);
virtual void Stop();
virtual void Start();
- virtual void SendMetric(utils::SharedPtr<MetricWrapper> metric);
- DEPRECATED void set_streamer(Streamer* streamer);
- void set_streamer(utils::SharedPtr<Streamer> streamer);
+ virtual void SendMetric(std::shared_ptr<MetricWrapper> metric);
+ void set_streamer(std::shared_ptr<Streamer> streamer);
const std::string& ip() const;
int16_t port() const;
@@ -101,7 +95,7 @@ class TelemetryMonitor {
std::string server_address_;
int16_t port_;
threads::Thread* thread_;
- utils::SharedPtr<Streamer> streamer_;
+ std::shared_ptr<Streamer> streamer_;
ApplicationManagerObserver app_observer;
TransportManagerObserver tm_observer;
ProtocolHandlerObserver ph_observer;
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
index b601e89b18..d1239c9d1b 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
@@ -41,7 +41,7 @@ namespace telemetry_monitor {
class TransportManagerMecticWrapper : public MetricWrapper {
public:
- utils::SharedPtr<transport_manager::TMTelemetryObserver::MessageMetric>
+ std::shared_ptr<transport_manager::TMTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
index bff5834586..d0bf4ba5bb 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
@@ -49,7 +49,8 @@ class TransportManagerObserver : public transport_manager::TMTelemetryObserver {
private:
TelemetryMonitor* telemetry_monitor_;
- std::map<const protocol_handler::RawMessage*, TimevalStruct> time_starts;
+ std::map<const protocol_handler::RawMessage*, date_time::TimeDuration>
+ time_starts;
};
} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_OBSERVER_H_
diff --git a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
index b693d9df22..006aac196f 100644
--- a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
@@ -41,10 +41,9 @@ Json::Value ApplicationManagerMetricWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "ApplicationManager";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& params =
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
+ const ns_smart_device_link::ns_smart_objects::SmartObject& params =
message_metric->message->getElement(application_manager::strings::params);
result[strings::correlation_id] = utils::ConvertInt64ToLongLongInt(
params[application_manager::strings::correlation_id].asInt());
diff --git a/src/components/telemetry_monitor/src/application_manager_observer.cc b/src/components/telemetry_monitor/src/application_manager_observer.cc
index cb390eddeb..1e621c8a6e 100644
--- a/src/components/telemetry_monitor/src/application_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/application_manager_observer.cc
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "telemetry_monitor/application_manager_observer.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
@@ -41,8 +41,8 @@ ApplicationManagerObserver::ApplicationManagerObserver(
: telemetry_monitor_(telemetry_monitor) {}
void ApplicationManagerObserver::OnMessage(
- utils::SharedPtr<MessageMetric> metric) {
- ApplicationManagerMetricWrapper* m = new ApplicationManagerMetricWrapper();
+ std::shared_ptr<MessageMetric> metric) {
+ auto m = std::make_shared<ApplicationManagerMetricWrapper>();
m->message_metric = metric;
m->grabResources();
telemetry_monitor_->SendMetric(m);
diff --git a/src/components/telemetry_monitor/src/metric_wrapper.cc b/src/components/telemetry_monitor/src/metric_wrapper.cc
index 937a705ef7..10b694c5e6 100644
--- a/src/components/telemetry_monitor/src/metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/metric_wrapper.cc
@@ -45,7 +45,6 @@ bool MetricWrapper::grabResources() {
} else {
return false;
}
- flush(std::cout);
}
std::string MetricWrapper::GetStyledString() {
diff --git a/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc b/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
index 335f0dbb29..1591e00af8 100644
--- a/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
@@ -40,9 +40,8 @@ Json::Value ProtocolHandlerMecticWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "ProtocolHandler";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
result[strings::message_id] = message_metric->message_id;
result[strings::connection_key] = message_metric->connection_key;
return result;
diff --git a/src/components/telemetry_monitor/src/protocol_handler_observer.cc b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
index 2244cb2259..19b04da392 100644
--- a/src/components/telemetry_monitor/src/protocol_handler_observer.cc
+++ b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
@@ -44,7 +44,7 @@ ProtocolHandlerObserver::ProtocolHandlerObserver(
: telemetry_monitor_(telemetry_monitor) {}
void ProtocolHandlerObserver::StartMessageProcess(
- uint32_t message_id, const TimevalStruct& start_time) {
+ uint32_t message_id, const date_time::TimeDuration& start_time) {
if (message_id == 0) {
return;
}
@@ -58,17 +58,17 @@ void ProtocolHandlerObserver::StartMessageProcess(
}
void ProtocolHandlerObserver::EndMessageProcess(
- utils::SharedPtr<MessageMetric> m) {
+ std::shared_ptr<MessageMetric> m) {
uint32_t message_id = m->message_id;
- std::map<uint32_t, TimevalStruct>::const_iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::const_iterator it =
time_starts.find(message_id);
if (it == time_starts.end()) {
LOG4CXX_WARN(logger_, "Cant find start time for message" << message_id);
return;
}
m->begin = time_starts[message_id];
- m->end = date_time::DateTime::getCurrentTime();
- ProtocolHandlerMecticWrapper* metric = new ProtocolHandlerMecticWrapper();
+ m->end = date_time::getCurrentTime();
+ auto metric = std::make_shared<ProtocolHandlerMecticWrapper>();
metric->message_metric = m;
metric->grabResources();
telemetry_monitor_->SendMetric(metric);
diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc
index 53a5a2dc70..d62724a479 100644
--- a/src/components/telemetry_monitor/src/telemetry_monitor.cc
+++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#include "telemetry_monitor/telemetry_monitor.h"
@@ -42,8 +42,7 @@
#include "transport_manager/transport_manager_default.h"
#include "utils/resource_usage.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_observable.h"
namespace telemetry_monitor {
@@ -60,13 +59,11 @@ TelemetryMonitor::TelemetryMonitor(const std::string& server_address,
, ph_observer(this) {}
void TelemetryMonitor::Start() {
- streamer_ = streamer_ ? streamer_ : utils::MakeShared<Streamer>(this);
+ streamer_ = streamer_ ? streamer_ : std::make_shared<Streamer>(this);
thread_ = threads::CreateThread("TelemetryMonitor", streamer_.get());
}
-void TelemetryMonitor::set_streamer(Streamer* streamer) {}
-
-void TelemetryMonitor::set_streamer(utils::SharedPtr<Streamer> streamer) {
+void TelemetryMonitor::set_streamer(std::shared_ptr<Streamer> streamer) {
LOG4CXX_AUTO_TRACE(logger_);
if (thread_ && !thread_->is_running()) {
streamer_ = streamer;
@@ -115,7 +112,7 @@ void TelemetryMonitor::Stop() {
thread_ = NULL;
}
-void TelemetryMonitor::SendMetric(utils::SharedPtr<MetricWrapper> metric) {
+void TelemetryMonitor::SendMetric(std::shared_ptr<MetricWrapper> metric) {
if (streamer_ && streamer_->is_client_connected_) {
streamer_->PushMessage(metric);
}
@@ -149,7 +146,7 @@ void Streamer::threadMain() {
is_client_connected_ = true;
while (is_client_connected_) {
while (!messages_.empty()) {
- utils::SharedPtr<MetricWrapper> metric;
+ std::shared_ptr<MetricWrapper> metric;
if (!messages_.pop(metric)) {
continue;
}
@@ -251,8 +248,9 @@ bool Streamer::IsReady() const {
fd_set fds;
FD_ZERO(&fds);
FD_SET(client_socket_fd_, &fds);
- TimevalStruct tv = {0, 0};
- tv.tv_sec = 5; // set a 5 second timeout
+ // need to construct a timeval for the duration, can't use duration
+ struct timeval tv;
+ tv.tv_sec = 5;
tv.tv_usec = 0;
const int retval = select(client_socket_fd_ + 1, 0, &fds, 0, &tv);
@@ -282,7 +280,7 @@ bool Streamer::Send(const std::string& msg) {
return true;
}
-void Streamer::PushMessage(utils::SharedPtr<MetricWrapper> metric) {
+void Streamer::PushMessage(std::shared_ptr<MetricWrapper> metric) {
messages_.push(metric);
}
} // namespace telemetry_monitor
diff --git a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
index a891aa1118..789da92eaf 100644
--- a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
@@ -41,9 +41,8 @@ Json::Value TransportManagerMecticWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "TransportManager";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
result[strings::data_size] = static_cast<uint32_t>(message_metric->data_size);
return result;
}
diff --git a/src/components/telemetry_monitor/src/transport_manager_observer.cc b/src/components/telemetry_monitor/src/transport_manager_observer.cc
index b3e57ac22a..25817d6c73 100644
--- a/src/components/telemetry_monitor/src/transport_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_observer.cc
@@ -44,20 +44,20 @@ TransportManagerObserver::TransportManagerObserver(
void TransportManagerObserver::StartRawMsg(
const protocol_handler::RawMessage* ptr) {
- time_starts[ptr] = date_time::DateTime::getCurrentTime();
+ time_starts[ptr] = date_time::getCurrentTime();
}
void TransportManagerObserver::StopRawMsg(
const protocol_handler::RawMessage* ptr) {
- std::map<const protocol_handler::RawMessage*, TimevalStruct>::const_iterator
- it;
+ std::map<const protocol_handler::RawMessage*,
+ date_time::TimeDuration>::const_iterator it;
it = time_starts.find(ptr);
if (it != time_starts.end()) {
- TransportManagerMecticWrapper* m = new TransportManagerMecticWrapper();
- m->message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ auto m = std::make_shared<TransportManagerMecticWrapper>();
+ m->message_metric = std::make_shared<
+ transport_manager::TMTelemetryObserver::MessageMetric>();
m->message_metric->begin = it->second;
- m->message_metric->end = date_time::DateTime::getCurrentTime();
+ m->message_metric->end = date_time::getCurrentTime();
m->message_metric->data_size = ptr->data_size();
m->grabResources();
telemetry_monitor_->SendMetric(m);
diff --git a/src/components/telemetry_monitor/test/application_manager_metric_test.cc b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
index 9029c41bc4..2e6eaad9d8 100644
--- a/src/components/telemetry_monitor/test/application_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
@@ -50,22 +50,20 @@ TEST(ApplicationManagerMetricWrapper, grabResources) {
TEST(ApplicationManagerMetricWrapper, GetJsonMetric) {
ApplicationManagerMetricWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
-
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
- metric_test.message_metric =
- new application_manager::AMTelemetryObserver::MessageMetric();
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
+
+ metric_test.message_metric = std::make_shared<
+ application_manager::AMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
obj["params"][application_manager::strings::correlation_id] = 11;
obj["params"][application_manager::strings::connection_key] = 12;
metric_test.message_metric->message =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj);
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>(
+ obj);
Json::Value jvalue = metric_test.GetJsonMetric();
EXPECT_EQ("null\n",
@@ -75,9 +73,9 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetric) {
EXPECT_EQ("null\n",
jvalue[telemetry_monitor::strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(),
jvalue[telemetry_monitor::strings::correlation_id].asInt64());
@@ -90,37 +88,34 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetricWithGrabResources) {
utils::ResourseUsage* resources = utils::Resources::getCurrentResourseUsage();
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
- metric_test.message_metric =
- new application_manager::AMTelemetryObserver::MessageMetric();
+ metric_test.message_metric = std::make_shared<
+ application_manager::AMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
obj["params"][application_manager::strings::correlation_id] = 11;
obj["params"][application_manager::strings::connection_key] = 12;
metric_test.message_metric->message =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj);
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>(
+ obj);
Json::Value jvalue = metric_test.GetJsonMetric();
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(),
jvalue[telemetry_monitor::strings::correlation_id].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::connection_key].asInt(),
jvalue[telemetry_monitor::strings::connection_key].asInt());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_NEAR(
diff --git a/src/components/telemetry_monitor/test/application_manager_observer_test.cc b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
index 5b7a551247..deecfa57b7 100644
--- a/src/components/telemetry_monitor/test/application_manager_observer_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
@@ -35,7 +35,7 @@
#include "application_manager/telemetry_observer.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
#include "telemetry_monitor/application_manager_observer.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_monitor.h"
namespace test {
@@ -49,7 +49,7 @@ TEST(ApplicationManagerObserver, CallOnMessage) {
MockTelemetryMonitor mock_telemetry_monitor;
ApplicationManagerObserver app_observer(&mock_telemetry_monitor);
typedef application_manager::AMTelemetryObserver::MessageMetric AMMetric;
- utils::SharedPtr<AMMetric> ptr =
+ std::shared_ptr<AMMetric> ptr =
application_manager::AMTelemetryObserver::MessageMetricSharedPtr();
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_));
app_observer.OnMessage(ptr);
diff --git a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
index fdda58bd08..c2aebe72b3 100644
--- a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
+++ b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
@@ -37,7 +37,6 @@
#include "gmock/gmock.h"
#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/metric_wrapper.h"
-#include "utils/shared_ptr.h"
namespace test {
namespace components {
@@ -50,7 +49,7 @@ class MockTelemetryMonitor : public telemetry_monitor::TelemetryMonitor {
MOCK_METHOD0(Stop, void());
MOCK_METHOD0(Start, void());
MOCK_METHOD1(SendMetric,
- void(utils::SharedPtr<telemetry_monitor::MetricWrapper> metric));
+ void(std::shared_ptr<telemetry_monitor::MetricWrapper> metric));
};
} // namespace transport_manager_test
} // namespace components
diff --git a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
index 8253cf2553..c9130411e7 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
@@ -51,15 +51,12 @@ TEST(ProtocolHandlerMetricTest, grabResources) {
TEST(ProtocolHandlerMetricTest, GetJsonMetric) {
ProtocolHandlerMecticWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
metric_test.message_metric =
- new protocol_handler::PHTelemetryObserver::MessageMetric();
+ std::make_shared<protocol_handler::PHTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->message_id = 5;
@@ -71,10 +68,8 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetric) {
EXPECT_EQ("null\n", jvalue[strings::utime].toStyledString());
EXPECT_EQ("null\n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(5, jvalue[strings::message_id].asInt64());
EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
}
@@ -85,15 +80,12 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
EXPECT_TRUE(resources != NULL);
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
metric_test.message_metric =
- new protocol_handler::PHTelemetryObserver::MessageMetric();
+ std::make_shared<protocol_handler::PHTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->message_id = 5;
@@ -107,10 +99,8 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
EXPECT_NE("null/n", jvalue[strings::utime].toStyledString());
EXPECT_NE("null/n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(5, jvalue[strings::message_id].asInt64());
EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
diff --git a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
index 784e809da6..587bf21ce6 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
@@ -47,13 +47,12 @@ TEST(ProtocolHandlerObserverTest, MessageProcess) {
ProtocolHandlerObserver pr_handler(&mock_telemetry_monitor);
uint32_t message_id = 1;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
pr_handler.StartMessageProcess(message_id, start_time);
typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType;
- utils::SharedPtr<MetricType> message_metric = new MetricType();
+ std::shared_ptr<MetricType> message_metric = std::make_shared<MetricType>();
message_metric->message_id = 1;
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_));
pr_handler.EndMessageProcess(message_metric);
@@ -64,13 +63,12 @@ TEST(ProtocolHandlerObserverTest, MessageProcessWithZeroMessageId) {
ProtocolHandlerObserver pr_handler(&mock_telemetry_monitor);
uint32_t message_id = 0;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
pr_handler.StartMessageProcess(message_id, start_time);
typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType;
- utils::SharedPtr<MetricType> message_metric = new MetricType();
+ std::shared_ptr<MetricType> message_metric = std::make_shared<MetricType>();
message_metric->message_id = 0;
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_)).Times(0);
pr_handler.EndMessageProcess(message_metric);
diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
index 5235f0a469..b8d3f9063f 100644
--- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
+++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
@@ -40,8 +40,6 @@
#include "connection_handler/mock_connection_handler.h"
#include "transport_manager/mock_transport_manager.h"
#include "telemetry_monitor/mock_telemetry_observable.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using testing::Return;
using testing::_;
@@ -57,7 +55,7 @@ class StreamerMock : public Streamer {
StreamerMock(TelemetryMonitor* const server) : Streamer(server) {
is_client_connected_ = true;
}
- MOCK_METHOD1(PushMessage, void(utils::SharedPtr<MetricWrapper> metric));
+ MOCK_METHOD1(PushMessage, void(std::shared_ptr<MetricWrapper> metric));
};
TEST(TelemetryMonitorTest, MessageProcess) {
@@ -92,14 +90,14 @@ TEST(TelemetryMonitorTest, MessageProcess) {
EXPECT_CALL(am_observeble, SetTelemetryObserver(_));
EXPECT_CALL(transport_manager_mock, SetTelemetryObserver(_));
telemetry_monitor::TelemetryMonitor telemetry_monitor(server_address, port);
- utils::SharedPtr<StreamerMock> streamer_mock =
- utils::MakeShared<StreamerMock>(&telemetry_monitor);
+ std::shared_ptr<StreamerMock> streamer_mock =
+ std::make_shared<StreamerMock>(&telemetry_monitor);
// streamer_mock will be freed by telemetry_monitor on destruction
telemetry_monitor.Start();
telemetry_monitor.set_streamer(streamer_mock);
telemetry_monitor.Init(
&protocol_handler_mock, &am_observeble, &transport_manager_mock);
- utils::SharedPtr<telemetry_monitor::MetricWrapper> test_metric;
+ std::shared_ptr<telemetry_monitor::MetricWrapper> test_metric;
EXPECT_CALL(*streamer_mock, PushMessage(test_metric));
telemetry_monitor.SendMetric(test_metric);
}
diff --git a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
index 6eb479387a..40caa6e0d6 100644
--- a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
@@ -51,15 +51,11 @@ TEST(TransportManagerMetricWrapper, grabResources) {
TEST(TransportManagerMetricWrapper, GetJsonMetric) {
TransportManagerMecticWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
metric_test.message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ std::make_shared<transport_manager::TMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->data_size = 1000;
@@ -69,10 +65,8 @@ TEST(TransportManagerMetricWrapper, GetJsonMetric) {
EXPECT_EQ("null\n", jvalue[strings::utime].toStyledString());
EXPECT_EQ("null\n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(1000, jvalue[strings::data_size].asInt());
}
@@ -82,15 +76,11 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
EXPECT_TRUE(resources != NULL);
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
metric_test.message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ std::make_shared<transport_manager::TMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
@@ -98,10 +88,8 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
Json::Value jvalue = metric_test.GetJsonMetric();
EXPECT_EQ("\"TransportManager\"\n", jvalue[strings::logger].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(1000, jvalue[strings::data_size].asInt());
EXPECT_NEAR(resources->stime, jvalue[strings::stime].asInt(), 1);
diff --git a/src/components/test_main.cc b/src/components/test_main.cc
index 72c90acb5c..61606756fe 100644
--- a/src/components/test_main.cc
+++ b/src/components/test_main.cc
@@ -1,12 +1,16 @@
#include "gmock/gmock.h"
#include "utils/logger.h"
#include "utils/custom_string.h"
+#include <iostream>
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
int main(int argc, char** argv) {
namespace custom_str = utils::custom_string;
testing::InitGoogleMock(&argc, argv);
::testing::DefaultValue<custom_str::CustomString>::Set(
custom_str::CustomString(""));
const int result = RUN_ALL_TESTS();
+
DEINIT_LOGGER();
return result;
}
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
index 4fa224393d..2f734b3a05 100644
--- a/src/components/transport_manager/CMakeLists.txt
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -43,6 +43,12 @@ include_directories (
${LOG4CXX_INCLUDE_DIRECTORY}
)
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include/transport_manager/tcp/platform_specific/qnx")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include/transport_manager/tcp/platform_specific/linux")
+endif ()
+
set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
@@ -96,8 +102,23 @@ if(NOT BUILD_TESTS)
)
endif()
+# exclude platform-dependent files before running collect_sources
+list(APPEND EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/tcp/platform_specific
+ ${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific
+)
+
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+# then add platform-dependent files later
+set(PLATFORM_DEPENDENT_SOURCES)
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES "${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific/qnx")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES "${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific/linux")
+endif ()
+list(APPEND SOURCES ${PLATFORM_DEPENDENT_SOURCES})
+
add_library("TransportManager" ${SOURCES})
target_link_libraries("TransportManager" ${LIBRARIES})
diff --git a/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
index 36a2b374dd..e53a472bcb 100644
--- a/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
@@ -74,6 +74,15 @@ class IAP2BluetoothEmulationTransportAdapter : public TcpTransportAdapter {
*/
void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+ /**
+ * @brief Notification that transport's configuration is updated. This
+ * override is needed so that a OnTransportConfigUpdated is not sent to the
+ * mobile device for the emulated transport.
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
protected:
/**
* @brief GetDeviceType Provides SDL device type for transport adapter
@@ -110,6 +119,15 @@ class IAP2USBEmulationTransportAdapter : public TcpTransportAdapter {
*/
void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+ /**
+ * @brief Notification that transport's configuration is updated. This
+ * override is needed so that a OnTransportConfigUpdated is not sent to the
+ * mobile device for the emulated transport.
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
protected:
/**
* @brief GetDeviceType Provides SDL device type for transport adapter
diff --git a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h
new file mode 100644
index 0000000000..8154503077
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h
@@ -0,0 +1,41 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Destructor
+ */
+ virtual ~NetworkInterfaceListener() {}
+
+ /**
+ * @brief Initialize this listener
+ */
+ virtual bool Init() = 0;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ virtual void Deinit() = 0;
+
+ /**
+ * @brief Start this listener
+ */
+ virtual bool Start() = 0;
+
+ /**
+ * @brief Stop this listener
+ */
+ virtual bool Stop() = 0;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
new file mode 100644
index 0000000000..159b5ff21d
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
@@ -0,0 +1,63 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
+
+#include <string>
+#include <memory>
+
+#include "utils/macro.h"
+#include "transport_manager/tcp/network_interface_listener.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class NetworkInterfaceListenerImpl : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ NetworkInterfaceListenerImpl(TcpClientListener* tcp_client_listener,
+ const std::string designated_interface);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~NetworkInterfaceListenerImpl();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+ private:
+ std::unique_ptr<NetworkInterfaceListener> platform_specific_impl_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h
new file mode 100644
index 0000000000..bb60b09a9d
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h
@@ -0,0 +1,201 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <netinet/in.h>
+#include "transport_manager/tcp/network_interface_listener.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+struct ifaddrmsg;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Struct to keep network interface's status flags and IP addresses
+ */
+class InterfaceStatus {
+ public:
+ InterfaceStatus()
+ : flags_(0)
+ , has_ipv4_(false)
+ , has_ipv6_(false)
+ , ipv4_address_()
+ , ipv6_address_() {}
+ ~InterfaceStatus() {}
+
+ bool IsAvailable() const;
+ bool IsLoopback() const;
+ // only for debugging output
+ unsigned int GetFlags() const {
+ return flags_;
+ }
+
+ bool HasIPAddress() const;
+ std::string GetIPv4Address() const;
+ std::string GetIPv6Address() const;
+
+ void SetFlags(unsigned int flags) {
+ flags_ = flags;
+ }
+
+ // specify NULL to remove existing address
+ void SetIPv4Address(struct in_addr* addr);
+ void SetIPv6Address(struct in6_addr* addr);
+
+ private:
+ unsigned int flags_;
+ bool has_ipv4_;
+ bool has_ipv6_;
+ struct in_addr ipv4_address_;
+ struct in6_addr ipv6_address_;
+};
+
+typedef std::map<std::string, InterfaceStatus> InterfaceStatusTable;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class PlatformSpecificNetworkInterfaceListener
+ : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface = "");
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~PlatformSpecificNetworkInterfaceListener();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+#ifdef BUILD_TESTS
+ void SetTesting(bool enabled) {
+ testing_ = enabled;
+ }
+
+ int GetSocket() const {
+ return socket_;
+ }
+
+ threads::Thread* GetThread() const {
+ return thread_;
+ }
+
+ void OverwriteStatusTable(const InterfaceStatusTable dummy_table) {
+ status_table_ = dummy_table;
+ }
+
+ void testCallNotifyIPAddresses() {
+ NotifyIPAddresses();
+ }
+
+ const std::string& GetSelectedInterfaceName() const {
+ return selected_interface_;
+ }
+#endif // BUILD_TESTS
+
+ private:
+ // Struct to hold an event on a network interface.
+ // The event can be either an update on flags or an update on IP address.
+ struct EventParam {
+ unsigned int if_index;
+ unsigned int flags;
+ struct sockaddr_storage address;
+
+ EventParam(int interface_index, unsigned int interface_flags = 0)
+ : if_index(interface_index), flags(interface_flags), address() {}
+ };
+
+ // parent class which we will notify the events to
+ TcpClientListener* tcp_client_listener_;
+ // if configured, NetworkInterfaceListener will always look into the IP
+ // addresses of this interface
+ const std::string designated_interface_;
+
+ // a map to store status of each interface
+ InterfaceStatusTable status_table_;
+ // this is the name of the interface we are currently focusing on
+ std::string selected_interface_;
+ // previous IP addresses that we have notified
+ std::string notified_ipv4_addr_;
+ std::string notified_ipv6_addr_;
+
+ int socket_;
+ int pipe_fds_[2];
+ threads::Thread* thread_;
+
+#ifdef BUILD_TESTS
+ bool testing_;
+#endif
+
+ void Loop();
+ bool StopLoop();
+
+ // reset status_table_ by fetching current status of each interface
+ bool InitializeStatus();
+ // update status_table_ by applying the events
+ bool UpdateStatus(uint16_t type, std::vector<EventParam>& params);
+ // update notified_ipv4_addr_ and notified_ipv6_addr_ then notify the parent
+ // class of the change if necessary
+ void NotifyIPAddresses();
+ // Select an appropriate network interface that we will get IP addresses. Also
+ // update selected_interface_.
+ const std::string SelectInterface();
+ // convert ifaddrmsg to a list of EventParam structs
+ std::vector<EventParam> ParseIFAddrMessage(struct ifaddrmsg* message,
+ unsigned int size);
+ // for debugging
+ void DumpTable() const;
+
+ class ListenerThreadDelegate : public threads::ThreadDelegate {
+ public:
+ explicit ListenerThreadDelegate(
+ PlatformSpecificNetworkInterfaceListener* parent);
+ virtual void threadMain();
+ void exitThreadMain();
+
+ private:
+ PlatformSpecificNetworkInterfaceListener* parent_;
+ };
+
+ DISALLOW_COPY_AND_ASSIGN(PlatformSpecificNetworkInterfaceListener);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h
new file mode 100644
index 0000000000..2cb5eb47a7
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h
@@ -0,0 +1,70 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <netinet/in.h>
+#include "transport_manager/tcp/network_interface_listener.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+class Thread;
+struct ifaddrmsg;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class PlatformSpecificNetworkInterfaceListener
+ : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface = "");
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~PlatformSpecificNetworkInterfaceListener();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+ private:
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
index 2640049ecc..0f9529d8d8 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
@@ -36,15 +36,18 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
+#include "utils/lock.h"
#include "utils/threads/thread_delegate.h"
#include "transport_manager/transport_adapter/client_connection_listener.h"
class Thread;
+struct in_addr;
namespace transport_manager {
namespace transport_adapter {
class TransportAdapterController;
+class NetworkInterfaceListener;
/**
* @brief Listener of device adapter that use TCP transport.
@@ -57,11 +60,15 @@ class TcpClientListener : public ClientConnectionListener {
* @param controller Pointer to the device adapter controller.
* @param port Port No.
* @param enable_keepalive If true enables TCP keepalive on accepted
+ * @param designated_interface Specify the name of the network interface to
+ *listen on. If empty, then this process will listen on all network
+ *interfaces.
*connections
*/
TcpClientListener(TransportAdapterController* controller,
uint16_t port,
- bool enable_keepalive);
+ bool enable_keepalive,
+ const std::string designated_interface = "");
/**
* @brief Destructor.
@@ -101,7 +108,18 @@ class TcpClientListener : public ClientConnectionListener {
*/
virtual TransportAdapter::Error StopListening();
+ /**
+ * @brief Called from NetworkInterfaceListener when IP address of the network
+ * interface is changed.
+ */
+ virtual void OnIPAddressUpdated(const std::string ipv4_addr,
+ const std::string ipv6_addr);
+
#ifdef BUILD_TESTS
+ void set_network_interface_listener(NetworkInterfaceListener* listener) {
+ interface_listener_ = listener;
+ }
+
uint16_t port() const {
return port_;
}
@@ -113,19 +131,47 @@ class TcpClientListener : public ClientConnectionListener {
threads::Thread* thread() const {
return thread_;
}
+
+ static void set_testing(bool enabled) {
+ testing_ = enabled;
+ }
#endif // BUILD_TESTS
private:
const uint16_t port_;
const bool enable_keepalive_;
TransportAdapterController* controller_;
+ bool initialized_;
+ bool started_;
threads::Thread* thread_;
int socket_;
bool thread_stop_requested_;
+ int pipe_fds_[2];
+ NetworkInterfaceListener* interface_listener_;
+ const std::string designated_interface_;
+ std::string current_ip_address_;
+ sync_primitives::Lock start_stop_lock_;
+
+#ifdef BUILD_TESTS
+ static bool testing_;
+#endif // BUILD_TESTS
void Loop();
void StopLoop();
+ TransportAdapter::Error StartListeningThread();
+ TransportAdapter::Error StopListeningThread();
+
+ bool StartOnNetworkInterface();
+ bool StopOnNetworkInterface();
+ bool IsListeningOnSpecificInterface() const;
+
+ static int CreateIPv4ServerSocket(uint16_t port,
+ const std::string interface_name = "");
+ static void DestroyServerSocket(int sock);
+ static bool GetIPv4Address(const std::string interface_name,
+ struct in_addr* ip_address);
+
class ListeningThreadDelegate : public threads::ThreadDelegate {
public:
explicit ListeningThreadDelegate(TcpClientListener* parent);
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
index 5431b4455d..37f5a7fe49 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
@@ -58,6 +58,18 @@ class TcpTransportAdapter : public TransportAdapterImpl {
*/
virtual ~TcpTransportAdapter();
+ /**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ /**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const OVERRIDE;
+
protected:
/**
* @brief Return type of device.
@@ -77,6 +89,19 @@ class TcpTransportAdapter : public TransportAdapterImpl {
* @return True on success false otherwise
*/
virtual bool Restore();
+
+ private:
+ /**
+ * @brief Keeps transport specific configuration
+ *
+ * TCP transport uses following information:
+ * - "enabled": whether the transport is currently enabled or not. Value can
+ * be "true" or "false".
+ * - "tcp_ip_address": string representation of IP address (either IPv4 or
+ * IPv6)
+ * - "tcp_port": string representation of TCP port number (e.g. "12345")
+ */
+ TransportConfig transport_config_;
};
} // namespace transport_adapter
diff --git a/src/components/transport_manager/include/transport_manager/telemetry_observer.h b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
index 5e42289a03..a38255966b 100644
--- a/src/components/transport_manager/include/transport_manager/telemetry_observer.h
+++ b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
@@ -42,8 +42,8 @@ namespace transport_manager {
class TMTelemetryObserver {
public:
struct MessageMetric {
- TimevalStruct begin;
- TimevalStruct end;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
size_t data_size;
};
virtual void StartRawMsg(const protocol_handler::RawMessage* ptr) = 0;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
index 537e94b055..2374d8a126 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
@@ -35,7 +35,6 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
-#include "utils/shared_ptr.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
namespace transport_manager {
@@ -67,7 +66,7 @@ class Connection {
virtual TransportAdapter::Error Disconnect() = 0;
};
-typedef utils::SharedPtr<Connection> ConnectionSPtr;
+typedef std::shared_ptr<Connection> ConnectionSPtr;
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
index 3792b94d7c..f1c679c123 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
@@ -40,7 +40,7 @@
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/common.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/threads/thread_delegate.h"
#include "utils/lock.h"
@@ -201,7 +201,7 @@ class ThreadedSocketConnection : public Connection {
FrameQueue frames_to_send_;
mutable sync_primitives::Lock frames_to_send_mutex_;
- sync_primitives::atomic_int socket_;
+ std::atomic_int socket_;
bool terminate_flag_;
bool unexpected_disconnect_;
const DeviceUID device_uid_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
index 0b38f82637..69d76b4b2b 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
@@ -204,6 +204,13 @@ class TransportAdapterController {
const ApplicationHandle& app_handle,
::protocol_handler::RawMessagePtr message,
const DataSendError&) = 0;
+
+ /**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ virtual void TransportConfigUpdated(const TransportConfig& new_config) = 0;
};
} // namespace transport_adapter
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
index 2b1ada79ad..078f93b32f 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
@@ -400,6 +400,13 @@ class TransportAdapterImpl : public TransportAdapter,
const DataSendError& error) OVERRIDE;
/**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ /**
* @brief DoTransportSwitch notifies listeners of transport adapter events
* that transport switching is requested by system
*/
@@ -420,6 +427,14 @@ class TransportAdapterImpl : public TransportAdapter,
SwitchableDevices GetSwitchableDevices() const OVERRIDE;
/**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const OVERRIDE {
+ // default is empty
+ return TransportConfig();
+ }
+
+ /**
* @brief Return name of device.
*
* @param device_id Device unique identifier.
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
index 424fa53dea..4606bac2d4 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
@@ -277,6 +277,15 @@ class TransportAdapterListener {
*/
virtual void OnTransportSwitchRequested(
const TransportAdapter* transport_adapter) = 0;
+
+ /**
+ * @brief Notification that the transport's specific configuration has been
+ * updated.
+ *
+ * @param transport_adapter pointer to the transport adapter
+ */
+ virtual void OnTransportConfigUpdated(
+ const TransportAdapter* transport_adapter) = 0;
};
} // transport_adapter namespace
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
index 8a8031c3cf..a744400279 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
@@ -272,6 +272,15 @@ class TransportAdapterListenerImpl
*/
void OnTransportSwitchRequested(const TransportAdapter* adapter) OVERRIDE;
+ /**
+ * @brief Notification that the transport's specific configuration has been
+ * updated.
+ *
+ * @param transport_adapter pointer to the transport adapter
+ */
+ void OnTransportConfigUpdated(
+ const transport_adapter::TransportAdapter* adapter) OVERRIDE;
+
private:
TransportManager* transport_manager_;
TransportAdapter* transport_adapter_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
index eaa71ce3bb..c1df49f91b 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
@@ -64,7 +64,7 @@ typedef threads::MessageLoopThread<std::queue<protocol_handler::RawMessagePtr> >
RawMessageLoopThread;
typedef threads::MessageLoopThread<std::queue<TransportAdapterEvent> >
TransportAdapterEventLoopThread;
-typedef utils::SharedPtr<timer::Timer> TimerSPtr;
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
typedef std::map<DeviceUID, TransportAdapter*> DeviceToAdapterMap;
/**
@@ -245,14 +245,6 @@ class TransportManagerImpl
int Visibility(const bool& on_off) const OVERRIDE;
/**
- * DEPRECATED
- * Must be moved under 'private' section
- * @brief Updates total device list with info from specific transport adapter.
- * @param ta Transport adapter
- */
- void UpdateDeviceList(TransportAdapter* ta);
-
- /**
* @brief OnDeviceListUpdated updates device list and sends appropriate
* notifications to listeners in case of something is changed
* @param ta Transport adapter to check for updated devices state
@@ -501,6 +493,12 @@ class TransportManagerImpl
* @return True if mapping has been updated, otherwise - false
*/
bool UpdateDeviceMapping(TransportAdapter* ta);
+
+ /**
+ * @brief Updates total device list with info from specific transport adapter.
+ * @param ta Transport adapter
+ */
+ void UpdateDeviceList(TransportAdapter* ta);
}; // class TransportManagerImpl
} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/common.h b/src/components/transport_manager/include/transport_manager/usb/common.h
index 1c6011dbb2..1db1a83a3a 100644
--- a/src/components/transport_manager/include/transport_manager/usb/common.h
+++ b/src/components/transport_manager/include/transport_manager/usb/common.h
@@ -35,8 +35,6 @@
#include <stdint.h>
-#include "utils/shared_ptr.h"
-
#if defined(__QNXNTO__)
#include "transport_manager/usb/qnx/usb_handler.h"
#else
@@ -64,7 +62,7 @@ static const uint16_t kApplePid8 = 0x12a8; // iPhone 5
static const int kUsbConfiguration = 1;
-typedef utils::SharedPtr<UsbHandler> UsbHandlerSptr;
+typedef std::shared_ptr<UsbHandler> UsbHandlerSptr;
class UsbDeviceListener {
public:
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device.h b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
index 8ca1a32a28..ea31bb0376 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
@@ -54,9 +54,9 @@ class UsbDevice : public Device {
return usb_device_;
}
- protected:
virtual ~UsbDevice() {}
+ protected:
virtual bool IsSameAs(const Device* other_device) const {
return unique_device_id() == other_device->unique_device_id();
}
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
index 0d8a77c88f..62615cb30f 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -37,7 +37,6 @@
#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -55,8 +54,8 @@ TransportAdapter::Error BluetoothConnectionFactory::Init() {
TransportAdapter::Error BluetoothConnectionFactory::CreateConnection(
const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<BluetoothSocketConnection> connection =
- utils::MakeShared<BluetoothSocketConnection>(
+ std::shared_ptr<BluetoothSocketConnection> connection =
+ std::make_shared<BluetoothSocketConnection>(
device_uid, app_handle, controller_);
controller_->ConnectionCreated(connection, device_uid, app_handle);
TransportAdapter::Error error = connection->Start();
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
index 038515170d..e7cc3d4f34 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
@@ -45,6 +45,7 @@
#include <sys/socket.h>
#include <algorithm>
+#include <iostream>
#include <limits>
#include "utils/logger.h"
@@ -56,7 +57,8 @@ bool BluetoothDevice::GetRfcommChannel(const ApplicationHandle app_handle,
uint8_t* channel_out) {
LOG4CXX_TRACE(logger_,
"enter. app_handle: " << app_handle
- << ", channel_out: " << channel_out);
+ << ", channel_out: " << std::hex
+ << reinterpret_cast<void*>(channel_out));
if (app_handle < 0 || app_handle > std::numeric_limits<uint8_t>::max()) {
LOG4CXX_TRACE(logger_,
"exit with FALSE. Condition: app_handle < 0 || app_handle > "
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
index 743c95f2e6..75ea799ce8 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
@@ -262,8 +262,8 @@ void BluetoothDeviceScanner::CheckSDLServiceOnDevices(
deviceName[name_len - 1] = '\0';
}
- Device* bluetooth_device =
- new BluetoothDevice(bd_address, deviceName, sdl_rfcomm_channels[i]);
+ auto bluetooth_device = std::make_shared<BluetoothDevice>(
+ bd_address, deviceName, sdl_rfcomm_channels[i]);
if (bluetooth_device) {
LOG4CXX_INFO(logger_, "Bluetooth device created successfully");
discovered_devices->push_back(bluetooth_device);
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
index 0f83f32c60..b373744f79 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
@@ -80,8 +80,8 @@ void BluetoothTransportAdapter::Store() const {
if (!device) { // device could have been disconnected
continue;
}
- utils::SharedPtr<BluetoothDevice> bluetooth_device =
- DeviceSptr::static_pointer_cast<BluetoothDevice>(device);
+ std::shared_ptr<BluetoothDevice> bluetooth_device =
+ std::static_pointer_cast<BluetoothDevice>(device);
Json::Value device_dictionary;
device_dictionary["name"] = bluetooth_device->name();
char address[18];
diff --git a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
index 6b7d44ea8d..31e997f3ba 100644
--- a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
+++ b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
@@ -69,6 +69,11 @@ DeviceType IAP2BluetoothEmulationTransportAdapter::GetDeviceType() const {
return IOS_BT;
}
+void IAP2BluetoothEmulationTransportAdapter::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ return;
+}
+
IAP2USBEmulationTransportAdapter::IAP2USBEmulationTransportAdapter(
const uint16_t port,
resumption::LastState& last_state,
@@ -78,6 +83,7 @@ IAP2USBEmulationTransportAdapter::IAP2USBEmulationTransportAdapter(
signal_handler_ = threads::CreateThread("iAP signal handler", delegate);
signal_handler_->start();
const auto result = mkfifo(out_signals_channel, mode);
+ UNUSED(result);
LOG4CXX_DEBUG(logger_, "Out signals channel creation result: " << result);
}
@@ -119,10 +125,16 @@ DeviceType IAP2USBEmulationTransportAdapter::GetDeviceType() const {
return IOS_USB;
}
+void IAP2USBEmulationTransportAdapter::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ return;
+}
+
IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::
IAPSignalHandlerDelegate(IAP2USBEmulationTransportAdapter& adapter)
: adapter_(adapter), run_flag_(true), in_(0) {
const auto result = mkfifo(in_signals_channel, mode);
+ UNUSED(result);
LOG4CXX_DEBUG(logger_, "In signals channel creation result: " << result);
}
diff --git a/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc b/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc
new file mode 100644
index 0000000000..85c479134d
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc
@@ -0,0 +1,42 @@
+#include "transport_manager/tcp/network_interface_listener_impl.h"
+#include "platform_specific_network_interface_listener_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+NetworkInterfaceListenerImpl::NetworkInterfaceListenerImpl(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface)
+ : platform_specific_impl_(new PlatformSpecificNetworkInterfaceListener(
+ tcp_client_listener, designated_interface)) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+NetworkInterfaceListenerImpl::~NetworkInterfaceListenerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool NetworkInterfaceListenerImpl::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Init();
+}
+
+void NetworkInterfaceListenerImpl::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ platform_specific_impl_->Deinit();
+}
+
+bool NetworkInterfaceListenerImpl::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Start();
+}
+
+bool NetworkInterfaceListenerImpl::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Stop();
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
new file mode 100644
index 0000000000..047d43b7bf
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
@@ -0,0 +1,673 @@
+#include "transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h"
+
+#include <arpa/inet.h>
+#include <asm/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <ifaddrs.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+#include "transport_manager/tcp/tcp_client_listener.h"
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+static std::string GetInterfaceName(unsigned int if_index);
+static bool SetNonblocking(int s);
+
+bool InterfaceStatus::IsAvailable() const {
+ // check if the interface is UP and RUNNING
+ return ((flags_ & IFF_UP) > 0) && ((flags_ & IFF_RUNNING) > 0);
+}
+
+bool InterfaceStatus::IsLoopback() const {
+ return flags_ & IFF_LOOPBACK;
+}
+
+bool InterfaceStatus::HasIPAddress() const {
+ return has_ipv4_ || has_ipv6_;
+}
+
+std::string InterfaceStatus::GetIPv4Address() const {
+ char buf[INET_ADDRSTRLEN] = "";
+ if (has_ipv4_ && IsAvailable()) {
+ inet_ntop(AF_INET, &ipv4_address_, buf, sizeof(buf));
+ }
+ return std::string(buf);
+}
+
+std::string InterfaceStatus::GetIPv6Address() const {
+ char buf[INET6_ADDRSTRLEN] = "";
+ if (has_ipv6_ && IsAvailable()) {
+ inet_ntop(AF_INET6, &ipv6_address_, buf, sizeof(buf));
+ }
+ return std::string(buf);
+}
+
+void InterfaceStatus::SetIPv4Address(struct in_addr* addr) {
+ if (addr == NULL) {
+ has_ipv4_ = false;
+ } else {
+ ipv4_address_ = *addr;
+ has_ipv4_ = true;
+ }
+}
+
+void InterfaceStatus::SetIPv6Address(struct in6_addr* addr) {
+ if (addr == NULL) {
+ has_ipv6_ = false;
+ } else {
+ ipv6_address_ = *addr;
+ has_ipv6_ = true;
+ }
+}
+
+PlatformSpecificNetworkInterfaceListener::
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface)
+ : tcp_client_listener_(tcp_client_listener)
+ , designated_interface_(designated_interface)
+ , selected_interface_("")
+ , notified_ipv4_addr_("")
+ , notified_ipv6_addr_("")
+ , socket_(-1)
+#ifdef BUILD_TESTS
+ , testing_(false)
+#endif // BUILD_TESTS
+{
+ pipe_fds_[0] = pipe_fds_[1] = -1;
+ thread_ = threads::CreateThread("PlatformSpecificNetworkInterfaceListener",
+ new ListenerThreadDelegate(this));
+}
+
+PlatformSpecificNetworkInterfaceListener::
+ ~PlatformSpecificNetworkInterfaceListener() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ Stop();
+ Deinit();
+
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ >= 0) {
+ LOG4CXX_WARN(logger_, "Network interface listener is already initialized");
+ return false;
+ }
+
+ socket_ = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ if (socket_ == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create netlink socket");
+ return false;
+ }
+
+ if (!SetNonblocking(socket_)) {
+ LOG4CXX_WARN(logger_, "Failed to configure netlink socket to non-blocking");
+ }
+
+ struct sockaddr_nl addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.nl_family = AF_NETLINK;
+ addr.nl_pad = 0;
+ addr.nl_pid = 0;
+ addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR;
+
+ if (bind(socket_, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to bind netlink socket");
+ close(socket_);
+ socket_ = -1;
+ return false;
+ }
+
+ if (pipe(pipe_fds_) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create internal pipe");
+ close(socket_);
+ socket_ = -1;
+ return false;
+ }
+
+ if (!SetNonblocking(pipe_fds_[0])) {
+ LOG4CXX_WARN(logger_, "Failed to configure pipe to non-blocking");
+ }
+
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ >= 0) {
+ close(socket_);
+ socket_ = -1;
+ }
+ if (pipe_fds_[1] >= 0) {
+ close(pipe_fds_[1]);
+ pipe_fds_[1] = -1;
+ }
+ if (pipe_fds_[0] >= 0) {
+ close(pipe_fds_[0]);
+ pipe_fds_[0] = -1;
+ }
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ < 0) {
+ LOG4CXX_WARN(logger_, "Interface listener is not initialized");
+ return false;
+ }
+
+ if (thread_->is_running()) {
+ LOG4CXX_WARN(logger_, "Interface listener is already started");
+ return false;
+ }
+
+ if (!thread_->start()) {
+ LOG4CXX_ERROR(logger_, "Failed to start interface listener");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "Network interface listener started");
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!thread_->is_running()) {
+ LOG4CXX_DEBUG(logger_, "interface listener is not running");
+ return false;
+ }
+
+ thread_->join();
+
+ LOG4CXX_INFO(logger_, "Network interface listener stopped");
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Loop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Initialize status_table_ by acquiring a list of interfaces and their
+ // current statuses. Also we will notify an event to the listener if IP
+ // address is already available.
+ InitializeStatus();
+ NotifyIPAddresses();
+
+ // I am not sure required buffer size for netlink data structures. Most of
+ // implementation I found online uses 4096 so I followed them.
+ char buf[4096];
+ fd_set rfds;
+
+ while (1) {
+ FD_ZERO(&rfds);
+ FD_SET(socket_, &rfds);
+ FD_SET(pipe_fds_[0], &rfds);
+ int nfds = socket_ > pipe_fds_[0] ? socket_ : pipe_fds_[0];
+
+ // wait for some data from netlink socket (socket_) and our internal pipe
+ int ret = select(nfds + 1, &rfds, NULL, NULL, NULL);
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "select failed for netlink. Aborting interface listener.");
+ break;
+ }
+ }
+
+ // Received data from internal pipe, indicating StopLoop() is called.
+ // We'll break the while() loop and eventually exit this thread.
+ if (FD_ISSET(pipe_fds_[0], &rfds)) {
+ ret = read(pipe_fds_[0], buf, sizeof(buf));
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to read from pipe. Aborting interface listener.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(logger_,
+ "Pipe disconnected. Aborting interface listener.");
+ break;
+ } else {
+ LOG4CXX_DEBUG(logger_, "received terminating event through pipe");
+ break;
+ }
+ }
+
+#ifdef BUILD_TESTS
+ if (testing_) { // don't enable events from network interface while testing
+ continue;
+ }
+#endif // BUILD_TESTS
+
+ // received data from netlink socket
+ if (FD_ISSET(socket_, &rfds)) {
+ ret = recv(socket_, buf, sizeof(buf), 0);
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(logger_,
+ "Failed to read from netlink socket. Aborting interface "
+ "listener.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(
+ logger_,
+ "Netlink socket disconnected. Aborting interface listener.");
+ break;
+ } else {
+ struct nlmsghdr* header = reinterpret_cast<struct nlmsghdr*>(buf);
+ int len = ret;
+
+ // Parse the stream. We may receive multiple (header + data) pairs at a
+ // time so we use for-loop to go through.
+ for (; NLMSG_OK(header, len); header = NLMSG_NEXT(header, len)) {
+ if (header->nlmsg_type == NLMSG_ERROR) {
+ LOG4CXX_WARN(logger_, "received error event from netlink");
+ break;
+ }
+
+ std::vector<EventParam> params;
+
+ if (header->nlmsg_type == RTM_NEWLINK ||
+ header->nlmsg_type == RTM_DELLINK) {
+ // For these events, data part contains an ifinfomsg struct and a
+ // series of rtattr structures. See rtnetlink(7).
+ // We are only interested in interface index and flags.
+ struct ifinfomsg* ifinfo_msg =
+ reinterpret_cast<struct ifinfomsg*>(NLMSG_DATA(header));
+ EventParam param(ifinfo_msg->ifi_index, ifinfo_msg->ifi_flags);
+ params.push_back(param);
+
+ } else if (header->nlmsg_type == RTM_NEWADDR ||
+ header->nlmsg_type == RTM_DELADDR) {
+ // For these events, data part contains an ifaddrmsg struct and
+ // optionally some rtattr structures. We'll extract IP address(es)
+ // from them.
+ struct ifaddrmsg* ifaddr_msg =
+ reinterpret_cast<struct ifaddrmsg*>(NLMSG_DATA(header));
+ unsigned int size = IFA_PAYLOAD(header);
+ params = ParseIFAddrMessage(ifaddr_msg, size);
+
+ } else {
+ continue;
+ }
+
+ // update status_table_ based on received data
+ UpdateStatus(header->nlmsg_type, params);
+ }
+ }
+
+ // notify the listener if necessary
+ NotifyIPAddresses();
+ }
+ }
+}
+
+bool PlatformSpecificNetworkInterfaceListener::StopLoop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ LOG4CXX_INFO(logger_, "Stopping network interface listener");
+
+ if (pipe_fds_[1] < 0) {
+ LOG4CXX_WARN(logger_, "StopLoop called in invalid state");
+ return false;
+ }
+
+ char dummy[1] = {0};
+ int ret = write(pipe_fds_[1], dummy, sizeof(dummy));
+ if (ret <= 0) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Failed to send stop message to interface listener");
+ return false;
+ }
+
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::InitializeStatus() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef BUILD_TESTS
+ if (testing_) {
+ // don't actually call getifaddrs()
+ return true;
+ }
+#endif // BUILD_TESTS
+
+ struct ifaddrs* if_list, *interface;
+ if (getifaddrs(&if_list) != 0) {
+ LOG4CXX_WARN(logger_,
+ "getifaddr failed, interface status won't be available until "
+ "a change occurs");
+ return false;
+ }
+
+ // clear existing table
+ status_table_.clear();
+
+ for (interface = if_list; interface != NULL;
+ interface = interface->ifa_next) {
+ if (interface->ifa_name == NULL || interface->ifa_name[0] == '\0') {
+ continue;
+ }
+ if (interface->ifa_addr == NULL) {
+ continue;
+ }
+
+ std::string ifname(interface->ifa_name);
+ InterfaceStatus& status = status_table_[ifname];
+
+ switch (interface->ifa_addr->sa_family) {
+ case AF_INET: {
+ struct sockaddr_in* addr =
+ reinterpret_cast<struct sockaddr_in*>(interface->ifa_addr);
+ status.SetIPv4Address(&addr->sin_addr);
+ break;
+ }
+ case AF_INET6: {
+ struct sockaddr_in6* addr =
+ reinterpret_cast<struct sockaddr_in6*>(interface->ifa_addr);
+ status.SetIPv6Address(&addr->sin6_addr);
+ break;
+ }
+ default:
+ continue;
+ }
+ status.SetFlags(interface->ifa_flags);
+ }
+
+ freeifaddrs(if_list);
+
+ LOG4CXX_DEBUG(logger_, "Successfully acquired network interface status");
+ DumpTable();
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::UpdateStatus(
+ uint16_t type, std::vector<EventParam>& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ for (std::vector<EventParam>::iterator it = params.begin();
+ it != params.end();
+ ++it) {
+ std::string ifname = GetInterfaceName(it->if_index);
+ if (ifname.empty()) {
+ continue;
+ }
+
+ InterfaceStatus& status = status_table_[ifname];
+
+ switch (type) {
+ case RTM_NEWLINK: {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: interface " << ifname
+ << " created or updated");
+ status.SetFlags(it->flags);
+ break;
+ }
+ case RTM_DELLINK:
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: interface " << ifname << " removed");
+ status_table_.erase(ifname);
+ break;
+ case RTM_NEWADDR: {
+ sockaddr* addr = reinterpret_cast<sockaddr*>(&it->address);
+ if (addr->sa_family == AF_INET) {
+ sockaddr_in* addr_in = reinterpret_cast<sockaddr_in*>(addr);
+ status.SetIPv4Address(&addr_in->sin_addr);
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv4 address of interface "
+ << ifname << " updated to "
+ << status.GetIPv4Address());
+ } else if (addr->sa_family == AF_INET6) {
+ sockaddr_in6* addr_in6 = reinterpret_cast<sockaddr_in6*>(addr);
+ status.SetIPv6Address(&addr_in6->sin6_addr);
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv6 address of interface "
+ << ifname << " updated to "
+ << status.GetIPv6Address());
+ }
+ break;
+ }
+ case RTM_DELADDR: {
+ sockaddr* addr = reinterpret_cast<sockaddr*>(&it->address);
+ if (addr->sa_family == AF_INET) {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv4 address of interface "
+ << ifname << " removed");
+ status.SetIPv4Address(NULL);
+ } else if (addr->sa_family == AF_INET6) {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv6 address of interface "
+ << ifname << " removed");
+ status.SetIPv6Address(NULL);
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported netlink event (" << type << ")");
+ break;
+ }
+ }
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::NotifyIPAddresses() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string ipv4_addr;
+ std::string ipv6_addr;
+ const std::string interface_name = SelectInterface();
+
+ // note that if interface_name is empty (i.e. no interface is selected),
+ // the IP addresses will be empty
+ if (!interface_name.empty()) {
+ InterfaceStatusTable::iterator it = status_table_.find(interface_name);
+ if (status_table_.end() != it) {
+ InterfaceStatus& status = it->second;
+ ipv4_addr = status.GetIPv4Address();
+ ipv6_addr = status.GetIPv6Address();
+ }
+ }
+
+ if (notified_ipv4_addr_ != ipv4_addr || notified_ipv6_addr_ != ipv6_addr) {
+ LOG4CXX_INFO(logger_,
+ "IP address updated: \"" << notified_ipv4_addr_ << "\" -> \""
+ << ipv4_addr << "\", \""
+ << notified_ipv6_addr_ << "\" -> \""
+ << ipv6_addr << "\"");
+
+ notified_ipv4_addr_ = ipv4_addr;
+ notified_ipv6_addr_ = ipv6_addr;
+
+ tcp_client_listener_->OnIPAddressUpdated(notified_ipv4_addr_,
+ notified_ipv6_addr_);
+ }
+}
+
+const std::string PlatformSpecificNetworkInterfaceListener::SelectInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!designated_interface_.empty()) {
+ return designated_interface_;
+ }
+
+ InterfaceStatusTable::iterator it;
+
+ if (!selected_interface_.empty()) {
+ // if current network interface is still available and has IP address, then
+ // we use it
+ it = status_table_.find(selected_interface_);
+ if (it != status_table_.end()) {
+ InterfaceStatus& status = it->second;
+ if (status.IsAvailable() && status.HasIPAddress()) {
+ return selected_interface_;
+ }
+ }
+ }
+
+ // pick a network interface that has IP address
+ for (it = status_table_.begin(); it != status_table_.end(); ++it) {
+ InterfaceStatus& status = it->second;
+ // ignore loopback interfaces
+ if (status.IsLoopback()) {
+ continue;
+ }
+ // if the interface has to be UP and RUNNING, and must have an IP address
+ if (!(status.IsAvailable() && status.HasIPAddress())) {
+ continue;
+ }
+
+ selected_interface_ = it->first;
+ LOG4CXX_DEBUG(logger_,
+ "selecting network interface: " << selected_interface_);
+ return selected_interface_;
+ }
+
+ selected_interface_ = "";
+ return selected_interface_;
+}
+
+std::vector<PlatformSpecificNetworkInterfaceListener::EventParam>
+PlatformSpecificNetworkInterfaceListener::ParseIFAddrMessage(
+ struct ifaddrmsg* message, unsigned int size) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::vector<EventParam> params;
+
+ // Iterate through rtattr structs. (The first one can be acquired through
+ // IFA_RTA() macro)
+ for (struct rtattr* attr = IFA_RTA(message); RTA_OK(attr, size);
+ attr = RTA_NEXT(attr, size)) {
+ if (!(attr->rta_type == IFA_LOCAL || attr->rta_type == IFA_ADDRESS)) {
+ continue;
+ }
+
+ EventParam param(message->ifa_index);
+
+ if (message->ifa_family == AF_INET) {
+ // make sure the size of data is >= 4 bytes
+ if (RTA_PAYLOAD(attr) < sizeof(struct in_addr)) {
+ LOG4CXX_DEBUG(logger_,
+ "Invalid netlink event: insufficient IPv4 address data");
+ continue;
+ }
+
+ // Data part of rtattr contains IPv4 address. Copy it to param.address
+ struct in_addr* ipv4_addr =
+ reinterpret_cast<struct in_addr*>(RTA_DATA(attr));
+
+ struct sockaddr_in* sockaddr =
+ reinterpret_cast<struct sockaddr_in*>(&param.address);
+ sockaddr->sin_family = AF_INET;
+ sockaddr->sin_addr = *ipv4_addr;
+
+ } else if (message->ifa_family == AF_INET6) {
+ // make sure the size of data is >= 16 bytes
+ if (RTA_PAYLOAD(attr) < sizeof(struct in6_addr)) {
+ LOG4CXX_DEBUG(logger_,
+ "Invalid netlink event: insufficient IPv6 address data");
+ continue;
+ }
+
+ // Data part of rtattr contains IPv6 address. Copy it to param.address
+ struct in6_addr* ipv6_addr =
+ reinterpret_cast<struct in6_addr*>(RTA_DATA(attr));
+
+ struct sockaddr_in6* sockaddr =
+ reinterpret_cast<struct sockaddr_in6*>(&param.address);
+ sockaddr->sin6_family = AF_INET6;
+ sockaddr->sin6_addr = *ipv6_addr;
+
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Unsupported family (" << message->ifa_family << ")");
+ continue;
+ }
+
+ params.push_back(param);
+ }
+
+ return params;
+}
+
+void PlatformSpecificNetworkInterfaceListener::DumpTable() const {
+ LOG4CXX_DEBUG(logger_,
+ "Number of network interfaces: " << status_table_.size());
+
+ for (auto it = status_table_.begin(); it != status_table_.end(); ++it) {
+ const std::string ifname = it->first;
+ const InterfaceStatus& status = it->second;
+ UNUSED(status);
+
+ LOG4CXX_DEBUG(
+ logger_,
+ " " << ifname << " : flags=" << status.GetFlags()
+ << " : available: " << (status.IsAvailable() ? "yes" : "no")
+ << " IPv4: " << status.GetIPv4Address()
+ << " IPv6: " << status.GetIPv6Address()
+ << (status.IsLoopback() ? " (loopback)" : ""));
+ }
+}
+
+PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ ListenerThreadDelegate(PlatformSpecificNetworkInterfaceListener* parent)
+ : parent_(parent) {}
+
+void PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ threadMain() {
+ parent_->Loop();
+}
+
+void PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ exitThreadMain() {
+ parent_->StopLoop();
+}
+
+static std::string GetInterfaceName(unsigned int if_index) {
+ char buf[IFNAMSIZ + 1] = "";
+ if_indextoname(if_index, buf);
+ return std::string(buf);
+}
+
+static bool SetNonblocking(int s) {
+ int prev_flag = fcntl(s, F_GETFL, 0);
+ if (prev_flag == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to acquire socket flag");
+ return false;
+ }
+
+ int ret = fcntl(s, F_SETFL, prev_flag | O_NONBLOCK);
+ if (ret == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to configure socket to non-blocking");
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc b/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc
new file mode 100644
index 0000000000..15b3814999
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc
@@ -0,0 +1,38 @@
+#include "transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+PlatformSpecificNetworkInterfaceListener::
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface) {}
+
+PlatformSpecificNetworkInterfaceListener::
+ ~PlatformSpecificNetworkInterfaceListener() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
index 207149eb8c..9f2597f0a7 100644
--- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc
+++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
@@ -36,11 +36,14 @@
#include <memory.h>
#include <signal.h>
#include <errno.h>
+#include <fcntl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/select.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
+#include <ifaddrs.h>
#ifdef __linux__
#include <linux/tcp.h>
#else // __linux__
@@ -53,9 +56,10 @@
#include <sstream>
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/threads/thread.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/tcp/network_interface_listener_impl.h"
#include "transport_manager/tcp/tcp_device.h"
#include "transport_manager/tcp/tcp_socket_connection.h"
@@ -64,72 +68,88 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+static bool SetNonblocking(int s);
+
+#ifdef BUILD_TESTS
+bool TcpClientListener::testing_ = false;
+#endif // BUILD_TESTS
+
TcpClientListener::TcpClientListener(TransportAdapterController* controller,
const uint16_t port,
- const bool enable_keepalive)
+ const bool enable_keepalive,
+ const std::string designated_interface)
: port_(port)
, enable_keepalive_(enable_keepalive)
, controller_(controller)
+ , initialized_(false)
+ , started_(false)
, thread_(0)
, socket_(-1)
- , thread_stop_requested_(false) {
+ , thread_stop_requested_(false)
+ , designated_interface_(designated_interface) {
+ pipe_fds_[0] = pipe_fds_[1] = -1;
thread_ = threads::CreateThread("TcpClientListener",
new ListeningThreadDelegate(this));
+ interface_listener_ =
+ new NetworkInterfaceListenerImpl(this, designated_interface);
}
TransportAdapter::Error TcpClientListener::Init() {
LOG4CXX_AUTO_TRACE(logger_);
thread_stop_requested_ = false;
- socket_ = socket(AF_INET, SOCK_STREAM, 0);
- if (-1 == socket_) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
- return TransportAdapter::FAIL;
- }
-
- sockaddr_in server_address = {0};
- server_address.sin_family = AF_INET;
- server_address.sin_port = htons(port_);
- server_address.sin_addr.s_addr = INADDR_ANY;
-
- int optval = 1;
- if (0 !=
- setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed");
+ if (!IsListeningOnSpecificInterface()) {
+ // Network interface is not specified. We will listen on all interfaces
+ // using INADDR_ANY. If socket creation fails, we will treat it an error.
+ socket_ = CreateIPv4ServerSocket(port_);
+ if (-1 == socket_) {
+ LOG4CXX_ERROR(logger_, "Failed to create TCP socket");
+ return TransportAdapter::FAIL;
+ }
+ } else {
+ // Network interface is specified and we wiill listen only on the interface.
+ // In this case, the server socket will be created once
+ // NetworkInterfaceListener notifies the interface's IP address.
+ LOG4CXX_INFO(logger_,
+ "TCP server socket will listen on "
+ << designated_interface_
+ << " once it has an IPv4 address.");
}
- if (bind(socket_,
- reinterpret_cast<sockaddr*>(&server_address),
- sizeof(server_address)) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ if (!interface_listener_->Init()) {
+ if (socket_ >= 0) {
+ close(socket_);
+ socket_ = -1;
+ }
return TransportAdapter::FAIL;
}
- const int kBacklog = 128;
- if (0 != listen(socket_, kBacklog)) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
- return TransportAdapter::FAIL;
- }
+ initialized_ = true;
return TransportAdapter::OK;
}
void TcpClientListener::Terminate() {
LOG4CXX_AUTO_TRACE(logger_);
- if (socket_ == -1) {
- LOG4CXX_WARN(logger_, "Socket has been closed");
+
+ if (!initialized_) {
return;
}
- if (shutdown(socket_, SHUT_RDWR) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to shutdown socket");
- }
- if (close(socket_) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to close socket");
+
+ if (!IsListeningOnSpecificInterface()) {
+ DestroyServerSocket(socket_);
+ socket_ = -1;
+ } else {
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ DestroyServerSocket(socket_);
+ socket_ = -1;
}
- socket_ = -1;
+
+ interface_listener_->Deinit();
+ initialized_ = false;
}
bool TcpClientListener::IsInitialised() const {
- return thread_;
+ return initialized_;
}
TcpClientListener::~TcpClientListener() {
@@ -138,6 +158,7 @@ TcpClientListener::~TcpClientListener() {
delete thread_->delegate();
threads::DeleteThread(thread_);
Terminate();
+ delete interface_listener_;
}
void SetKeepaliveOptions(const int fd) {
@@ -203,104 +224,152 @@ void SetKeepaliveOptions(const int fd) {
void TcpClientListener::Loop() {
LOG4CXX_AUTO_TRACE(logger_);
- while (!thread_stop_requested_) {
- sockaddr_in client_address;
- socklen_t client_address_size = sizeof(client_address);
- const int connection_fd = accept(
- socket_, (struct sockaddr*)&client_address, &client_address_size);
- if (thread_stop_requested_) {
- LOG4CXX_DEBUG(logger_, "thread_stop_requested_");
- close(connection_fd);
- break;
- }
+ fd_set rfds;
+ char dummy[16];
- if (connection_fd < 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "accept() failed");
- continue;
- }
-
- if (AF_INET != client_address.sin_family) {
- LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
- close(connection_fd);
- continue;
+ while (!thread_stop_requested_) {
+ FD_ZERO(&rfds);
+ FD_SET(socket_, &rfds);
+ FD_SET(pipe_fds_[0], &rfds);
+ int nfds = socket_ > pipe_fds_[0] ? socket_ : pipe_fds_[0];
+
+ int ret = select(nfds + 1, &rfds, NULL, NULL, NULL);
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ } else {
+ LOG4CXX_WARN(logger_, "select failed for TCP server socket");
+ break;
+ }
}
- char device_name[32];
- strncpy(device_name,
- inet_ntoa(client_address.sin_addr),
- sizeof(device_name) / sizeof(device_name[0]));
- LOG4CXX_INFO(logger_, "Connected client " << device_name);
- LOG4CXX_INFO(logger_, "Port is: " << port_);
-
- if (enable_keepalive_) {
- SetKeepaliveOptions(connection_fd);
+ if (FD_ISSET(pipe_fds_[0], &rfds)) {
+ ret = read(pipe_fds_[0], dummy, sizeof(dummy));
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to read from pipe, aborting TCP server socket loop.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(logger_,
+ "Pipe disconnected, aborting TCP server socket loop.");
+ break;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "received stop command of TCP server socket loop");
+ break;
+ }
}
- const auto device_uid =
- device_name + std::string(":") + std::to_string(port_);
+ if (FD_ISSET(socket_, &rfds)) {
+ sockaddr_in client_address;
+ socklen_t client_address_size = sizeof(client_address);
+ const int connection_fd = accept(
+ socket_, (struct sockaddr*)&client_address, &client_address_size);
+ if (thread_stop_requested_) {
+ LOG4CXX_DEBUG(logger_, "thread_stop_requested_");
+ close(connection_fd);
+ break;
+ }
+
+ if (connection_fd < 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "accept() failed");
+ continue;
+ }
+
+ if (AF_INET != client_address.sin_family) {
+ LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
+ close(connection_fd);
+ continue;
+ }
+
+ char device_name[32];
+ size_t size = sizeof(device_name) / sizeof(device_name[0]);
+ strncpy(device_name, inet_ntoa(client_address.sin_addr), size);
+
+ device_name[size - 1] = '\0';
+ LOG4CXX_INFO(logger_, "Connected client " << device_name);
+ LOG4CXX_INFO(logger_, "Port is: " << port_);
+
+ if (enable_keepalive_) {
+ SetKeepaliveOptions(connection_fd);
+ }
+
+ const auto device_uid =
+ device_name + std::string(":") + std::to_string(port_);
#if defined(BUILD_TESTS)
- TcpDevice* tcp_device =
- new TcpDevice(client_address.sin_addr.s_addr, device_uid, device_name);
+ auto tcp_device = std::make_shared<TcpDevice>(
+ client_address.sin_addr.s_addr, device_uid, device_name);
#else
- TcpDevice* tcp_device =
- new TcpDevice(client_address.sin_addr.s_addr, device_uid);
+ auto tcp_device = std::make_shared<TcpDevice>(
+ client_address.sin_addr.s_addr, device_uid);
#endif // BUILD_TESTS
- DeviceSptr device = controller_->AddDevice(tcp_device);
- tcp_device = static_cast<TcpDevice*>(device.get());
- const ApplicationHandle app_handle =
- tcp_device->AddIncomingApplication(connection_fd);
-
- utils::SharedPtr<TcpSocketConnection> connection =
- utils::MakeShared<TcpSocketConnection>(
- device->unique_device_id(), app_handle, controller_);
- controller_->ConnectionCreated(
- connection, device->unique_device_id(), app_handle);
- connection->set_socket(connection_fd);
- const TransportAdapter::Error error = connection->Start();
- if (TransportAdapter::OK != error) {
- LOG4CXX_ERROR(logger_,
- "TCP connection::Start() failed with error: " << error);
+ DeviceSptr device = controller_->AddDevice(tcp_device);
+ auto tcp_device_raw = static_cast<TcpDevice*>(device.get());
+ const ApplicationHandle app_handle =
+ tcp_device_raw->AddIncomingApplication(connection_fd);
+
+ std::shared_ptr<TcpSocketConnection> connection =
+ std::make_shared<TcpSocketConnection>(
+ device->unique_device_id(), app_handle, controller_);
+ controller_->ConnectionCreated(
+ connection, device->unique_device_id(), app_handle);
+ connection->set_socket(connection_fd);
+ const TransportAdapter::Error error = connection->Start();
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(logger_,
+ "TCP connection::Start() failed with error: " << error);
+ }
}
}
+
+ LOG4CXX_INFO(logger_, "TCP server socket loop is terminated.");
}
void TcpClientListener::StopLoop() {
LOG4CXX_AUTO_TRACE(logger_);
+ if (pipe_fds_[1] < 0) {
+ LOG4CXX_WARN(logger_, "StopLoop called in invalid state");
+ return;
+ }
+
thread_stop_requested_ = true;
- // We need to connect to the listening socket to unblock accept() call
- int byesocket = socket(AF_INET, SOCK_STREAM, 0);
- sockaddr_in server_address = {0};
- server_address.sin_family = AF_INET;
- server_address.sin_port = htons(port_);
- server_address.sin_addr.s_addr = INADDR_ANY;
- if (0 != connect(byesocket,
- reinterpret_cast<sockaddr*>(&server_address),
- sizeof(server_address))) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to connect byesocket");
- } else {
- // Can only shutdown socket if connected
- if (0 != shutdown(byesocket, SHUT_RDWR)) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to shutdown byesocket");
- }
+
+ char dummy[1] = {0};
+ int ret = write(pipe_fds_[1], dummy, sizeof(dummy));
+ if (ret <= 0) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Failed to send stop message to TCP server socket loop");
}
- close(byesocket);
}
TransportAdapter::Error TcpClientListener::StartListening() {
LOG4CXX_AUTO_TRACE(logger_);
- if (thread_->is_running()) {
+ if (started_) {
LOG4CXX_WARN(
logger_,
"TransportAdapter::BAD_STATE. Listener has already been started");
return TransportAdapter::BAD_STATE;
}
- if (!thread_->start()) {
- LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed");
+ if (!interface_listener_->Start()) {
return TransportAdapter::FAIL;
}
+
+ if (!IsListeningOnSpecificInterface()) {
+ TransportAdapter::Error ret = StartListeningThread();
+ if (TransportAdapter::OK != ret) {
+ LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed");
+ interface_listener_->Stop();
+ return ret;
+ }
+ }
+
+ started_ = true;
LOG4CXX_INFO(logger_, "Tcp client listener has started successfully");
return TransportAdapter::OK;
}
@@ -319,16 +388,286 @@ TcpClientListener::ListeningThreadDelegate::ListeningThreadDelegate(
TransportAdapter::Error TcpClientListener::StopListening() {
LOG4CXX_AUTO_TRACE(logger_);
- if (!thread_->is_running()) {
+ if (!started_) {
LOG4CXX_DEBUG(logger_, "TcpClientListener is not running now");
return TransportAdapter::BAD_STATE;
}
- thread_->join();
+ interface_listener_->Stop();
+
+ StopListeningThread();
+ started_ = false;
LOG4CXX_INFO(logger_, "Tcp client listener has stopped successfully");
return TransportAdapter::OK;
}
+TransportAdapter::Error TcpClientListener::StartListeningThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // StartListening() can be called from multiple threads
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+
+ if (pipe_fds_[0] < 0 || pipe_fds_[1] < 0) {
+ // recreate the pipe every time, so that the thread loop will not get
+ // leftover
+ // data inside pipe after it is started
+ if (pipe(pipe_fds_) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create internal pipe");
+ return TransportAdapter::FAIL;
+ }
+ if (!SetNonblocking(pipe_fds_[0])) {
+ LOG4CXX_WARN(logger_, "Failed to configure pipe to non-blocking");
+ }
+ }
+
+ thread_stop_requested_ = false;
+
+ if (!thread_->start()) {
+ return TransportAdapter::FAIL;
+ }
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error TcpClientListener::StopListeningThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // StopListening() can be called from multiple threads
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+
+ thread_->join();
+
+ close(pipe_fds_[1]);
+ pipe_fds_[1] = -1;
+ close(pipe_fds_[0]);
+ pipe_fds_[0] = -1;
+
+ return TransportAdapter::OK;
+}
+
+void TcpClientListener::OnIPAddressUpdated(const std::string ipv4_addr,
+ const std::string ipv6_addr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Since we only create a TCP socket with IPv4 option (AF_INET), currently we
+ // do not use IPv6 address.
+ if (ipv4_addr != current_ip_address_) {
+ if (IsListeningOnSpecificInterface()) {
+ if (!current_ip_address_.empty()) {
+ // the server socket is running, terminate it
+ LOG4CXX_DEBUG(logger_,
+ "Stopping current TCP server socket on "
+ << designated_interface_);
+ StopOnNetworkInterface();
+ }
+ if (!ipv4_addr.empty()) {
+ // start (or restart) server socket with the new IP address
+ LOG4CXX_DEBUG(
+ logger_, "Starting TCP server socket on " << designated_interface_);
+ StartOnNetworkInterface();
+ }
+ }
+
+ current_ip_address_ = ipv4_addr;
+
+ std::string enabled = !current_ip_address_.empty() ? "true" : "false";
+ std::ostringstream oss;
+ oss << port_;
+
+ TransportConfig config;
+ config.insert(std::make_pair(tc_enabled, enabled));
+ config.insert(std::make_pair(tc_tcp_ip_address, current_ip_address_));
+ config.insert(std::make_pair(tc_tcp_port, oss.str()));
+
+ controller_->TransportConfigUpdated(config);
+ }
+}
+
+bool TcpClientListener::StartOnNetworkInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // this method is only for the case that network interface is specified
+ if (IsListeningOnSpecificInterface()) {
+ {
+ // make sure that two threads will not update socket_ at the same time
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ if (socket_ < 0) {
+ socket_ = CreateIPv4ServerSocket(port_, designated_interface_);
+ if (-1 == socket_) {
+ LOG4CXX_WARN(logger_, "Failed to create TCP socket");
+ return false;
+ }
+ }
+ }
+
+ if (TransportAdapter::OK != StartListeningThread()) {
+ LOG4CXX_WARN(logger_, "Failed to start TCP client listener");
+ return false;
+ }
+ LOG4CXX_INFO(logger_,
+ "TCP server socket started on " << designated_interface_);
+ }
+ return true;
+}
+
+bool TcpClientListener::StopOnNetworkInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (IsListeningOnSpecificInterface()) {
+ if (TransportAdapter::OK != StopListeningThread()) {
+ LOG4CXX_WARN(logger_, "Failed to stop TCP client listener");
+ return false;
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ DestroyServerSocket(socket_);
+ socket_ = -1;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "TCP server socket on " << designated_interface_
+ << " stopped");
+ }
+ return true;
+}
+
+bool TcpClientListener::IsListeningOnSpecificInterface() const {
+ return !designated_interface_.empty();
+}
+
+int TcpClientListener::CreateIPv4ServerSocket(
+ uint16_t port, const std::string interface_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ struct in_addr ipv4_address;
+ memset(&ipv4_address, 0, sizeof(ipv4_address));
+ if (interface_name.empty()) {
+ ipv4_address.s_addr = htonl(INADDR_ANY);
+ } else if (!GetIPv4Address(interface_name, &ipv4_address)) {
+ return -1;
+ }
+
+ int sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (-1 == sock) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
+ return -1;
+ }
+
+ sockaddr_in server_address = {0};
+ server_address.sin_family = AF_INET;
+ server_address.sin_port = htons(port);
+ server_address.sin_addr = ipv4_address;
+
+ int optval = 1;
+ if (0 !=
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed");
+ }
+
+ if (bind(sock,
+ reinterpret_cast<sockaddr*>(&server_address),
+ sizeof(server_address)) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ close(sock);
+ return -1;
+ }
+
+ const int kBacklog = 128;
+ if (0 != listen(sock, kBacklog)) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
+ close(sock);
+ return -1;
+ }
+
+ return sock;
+}
+
+void TcpClientListener::DestroyServerSocket(int sock) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (sock >= 0) {
+ if (shutdown(sock, SHUT_RDWR) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to shutdown socket");
+ }
+ if (close(sock) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to close socket");
+ }
+ }
+}
+
+bool TcpClientListener::GetIPv4Address(const std::string interface_name,
+ struct in_addr* ip_address) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef BUILD_TESTS
+ if (testing_) {
+ // don't actually call getifaddrs(), instead return a dummy address of
+ // INADDR_LOOPBACK
+ struct in_addr dummy_addr;
+ dummy_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if (ip_address != NULL) {
+ *ip_address = dummy_addr;
+ }
+ return true;
+ }
+#endif // BUILD_TESTS
+
+ struct ifaddrs* if_list;
+ if (getifaddrs(&if_list) != 0) {
+ LOG4CXX_WARN(logger_, "getifaddrs failed");
+ return false;
+ }
+
+ struct ifaddrs* interface;
+ bool found = false;
+
+ for (interface = if_list; interface != NULL;
+ interface = interface->ifa_next) {
+ if (interface->ifa_name == NULL) {
+ continue;
+ }
+ if (interface_name == interface->ifa_name) {
+ if (interface->ifa_addr == NULL) {
+ continue;
+ }
+ switch (interface->ifa_addr->sa_family) {
+ case AF_INET: {
+ struct sockaddr_in* addr =
+ reinterpret_cast<struct sockaddr_in*>(interface->ifa_addr);
+ if (ip_address != NULL) {
+ *ip_address = addr->sin_addr;
+ }
+ found = true;
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+
+ freeifaddrs(if_list);
+
+ return found;
+}
+
+static bool SetNonblocking(int s) {
+ int prev_flag = fcntl(s, F_GETFL, 0);
+ if (prev_flag == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to acquire socket flag");
+ return false;
+ }
+
+ int ret = fcntl(s, F_SETFL, prev_flag | O_NONBLOCK);
+ if (ret == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to configure socket to non-blocking");
+ return false;
+ }
+
+ return true;
+}
+
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
index 114425076a..e202554f8f 100644
--- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -35,7 +35,6 @@
#include "transport_manager/tcp/tcp_server_originated_socket_connection.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -56,8 +55,8 @@ TransportAdapter::Error TcpConnectionFactory::CreateConnection(
LOG4CXX_DEBUG(logger_,
"DeviceUID: " << &device_uid
<< ", ApplicationHandle: " << &app_handle);
- utils::SharedPtr<TcpServerOriginatedSocketConnection> connection =
- utils::MakeShared<TcpServerOriginatedSocketConnection>(
+ std::shared_ptr<TcpServerOriginatedSocketConnection> connection =
+ std::make_shared<TcpServerOriginatedSocketConnection>(
device_uid, app_handle, controller_);
controller_->ConnectionCreated(connection, device_uid, app_handle);
const TransportAdapter::Error error = connection->Start();
diff --git a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
index 516f2d3ec4..2f10bd9454 100644
--- a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
+++ b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
@@ -56,7 +56,7 @@ bool TcpServerOriginatedSocketConnection::Establish(ConnectError** error) {
DCHECK(error);
LOG4CXX_DEBUG(logger_, "error " << error);
DeviceSptr device = controller()->FindDevice(device_handle());
- if (!device.valid()) {
+ if (device.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Device " << device_handle() << " not found");
*error = new ConnectError();
return false;
diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
index 0e9e63263b..b3dbf49628 100644
--- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
+++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
@@ -55,14 +55,35 @@ TcpTransportAdapter::TcpTransportAdapter(
const uint16_t port,
resumption::LastState& last_state,
const TransportManagerSettings& settings)
- : TransportAdapterImpl(NULL,
- new TcpConnectionFactory(this),
- new TcpClientListener(this, port, true),
- last_state,
- settings) {}
+ : TransportAdapterImpl(
+ NULL,
+ new TcpConnectionFactory(this),
+ new TcpClientListener(
+ this,
+ port,
+ true,
+ settings.transport_manager_tcp_adapter_network_interface()),
+ last_state,
+ settings) {}
TcpTransportAdapter::~TcpTransportAdapter() {}
+void TcpTransportAdapter::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_config_ = new_config;
+
+ // call the method of parent class to trigger OnTransportConfigUpdated() for
+ // the listeners
+ TransportAdapterImpl::TransportConfigUpdated(new_config);
+}
+
+TransportConfig TcpTransportAdapter::GetTransportConfiguration() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return transport_config_;
+}
+
DeviceType TcpTransportAdapter::GetDeviceType() const {
return TCP;
}
@@ -79,8 +100,8 @@ void TcpTransportAdapter::Store() const {
if (!device) { // device could have been disconnected
continue;
}
- utils::SharedPtr<TcpDevice> tcp_device =
- DeviceSptr::static_pointer_cast<TcpDevice>(device);
+ std::shared_ptr<TcpDevice> tcp_device =
+ std::static_pointer_cast<TcpDevice>(device);
Json::Value device_dictionary;
device_dictionary["name"] = tcp_device->name();
struct in_addr address;
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
index bdacd68006..346139cbd2 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
@@ -43,18 +43,24 @@
namespace transport_manager {
namespace transport_adapter {
+const char* tc_enabled = "enabled";
+const char* tc_tcp_port = "tcp_port";
+const char* tc_tcp_ip_address = "tcp_ip_address";
+
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
namespace {
-// @deprecated DeviceTypes: PASA_AOA, PASA_BLUETOOTH, MME
DeviceTypes devicesType = {
std::make_pair(DeviceType::AOA, std::string("USB_AOA")),
- std::make_pair(DeviceType::PASA_AOA, std::string("USB_AOA")),
std::make_pair(DeviceType::BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(DeviceType::PASA_BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(DeviceType::MME, std::string("USB_IOS")),
std::make_pair(DeviceType::IOS_BT, std::string("BLUETOOTH_IOS")),
std::make_pair(DeviceType::IOS_USB, std::string("USB_IOS")),
- std::make_pair(DeviceType::TCP, std::string("WIFI"))};
+ std::make_pair(DeviceType::TCP, std::string("WIFI")),
+ std::make_pair(DeviceType::IOS_USB_HOST_MODE,
+ std::string("USB_IOS_HOST_MODE")),
+ std::make_pair(DeviceType::IOS_USB_DEVICE_MODE,
+ std::string("USB_IOS_DEVICE_MODE")),
+ std::make_pair(DeviceType::IOS_CARPLAY_WIRELESS,
+ std::string("CARPLAY_WIRELESS_IOS"))};
}
TransportAdapterImpl::TransportAdapterImpl(
@@ -695,6 +701,16 @@ void TransportAdapterImpl::DataSendFailed(
LOG4CXX_TRACE(logger_, "exit");
}
+void TransportAdapterImpl::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end();
+ ++it) {
+ (*it)->OnTransportConfigUpdated(this);
+ }
+}
+
void TransportAdapterImpl::DoTransportSwitch() const {
LOG4CXX_AUTO_TRACE(logger_);
std::for_each(
@@ -803,16 +819,16 @@ ApplicationList TransportAdapterImpl::GetApplicationList(
const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
ApplicationList lst = device->GetApplicationList();
LOG4CXX_TRACE(logger_,
"exit with ApplicationList. It's size = "
- << lst.size() << " Condition: device.valid()");
+ << lst.size() << " Condition: device.use_count() != 0");
return lst;
}
- LOG4CXX_TRACE(
- logger_,
- "exit with empty ApplicationList. Condition: NOT device.valid()");
+ LOG4CXX_TRACE(logger_,
+ "exit with empty ApplicationList. Condition: NOT "
+ "device.use_count() != 0");
return ApplicationList();
}
@@ -875,7 +891,7 @@ bool TransportAdapterImpl::IsInitialised() const {
std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const {
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
return device->name();
} else {
return "";
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
index f1181ce921..544cdde999 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
@@ -275,7 +275,7 @@ void TransportAdapterListenerImpl::OnDataSendDone(
device,
app_id,
data_container,
- new BaseError());
+ std::make_shared<BaseError>());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -376,4 +376,23 @@ void TransportAdapterListenerImpl::OnTransportSwitchRequested(
LOG4CXX_WARN(logger_, "Failed to receive event from device");
}
}
+
+void TransportAdapterListenerImpl::OnTransportConfigUpdated(
+ const transport_adapter::TransportAdapter* adapter) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const TransportAdapterEvent event(EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr());
+
+ if (transport_manager_ != NULL &&
+ transport_manager::E_SUCCESS !=
+ transport_manager_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+}
+
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index a364220a64..2b0296debb 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -44,7 +44,7 @@
#include "utils/macro.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include "transport_manager/common.h"
#include "transport_manager/transport_manager_listener.h"
@@ -529,6 +529,8 @@ int TransportManagerImpl::Reinit() {
LOG4CXX_AUTO_TRACE(logger_);
DisconnectAllDevices();
TerminateAllAdapters();
+ device_to_adapter_map_.clear();
+ connection_id_counter_ = 0;
int ret = InitAllAdapters();
return ret;
}
@@ -1066,7 +1068,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_ERROR(logger_, "Transport adapter failed to send data");
// TODO(YK): potential error case -> thread unsafe
// update of message content
- if (event.event_data.valid()) {
+ if (event.event_data.use_count() != 0) {
event.event_data->set_waiting(true);
} else {
LOG4CXX_DEBUG(logger_, "Data is invalid");
@@ -1144,6 +1146,13 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "eevent_type = ON_UNEXPECTED_DISCONNECT");
break;
}
+ case EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED: {
+ LOG4CXX_DEBUG(logger_, "event_type = ON_TRANSPORT_CONFIG_UPDATED");
+ transport_adapter::TransportConfig config =
+ event.transport_adapter->GetTransportConfiguration();
+ RaiseEvent(&TransportManagerListener::OnTransportConfigUpdated, config);
+ break;
+ }
} // switch
LOG4CXX_TRACE(logger_, "exit");
}
@@ -1203,9 +1212,9 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal(
const DeviceHandle device_handle)
: transport_manager(transport_manager)
, transport_adapter(transport_adapter)
- , timer(utils::MakeShared<timer::Timer,
- const char*,
- ::timer::TimerTaskImpl<ConnectionInternal>*>(
+ , timer(std::make_shared<timer::Timer,
+ const char*,
+ ::timer::TimerTaskImpl<ConnectionInternal>*>(
"TM DiscRoutine",
new ::timer::TimerTaskImpl<ConnectionInternal>(
this, &ConnectionInternal::DisconnectFailedRoutine)))
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
index e9ab2bae8e..212e6e0ec3 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -224,7 +224,7 @@ void UsbConnection::OnOutTransfer(libusb_transfer* transfer) {
device_uid_, app_handle_, current_out_message_, DataSendError());
PopOutMessage();
}
- if (!current_out_message_.valid()) {
+ if (current_out_message_.use_count() == 0) {
libusb_free_transfer(transfer);
out_transfer_ = NULL;
waiting_out_transfer_cancel_ = false;
@@ -242,7 +242,7 @@ TransportAdapter::Error UsbConnection::SendData(
return TransportAdapter::BAD_STATE;
}
sync_primitives::AutoLock locker(out_messages_mutex_);
- if (current_out_message_.valid()) {
+ if (current_out_message_.use_count() != 0) {
out_messages_.push_back(message);
} else {
current_out_message_ = message;
diff --git a/src/components/transport_manager/src/usb/qnx/usb_connection.cc b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
index 516a367ebc..b9386c5d9f 100644
--- a/src/components/transport_manager/src/usb/qnx/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
@@ -230,7 +230,7 @@ void UsbConnection::OnOutTransfer(usbd_urb* urb) {
}
}
- if ((!disconnecting_) && current_out_message_.valid()) {
+ if ((!disconnecting_) && (current_out_message_.use_count() != 0)) {
PostOutTransfer();
} else {
pending_out_transfer_ = false;
@@ -243,7 +243,7 @@ TransportAdapter::Error UsbConnection::SendData(
return TransportAdapter::BAD_STATE;
}
sync_primitives::AutoLock locker(out_messages_mutex_);
- if (current_out_message_.valid()) {
+ if (current_out_message_.use_count() != 0) {
out_messages_.push_back(message);
} else {
current_out_message_ = message;
diff --git a/src/components/transport_manager/src/usb/usb_connection_factory.cc b/src/components/transport_manager/src/usb/usb_connection_factory.cc
index 1136dfad21..528855cd50 100644
--- a/src/components/transport_manager/src/usb/usb_connection_factory.cc
+++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc
@@ -34,7 +34,6 @@
#include "transport_manager/usb/usb_device.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
#if defined(__QNXNTO__)
#include "transport_manager/usb/qnx/usb_connection.h"
@@ -65,21 +64,21 @@ TransportAdapter::Error UsbConnectionFactory::CreateConnection(
"enter DeviceUID: " << &device_uid
<< ", ApplicationHandle: " << &app_handle);
DeviceSptr device = controller_->FindDevice(device_uid);
- if (!device.valid()) {
+ if (device.use_count() == 0) {
LOG4CXX_ERROR(logger_, "device " << device_uid << " not found");
- LOG4CXX_TRACE(
- logger_,
- "exit with TransportAdapter::BAD_PARAM. Condition: !device.valid()");
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::BAD_PARAM. Condition: "
+ "device.use_count() == 0");
return TransportAdapter::BAD_PARAM;
}
UsbDevice* usb_device = static_cast<UsbDevice*>(device.get());
- utils::SharedPtr<UsbConnection> connection =
- utils::MakeShared<UsbConnection>(device_uid,
- app_handle,
- controller_,
- usb_handler_,
- usb_device->usb_device());
+ std::shared_ptr<UsbConnection> connection =
+ std::make_shared<UsbConnection>(device_uid,
+ app_handle,
+ controller_,
+ usb_handler_,
+ usb_device->usb_device());
controller_->ConnectionCreated(connection, device_uid, app_handle);
if (connection->Init()) {
LOG4CXX_INFO(logger_, "USB connection initialised");
diff --git a/src/components/transport_manager/test/CMakeLists.txt b/src/components/transport_manager/test/CMakeLists.txt
index 41aae296ac..240784436b 100644
--- a/src/components/transport_manager/test/CMakeLists.txt
+++ b/src/components/transport_manager/test/CMakeLists.txt
@@ -42,11 +42,18 @@ include_directories(
)
set(EXCLUDE_PATHS
+ platform_specific
raw_message_matcher.cc
)
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+set(PLATFORM_DEPENDENT_SOURCES)
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES platform_specific/linux)
+endif()
+list(APPEND SOURCES ${PLATFORM_DEPENDENT_SOURCES})
+
set(LIBRARIES
gmock
ConfigProfile
diff --git a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
index bb15c19d3b..9c7327e6fb 100644
--- a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
+++ b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
@@ -57,8 +57,8 @@ class RawMessageMatcher : public MatcherInterface<RawMessagePtr> {
virtual bool MatchAndExplain(const RawMessagePtr ptr,
MatchResultListener* listener) const;
- virtual void DescribeTo(::std::ostream* os) const;
- virtual void DescribeNegationTo(::std::ostream* os) const;
+ virtual void DescribeTo(std::ostream* os) const;
+ virtual void DescribeNegationTo(std::ostream* os) const;
private:
const RawMessagePtr ptr_;
diff --git a/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h
new file mode 100644
index 0000000000..d18500b02d
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h
@@ -0,0 +1,34 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/tcp/tcp_client_listener.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace ::transport_manager::transport_adapter;
+
+class MockTcpClientListener : public TcpClientListener {
+ public:
+ MockTcpClientListener(TransportAdapterController* controller,
+ uint16_t port,
+ bool enable_keepalive,
+ const std::string designated_interface = "")
+ : TcpClientListener(
+ controller, port, enable_keepalive, designated_interface) {}
+ MOCK_METHOD0(Init, TransportAdapter::Error());
+ MOCK_METHOD0(Terminate, void());
+ MOCK_CONST_METHOD0(IsInitialised, bool());
+ MOCK_METHOD0(StartListening, TransportAdapter::Error());
+ MOCK_METHOD0(StopListening, TransportAdapter::Error());
+ MOCK_METHOD2(OnIPAddressUpdated,
+ void(const std::string ipv4_addr, const std::string ipv6_addr));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
index 03e7630e8b..dce23189c8 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
@@ -122,6 +122,8 @@ class MockTransportAdapterListener : public TransportAdapterListener {
const ApplicationHandle&));
MOCK_METHOD1(OnTransportSwitchRequested,
void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD1(OnTransportConfigUpdated,
+ void(const TransportAdapter* transport_adapter));
};
} // namespace transport_manager_test
diff --git a/src/components/transport_manager/test/network_interface_listener_test.cc b/src/components/transport_manager/test/network_interface_listener_test.cc
new file mode 100644
index 0000000000..55a35fb4ea
--- /dev/null
+++ b/src/components/transport_manager/test/network_interface_listener_test.cc
@@ -0,0 +1,57 @@
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <time.h>
+
+#include "gtest/gtest.h"
+#include "transport_manager/tcp/network_interface_listener_impl.h"
+#include "transport_manager/tcp/mock_tcp_client_listener.h"
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kStartNotificationTimeoutMsec = 500;
+}
+
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::SaveArg;
+
+class NetworkInterfaceListenerTest : public ::testing::Test {
+ public:
+ NetworkInterfaceListenerTest()
+ : interface_listener_impl_(NULL)
+ , mock_tcp_client_listener_(NULL, 0, false, "") {}
+
+ virtual ~NetworkInterfaceListenerTest() {}
+
+ protected:
+ struct InterfaceEntry {
+ const char* name;
+ const char* ipv4_address;
+ const char* ipv6_address;
+ unsigned int flags;
+ };
+
+ void Deinit() {
+ delete interface_listener_impl_;
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
+ NetworkInterfaceListenerImpl* interface_listener_impl_;
+ MockTcpClientListener mock_tcp_client_listener_;
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
new file mode 100644
index 0000000000..da58466c29
--- /dev/null
+++ b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
@@ -0,0 +1,567 @@
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <time.h>
+
+#include "gtest/gtest.h"
+#include "platform_specific_network_interface_listener_impl.h"
+#include "transport_manager/tcp/mock_tcp_client_listener.h"
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kStartNotificationTimeoutMsec = 500;
+}
+
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::SaveArg;
+
+class NetworkInterfaceListenerTest : public ::testing::Test {
+ public:
+ NetworkInterfaceListenerTest()
+ : interface_listener_impl_(NULL)
+ , mock_tcp_client_listener_(NULL, 0, false, "") {}
+
+ virtual ~NetworkInterfaceListenerTest() {}
+
+ protected:
+ struct InterfaceEntry {
+ const char* name;
+ const char* ipv4_address;
+ const char* ipv6_address;
+ unsigned int flags;
+ };
+
+ void Init(const std::string interface_name) {
+ interface_listener_impl_ = new PlatformSpecificNetworkInterfaceListener(
+ &mock_tcp_client_listener_, interface_name);
+ // disable events from actual network interfaces
+ interface_listener_impl_->SetTesting(true);
+ }
+
+ void Deinit() {
+ delete interface_listener_impl_;
+ }
+
+ void SetDummyInterfaceTable(struct InterfaceEntry* entries) {
+ InterfaceStatusTable dummy_table;
+
+ while (entries->name != NULL) {
+ InterfaceStatus status;
+ if (entries->ipv4_address != NULL) {
+ struct in_addr addr;
+ ASSERT_EQ(1, inet_pton(AF_INET, entries->ipv4_address, &addr));
+ status.SetIPv4Address(&addr);
+ }
+ if (entries->ipv6_address != NULL) {
+ struct in6_addr addr6;
+ ASSERT_EQ(1, inet_pton(AF_INET6, entries->ipv6_address, &addr6));
+ status.SetIPv6Address(&addr6);
+ }
+ status.SetFlags(entries->flags);
+
+ dummy_table.insert(std::make_pair(entries->name, status));
+ entries++;
+ }
+
+ interface_listener_impl_->OverwriteStatusTable(dummy_table);
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
+ PlatformSpecificNetworkInterfaceListener* interface_listener_impl_;
+ MockTcpClientListener mock_tcp_client_listener_;
+};
+
+TEST_F(NetworkInterfaceListenerTest, Init) {
+ Init("");
+
+ EXPECT_TRUE(interface_listener_impl_->Init());
+ EXPECT_TRUE(0 <= interface_listener_impl_->GetSocket());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Deinit) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ interface_listener_impl_->Deinit();
+
+ EXPECT_EQ(-1, interface_listener_impl_->GetSocket());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Start_success) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ SetDummyInterfaceTable(entries);
+
+ // after stated, it is expected that the listener notifies current IP address
+ // (if it's available)
+ TestAsyncWaiter waiter;
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries[0].ipv4_address, ""))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+
+ // the "isThreadRunning_" flag of the thread will be update slightly later
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->GetThread()->is_running());
+
+ EXPECT_TRUE(waiter.WaitFor(1, kStartNotificationTimeoutMsec));
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Start_twice) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(interface_listener_impl_->Start());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_success) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->Stop());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(interface_listener_impl_->GetThread()->is_running());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_twice) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->Stop());
+
+ EXPECT_FALSE(interface_listener_impl_->Stop());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_without_Start) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ EXPECT_FALSE(interface_listener_impl_->Stop());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressChanged) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "5.6.7.8", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+
+ // this test case doesn't call Start() - we only check the behavior of
+ // NotifyIPAddresses()
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries2[0].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressNotChanged) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "172.16.23.30", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ // OnIPAddressUpdated() shouldn't be notified
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(0);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_GoesUnavailable) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address,
+ entries1[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Removed) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address,
+ entries1[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Added) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries2[1].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SelectInterface) {
+ // automatically select network interface
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ std::string output_ipv4_address;
+ std::string output_ipv6_address;
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&output_ipv4_address),
+ SaveArg<1>(&output_ipv6_address)));
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ std::string selected_interface =
+ interface_listener_impl_->GetSelectedInterfaceName();
+
+ // the interface listener should pick one of the interfaces
+ EXPECT_TRUE((selected_interface == entries[0].name &&
+ output_ipv4_address == entries[0].ipv4_address &&
+ output_ipv6_address == "") ||
+ (selected_interface == entries[1].name &&
+ output_ipv4_address == entries[1].ipv4_address &&
+ output_ipv6_address == entries[1].ipv6_address));
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest,
+ AutoSelectInterface_SkipUnavailableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ // dummy_int1 should not be selected
+ struct InterfaceEntry* expected = &entries[1];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address,
+ expected->ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SkipEmptyInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"net_dummy2", NULL, NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ // net_dummy2 should not be selected
+ struct InterfaceEntry* expected = &entries[0];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest,
+ AutoSelectInterface_SkipLoopbackInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING | IFF_LOOPBACK},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ // dummy_int1 should not be selected
+ struct InterfaceEntry* expected = &entries[1];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address,
+ expected->ipv6_address)).Times(1);
+
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_DisableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"net_dummy0", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make the interface "not running"
+ entries[0].flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ("", interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_EnableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"net_dummy0", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make the interface "not running"
+ entries[0].flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make it running again
+ entries[0].flags |= IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries[0].ipv4_address,
+ entries[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(entries[0].name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SwitchInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1",
+ "10.10.10.12",
+ "fd53:ba79:241d:30c1::78",
+ IFF_UP | IFF_RUNNING},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ const std::string selected_interface =
+ interface_listener_impl_->GetSelectedInterfaceName();
+ struct InterfaceEntry* selected = &entries[0];
+ while (selected->name != NULL) {
+ if (selected->name == selected_interface) {
+ break;
+ }
+ selected++;
+ }
+ ASSERT_TRUE(selected->name != NULL);
+
+ // make the interface "not running"
+ selected->flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ struct InterfaceEntry* switched;
+ if (selected == &entries[0]) {
+ switched = &entries[1];
+ } else {
+ switched = &entries[0];
+ }
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(switched->ipv4_address,
+ switched->ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(switched->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc
index b179f63ece..5205d6ae3c 100644
--- a/src/components/transport_manager/test/tcp_client_listener_test.cc
+++ b/src/components/transport_manager/test/tcp_client_listener_test.cc
@@ -30,21 +30,38 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <time.h>
+
#include "gtest/gtest.h"
#include "transport_manager/transport_adapter/mock_transport_adapter.h"
#include "transport_manager/tcp/tcp_client_listener.h"
+#include "transport_manager/tcp/network_interface_listener.h"
#include "transport_manager/mock_transport_manager.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
-#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/transport_adapter/mock_device.h"
+
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
namespace test {
namespace components {
namespace transport_manager_test {
+using ::testing::_;
+using ::testing::AtLeast;
using ::testing::Return;
using namespace ::transport_manager;
using namespace ::transport_manager::transport_adapter;
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kConnectionCreatedTimeoutMsec = 200;
+}
+
class MockTransportAdapterController : public TransportAdapterController {
public:
MOCK_METHOD1(AddDevice, DeviceSptr(DeviceSptr device));
@@ -95,37 +112,491 @@ class MockTransportAdapterController : public TransportAdapterController {
MOCK_METHOD2(DeviceDisconnected,
void(const DeviceUID& device_handle,
const DisconnectDeviceError& error));
+ MOCK_METHOD1(TransportConfigUpdated,
+ void(const transport_manager::transport_adapter::TransportConfig&
+ new_config));
};
-class TcpClientListenerTest : public ::testing::Test {
+class MockNetworkInterfaceListener : public NetworkInterfaceListener {
+ public:
+ MOCK_METHOD0(Init, bool());
+ MOCK_METHOD0(Deinit, void());
+ MOCK_METHOD0(Start, bool());
+ MOCK_METHOD0(Stop, bool());
+};
+
+class TcpClientListenerTest : public ::testing::TestWithParam<std::string> {
public:
TcpClientListenerTest()
- : port_(0)
+ : port_(0) /* On Linux, binding to port 0 lets the system choose an
+ available port */
, enable_keep_alive_(false)
- , tcp_client_listener_(
- &adapter_controller_mock_, port_, enable_keep_alive_) {}
+ , interface_listener_mock_(NULL)
+ , tcp_client_listener_(NULL) {}
+ virtual ~TcpClientListenerTest() {
+ delete tcp_client_listener_;
+ }
protected:
+ void SetUp() OVERRIDE {
+ tcp_client_listener_ = new TcpClientListener(
+ &adapter_controller_mock_, port_, enable_keep_alive_, GetParam());
+ interface_listener_mock_ = new MockNetworkInterfaceListener();
+ tcp_client_listener_->set_testing(true);
+ tcp_client_listener_->set_network_interface_listener(
+ interface_listener_mock_);
+ }
+
+ bool InterfaceNameSpecified() const {
+ return "" != GetParam();
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
uint16_t port_;
bool enable_keep_alive_;
MockTransportAdapterController adapter_controller_mock_;
- TcpClientListener tcp_client_listener_;
+ MockNetworkInterfaceListener* interface_listener_mock_;
+ TcpClientListener* tcp_client_listener_;
};
-TEST_F(TcpClientListenerTest, Ctor_test) {
- EXPECT_EQ(0, tcp_client_listener_.port());
- EXPECT_TRUE(NULL != tcp_client_listener_.thread());
- EXPECT_EQ(-1, tcp_client_listener_.get_socket());
+TEST_P(TcpClientListenerTest, Ctor_test) {
+ EXPECT_EQ(0, tcp_client_listener_->port());
+ EXPECT_TRUE(NULL != tcp_client_listener_->thread());
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+}
+
+TEST_P(TcpClientListenerTest, IsInitialised) {
+ // should return false until Init() is called
+ EXPECT_FALSE(tcp_client_listener_->IsInitialised());
+}
+
+TEST_P(TcpClientListenerTest, Init) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ if (InterfaceNameSpecified()) {
+ // TcpClientListener will create socket once IP address of the network is
+ // notified.
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+ } else {
+ // Interface name is not designated. In this case, TcpClientListener will
+ // create socket with Init().
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+ }
+
+ EXPECT_TRUE(tcp_client_listener_->IsInitialised());
+
+ // Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, Terminate) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+
+ tcp_client_listener_->Terminate();
+
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+}
+
+TEST_P(TcpClientListenerTest, StartListening) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ // the "isThreadRunning_" flag of the thread will be update slightly later
+ SleepFor(kThreadStartWaitMsec);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ } else {
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ // Stop() and Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StartListening_twice) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ // call again
+ EXPECT_EQ(TransportAdapter::BAD_STATE,
+ tcp_client_listener_->StartListening());
+
+ // Stop() and Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StopListening) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StopListening());
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StopListening_twice) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StopListening());
+
+ // call again
+ EXPECT_EQ(TransportAdapter::BAD_STATE, tcp_client_listener_->StopListening());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
-TEST_F(TcpClientListenerTest, IsInitialised) {
- EXPECT_TRUE(tcp_client_listener_.IsInitialised());
+TEST_P(TcpClientListenerTest, ClientConnection) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ if (InterfaceNameSpecified()) {
+ // set up a server socket by notifying a dummy IP address
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(1);
+ tcp_client_listener_->OnIPAddressUpdated(std::string("192.168.1.1"),
+ std::string(""));
+ }
+
+ // get the port number (assigned by system) that the socket is listening on
+ struct sockaddr_in server_addr;
+ socklen_t server_addr_len = sizeof(server_addr);
+ EXPECT_EQ(0,
+ getsockname(tcp_client_listener_->get_socket(),
+ reinterpret_cast<struct sockaddr*>(&server_addr),
+ &server_addr_len));
+
+ // try connecting to the socket
+ struct sockaddr_in client_addr;
+ client_addr.sin_family = AF_INET;
+ client_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ client_addr.sin_port = server_addr.sin_port;
+ socklen_t client_addr_len = sizeof(client_addr);
+
+ int s = socket(AF_INET, SOCK_STREAM, 0);
+ EXPECT_TRUE(0 <= s);
+
+ TestAsyncWaiter waiter;
+
+ // controller should be notified of AddDevice event
+ DeviceSptr mock_device = std::make_shared<MockTCPDevice>(
+ htonl(INADDR_LOOPBACK), "dummy_tcp_device");
+ EXPECT_CALL(adapter_controller_mock_, AddDevice(_))
+ .WillOnce(Return(mock_device));
+ EXPECT_CALL(adapter_controller_mock_, ConnectionCreated(_, _, _))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ // adapter_controller_mock_ may also receive ConnectDone() and
+ // ConnectionFinished() from ThreadedSocketConnection. Ignore them as hey are
+ // not part ly client listener's tests.
+ EXPECT_CALL(adapter_controller_mock_, ConnectDone(_, _)).Times(AtLeast(0));
+ EXPECT_CALL(adapter_controller_mock_, ConnectionFinished(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_EQ(0,
+ connect(s,
+ reinterpret_cast<struct sockaddr*>(&client_addr),
+ client_addr_len));
+
+ // since the connection is handled on another thread, wait for some time
+ EXPECT_TRUE(waiter.WaitFor(1, kConnectionCreatedTimeoutMsec));
+
+ close(s);
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
-TEST_F(TcpClientListenerTest, Init) {
- EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_.Init());
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_ValidIPv4Address) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config;
+ expected_config.insert(std::make_pair(tc_enabled, "true"));
+ expected_config.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr));
+ expected_config.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(expected_config))
+ .Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ // when the client listener runs with designated interface name, it should
+ // start the thread here
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_changed) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "172.16.2.3";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_same) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "192.168.1.1"; // same as before
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ // client listener should not generate TransportConfigUpdated event
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(0);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_disabled) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "false"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_reenabled) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "false"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_3 = "192.168.1.1";
+ TransportConfig expected_config_3;
+ expected_config_3.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_3.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_3));
+ expected_config_3.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_3)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_3, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_EmptyIPv4Address) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr = "";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ // if the client listener receives an empty IP address after started, it
+ // should ignore it
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(0);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+INSTANTIATE_TEST_CASE_P(NetworkInterfaceName,
+ TcpClientListenerTest,
+ ::testing::Values(std::string(""),
+ std::string("dummy_interface0")));
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
index dd587569d3..959180948a 100644
--- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc
+++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
@@ -41,13 +41,12 @@
#include "transport_manager/tcp/mock_tcp_transport_adapter.h"
#include "transport_manager/mock_transport_manager_settings.h"
-#include "utils/make_shared.h"
-
namespace test {
namespace components {
namespace transport_manager_test {
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::_;
using namespace ::protocol_handler;
@@ -61,6 +60,13 @@ class TcpAdapterTest : public ::testing::Test {
resumption::LastStateImpl last_state_;
const uint32_t port = 12345;
const std::string string_port = "12345";
+ std::string network_interface = "";
+
+ void SetUp() OVERRIDE {
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
+ }
};
TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
@@ -68,7 +74,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ std::shared_ptr<MockTCPDevice> mockdev =
+ std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -79,7 +86,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
.WillOnce(Return(mock_connection));
@@ -107,13 +114,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -125,7 +132,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) {
const int app_handle = 1;
std::vector<int> intList = {app_handle};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -162,13 +169,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) {
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -182,7 +189,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) {
std::vector<int> intList = {app_handle[0], app_handle[1], app_handle[2]};
const std::string ports[connection_count] = {"11111", "67890", "98765"};
const int int_port[connection_count] = {11111, 67890, 98765};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -220,7 +227,7 @@ TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ auto mockdev = std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -257,7 +264,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ std::shared_ptr<MockTCPDevice> mockdev =
+ std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -268,7 +276,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
.WillOnce(Return(mock_connection));
@@ -292,13 +300,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -310,7 +318,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
const int app_handle = 1;
std::vector<int> intList = {app_handle};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -339,6 +347,37 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
}
}
+TEST_F(TcpAdapterTest, NotifyTransportConfigUpdated) {
+ MockTransportAdapterListener mock_adapter_listener;
+
+ MockTCPTransportAdapter transport_adapter(
+ port, last_state_, transport_manager_settings);
+ transport_adapter.AddListener(&mock_adapter_listener);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ EXPECT_CALL(mock_adapter_listener, OnTransportConfigUpdated(_)).Times(1);
+
+ transport_adapter.TransportConfigUpdated(config);
+}
+
+TEST_F(TcpAdapterTest, GetTransportConfiguration) {
+ MockTCPTransportAdapter transport_adapter(
+ port, last_state_, transport_manager_settings);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ transport_adapter.TransportConfigUpdated(config);
+
+ EXPECT_EQ(config, transport_adapter.GetTransportConfiguration());
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc
index 14b8850b49..a5d08035ae 100644
--- a/src/components/transport_manager/test/transport_adapter_listener_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc
@@ -129,7 +129,7 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) {
TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
unsigned char data[3] = {0x20, 0x07, 0x01};
::protocol_handler::RawMessagePtr data_container =
- new ::protocol_handler::RawMessage(1, 1, data, 3);
+ std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3);
EXPECT_CALL(tr_mock,
ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_SEND_DONE,
@@ -145,7 +145,7 @@ TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
TEST_F(TransportAdapterListenerTest, OnDataSendFailed) {
unsigned char data[3] = {0x20, 0x07, 0x01};
::protocol_handler::RawMessagePtr data_container =
- new ::protocol_handler::RawMessage(1, 1, data, 3);
+ std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3);
DataSendError err;
EXPECT_CALL(tr_mock,
@@ -230,6 +230,15 @@ TEST_F(TransportAdapterListenerTest, OnUnexpectedDisconnect) {
&adapter_mock, dev_id, app_handle, err);
}
+TEST_F(TransportAdapterListenerTest, OnTransportConfigUpdated) {
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnTransportConfigUpdated(&adapter_mock);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc
index 6d709e0c17..9e602332c6 100644
--- a/src/components/transport_manager/test/transport_adapter_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_test.cc
@@ -45,7 +45,7 @@
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
+
#include "resumption/last_state_impl.h"
#include "config_profile/profile.h"
@@ -156,10 +156,10 @@ TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev = new MockDevice(dev_id, uniq_id);
+ auto mockdev = std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
- std::vector<utils::SharedPtr<Device> > devList;
+ std::vector<std::shared_ptr<Device> > devList;
devList.push_back(mockdev);
EXPECT_CALL(*mockdev, IsSameAs(_)).WillOnce(Return(true));
@@ -189,8 +189,8 @@ TEST_F(TransportAdapterTest, AddDevice) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
@@ -277,8 +277,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -307,7 +307,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) {
EXPECT_CALL(*serverMock, IsInitialised()).Times(0);
EXPECT_CALL(*serverMock, CreateConnection(_, _)).Times(0);
EXPECT_CALL(transport_adapter, FindDevice(uniq_id))
- .WillOnce(Return(utils::SharedPtr<MockDevice>()));
+ .WillOnce(Return(std::shared_ptr<MockDevice>()));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::BAD_PARAM, res);
@@ -323,8 +323,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -354,8 +354,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -401,7 +401,7 @@ TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -425,8 +425,8 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -443,7 +443,7 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
EXPECT_CALL(*mock_connection, Disconnect())
@@ -467,8 +467,8 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
@@ -485,8 +485,8 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
- utils::SharedPtr<MockConnection> mock_connection =
- utils::MakeShared<MockConnection>();
+ std::shared_ptr<MockConnection> mock_connection =
+ std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
@@ -545,7 +545,7 @@ TEST_F(TransportAdapterTest, SendData) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -553,7 +553,8 @@ TEST_F(TransportAdapterTest, SendData) {
const unsigned int kSize = 3;
unsigned char data[kSize] = {0x20, 0x07, 0x01};
- const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize);
+ const RawMessagePtr kMessage =
+ std::make_shared<RawMessage>(1, 1, data, kSize);
EXPECT_CALL(*mock_connection, SendData(kMessage))
.WillOnce(Return(TransportAdapter::OK));
@@ -586,12 +587,13 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
const unsigned int kSize = 3;
unsigned char data[kSize] = {0x20, 0x07, 0x01};
- const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize);
+ const RawMessagePtr kMessage =
+ std::make_shared<RawMessage>(1, 1, data, kSize);
EXPECT_CALL(*mock_connection, SendData(kMessage)).Times(0);
res = transport_adapter.SendData(dev_id, app_handle, kMessage);
@@ -712,8 +714,8 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -744,7 +746,7 @@ TEST_F(TransportAdapterTest, FindEstablishedConnection) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -763,14 +765,14 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_NoDeviseWithAskedId_UNSUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
- utils::SharedPtr<MockDevice> mock_device =
- utils::MakeShared<MockDevice>("test_device_name", "test_device_uid0");
+ std::shared_ptr<MockDevice> mock_device =
+ std::make_shared<MockDevice>("test_device_name", "test_device_uid0");
transport_adapter.AddDevice(mock_device);
EXPECT_CALL(*mock_device, LaunchApp(bundle_id)).Times(0);
EXPECT_CALL(transport_adapter, FindDevice("test_device_uid1"))
- .WillOnce(Return(utils::SharedPtr<MockDevice>()));
+ .WillOnce(Return(std::shared_ptr<MockDevice>()));
transport_adapter.RunAppOnDevice("test_device_uid1", bundle_id);
}
@@ -782,8 +784,8 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_DeviseWithAskedIdWasFound_SUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
- utils::SharedPtr<MockDevice> mock_device =
- utils::MakeShared<MockDevice>("test_device_name", device_uid);
+ std::shared_ptr<MockDevice> mock_device =
+ std::make_shared<MockDevice>("test_device_name", device_uid);
transport_adapter.AddDevice(mock_device);
@@ -800,7 +802,7 @@ TEST_F(TransportAdapterTest, StopDevice) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- auto mockdev = utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ auto mockdev = std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
@@ -809,6 +811,35 @@ TEST_F(TransportAdapterTest, StopDevice) {
transport_adapter.StopDevice(uniq_id);
}
+TEST_F(TransportAdapterTest, TransportConfigUpdated) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ MockTransportAdapterListener mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ EXPECT_CALL(mock_listener, OnTransportConfigUpdated(_));
+ transport_adapter.TransportConfigUpdated(config);
+}
+
+TEST_F(TransportAdapterTest, GetTransportConfigration) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ TransportConfig empty_config;
+
+ EXPECT_EQ(empty_config, transport_adapter.GetTransportConfiguration());
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_manager_default_test.cc b/src/components/transport_manager/test/transport_manager_default_test.cc
index d095a51cb6..8e8a964228 100644
--- a/src/components/transport_manager/test/transport_manager_default_test.cc
+++ b/src/components/transport_manager/test/transport_manager_default_test.cc
@@ -74,6 +74,10 @@ TEST(TestTransportManagerDefault, Init_LastStateNotUsed) {
.WillRepeatedly(Return(false));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
.WillRepeatedly(Return(12345u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
@@ -106,6 +110,10 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed) {
.WillRepeatedly(Return(true));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
.WillRepeatedly(Return(12345u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
@@ -137,6 +145,10 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed_InvalidPort) {
.WillRepeatedly(Return(true));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
.WillRepeatedly(Return(1u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
index eebb247908..5f13adcd44 100644
--- a/src/components/transport_manager/test/transport_manager_impl_test.cc
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -42,8 +42,7 @@
#include "transport_manager/mock_transport_manager_impl.h"
#include "transport_manager/mock_transport_manager_settings.h"
#include "resumption/last_state_impl.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/test_async_waiter.h"
using ::testing::_;
@@ -55,7 +54,7 @@ using ::testing::DoAll;
using ::protocol_handler::RawMessage;
using ::protocol_handler::RawMessagePtr;
-using utils::MakeShared;
+using std::make_shared;
namespace test {
namespace components {
@@ -85,7 +84,7 @@ class TransportManagerImplTest : public ::testing::Test {
"app_info_storage");
tm_.Init(last_state_);
mock_adapter_ = new MockTransportAdapter();
- tm_listener_ = MakeShared<MockTransportManagerListener>();
+ tm_listener_ = std::make_shared<MockTransportManagerListener>();
#ifdef TELEMETRY_MONITOR
tm_.SetTelemetryObserver(&mock_metric_observer_);
@@ -96,14 +95,14 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(mock_adapter_));
connection_key_ = 1;
- error_ = MakeShared<BaseError>();
+ error_ = std::make_shared<BaseError>();
const unsigned int version_protocol_ = 1;
const unsigned int kSize = 12;
unsigned char data[kSize] = {
0x20, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- test_message_ =
- MakeShared<RawMessage>(connection_key_, version_protocol_, data, kSize);
+ test_message_ = std::make_shared<RawMessage>(
+ connection_key_, version_protocol_, data, kSize);
}
DeviceInfo ConstructDeviceInfo(const std::string& mac_address,
@@ -331,7 +330,7 @@ class TransportManagerImplTest : public ::testing::Test {
#endif // TELEMETRY_MONITOR
MockTransportAdapter* mock_adapter_;
- utils::SharedPtr<MockTransportManagerListener> tm_listener_;
+ std::shared_ptr<MockTransportManagerListener> tm_listener_;
MockTransportManagerImpl tm_;
const ApplicationHandle application_id_ = 1;
ConnectionUID connection_key_;
@@ -1144,7 +1143,7 @@ TEST_F(TransportManagerImplTest,
test_message_,
error_));
- auto second_mock_adapter = utils::MakeShared<MockTransportAdapter>();
+ auto second_mock_adapter = std::make_shared<MockTransportAdapter>();
const auto usb_serial = "USB_serial";
DeviceInfo second_device =
@@ -1220,7 +1219,7 @@ TEST_F(TransportManagerImplTest,
test_message_,
error_));
- auto second_mock_adapter = utils::MakeShared<MockTransportAdapter>();
+ auto second_mock_adapter = std::make_shared<MockTransportAdapter>();
DeviceInfo second_device =
ConstructDeviceInfo("MA:CA:DR:ES:S", "USB_IOS", "SecondDeviceName");
@@ -1323,6 +1322,29 @@ TEST_F(TransportManagerImplTest,
tm_.OnDeviceListUpdated(mock_adapter_);
}
+TEST_F(TransportManagerImplTest, OnTransportConfigUpdated) {
+ TransportAdapterEvent test_event(EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED,
+ mock_adapter_,
+ "",
+ 0,
+ test_message_,
+ error_);
+
+ transport_adapter::TransportConfig config;
+ config[transport_manager::transport_adapter::tc_enabled] =
+ std::string("true");
+ config[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string("192.168.1.1");
+ config[transport_manager::transport_adapter::tc_tcp_port] =
+ std::string("12345");
+
+ EXPECT_CALL(*mock_adapter_, GetTransportConfiguration())
+ .WillOnce(Return(config));
+
+ EXPECT_CALL(*tm_listener_, OnTransportConfigUpdated(config));
+ tm_.TestHandle(test_event);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index 51835c125a..98da4cf2ab 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -38,7 +38,9 @@ include_directories (
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/media_manager/include
${COMPONENTS_DIR}/protocol_handler/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src
)
# dbms
@@ -101,7 +103,7 @@ set(PATHS
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- # --- QDB Wrapper
+ # --- QDB Wrapper
add_subdirectory(./src/qdb_wrapper)
else ()
# --- SQLite Wrapper
@@ -109,14 +111,21 @@ else ()
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- list(APPEND LIBRARIES dl pthread ${RTLIB})
+ list(APPEND LIBRARIES dl pthread ${RTLIB})
endif()
add_library("Utils" ${SOURCES})
+GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_thread -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_date_time -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_filesystem -L${BOOST_LIBS_DIRECTORY})
target_link_libraries("Utils" ${LIBRARIES})
+add_dependencies("Utils" Boost)
+
if(ENABLE_LOG)
- add_dependencies("Utils" install-3rd_party_logger)
+ add_dependencies("Utils" install-3rd_party_logger Boost)
endif()
if(BUILD_TESTS)
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index 22c200934f..e26fef34bb 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -33,17 +33,19 @@
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
-#include <string.h>
#include <stdint.h>
+#include <string.h>
+#include <fstream>
+#include <iostream>
#include <string>
#include <vector>
-#include <iostream>
-#include <fstream>
+#include <time.h>
namespace file_system {
/**
- * @brief Get available disc space.
+ * @brief Get available disc space of directory. Returns 0 if the directory does
+ * not exist.
*
* @param path to directory
* @return free disc space.
@@ -51,22 +53,23 @@ namespace file_system {
uint64_t GetAvailableDiskSpace(const std::string& path);
/*
- * @brief Get size of current directory
+ * @brief Get size of given directory
*
* @param path to directory
+ * @return size of directory, return 0 if dir not exist
*/
size_t DirectorySize(const std::string& path);
/*
- * @brief Get size of current file
+ * @brief Get size of given file
*
* @param path to file
* @return size of file, return 0 if file not exist
*/
-int64_t FileSize(const std::string& path);
+uint64_t FileSize(const std::string& path);
/**
- * @brief Creates directory
+ * @brief Creates directory with owner_all permissions
* @param name path to directory
* @return path to created directory.
*/
@@ -80,76 +83,75 @@ std::string CreateDirectory(const std::string& name);
bool CreateDirectoryRecursively(const std::string& path);
/**
- * @brief Checks the file to see whether the file is a directory
- * @param name path to file
- * @return returns true if file is directory.
- */
+ * @brief Checks the file to see whether the file is a directory
+ * @param name path to file
+ * @return returns true if file is directory.
+ */
bool IsDirectory(const std::string& name);
/**
- * @brief Is directory exist
- * @param name path to directory
- * @return returns true if directory is exists.
- */
+ * @brief Does directory exist
+ * @param name path to directory
+ * @return returns true if the file exists and is a directory.
+ */
bool DirectoryExists(const std::string& name);
/**
- * @brief Is file exist
- * @param name path to file
- * @return returns true if file is exists.
- */
+ * @brief Does file exist
+ * @param name path to file
+ * @return returns true if the file exists.
+ */
bool FileExists(const std::string& name);
/**
- * @brief Writes to file
- *
- * @remark - create file if it doesn't exist
- * @param name path to file
- * @param data data to write
- * @return returns true if the operation is successfully.
- */
+ * @brief Writes to file
+ *
+ * @remark - create file if it doesn't exist
+ * @param name path to file
+ * @param data data to write
+ * @return returns true if the operation is successful.
+ */
bool Write(const std::string& file_name,
const std::vector<uint8_t>& data,
std::ios_base::openmode mode = std::ios_base::out);
/**
- * @brief Opens file stream for writing
- * @param file_name path to file to write data to
- * @return returns pointer to opened stream in case of success;
- * otherwise returns NULL
- */
+ * @brief Opens file stream for writing
+ * @param file_name path to file to write data to
+ * @return returns pointer to opened stream in case of success;
+ * otherwise returns NULL
+ */
std::ofstream* Open(const std::string& file_name,
std::ios_base::openmode mode = std::ios_base::out);
/**
- * @brief Writes to file stream
- * @param file_stream file stream to be written to
- * @param data data to be written to file
- * @param data_size size of data to be written to file
- * @return returns true if the operation is successfully.
- */
+ * @brief Writes to file stream
+ * @param file_stream file stream to be written to
+ * @param data data to be written to file
+ * @param data_size size of data to be written to file
+ * @return returns true if the operation is successful.
+ */
bool Write(std::ofstream* const file_stream,
const uint8_t* data,
uint32_t data_size);
/**
- * @brief Closes file stream
- * @param file_stream file stream to be closed
- */
+ * @brief Closes file stream
+ * @param file_stream file stream to be closed
+ */
void Close(std::ofstream* file_stream);
/**
- * @brief Returns current working directory path
- * If filename begins with "/", return unchanged filename
- * @param name file name
- * @return returns full file path.
- */
+ * @brief Returns current working directory path
+ * @return returns full file path.
+ */
std::string CurrentWorkingDirectory();
/**
- * @brief Allows to obtaine absolute path for certain path.
- * @param path the file name for which absolute path have to be calculated.
- * @return absolute path for certain path.
+ * @brief Convert a path to its absolute form.
+ * @param path the file name to convert.
+ * @return corresponding absolute path for a valid path, otherwise an empty
+ * string.
*/
std::string GetAbsolutePath(const std::string& path);
@@ -162,55 +164,63 @@ std::string GetAbsolutePath(const std::string& path);
bool IsFileNameValid(const std::string& file_name);
/**
- * @brief Removes file
- *
- * @param name path to file
- * @return returns true if the file is successfully deleted.
- */
+ * @brief Removes file
+ *
+ * @param name path to file
+ * @return returns true if the file is successfully deleted.
+ */
bool DeleteFile(const std::string& name);
/**
+ * @brief Removes contents of directory but not directory itself
+ *
+ * @param directory_name path to directory.
+ */
+void remove_directory_content(const std::string& directory_name);
+
+/**
* @brief Removes directory.
*
- * @param name path to directory.
+ * @param directory_name path to directory.
* @param is_recursively true if you need delete directory recursively,
- *otherwise false.
+ * otherwise false. A non-empty directory with is_recursively == false will
+ * return false.
* @return returns true if the directory is successfully deleted.
*/
bool RemoveDirectory(const std::string& directory_name,
bool is_recursively = true);
/**
- * @brief Check access rights
- *
- * @param name path to file.
- * @param how Read/write attribute.
- * @return returns true if file has the given mode.
- */
+ * @brief Check access rights
+ *
+ * @param name path to file.
+ * @param how Read/write attribute.
+ * @return returns true if file has the given mode.
+ */
bool IsAccessible(const std::string& name, int32_t how);
/**
- * @brief Check access rights for writing
- *
- * @param name path to file or folder
- * @return returns true if has access rights.
- */
+ * @brief Check access rights for writing
+ *
+ * @param name path to file or folder
+ * @return returns true if has access rights.
+ */
bool IsWritingAllowed(const std::string& name);
/**
- * @brief Check access rights for reading
- *
- * @param name path to file.
- * @return returns true if file has access rights.
- */
+ * @brief Check access rights for reading
+ *
+ * @param name path to file.
+ * @return returns true if file has access rights.
+ */
bool IsReadingAllowed(const std::string& name);
/**
- * @brief Lists all files in given directory
- *
- * @param name path to directory.
- * @return returns list of files.
- */
+ * @brief Lists all files in given directory
+ *
+ * @param name path to directory.
+ * @return returns list of files.
+ */
std::vector<std::string> ListFiles(const std::string& directory_name);
/**
@@ -223,30 +233,30 @@ bool WriteBinaryFile(const std::string& name,
const std::vector<uint8_t>& contents);
/**
- * @brief Reads from file
- *
- * @param name path to file
- * @param result read data
- * @return returns true if the operation is successfully.
- */
+ * @brief Reads from file
+ *
+ * @param name path to file
+ * @param result read data
+ * @return returns true if the operation is successfully.
+ */
bool ReadBinaryFile(const std::string& name, std::vector<uint8_t>& result);
bool ReadFile(const std::string& name, std::string& result);
/**
- * @brief Convert special symbols in system path to percent-encoded
- *
- * @param name path to file
- * @return returns converted path.
-*/
+ * @brief Convert special symbols in system path to percent-encoded
+ *
+ * @param name path to file
+ * @return returns converted path.
+ */
const std::string ConvertPathForURL(const std::string& path);
/**
- * @brief Create empty file
- *
- * @param name path to file
- * @return if result success return true
-*/
+ * @brief Create empty file
+ *
+ * @param name path to file
+ * @return if result success return true
+ */
bool CreateFile(const std::string& path);
/**
@@ -254,28 +264,26 @@ bool CreateFile(const std::string& path);
* @param path Path to file
* @return Modification time in nanoseconds
*/
-uint64_t GetFileModificationTime(const std::string& path);
+time_t GetFileModificationTime(const std::string& path);
/**
- * @brief Copy file from source to destination
- *
- * @param src Source file path
- * @param dst Destination file path
- * @return if result success return true
-*/
+ * @brief Copy file from source to destination
+ *
+ * @param src Source file path
+ * @param dst Destination file path
+ * @return if result success return true
+ */
bool CopyFile(const std::string& src, const std::string& dst);
/**
- * @brief Move file from source to destination
- *
- * @param src Source file path
- * @param dst Destination file path
- * @return if result success return true
-*/
+ * @brief Move file from source to destination
+ *
+ * @param src Source file path
+ * @param dst Destination file path
+ * @return if result success return true
+ */
bool MoveFile(const std::string& src, const std::string& dst);
-void remove_directory_content(const std::string& directory_name);
-
} // namespace file_system
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
index d6a9edd072..b20b43c251 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -56,18 +56,14 @@ typedef std::queue<LogMessage> LogMessageQueue;
typedef threads::MessageLoopThread<LogMessageQueue>
LogMessageLoopThreadTemplate;
-class LogMessageHandler : public LogMessageLoopThreadTemplate::Handler {
- public:
- virtual void Handle(const LogMessage message) OVERRIDE;
-};
-
-class LogMessageLoopThread : public LogMessageLoopThreadTemplate {
+class LogMessageLoopThread : public LogMessageLoopThreadTemplate,
+ public LogMessageLoopThreadTemplate::Handler {
public:
LogMessageLoopThread();
~LogMessageLoopThread();
+ void Handle(const LogMessage message) OVERRIDE;
private:
- LogMessageHandler* handler_;
DISALLOW_COPY_AND_ASSIGN(LogMessageLoopThread);
};
diff --git a/src/components/utils/include/utils/optional.h b/src/components/utils/include/utils/optional.h
new file mode 100644
index 0000000000..0395945de0
--- /dev/null
+++ b/src/components/utils/include/utils/optional.h
@@ -0,0 +1,83 @@
+#ifndef ERROR_OR_H
+#define ERROR_OR_H
+#include <string>
+#include "utils/macro.h"
+
+namespace utils {
+
+/**
+ * @brief The Optional class is able to keep value, manage it it is empty and
+ * specify error code.
+ * Can be used as return value of function that is not guarantee that vaue will
+ * be returned
+ *
+ */
+template <typename ObjectType, typename ErrorType = std::string>
+class Optional {
+ public:
+ /**
+ * @brief The OptionalEmpty enum enum with one value to specify that Optional
+ * is not initialized
+ */
+ enum OptionalEmpty { EMPTY };
+
+ /**
+ * @brief Optional constructor with object initialization
+ * @param object object to initialize Optional
+ */
+ Optional(ObjectType& object)
+ : object_(&object), error_(), is_initialized_(true) {}
+
+ /**
+ * @brief Optional constructor with object and error initialization
+ * @param object object to initialize Optional
+ * @param error error code initialization
+ */
+ Optional(ObjectType& object, ErrorType error)
+ : object_(&object), error_(error), is_initialized_(true) {}
+
+ /**
+ * @brief Optional constructir without object initialization
+ * @param empty manadatory parameter for explicit specifying that Optional is
+ * empty
+ * @param error error code initialization
+ */
+ Optional(OptionalEmpty empty, ErrorType error)
+ : object_(nullptr), error_(error), is_initialized_(false) {}
+
+ /**
+ * @brief Optional empty optional initialization without specifying error code
+ * @param empty manadatory parameter for explicit specifying that Optional is
+ * empty
+ */
+ Optional(OptionalEmpty empty)
+ : object_(nullptr), error_(), is_initialized_(false) {}
+
+ /**
+ * @brief operator bool operator for checking if optional is initialized
+ */
+ operator bool() const {
+ return is_initialized_;
+ }
+
+ /**
+ * @brief operator * access to object
+ * @return
+ */
+ ObjectType& operator*() const {
+ DCHECK(is_initialized_);
+ return *object_;
+ }
+
+ ErrorType error() const {
+ return error_;
+ }
+
+ private:
+ ObjectType* object_;
+ ErrorType error_;
+ bool is_initialized_;
+};
+
+} // utils utils
+#endif // ERROR_OR_H
diff --git a/src/components/utils/include/utils/signals.h b/src/components/utils/include/utils/signals.h
index 72d29a9e28..bda83f315f 100644
--- a/src/components/utils/include/utils/signals.h
+++ b/src/components/utils/include/utils/signals.h
@@ -38,11 +38,61 @@ typedef void (*sighandler_t)(int);
#else
#include <signal.h>
#endif
+#include "appMain/low_voltage_signals_handler.h"
namespace utils {
-bool UnsibscribeFromTermination();
-bool WaitTerminationSignals(sighandler_t sig_handler);
+class Signals {
+ public:
+ /**
+ * @brief Unsubscribe thread from termination signals SIGINT and SIGTERM
+ * @return True if thread unsubscribed successfuly, otherwise false
+ */
+ static bool UnsubscribeFromTermination();
+
+ /**
+ * @brief Triggers thread to wait for termination signals SIGINT and SIGTERM
+ * @param sig_handler - handler to work with signals specidied above
+ * @return True if handler handles signals successfuly, otherwise false
+ */
+ static bool WaitTerminationSignals(sighandler_t sig_handler);
+
+ /**
+ * @brief Unsubscribe thread from low voltage signals
+ * SIGLOWVOLTAGE, SIGWAKEUP and SIGIGNOFF
+ * @return True if thread unsubscribed successfuly, otherwise false
+ */
+ static bool UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data);
+
+ /**
+ * @brief Sends signal to specified process
+ * @param signal to send
+ * @param destination process signal to be sent to
+ */
+ static void SendSignal(const int signo, const pid_t pid);
+
+ /**
+ * @brief Creates child process
+ * @return created process id or -1 in case of error
+ */
+ static pid_t Fork();
+
+ /**
+ * @brief Wait for child process to be terminated
+ * @param cpid - process to wait for termination
+ * @param status store status information in the int to which it points
+ * @param options - options for exit form function
+ * detailed options can be found here: https://linux.die.net/man/2/waitpid
+ */
+ static void WaitPid(pid_t cpid, int* status, int options);
+
+ /**
+ * @brief Exits for process
+ * @param status - exit status code
+ */
+ static void ExitProcess(const int status);
+};
} // namespace utils
diff --git a/src/components/utils/include/utils/system_time_handler.h b/src/components/utils/include/utils/system_time_handler.h
new file mode 100644
index 0000000000..15b2dd0cca
--- /dev/null
+++ b/src/components/utils/include/utils/system_time_handler.h
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_TIME_HANDLER_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_TIME_HANDLER_H_
+
+#include <time.h>
+
+namespace utils {
+
+/**
+ * @brief The SystemTimeListener interface.
+ * This interface allows to get notifications whenever
+ * system time appears or fails to appear.
+ */
+class SystemTimeListener {
+ public:
+ /**
+ * @brief OnSystemTimeArrived Notify about system time
+ * in utc format
+ * @param utc_time current system time.
+ */
+ virtual void OnSystemTimeArrived(const time_t utc_time) = 0;
+};
+
+/**
+ * @brief SystemTimeHandler the interface which provides the necessary
+ * public API to work with system time. The class does not implement
+ * any logic it's public api forwards call to the private virtual
+ * methods which are suppose to be defined within specific implementation.
+ */
+class SystemTimeHandler {
+ public:
+ /**
+ * @brief SystemTimeHandler creates an instance
+ * for this class.
+ */
+ SystemTimeHandler();
+
+ /**
+ * @brief QuerySystemTime provides the public interface
+ * to retrieve the system time. Interface uses private implementation
+ * hence the logic will be defined within descendant class.
+ */
+ void QuerySystemTime();
+
+ /**
+ * @brief SubscribeOnSystemTime allows to subscribe listener
+ * to the certain event. This class does not provide such storage.
+ * It rather uses private pure virtual function. So the final behaviour
+ * should be defined within the descendant class
+ */
+ void SubscribeOnSystemTime(SystemTimeListener* listener);
+
+ /**
+ * @brief UnsubscribeFromSystemTime allows to unsubscribe listener
+ * from the certain event. This class does not manipulate with storage.
+ * It rather uses private pure virtual function. So the final behaviour
+ * should be defined within the descendant class
+ */
+ void UnsubscribeFromSystemTime(SystemTimeListener* listener);
+
+ /**
+ * @brief GetUTCTime allows to obtain cached result for the
+ * GetSystemTime request
+ * @return utc time.
+ */
+ time_t GetUTCTime();
+
+ /**
+ * @brief Checks if system time is ready
+ * and can be requested by GetSystemTime request
+ * @return True if HMI is ready to provide UTC time
+ * otherwise False
+ */
+ bool system_time_can_be_received() const;
+
+ /**
+ * @brief ~SystemTimeHandler destroys the object
+ */
+ virtual ~SystemTimeHandler();
+
+ private:
+ /**
+ * @brief DoSystemTimeQuery responsible for the system time querying.
+ * It is up to implementator how exactly system is going to receive this time.
+ */
+ virtual void DoSystemTimeQuery() = 0;
+
+ /**
+ * @brief DoSubscribe implements the logic which allows to handle
+ * subscription process. The handling logic should be defined within
+ * descendant class.
+ */
+ virtual void DoSubscribe(SystemTimeListener* listener) = 0;
+
+ /**
+ * @brief DoUnsubscribe implements the logic which allows to handle
+ * unsubscription process. The handling logic should be defined within
+ * descendant class.
+ */
+ virtual void DoUnsubscribe(SystemTimeListener* listener) = 0;
+
+ /**
+ * @brief FetchSystemTime allows to obtain the cached result
+ * for the GetSystemTime request.
+ * @return utc time.
+ */
+ virtual time_t FetchSystemTime() = 0;
+
+ /**
+ * @brief Checks if UTC time is ready to provided by HMI
+ * and can be requested by GetSystemTime request
+ * @return True if HMI is ready to provide UTC time
+ * otherwise False
+ */
+ virtual bool utc_time_can_be_received() const = 0;
+};
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_TIME_HANDLER_H_
diff --git a/src/components/utils/include/utils/timer.h b/src/components/utils/include/utils/timer.h
index ab3d48ef6f..e391db992c 100644
--- a/src/components/utils/include/utils/timer.h
+++ b/src/components/utils/include/utils/timer.h
@@ -218,7 +218,7 @@ class Timer {
mutable sync_primitives::Lock state_lock_;
- mutable std::auto_ptr<TimerDelegate> delegate_;
+ mutable std::unique_ptr<TimerDelegate> delegate_;
threads::Thread* thread_;
/**
diff --git a/src/components/utils/src/conditional_variable_boost.cc b/src/components/utils/src/conditional_variable_boost.cc
new file mode 100644
index 0000000000..a74aa3eaa6
--- /dev/null
+++ b/src/components/utils/src/conditional_variable_boost.cc
@@ -0,0 +1,135 @@
+/*
+ * 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 "utils/conditional_variable.h"
+
+#include <errno.h>
+#include <time.h>
+
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include <boost/exception/diagnostic_information.hpp>
+
+namespace {
+const long kNanosecondsPerSecond = 1000000000;
+const long kMillisecondsPerSecond = 1000;
+const long kNanosecondsPerMillisecond = 1000000;
+} // namespace
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+ConditionalVariable::ConditionalVariable() {}
+
+ConditionalVariable::~ConditionalVariable() {}
+
+void ConditionalVariable::NotifyOne() {
+ cond_var_.notify_one();
+}
+
+void ConditionalVariable::Broadcast() {
+ cond_var_.notify_all();
+}
+
+bool ConditionalVariable::Wait(BaseLock& lock) {
+ // NOTE this grossness is due to boost mutex and recursive mutex not sharing a
+ // superclass
+ try {
+ lock.AssertTakenAndMarkFree();
+ // What kind of lock are we ?
+ if (Lock* test_lock = dynamic_cast<Lock*>(&lock)) {
+ // Regular lock
+ cond_var_.wait<boost::mutex>(test_lock->mutex_);
+ } else if (RecursiveLock* test_rec_lock =
+ dynamic_cast<RecursiveLock*>(&lock)) {
+ // Recursive lock
+ cond_var_.wait<boost::recursive_mutex>(test_rec_lock->mutex_);
+ } else {
+ // unknown, give up the lock
+ LOG4CXX_ERROR(logger_, "Unknown lock type!");
+ NOTREACHED();
+ }
+ lock.AssertFreeAndMarkTaken();
+ } catch (const boost::exception& error) {
+ std::string error_string = boost::diagnostic_information(error);
+ LOG4CXX_FATAL(logger_, error_string);
+ NOTREACHED();
+ }
+ return true;
+}
+
+bool ConditionalVariable::Wait(AutoLock& auto_lock) {
+ BaseLock& lock = auto_lock.GetLock();
+ return Wait(lock);
+}
+
+ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
+ AutoLock& auto_lock, uint32_t milliseconds) {
+ BaseLock& lock = auto_lock.GetLock();
+
+ WaitStatus wait_status = kNoTimeout;
+ try {
+ lock.AssertTakenAndMarkFree();
+ bool timeout = true;
+
+ // What kind of lock are we ?
+ if (Lock* test_lock = dynamic_cast<Lock*>(&lock)) {
+ // Regular lock
+ // cond_var_.wait<boost::mutex>(test_lock->mutex_);
+ timeout = cond_var_.timed_wait<boost::mutex>(
+ test_lock->mutex_, boost::posix_time::milliseconds(milliseconds));
+ } else if (RecursiveLock* test_rec_lock =
+ dynamic_cast<RecursiveLock*>(&lock)) {
+ // Recursive lock
+ // cond_var_.wait<boost::recursive_mutex>(test_rec_lock->mutex_);
+ timeout = cond_var_.timed_wait<boost::recursive_mutex>(
+ test_rec_lock->mutex_, boost::posix_time::milliseconds(milliseconds));
+ } else {
+ // this is an unknown lock, we have an issue
+ LOG4CXX_ERROR(logger_, "Unknown lock type!");
+ NOTREACHED();
+ }
+
+ if (!timeout) {
+ wait_status = kTimeout;
+ }
+ lock.AssertFreeAndMarkTaken();
+ } catch (const boost::exception& error) {
+ std::string error_string = boost::diagnostic_information(error);
+ LOG4CXX_FATAL(logger_, error_string);
+ NOTREACHED();
+ }
+
+ return wait_status;
+}
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/conditional_variable_posix.cc b/src/components/utils/src/conditional_variable_posix.cc
deleted file mode 100644
index 50ebc74556..0000000000
--- a/src/components/utils/src/conditional_variable_posix.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "utils/conditional_variable.h"
-
-#include <errno.h>
-#include <time.h>
-
-#include "utils/lock.h"
-#include "utils/logger.h"
-
-namespace {
-const long kNanosecondsPerSecond = 1000000000;
-const long kMillisecondsPerSecond = 1000;
-const long kNanosecondsPerMillisecond = 1000000;
-}
-
-namespace sync_primitives {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
-
-ConditionalVariable::ConditionalVariable() {
- pthread_condattr_t attrs;
- int initialized = pthread_condattr_init(&attrs);
- if (initialized != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to initialize "
- "conditional variable attributes");
- pthread_condattr_setclock(&attrs, CLOCK_MONOTONIC);
- initialized = pthread_cond_init(&cond_var_, &attrs);
- if (initialized != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to initialize "
- "conditional variable");
- int rv = pthread_condattr_destroy(&attrs);
- if (rv != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to destroy "
- "conditional variable attributes");
-}
-
-ConditionalVariable::~ConditionalVariable() {
- pthread_cond_destroy(&cond_var_);
-}
-
-void ConditionalVariable::NotifyOne() {
- int signaled = pthread_cond_signal(&cond_var_);
- if (signaled != 0)
- LOG4CXX_ERROR(logger_, "Failed to signal conditional variable");
-}
-
-void ConditionalVariable::Broadcast() {
- int signaled = pthread_cond_broadcast(&cond_var_);
- if (signaled != 0)
- LOG4CXX_ERROR(logger_, "Failed to broadcast conditional variable");
-}
-
-bool ConditionalVariable::Wait(Lock& lock) {
- lock.AssertTakenAndMarkFree();
- int wait_status = pthread_cond_wait(&cond_var_, &lock.mutex_);
- lock.AssertFreeAndMarkTaken();
- if (wait_status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
- return false;
- }
- return true;
-}
-
-bool ConditionalVariable::Wait(AutoLock& auto_lock) {
- Lock& lock = auto_lock.GetLock();
- lock.AssertTakenAndMarkFree();
- int wait_status = pthread_cond_wait(&cond_var_, &lock.mutex_);
- lock.AssertFreeAndMarkTaken();
- if (wait_status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
- return false;
- }
- return true;
-}
-
-ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
- AutoLock& auto_lock, uint32_t milliseconds) {
- struct timespec now;
- clock_gettime(CLOCK_MONOTONIC, &now);
- timespec wait_interval;
- wait_interval.tv_sec = now.tv_sec + (milliseconds / kMillisecondsPerSecond);
- wait_interval.tv_nsec =
- now.tv_nsec +
- (milliseconds % kMillisecondsPerSecond) * kNanosecondsPerMillisecond;
- wait_interval.tv_sec += wait_interval.tv_nsec / kNanosecondsPerSecond;
- wait_interval.tv_nsec %= kNanosecondsPerSecond;
- Lock& lock = auto_lock.GetLock();
- lock.AssertTakenAndMarkFree();
- int timedwait_status =
- pthread_cond_timedwait(&cond_var_, &lock.mutex_, &wait_interval);
- lock.AssertFreeAndMarkTaken();
- WaitStatus wait_status = kNoTimeout;
- switch (timedwait_status) {
- case 0: {
- wait_status = kNoTimeout;
- break;
- }
- case EINTR: {
- wait_status = kNoTimeout;
- break;
- }
- case ETIMEDOUT: {
- wait_status = kTimeout;
- break;
- }
- default: {
- LOG4CXX_ERROR(
- logger_,
- "Failed to timewait for conditional variable timedwait_status: "
- << timedwait_status);
- }
- }
- return wait_status;
-}
-
-} // namespace sync_primitives
diff --git a/src/components/utils/src/date_time.cc b/src/components/utils/src/date_time.cc
index fdf0926eb2..3ca6050b3f 100644
--- a/src/components/utils/src/date_time.cc
+++ b/src/components/utils/src/date_time.cc
@@ -30,94 +30,71 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/time.h>
-#include <stdint.h>
#include "utils/date_time.h"
-namespace date_time {
+#include <stdint.h>
+#include <sys/time.h>
+#include "boost/date_time/posix_time/posix_time.hpp"
-TimevalStruct DateTime::getCurrentTime() {
- TimevalStruct currentTime;
- timezone timeZone;
+namespace bpt = boost::posix_time;
+using namespace boost::date_time;
+namespace date_time {
- gettimeofday(&currentTime, &timeZone);
+/* Set of helper functions for the TimeDuration struct
+ */
- return currentTime;
+TimeDuration getCurrentTime() {
+ return bpt::microsec_clock::local_time() - bpt::from_time_t(0);
+}
+TimeDuration TimeDurationZero() {
+ return TimeDuration(0, 0, 0, 0);
+}
+int64_t getSecs(const TimeDuration& t) {
+ return t.total_seconds();
}
-int64_t date_time::DateTime::getSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec);
+int64_t getmSecs(const TimeDuration& t) {
+ return t.total_milliseconds();
}
-int64_t DateTime::getmSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec) * MILLISECONDS_IN_SECOND +
- times.tv_usec / MICROSECONDS_IN_MILLISECOND;
+int64_t getuSecs(const TimeDuration& t) {
+ return t.total_microseconds();
}
-int64_t DateTime::getuSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec) * MILLISECONDS_IN_SECOND *
- MICROSECONDS_IN_MILLISECOND +
- times.tv_usec;
+int64_t get_just_mSecs(const TimeDuration& t) {
+ return t.total_milliseconds() % MILLISECONDS_IN_SECOND;
}
-int64_t DateTime::calculateTimeSpan(const TimevalStruct& sinceTime) {
- return calculateTimeDiff(getCurrentTime(), sinceTime);
+int64_t get_just_uSecs(const TimeDuration& t) {
+ return t.total_microseconds() % MICROSECONDS_IN_SECOND;
}
-int64_t DateTime::calculateTimeDiff(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- TimevalStruct ret;
- if (Greater(times1, times2)) {
- ret = Sub(times1, times2);
- } else {
- ret = Sub(times2, times1);
- }
- return getmSecs(ret);
+int64_t calculateTimeSpan(const TimeDuration& sinceTime) {
+ return calculateTimeDiff(getCurrentTime(), sinceTime);
}
-void DateTime::AddMilliseconds(TimevalStruct& time, uint32_t milliseconds) {
- const uint32_t sec = milliseconds / MILLISECONDS_IN_SECOND;
- const uint32_t usec =
- (milliseconds % MILLISECONDS_IN_SECOND) * MICROSECONDS_IN_MILLISECOND;
- time.tv_sec += sec;
- time.tv_usec += usec;
- time = ConvertionUsecs(time);
+int64_t calculateTimeDiff(const TimeDuration& time1,
+ const TimeDuration& time2) {
+ return std::abs((time1 + -time2).total_milliseconds());
}
-TimevalStruct DateTime::Sub(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- TimevalStruct ret;
- timersub(&times1, &times2, &ret);
- return ret;
+void AddMilliseconds(TimeDuration& t, uint32_t milliseconds) {
+ t += bpt::milliseconds(milliseconds);
}
-bool DateTime::Greater(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return timercmp(&times1, &times2, > );
+bool Greater(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 > time2;
}
-bool DateTime::Less(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return timercmp(&times1, &times2, < );
+bool Less(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 < time2;
}
-bool DateTime::Equal(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return !timercmp(&times1, &times2, != );
+bool Equal(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 == time2;
}
-TimeCompare date_time::DateTime::compareTime(const TimevalStruct& time1,
- const TimevalStruct& time2) {
+TimeCompare compareTime(const TimeDuration& time1, const TimeDuration& time2) {
if (Greater(time1, time2))
return GREATER;
if (Less(time1, time2))
@@ -125,28 +102,4 @@ TimeCompare date_time::DateTime::compareTime(const TimevalStruct& time1,
return EQUAL;
}
-TimevalStruct date_time::DateTime::ConvertionUsecs(const TimevalStruct& time) {
- if (time.tv_usec >= MICROSECONDS_IN_SECOND) {
- TimevalStruct time1;
- time1.tv_sec = static_cast<int64_t>(time.tv_sec) +
- (time.tv_usec / MICROSECONDS_IN_SECOND);
- time1.tv_usec = static_cast<int64_t>(time.tv_usec) % MICROSECONDS_IN_SECOND;
- return time1;
- }
- return time;
-}
-
} // namespace date_time
-
-bool operator<(const TimevalStruct& time1, const TimevalStruct& time2) {
- return date_time::DateTime::Less(time1, time2);
-}
-
-bool operator==(const TimevalStruct& time1, const TimevalStruct& time2) {
- return date_time::DateTime::Equal(time1, time2);
-}
-
-const TimevalStruct operator-(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- return date_time::DateTime::Sub(time1, time2);
-}
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index 62a91ad1f3..f98aeda056 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -33,125 +33,114 @@
#include "utils/file_system.h"
#include "utils/logger.h"
-#include <sys/statvfs.h>
#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <sys/types.h>
#include <sstream>
#include <dirent.h>
#include <unistd.h>
// TODO(VS): lint error: Streams are highly discouraged.
-#include <fstream>
+#include <algorithm>
+#include <boost/filesystem.hpp>
#include <cstddef>
#include <cstdio>
-#include <algorithm>
+#include <fstream>
CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+// Easier reference
+namespace fs = boost::filesystem;
+using boost::system::error_code;
+
uint64_t file_system::GetAvailableDiskSpace(const std::string& path) {
- struct statvfs fsInfo = {0};
- if (statvfs(path.c_str(), &fsInfo) == 0) {
- return fsInfo.f_bsize * fsInfo.f_bfree;
- } else {
+ error_code ec;
+ fs::space_info si = fs::space(path, ec);
+
+ if (ec) {
+ // If something went wrong, assume no free space
return 0;
+ } else {
+ return si.free;
}
}
-int64_t file_system::FileSize(const std::string& path) {
- if (file_system::FileExists(path)) {
- struct stat file_info = {0};
- if (0 != stat(path.c_str(), &file_info)) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file size: " << path);
- } else {
- return file_info.st_size;
- }
+uint64_t file_system::FileSize(const std::string& path) {
+ error_code ec;
+ // Boost returns sizes as unsigned
+ uint64_t fsize = (uint64_t)fs::file_size(path, ec);
+
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file size: " << path);
+ return 0;
}
- return 0;
+ return fsize;
}
size_t file_system::DirectorySize(const std::string& path) {
- size_t size = 0;
- int32_t return_code = 0;
- DIR* directory = NULL;
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
- struct dirent* result = NULL;
- struct stat file_info = {0};
- directory = opendir(path.c_str());
- if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
- if (0 == strcmp(result->d_name, "..") ||
- 0 == strcmp(result->d_name, ".")) {
- continue;
- }
- std::string full_element_path = path + "/" + result->d_name;
- if (file_system::IsDirectory(full_element_path)) {
- size += DirectorySize(full_element_path);
- } else {
- stat(full_element_path.c_str(), &file_info);
- size += file_info.st_size;
- }
+ size_t dir_size = 0;
+ error_code ec;
+ // Recursively iterate through directory to accumulate file sizes
+ fs::recursive_directory_iterator iter(path, ec);
+ // Directory does not exist
+ if (ec) {
+ return 0;
+ }
+ // default constructor gives end iterator
+ fs::recursive_directory_iterator end;
+ while (iter != end) {
+ size_t fsize = fs::file_size(iter->path(), ec);
+ // No error means we can add the file
+ if (!ec) {
+ dir_size += fsize;
}
+ iter++; // next entry
}
- closedir(directory);
- return size;
+ return dir_size;
}
+// NOTE that boost makes 0777 permissions by default
std::string file_system::CreateDirectory(const std::string& name) {
- if (!DirectoryExists(name)) {
- if (0 != mkdir(name.c_str(), S_IRWXU)) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to create directory: " << name);
- }
+ error_code ec;
+ bool success = fs::create_directory(name, ec);
+ if (!success || ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to create directory: " << name);
+ } else {
+ // Set 0700 permissions to maintain previous API
+ fs::permissions(name, fs::perms::owner_all, ec);
}
-
return name;
}
bool file_system::CreateDirectoryRecursively(const std::string& path) {
- size_t pos = 0;
- bool ret_val = true;
-
- while (ret_val == true && pos <= path.length()) {
- pos = path.find('/', pos + 1);
- if (!DirectoryExists(path.substr(0, pos))) {
- if (0 != mkdir(path.substr(0, pos).c_str(), S_IRWXU)) {
- ret_val = false;
- }
- }
- }
+ error_code ec;
+ // Create directory and all parents
+ fs::create_directories(path, ec);
- return ret_val;
-}
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_,
+ "Unable to create directory recursively: "
+ << path << " reason: " << ec.message());
-bool file_system::IsDirectory(const std::string& name) {
- struct stat status = {0};
-
- if (-1 == stat(name.c_str(), &status)) {
return false;
}
-
- return S_ISDIR(status.st_mode);
+ // return true if we made something or if it already existed
+ return true;
}
+bool file_system::IsDirectory(const std::string& name) {
+ error_code ec;
+ return fs::is_directory(name, ec);
+}
+// NOTE this may be a duplicate of IsDirectory since it already checks
+// existence
bool file_system::DirectoryExists(const std::string& name) {
- struct stat status = {0};
-
- if (-1 == stat(name.c_str(), &status) || !S_ISDIR(status.st_mode)) {
- return false;
- }
-
- return true;
+ return FileExists(name) && IsDirectory(name);
}
bool file_system::FileExists(const std::string& name) {
- struct stat status = {0};
-
- if (-1 == stat(name.c_str(), &status)) {
- return false;
- }
- return true;
+ error_code ec;
+ return fs::exists(name, ec);
}
bool file_system::Write(const std::string& file_name,
@@ -200,80 +189,75 @@ void file_system::Close(std::ofstream* file_stream) {
}
std::string file_system::CurrentWorkingDirectory() {
- const size_t filename_max_length = 1024;
- char path[filename_max_length];
- if (0 == getcwd(path, filename_max_length)) {
+ error_code ec;
+ fs::path currpath = fs::current_path(ec);
+ if (ec) {
LOG4CXX_WARN(logger_, "Could not get CWD");
}
- return std::string(path);
+ return currpath.string();
}
std::string file_system::GetAbsolutePath(const std::string& path) {
- char abs_path[PATH_MAX];
- if (NULL == realpath(path.c_str(), abs_path)) {
- return std::string();
+ error_code ec;
+ fs::path absolute = fs::canonical(path, ec);
+ if (ec) {
+ return std::string(); // invalid path
}
-
- return std::string(abs_path);
+ return absolute.string();
}
bool file_system::IsFileNameValid(const std::string& file_name) {
return file_name.end() == std::find(file_name.begin(), file_name.end(), '/');
}
+// Does not remove if file is write-protected
bool file_system::DeleteFile(const std::string& name) {
if (FileExists(name) && IsAccessible(name, W_OK)) {
- return !remove(name.c_str());
+ error_code ec;
+ bool success = fs::remove(name.c_str(), ec);
+ return success && !ec;
}
return false;
}
void file_system::remove_directory_content(const std::string& directory_name) {
- int32_t return_code = 0;
- DIR* directory = NULL;
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
- struct dirent* result = NULL;
-
- directory = opendir(directory_name.c_str());
-
- if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
-
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
- if (0 == strcmp(result->d_name, "..") ||
- 0 == strcmp(result->d_name, ".")) {
- continue;
- }
-
- std::string full_element_path = directory_name + "/" + result->d_name;
-
- if (file_system::IsDirectory(full_element_path)) {
- remove_directory_content(full_element_path);
- rmdir(full_element_path.c_str());
- } else {
- if (0 != remove(full_element_path.c_str())) {
- LOG4CXX_WARN_WITH_ERRNO(
- logger_, "Unable to remove file: " << full_element_path);
- }
- }
- }
+ error_code ec;
+ fs::directory_iterator dir_iter(directory_name, ec);
+
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_,
+ "Unable to empty directory: " << directory_name);
}
- closedir(directory);
+ // According to Boost's documentation, removing shouldn't invalidate the
+ // iterator, although it may cause the removed entry to appear again,
+ // duplicating the warning message. See here:
+ // https://www.boost.org/doc/libs/1_67_0/libs/filesystem/doc/reference.html#Class-directory_iterator
+ for (auto& dirent : dir_iter) {
+ fs::remove_all(dirent, ec);
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Unable to remove file: " << dirent.path().string());
+ }
+ }
}
bool file_system::RemoveDirectory(const std::string& directory_name,
bool is_recursively) {
- if (DirectoryExists(directory_name) && IsAccessible(directory_name, W_OK)) {
- if (is_recursively) {
- remove_directory_content(directory_name);
- }
-
- return !rmdir(directory_name.c_str());
+ // Make sure the directory exists
+ if (!DirectoryExists(directory_name) && IsAccessible(directory_name, W_OK)) {
+ return false;
}
- return false;
+ error_code ec;
+ bool success;
+ // If recursive, just force full remove
+ if (is_recursively) {
+ success = (fs::remove_all(directory_name, ec) != 0);
+ } else {
+ // Otherwise try to remove
+ success = fs::remove(directory_name, ec);
+ }
+ return success && !ec;
}
bool file_system::IsAccessible(const std::string& name, int32_t how) {
@@ -290,34 +274,20 @@ bool file_system::IsReadingAllowed(const std::string& name) {
std::vector<std::string> file_system::ListFiles(
const std::string& directory_name) {
+ error_code ec;
+
+ fs::directory_iterator dir_iter(directory_name, ec);
std::vector<std::string> listFiles;
- if (!DirectoryExists(directory_name)) {
+
+ // In case the directory doesn't exist / can't be read, second check may be
+ // redundant
+ if (ec || !DirectoryExists(directory_name)) {
return listFiles;
}
- int32_t return_code = 0;
- DIR* directory = NULL;
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
- struct dirent* result = NULL;
-
- directory = opendir(directory_name.c_str());
- if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
-
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
- if (0 == strcmp(result->d_name, "..") ||
- 0 == strcmp(result->d_name, ".")) {
- continue;
- }
-
- listFiles.push_back(std::string(result->d_name));
- }
-
- closedir(directory);
+ for (auto& dirent : dir_iter) {
+ listFiles.push_back(dirent.path().filename().string());
}
-
return listFiles;
}
@@ -390,47 +360,42 @@ bool file_system::CreateFile(const std::string& path) {
}
}
-uint64_t file_system::GetFileModificationTime(const std::string& path) {
- struct stat info;
- if (0 != stat(path.c_str(), &info)) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file mod time: " << path);
+time_t file_system::GetFileModificationTime(const std::string& path) {
+ error_code ec;
+ std::time_t time = fs::last_write_time(path, ec);
+ if (ec) {
+ return 0;
}
- return static_cast<uint64_t>(info.st_mtim.tv_nsec);
+ return time;
}
bool file_system::CopyFile(const std::string& src, const std::string& dst) {
if (!FileExists(src) || FileExists(dst) || !CreateFile(dst)) {
return false;
}
- std::vector<uint8_t> data;
- if (!ReadBinaryFile(src, data) || !WriteBinaryFile(dst, data)) {
- DeleteFile(dst);
+ error_code ec;
+ fs::copy_file(src, dst, ec);
+ if (ec) {
+ // something failed
return false;
}
return true;
}
bool file_system::MoveFile(const std::string& src, const std::string& dst) {
+ error_code ec;
+
if (std::rename(src.c_str(), dst.c_str()) == 0) {
return true;
- } else {
- // In case of src and dst on different file systems std::rename returns
- // an error (at least on QNX).
- // Seems, streams are not recommended for use, so have
- // to find another way to do this.
- std::ifstream s_src(src, std::ios::binary);
- if (!s_src.good()) {
- return false;
- }
- std::ofstream s_dst(dst, std::ios::binary);
- if (!s_dst.good()) {
- return false;
- }
- s_dst << s_src.rdbuf();
- s_dst.close();
- s_src.close();
- DeleteFile(src);
- return true;
}
- return false;
+ // In case of src and dst on different file systems std::rename returns
+ // an error (at least on QNX).
+ // Instead, copy the file over and delete the old one
+ bool success = CopyFile(src, dst);
+ if (!success) {
+ return false;
+ }
+ DeleteFile(src);
+
+ return true;
}
diff --git a/src/components/utils/src/lock_boost.cc b/src/components/utils/src/lock_boost.cc
new file mode 100644
index 0000000000..2299bcf77d
--- /dev/null
+++ b/src/components/utils/src/lock_boost.cc
@@ -0,0 +1,127 @@
+/*
+ * 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 <errno.h>
+#include <stdint.h>
+#include <string.h>
+#include <cstring>
+#include "utils/lock.h"
+#include "utils/logger.h"
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+Lock::Lock() : lock_taken_(0) {}
+
+Lock::~Lock() {
+ if (lock_taken_ > 0) {
+ LOG4CXX_FATAL(logger_, "Destroying non-released regular mutex " << &mutex_);
+ }
+}
+
+void Lock::Acquire() {
+ mutex_.lock();
+ AssertFreeAndMarkTaken();
+}
+
+void Lock::Release() {
+ AssertTakenAndMarkFree();
+ mutex_.unlock();
+}
+
+bool Lock::Try() {
+ bool status = mutex_.try_lock();
+ if (status) {
+ AssertFreeAndMarkTaken();
+ }
+ return status;
+}
+
+void Lock::AssertFreeAndMarkTaken() {
+ if (lock_taken_ != 0) {
+ LOG4CXX_FATAL(logger_, "Locking already taken not recursive mutex");
+ NOTREACHED();
+ }
+ lock_taken_++;
+}
+
+void Lock::AssertTakenAndMarkFree() {
+ if (lock_taken_ == 0) {
+ LOG4CXX_FATAL(logger_, "Unlocking a mutex that is not taken");
+ NOTREACHED();
+ }
+ lock_taken_--;
+}
+
+// Recursive lock looks the same on the surface, some code duplication is
+// necessary since they don't have a shared parent superclass
+RecursiveLock::RecursiveLock() : lock_taken_(0) {}
+
+RecursiveLock::~RecursiveLock() {
+ if (lock_taken_ > 0) {
+ LOG4CXX_FATAL(logger_,
+ "Destroying non-released recursive mutex " << &mutex_);
+ }
+}
+
+void RecursiveLock::Acquire() {
+ mutex_.lock();
+ AssertFreeAndMarkTaken();
+}
+
+void RecursiveLock::Release() {
+ AssertTakenAndMarkFree();
+ mutex_.unlock();
+}
+
+bool RecursiveLock::Try() {
+ bool status = mutex_.try_lock();
+ if (status) {
+ AssertFreeAndMarkTaken();
+ }
+ return status;
+}
+
+void RecursiveLock::AssertFreeAndMarkTaken() {
+ lock_taken_++;
+}
+
+void RecursiveLock::AssertTakenAndMarkFree() {
+ if (lock_taken_ == 0) {
+ LOG4CXX_FATAL(logger_, "Unlocking a recursive mutex that is not taken");
+ NOTREACHED();
+ }
+ lock_taken_--;
+}
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/lock_posix.cc b/src/components/utils/src/lock_posix.cc
deleted file mode 100644
index 9b90ad20b9..0000000000
--- a/src/components/utils/src/lock_posix.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "utils/lock.h"
-#include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <cstring>
-#include "utils/logger.h"
-
-namespace sync_primitives {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
-
-Lock::Lock()
-#ifndef NDEBUG
- : lock_taken_(0)
- , is_mutex_recursive_(false)
-#endif // NDEBUG
-{
- Init(false);
-}
-
-Lock::Lock(bool is_recursive)
-#ifndef NDEBUG
- : lock_taken_(0)
- , is_mutex_recursive_(is_recursive)
-#endif // NDEBUG
-{
- Init(is_recursive);
-}
-
-Lock::~Lock() {
-#ifndef NDEBUG
- if (lock_taken_ > 0) {
- LOG4CXX_ERROR(logger_, "Destroying non-released mutex " << &mutex_);
- }
-#endif
- int32_t status = pthread_mutex_destroy(&mutex_);
- if (status != 0) {
- LOG4CXX_ERROR(logger_,
- "Failed to destroy mutex " << &mutex_ << ": "
- << strerror(status));
- }
-}
-
-void Lock::Acquire() {
- const int32_t status = pthread_mutex_lock(&mutex_);
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to acquire mutex " << &mutex_ << ": "
- << strerror(status));
- NOTREACHED();
- } else {
- AssertFreeAndMarkTaken();
- }
-}
-
-void Lock::Release() {
- AssertTakenAndMarkFree();
- const int32_t status = pthread_mutex_unlock(&mutex_);
- if (status != 0) {
- LOG4CXX_ERROR(logger_,
- "Failed to unlock mutex" << &mutex_ << ": "
- << strerror(status));
- }
-}
-
-bool Lock::Try() {
- const int32_t status = pthread_mutex_trylock(&mutex_);
- if (status == 0) {
-#ifndef NDEBUG
- lock_taken_++;
-#endif
- return true;
- }
- return false;
-}
-
-#ifndef NDEBUG
-void Lock::AssertFreeAndMarkTaken() {
- if ((lock_taken_ > 0) && !is_mutex_recursive_) {
- LOG4CXX_ERROR(logger_, "Locking already taken not recursive mutex");
- NOTREACHED();
- }
- lock_taken_++;
-}
-void Lock::AssertTakenAndMarkFree() {
- if (lock_taken_ == 0) {
- LOG4CXX_ERROR(logger_, "Unlocking a mutex that is not taken");
- NOTREACHED();
- }
- lock_taken_--;
-}
-#endif
-
-void Lock::Init(bool is_recursive) {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
-
- const int32_t mutex_type =
- is_recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_ERRORCHECK;
-
- pthread_mutexattr_settype(&attr, mutex_type);
- const int32_t status = pthread_mutex_init(&mutex_, &attr);
-
- pthread_mutexattr_destroy(&attr);
-
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to initialize mutex. " << std::strerror(status));
- DCHECK(status != 0);
- }
-}
-
-} // namespace sync_primitives
diff --git a/src/components/utils/src/log_message_loop_thread.cc b/src/components/utils/src/log_message_loop_thread.cc
index 2b7f28fbfd..182eb64534 100644
--- a/src/components/utils/src/log_message_loop_thread.cc
+++ b/src/components/utils/src/log_message_loop_thread.cc
@@ -35,7 +35,7 @@
namespace logger {
-void LogMessageHandler::Handle(const LogMessage message) {
+void LogMessageLoopThread::Handle(const LogMessage message) {
message.logger->forcedLog(message.level,
message.entry,
message.timeStamp,
@@ -44,14 +44,13 @@ void LogMessageHandler::Handle(const LogMessage message) {
}
LogMessageLoopThread::LogMessageLoopThread()
- : LogMessageLoopThreadTemplate("Logger",
- handler_ = new LogMessageHandler()) {}
+ : LogMessageLoopThreadTemplate("Logger", this) {}
LogMessageLoopThread::~LogMessageLoopThread() {
// we'll have to drop messages
// while deleting logger thread
logger_status = DeletingLoggerThread;
- delete handler_;
+ LogMessageLoopThreadTemplate::Shutdown();
}
} // namespace logger
diff --git a/src/components/utils/src/logger.cc b/src/components/utils/src/logger.cc
index 4e93ca3d14..af21aeac77 100644
--- a/src/components/utils/src/logger.cc
+++ b/src/components/utils/src/logger.cc
@@ -39,6 +39,9 @@ void deinit_logger() {
CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
LOG4CXX_DEBUG(logger_, "Logger deinitialization");
logger::set_logs_enabled(false);
+ if (logger::logger_status == logger::LoggerThreadCreated) {
+ logger::flush_logger();
+ }
logger::delete_log_message_loop_thread();
log4cxx::LoggerPtr rootLogger = log4cxx::Logger::getRootLogger();
log4cxx::spi::LoggerRepositoryPtr repository =
diff --git a/src/components/utils/src/semantic_version.cc b/src/components/utils/src/semantic_version.cc
new file mode 100644
index 0000000000..9f0991e991
--- /dev/null
+++ b/src/components/utils/src/semantic_version.cc
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018, Livio
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "utils/semantic_version.h"
+
+namespace utils {
+
+const SemanticVersion base_rpc_version(4, 5, 1);
+const SemanticVersion rpc_version_5(5, 0, 0);
+
+} // namespace utils \ No newline at end of file
diff --git a/src/components/utils/src/signals_posix.cc b/src/components/utils/src/signals_posix.cc
index 274c254716..e13dc04f40 100644
--- a/src/components/utils/src/signals_posix.cc
+++ b/src/components/utils/src/signals_posix.cc
@@ -29,13 +29,16 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/wait.h>
#include <csignal>
#include <cstdlib>
#include <stdint.h>
+#include <iostream>
#include "utils/signals.h"
-bool utils::UnsibscribeFromTermination() {
+namespace utils {
+bool Signals::UnsubscribeFromTermination() {
// Disable some system signals receiving in thread
// by blocking those signals
// (system signals processes only in the main thread)
@@ -51,6 +54,42 @@ bool utils::UnsibscribeFromTermination() {
return !pthread_sigmask(SIG_BLOCK, &signal_set, NULL);
}
+bool Signals::UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data) {
+ // Disable Low Voltage signals in main thread
+ // due to all further threads will inherit signals mask
+ sigset_t signal_set;
+ sigemptyset(&signal_set);
+ const int SIGLOWVOLTAGE = SIGRTMIN + offset_data.low_voltage_signal_offset;
+ const int SIGWAKEUP = SIGRTMIN + offset_data.wake_up_signal_offset;
+ const int SIGIGNOFF = SIGRTMIN + offset_data.ignition_off_signal_offset;
+ sigaddset(&signal_set, SIGLOWVOLTAGE);
+ sigaddset(&signal_set, SIGWAKEUP);
+ sigaddset(&signal_set, SIGIGNOFF);
+
+ // Set signals mask to be blocked by thread
+ return !pthread_sigmask(SIG_BLOCK, &signal_set, nullptr);
+}
+
+void Signals::SendSignal(const int signo, const pid_t pid) {
+ if (kill(pid, signo) == -1) {
+ std::cerr << "Error sending signal: " << strsignal(signo) << " to " << pid
+ << " .Error: " << strerror(errno) << std::endl;
+ }
+}
+
+pid_t Signals::Fork() {
+ return fork();
+}
+
+void Signals::ExitProcess(const int status) {
+ exit(status);
+}
+
+void Signals::WaitPid(pid_t cpid, int* status, int options) {
+ waitpid(cpid, status, options);
+}
+
namespace {
bool CatchSIGSEGV(sighandler_t handler) {
struct sigaction act;
@@ -63,7 +102,7 @@ bool CatchSIGSEGV(sighandler_t handler) {
}
} // namespace
-bool utils::WaitTerminationSignals(sighandler_t sig_handler) {
+bool Signals::WaitTerminationSignals(sighandler_t sig_handler) {
sigset_t signal_set;
int sig = -1;
@@ -81,3 +120,4 @@ bool utils::WaitTerminationSignals(sighandler_t sig_handler) {
}
return false;
}
+} // namespace utils
diff --git a/src/components/utils/src/system_time_handler.cc b/src/components/utils/src/system_time_handler.cc
new file mode 100644
index 0000000000..0c3c62cc53
--- /dev/null
+++ b/src/components/utils/src/system_time_handler.cc
@@ -0,0 +1,62 @@
+/*
+ * 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 "utils/system_time_handler.h"
+
+namespace utils {
+
+SystemTimeHandler::SystemTimeHandler() {}
+
+SystemTimeHandler::~SystemTimeHandler() {}
+
+void SystemTimeHandler::QuerySystemTime() {
+ DoSystemTimeQuery();
+}
+
+void SystemTimeHandler::SubscribeOnSystemTime(SystemTimeListener* listener) {
+ DoSubscribe(listener);
+}
+
+void SystemTimeHandler::UnsubscribeFromSystemTime(
+ SystemTimeListener* listener) {
+ DoUnsubscribe(listener);
+}
+
+time_t SystemTimeHandler::GetUTCTime() {
+ return FetchSystemTime();
+}
+
+bool SystemTimeHandler::system_time_can_be_received() const {
+ return utc_time_can_be_received();
+}
+
+} // namespace utils
diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc
index 65abad65c2..f01dad8d58 100644
--- a/src/components/utils/test/async_runner_test.cc
+++ b/src/components/utils/test/async_runner_test.cc
@@ -36,8 +36,6 @@
#include "utils/lock.h"
#include "utils/threads/async_runner.h"
#include "utils/conditional_variable.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
@@ -92,7 +90,7 @@ class AsyncRunnerTest : public ::testing::Test {
protected:
ThreadDelegate** delegates_;
- ::utils::SharedPtr<AsyncRunner> async_runner_;
+ std::shared_ptr<AsyncRunner> async_runner_;
void CreateThreadsArray() {
delegates_ = new ThreadDelegate* [kDelegatesAmount];
@@ -103,7 +101,7 @@ class AsyncRunnerTest : public ::testing::Test {
}
void CreateAsyncRunner() {
- async_runner_ = ::utils::MakeShared<AsyncRunner>("test");
+ async_runner_ = std::make_shared<AsyncRunner>("test");
}
};
@@ -128,8 +126,8 @@ TEST_F(AsyncRunnerTest, StopThenRun_ExpectDelegateNotStarted) {
// Check that delegate was not started due to Stop() called before AsyncRun()
EXPECT_CALL(mock_thread_delegate, threadMain()).Times(0);
{
- ::utils::SharedPtr<AsyncRunner> async_runner =
- ::utils::MakeShared<AsyncRunner>("test");
+ std::shared_ptr<AsyncRunner> async_runner =
+ std::make_shared<AsyncRunner>("test");
async_runner->Stop();
async_runner->AsyncRun(&mock_thread_delegate);
}
diff --git a/src/components/utils/test/atomic_object_test.cc b/src/components/utils/test/atomic_object_test.cc
deleted file mode 100644
index 44975fd004..0000000000
--- a/src/components/utils/test/atomic_object_test.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "utils/atomic_object.h"
-#include "gtest/gtest.h"
-
-namespace test {
-namespace components {
-namespace utils_test {
-
-TEST(AtomicObjectTest, Construct) {
- sync_primitives::atomic_int var(5);
- EXPECT_EQ(5, var);
-
- var = 8;
- EXPECT_EQ(8, var);
-
- sync_primitives::atomic_bool flag = true;
-
- EXPECT_TRUE(flag == true);
-
- flag = false;
- EXPECT_FALSE(flag == true);
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
diff --git a/src/components/utils/test/conditional_variable_test.cc b/src/components/utils/test/conditional_variable_test.cc
index 524d53cafa..1ef29685e6 100644
--- a/src/components/utils/test/conditional_variable_test.cc
+++ b/src/components/utils/test/conditional_variable_test.cc
@@ -30,14 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <iostream>
#include <pthread.h>
+#include <iostream>
#include "gtest/gtest.h"
+#include "utils/conditional_variable.h"
#include "utils/lock.h"
#include "utils/macro.h"
-#include "utils/conditional_variable.h"
namespace test {
namespace components {
@@ -61,8 +61,8 @@ class ConditionalVariableTest : public ::testing::Test {
protected:
std::string test_value_;
- sync_primitives::ConditionalVariable cond_var_;
sync_primitives::Lock test_mutex_;
+ sync_primitives::ConditionalVariable cond_var_;
unsigned counter_;
};
@@ -102,6 +102,7 @@ TEST_F(ConditionalVariableTest,
cond_var_.WaitFor(test_lock, 2000);
std::string last_value("changed again by thread 1");
EXPECT_EQ(last_value, test_value_);
+ pthread_join(thread1, NULL);
}
TEST_F(ConditionalVariableTest,
@@ -116,6 +117,8 @@ TEST_F(ConditionalVariableTest,
ASSERT_FALSE(thread_created) << "thread2 is not created!";
check_counter();
EXPECT_EQ(2u, counter_);
+ pthread_join(thread1, NULL);
+ pthread_join(thread2, NULL);
}
TEST_F(
diff --git a/src/components/utils/test/data_accessor_test.cc b/src/components/utils/test/data_accessor_test.cc
index c7c728b676..24b7bab282 100644
--- a/src/components/utils/test/data_accessor_test.cc
+++ b/src/components/utils/test/data_accessor_test.cc
@@ -41,7 +41,8 @@ namespace utils_test {
TEST(DataAccessorTest, CreateDataAccessor) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
int data_from_testdata = testdata.GetData();
@@ -52,17 +53,19 @@ TEST(DataAccessorTest, CreateDataAccessor) {
TEST(DataAccessorTest, CreateDataAccessor_MutexIsLocked_CannotLockItAgain) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
TEST(DataAccessorTest, CopyDataAccessor_GetDataFromDataAccessors) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
DataAccessor<int> testdata_copy(testdata);
@@ -72,14 +75,15 @@ TEST(DataAccessorTest, CopyDataAccessor_GetDataFromDataAccessors) {
// assert
EXPECT_EQ(data_from_testdata, data_from_testdata_copy);
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
TEST(DataAccessorTest,
ChangedDataInDataAccessor_ChangeData_DataInDataAccessorIsChanged) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
test_value = 0;
@@ -93,40 +97,42 @@ TEST(DataAccessorTest,
DeleteDataAccessor_CreatedOneDeleteOneThread_MutexIsUnlocked) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
{
DataAccessor<int> testdata(test_value, testSet_lock_);
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
// assert
- EXPECT_TRUE(testSet_lock_.Try());
+ EXPECT_TRUE(testSet_lock_->Try());
- testSet_lock_.Release();
+ testSet_lock_->Release();
}
TEST(DataAccessorTest,
DeleteDataAccessor_CreatedThreadAndCopyDeleteBothThreads_MutexIsUnlocked) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
{
DataAccessor<int> testdata(test_value, testSet_lock_);
{
DataAccessor<int> testdata_copy(testdata);
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
// assert
- EXPECT_TRUE(testSet_lock_.Try());
- testSet_lock_.Release();
+ EXPECT_TRUE(testSet_lock_->Try());
+ testSet_lock_->Release();
}
} // namespace utils_test
diff --git a/src/components/utils/test/date_time_test.cc b/src/components/utils/test/date_time_test.cc
index a209ab4d43..00085813aa 100644
--- a/src/components/utils/test/date_time_test.cc
+++ b/src/components/utils/test/date_time_test.cc
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <boost/thread/thread.hpp>
#include "gtest/gtest.h"
#include "utils/date_time.h"
@@ -38,364 +39,270 @@ namespace components {
namespace utils_test {
using namespace date_time;
+
+namespace bpt = boost::posix_time;
TEST(DateTimeTest, GetCurrentTime) {
// arrange
- const TimevalStruct time1 = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time1 = getCurrentTime();
// assert
- ASSERT_NE(0, time1.tv_sec);
- ASSERT_GE(time1.tv_usec, 0);
+ ASSERT_NE(0, time1.total_seconds());
+ ASSERT_GE(get_just_uSecs(time1), 0);
// act
- const TimevalStruct time2 = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time2 = getCurrentTime();
// assert
- ASSERT_NE(0, time2.tv_sec);
- ASSERT_GE(time2.tv_usec, 0);
- ASSERT_GE(time2.tv_sec, time1.tv_sec);
+ ASSERT_NE(0, time2.total_seconds());
+ ASSERT_GE(get_just_uSecs(time1), 0);
+ ASSERT_GE(time2.total_seconds(), time1.total_seconds());
}
TEST(DateTimeTest, GetSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 1;
- time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time));
+ ASSERT_EQ(1, getSecs(time1));
}
TEST(DateTimeTest, GetmSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 1;
- time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
+ int expected = 1 * MILLISECONDS_IN_SECOND + 2;
- int64_t expect_value =
- time.tv_sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
- time.tv_usec / date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
+ ASSERT_EQ(expected, getmSecs(time1));
}
TEST(DateTimeTest, GetuSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 3;
- time.tv_usec = 4;
-
- int64_t expect_value = time.tv_sec *
- date_time::DateTime::MILLISECONDS_IN_SECOND *
- date_time::DateTime::MICROSECONDS_IN_MILLISECOND +
- time.tv_usec;
+ date_time::TimeDuration time1 = bpt::seconds(3) + bpt::microseconds(4);
+ int expect_value =
+ 3 * MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND + 4;
+
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getuSecs(time));
+ ASSERT_EQ(expect_value, getuSecs(time1));
}
TEST(DateTimeTest, GetuSecsmSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 5;
- time.tv_usec = 6;
+ date_time::TimeDuration time1 = bpt::seconds(5) + bpt::microseconds(6);
- int64_t expect_value = date_time::DateTime::getuSecs(time) /
- date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ int64_t expect_value = getuSecs(time1) / MICROSECONDS_IN_MILLISECOND;
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
+ ASSERT_EQ(expect_value, getmSecs(time1));
}
TEST(DateTimeTest, CalculateTimeSpan) {
// arrange
- const TimevalStruct time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time1 = getCurrentTime();
const uint32_t sleep_time_mSec = 10;
- usleep(sleep_time_mSec * date_time::DateTime::MICROSECONDS_IN_MILLISECOND);
+ // sleep current thread
+ boost::this_thread::sleep(boost::posix_time::milliseconds(sleep_time_mSec));
// assert
- ASSERT_GE(date_time::DateTime::calculateTimeSpan(time), sleep_time_mSec);
+ ASSERT_GE(calculateTimeSpan(time1), sleep_time_mSec);
}
TEST(DateTimeTest, CalculateTimeDiff) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(2) + bpt::milliseconds(2);
+ date_time::TimeDuration time2 = bpt::seconds(3) + bpt::milliseconds(4);
// time2 to time1
- TimevalStruct diff1;
- diff1.tv_sec = time2.tv_sec - time1.tv_sec;
- diff1.tv_usec = time2.tv_usec - time1.tv_usec;
-
- const int64_t mSecDiff =
- static_cast<int64_t>(diff1.tv_sec) * 1000 + diff1.tv_usec / 1000;
+ date_time::TimeDuration diff1 = bpt::seconds(1) + bpt::milliseconds(2);
// assert
- ASSERT_EQ(mSecDiff, date_time::DateTime::calculateTimeDiff(time2, time1));
+ ASSERT_EQ(diff1.total_milliseconds(), calculateTimeDiff(time2, time1));
- // time1 to time2
- TimevalStruct diff2;
- diff2.tv_sec = time1.tv_sec - time2.tv_sec;
- diff2.tv_usec = time1.tv_usec - time2.tv_usec;
-
- const int64_t mSecDiff2 =
- -(static_cast<int64_t>(diff2.tv_sec) * 1000 + diff2.tv_usec / 1000);
+ // time1 to time2, but calculateTimeDiff returns an absolute value
+ date_time::TimeDuration diff2 = -diff1.invert_sign();
// assert
- ASSERT_EQ(mSecDiff2, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(diff2.total_milliseconds(), calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, CalculateEqualTimeDiff) {
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
- TimevalStruct time2;
- time2.tv_sec = 1;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time2 = bpt::seconds(1) + bpt::milliseconds(2);
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(0, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, compareTime) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
- TimevalStruct time2;
- time2.tv_sec = 2;
- time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time2 = bpt::seconds(2) + bpt::milliseconds(4);
// assert
- ASSERT_EQ(LESS, date_time::DateTime::compareTime(time1, time2));
- ASSERT_EQ(GREATER, date_time::DateTime::compareTime(time2, time1));
- ASSERT_NE(EQUAL, date_time::DateTime::compareTime(time2, time1));
+ ASSERT_EQ(LESS, compareTime(time1, time2));
+ ASSERT_EQ(GREATER, compareTime(time2, time1));
+ ASSERT_NE(EQUAL, compareTime(time2, time1));
// act
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+ date_time::TimeDuration time3 = time2 - time1;
// assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time3));
+ ASSERT_EQ(EQUAL, compareTime(time1, time3));
}
TEST(DateTimeTest, GetSecs_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 0;
- time1.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 = bpt::microseconds(MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time1));
+ ASSERT_EQ(1, getSecs(time1));
}
TEST(DateTimeTest, compareTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time1));
- ASSERT_EQ(1, date_time::DateTime::getSecs(time2));
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time2));
-}
-
-TEST(DateTimeTest, compareEqualTime_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
-
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
-
- // assert
- ASSERT_TRUE(date_time::DateTime::Equal(time1, time2));
+ ASSERT_EQ(1, getSecs(time1));
+ ASSERT_EQ(1, getSecs(time2));
+ ASSERT_EQ(EQUAL, compareTime(time1, time2));
+ ASSERT_TRUE(Equal(time1, time2));
}
TEST(DateTimeTest, compareLessTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_TRUE(date_time::DateTime::Less(time1, time2));
+ ASSERT_TRUE(Less(time1, time2));
}
TEST(DateTimeTest, compareGreaterTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::milliseconds(2 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_TRUE(date_time::DateTime::Greater(time2, time1));
+ ASSERT_TRUE(Greater(time2, time1));
}
TEST(DateTimeTest, CalculateTimeSub_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+ date_time::TimeDuration time3 = time2 - time1;
// assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time3));
+ ASSERT_EQ(EQUAL, compareTime(time1, time3));
}
TEST(DateTimeTest, CalculateTimeDiff_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 2;
- time1.tv_usec = 5 * date_time::DateTime::MICROSECONDS_IN_SECOND;
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 =
+ bpt::seconds(2) + bpt::microseconds(5 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration time2 =
+ bpt::seconds(3) + bpt::microseconds(1 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(3000, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(3000, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(3000, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(3000, calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, CalculateEqualTimeDiff_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 2;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
-
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 =
+ bpt::seconds(2) + bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration time2 =
+ bpt::seconds(3) + bpt::microseconds(1 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
-}
+ ASSERT_EQ(0, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, calculateTimeDiff(time1, time2));
-TEST(DateTimeTest, CalculateEqualTimeSub_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
+ date_time::TimeDuration time3 = time2 - time1;
+ date_time::TimeDuration time4 = time1 - time2;
- TimevalStruct time2;
- time2.tv_sec = 2;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time_expected(0, 0, 0, 0);
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
- TimevalStruct time4 = date_time::DateTime::Sub(time1, time2);
-
- TimevalStruct time_expected;
- time_expected.tv_sec = 0;
- time_expected.tv_usec = 0;
- // assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time_expected, time3));
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time_expected, time4));
+ ASSERT_EQ(EQUAL, compareTime(time_expected, time3));
+ ASSERT_EQ(EQUAL, compareTime(time_expected, time4));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondMultiplesSecond_ExpectChangeTime) {
- TimevalStruct time1;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7000;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(10, time1.tv_sec);
- ASSERT_EQ(0, time1.tv_usec);
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, getSecs(time1));
+ ASSERT_EQ(0, get_just_mSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondNotMultiplesSecond_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7500;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(10, time1.tv_sec);
- ASSERT_EQ(500000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, time1.total_seconds());
+ ASSERT_EQ(500000, get_just_uSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMilliSecondLessThenSeconds_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 500;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(3, time1.tv_sec);
- ASSERT_EQ(500000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(3, getSecs(time1));
+ ASSERT_EQ(500000, get_just_uSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondEqualNull_ExpectNotChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 0;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(3, time1.tv_sec);
- ASSERT_EQ(0, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(3, getSecs(time1));
+ ASSERT_EQ(0, get_just_mSecs(time1));
}
TEST(DateTimeTest, AddMilliseconds_SetOverlowMicrosecond_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7600;
- time1.tv_sec = 3;
- time1.tv_usec = 500000;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(11, time1.tv_sec);
- ASSERT_EQ(100000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, getSecs(time1));
+ ASSERT_EQ(600000, get_just_uSecs(time1));
}
-TEST(DateTimeTest, Operator_minus_TimevalStruct_positive) {
- TimevalStruct time1;
- TimevalStruct time2;
- TimevalStruct time3;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- time2.tv_sec = 3;
- time2.tv_usec = 0;
- time3.tv_sec = 2;
- time3.tv_usec = 9000000;
- ASSERT_EQ(0, date_time::DateTime::getSecs(time1 - time2));
- ASSERT_EQ(8000000, date_time::DateTime::getuSecs(time3 - time1));
+TEST(DateTimeTest, Operator_minus_TimeDuration_positive) {
+ date_time::TimeDuration time1 = bpt::seconds(3);
+ date_time::TimeDuration time2 = bpt::seconds(3);
+ date_time::TimeDuration time3 =
+ bpt::seconds(2) + bpt::microseconds(9 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration diff1 = time1 - time2;
+ ASSERT_EQ(0, getSecs(diff1));
+ ASSERT_EQ(8000000, getuSecs(time3 - time1));
}
-TEST(DateTimeTest, Operator_minus_TimevalStruct_negative) {
- TimevalStruct time1;
- TimevalStruct time2;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- time2.tv_sec = 2;
- time2.tv_usec = 9000000;
- ASSERT_NE(1, date_time::DateTime::getSecs(time1 - time2));
- ASSERT_NE(-8000000, date_time::DateTime::getSecs(time2 - time1));
+TEST(DateTimeTest, Operator_minus_TimeDuration_negative) {
+ date_time::TimeDuration time1 = bpt::seconds(3);
+ date_time::TimeDuration time2 =
+ bpt::seconds(2) + bpt::microseconds(9 * MICROSECONDS_IN_SECOND);
+
+ ASSERT_NE(1, getSecs(time1 - time2));
+ ASSERT_NE(-8000000, getSecs(time2 - time1));
}
} // namespace utils_test
diff --git a/src/components/utils/test/file_system_test.cc b/src/components/utils/test/file_system_test.cc
index 95469766f8..eb35773fc9 100644
--- a/src/components/utils/test/file_system_test.cc
+++ b/src/components/utils/test/file_system_test.cc
@@ -990,13 +990,13 @@ TEST(FileSystemTest,
TEST(FileSystemTest, WriteFileGetSize) {
ASSERT_FALSE(FileExists("./test file"));
EXPECT_TRUE(CreateFile("./test file"));
- EXPECT_EQ(0, FileSize("./test file"));
+ EXPECT_EQ(0u, FileSize("./test file"));
unsigned char tmp[] = {'t', 'e', 's', 't'};
std::vector<unsigned char> data(tmp, tmp + 4);
EXPECT_TRUE(Write("./test file", data));
- EXPECT_NE(0, FileSize("./test file"));
+ EXPECT_NE(0u, FileSize("./test file"));
EXPECT_TRUE(DeleteFile("./test file"));
EXPECT_FALSE(FileExists("./test file"));
@@ -1022,13 +1022,14 @@ TEST(FileSystemTest, GetFileModificationTime) {
EXPECT_TRUE(CreateFile("./test file"));
- uint64_t modif_time = GetFileModificationTime("./test file");
- EXPECT_LE(0ul, modif_time);
+ time_t modif_time = GetFileModificationTime("./test file");
+ EXPECT_LE(0ul, static_cast<unsigned long>(modif_time));
std::vector<uint8_t> data(1, 1);
EXPECT_TRUE(WriteBinaryFile("./test file", data));
- EXPECT_LE(0ul, GetFileModificationTime("./test file"));
+ EXPECT_LE(0ul,
+ static_cast<unsigned long>(GetFileModificationTime("./test file")));
EXPECT_LE(modif_time, GetFileModificationTime("./test file"));
EXPECT_TRUE(DeleteFile("./test file"));
diff --git a/src/components/utils/test/include/utils/mock_signals_posix.h b/src/components/utils/test/include/utils/mock_signals_posix.h
new file mode 100644
index 0000000000..1aad2d5873
--- /dev/null
+++ b/src/components/utils/test/include/utils/mock_signals_posix.h
@@ -0,0 +1,59 @@
+/*
+ * 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_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
+#define SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
+
+#include "gmock/gmock.h"
+#include "utils/signals.h"
+#include <signal.h>
+#include "appMain/low_voltage_signals_handler.h"
+
+namespace utils {
+
+class MockSignalsPosix {
+ public:
+ MOCK_METHOD0(UnsubscribeFromTermination, bool());
+ MOCK_METHOD1(WaitTerminationSignals, bool(sighandler_t sig_handler));
+ MOCK_METHOD1(
+ UnsubscribeFromLowVoltageSignals,
+ bool(const main_namespace::LowVoltageSignalsOffset& offset_data));
+ MOCK_METHOD2(SendSignal, void(const int signo, const pid_t pid));
+ MOCK_METHOD0(Fork, pid_t());
+ MOCK_METHOD1(ExitProcess, void(const int status));
+ MOCK_METHOD3(WaitPid, void(pid_t cpid, int* status, int options));
+
+ static MockSignalsPosix* signals_posix_mock();
+};
+
+} // namespace utils
+#endif // SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
diff --git a/src/components/utils/test/lock_boost_test.cc b/src/components/utils/test/lock_boost_test.cc
new file mode 100644
index 0000000000..0da735a990
--- /dev/null
+++ b/src/components/utils/test/lock_boost_test.cc
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/lock.h"
+
+namespace test {
+namespace components {
+namespace utils_test {
+
+using sync_primitives::Lock;
+using sync_primitives::RecursiveLock;
+
+TEST(LockBoostTest, TestNonRecursive) {
+ // Create Lock object
+ Lock test_mutex;
+ // Lock mutex
+ test_mutex.Acquire();
+ // Check if created mutex is non-recursive
+ EXPECT_FALSE(test_mutex.Try());
+ // Release mutex before destroy
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, TestRecursive) {
+ // Create Lock object
+ RecursiveLock test_mutex;
+ // Lock mutex
+ test_mutex.Acquire();
+ // Check if created mutex is recursive
+ EXPECT_TRUE(test_mutex.Try());
+ // Release mutex before destroy
+ test_mutex.Release();
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, ReleaseMutex_ExpectMutexReleased) {
+ // Create Lock object (non-recursive mutex)
+ Lock test_mutex;
+ // Lock mutex
+ test_mutex.Acquire();
+ // Release mutex
+ test_mutex.Release();
+ // Try to lock it again. If released expect true
+ EXPECT_TRUE(test_mutex.Try());
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, TryLockNonRecursiveMutex_ExpectMutexNotLockedTwice) {
+ // Create Lock object (non-recursive mutex)
+ Lock test_mutex;
+ // Lock mutex
+ test_mutex.Try();
+ // Try to lock it again. If locked expect false
+ EXPECT_FALSE(test_mutex.Try());
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, TryLockRecursiveMutex_ExpectMutexLockedTwice) {
+ // Create Lock object (recursive mutex)
+ RecursiveLock test_mutex;
+ // Lock mutex
+ test_mutex.Try();
+ // Try to lock it again. Expect true and internal counter increase
+ EXPECT_TRUE(test_mutex.Try());
+ // Release mutex twice as was locked twice.
+ // Every Release() will decrement internal counter
+ test_mutex.Release();
+ test_mutex.Release();
+}
+
+} // namespace utils_test
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/lock_posix_test.cc b/src/components/utils/test/lock_posix_test.cc
deleted file mode 100644
index a78659ab31..0000000000
--- a/src/components/utils/test/lock_posix_test.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/lock.h"
-
-namespace test {
-namespace components {
-namespace utils_test {
-
-using sync_primitives::Lock;
-
-TEST(LockPosixTest, DefaultCtorTest_ExpectNonRecursiveMutexCreated) {
- // Create Lock object
- Lock test_mutex;
- // Lock mutex
- test_mutex.Acquire();
- // Check if created mutex is non-recursive
- EXPECT_FALSE(test_mutex.Try());
- // Release mutex before destroy
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, CtorTestWithFalseArgument_ExpectNonRecursiveMutexCreated) {
- // Create Lock object
- Lock test_mutex(false);
- // Lock mutex
- test_mutex.Acquire();
- // Check if created mutex is non-recursive
- EXPECT_FALSE(test_mutex.Try());
- // Release mutex before destroy
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, CtorTestWithTrueArgument_ExpectRecursiveMutexCreated) {
- // Create Lock object
- Lock test_mutex(true);
- // Lock mutex
- test_mutex.Acquire();
- // Check if created mutex is recursive
- EXPECT_TRUE(test_mutex.Try());
- // Release mutex before destroy
- test_mutex.Release();
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, AcquireMutex_ExpectMutexLocked) {
- // Create Lock object (non-recursive mutex)
- Lock test_mutex;
- // Lock mutex
- test_mutex.Acquire();
- // Try to lock it again. If locked expect false
- EXPECT_FALSE(test_mutex.Try());
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, ReleaseMutex_ExpectMutexReleased) {
- // Create Lock object (non-recursive mutex)
- Lock test_mutex;
- // Lock mutex
- test_mutex.Acquire();
- // Release mutex
- test_mutex.Release();
- // Try to lock it again. If released expect true
- EXPECT_TRUE(test_mutex.Try());
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, TryLockNonRecursiveMutex_ExpectMutexNotLockedTwice) {
- // Create Lock object (non-recursive mutex)
- Lock test_mutex;
- // Lock mutex
- test_mutex.Try();
- // Try to lock it again. If locked expect false
- EXPECT_FALSE(test_mutex.Try());
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, TryLockRecursiveMutex_ExpectMutexLockedTwice) {
- // Create Lock object (recursive mutex)
- Lock test_mutex(true);
- // Lock mutex
- test_mutex.Try();
- // Try to lock it again. Expect true and internal counter increase
- EXPECT_TRUE(test_mutex.Try());
- // Release mutex twice as was locked twice.
- // Every Release() will decrement internal counter
- test_mutex.Release();
- test_mutex.Release();
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
diff --git a/src/components/utils/test/log_message_loop_thread_test.cc b/src/components/utils/test/log_message_loop_thread_test.cc
index 032c7ecae1..92287fb45b 100644
--- a/src/components/utils/test/log_message_loop_thread_test.cc
+++ b/src/components/utils/test/log_message_loop_thread_test.cc
@@ -57,7 +57,7 @@ TEST(LogMessageLoopThread, DestroyLogMessage_loggerStatusDeletingLogger) {
logger::logger_status = LoggerThreadNotCreated;
}
-class MockLogMessageTest : public LogMessageHandler {
+class MockLogMessageTest : public LogMessageLoopThread {
public:
MOCK_CONST_METHOD1(Handle, void(const LogMessage message));
};
diff --git a/src/components/utils/test/message_queue_test.cc b/src/components/utils/test/message_queue_test.cc
index ddc1aa1d81..9aa70933d6 100644
--- a/src/components/utils/test/message_queue_test.cc
+++ b/src/components/utils/test/message_queue_test.cc
@@ -158,6 +158,8 @@ TEST_F(MessageQueueTest,
ASSERT_EQ(test_val_1, test_line);
// Check the size of queue after 1 element was removed
ASSERT_EQ(0u, test_queue.size());
+ pthread_join(thread1, NULL);
+ pthread_join(thread2, NULL);
}
TEST_F(MessageQueueTest,
@@ -169,6 +171,7 @@ TEST_F(MessageQueueTest,
test_queue.wait();
check_value = true;
ASSERT_TRUE(check_value);
+ pthread_join(thread1, NULL);
}
} // namespace utils_test
diff --git a/src/components/utils/test/messagemeter_test.cc b/src/components/utils/test/messagemeter_test.cc
index 4ec14ac1cc..d45e600034 100644
--- a/src/components/utils/test/messagemeter_test.cc
+++ b/src/components/utils/test/messagemeter_test.cc
@@ -57,25 +57,25 @@ const TimePair testing_time_pairs[] = {TimePair(0, 50),
class MessageMeterTest : public ::testing::TestWithParam<TimePair> {
protected:
void SetUp() OVERRIDE {
- usecs = date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ usecs = date_time::MICROSECONDS_IN_MILLISECOND;
id1 = 0x0;
id2 = 0xABCDEF;
id3 = 0xFEBCDA;
const TimePair time_pair = GetParam();
EXPECT_GT(usecs, time_pair.second) << "Wrong time (msecs) value";
+ time_range = date_time::seconds(time_pair.first) +
+ date_time::microseconds(time_pair.second * usecs);
- time_range.tv_sec = time_pair.first;
- time_range.tv_usec = time_pair.second * usecs;
- EXPECT_LT(0, date_time::DateTime::getuSecs(time_range))
+ EXPECT_LT(0, date_time::getuSecs(time_range))
<< "Wrong test case with null range value";
meter.set_time_range(time_range);
- time_range_msecs = date_time::DateTime::getmSecs(time_range);
+ time_range_msecs = date_time::getmSecs(time_range);
}
void TearDown() OVERRIDE {}
::utils::MessageMeter<int> meter;
- TimevalStruct time_range = {0, 0};
+ date_time::TimeDuration time_range = date_time::TimeDurationZero();
int64_t time_range_msecs;
int usecs;
int id1, id2, id3;
@@ -83,27 +83,25 @@ class MessageMeterTest : public ::testing::TestWithParam<TimePair> {
TEST(MessageMeterTest, DefaultTimeRange) {
const ::utils::MessageMeter<int> default_meter;
- const TimevalStruct time_second{1, 0};
+ const date_time::TimeDuration time_second = date_time::seconds(1);
EXPECT_EQ(time_second, default_meter.time_range());
}
TEST(MessageMeterTest, TimeRangeSetter) {
::utils::MessageMeter<int> meter;
- TimevalStruct time_range{0, 0};
+ date_time::TimeDuration time_range;
const int test_count_secs = 1000;
- // Skip 1000th msec value as wrong for TimevalStruct
+ // Skip 1000th msec value as wrong for date_time::TimeDuration
const int test_count_msecs = 999;
for (int sec = test_count_secs; sec >= 0; --sec) {
for (int msec = test_count_msecs; msec >= 0; --msec) {
- time_range.tv_sec = sec;
- time_range.tv_usec =
- msec * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
- // Setter TimevalStruct
+ time_range = date_time::seconds(sec) + date_time::milliseconds(msec);
+
+ // Setter date_time::TimeDuration
meter.set_time_range(time_range);
EXPECT_EQ(time_range, meter.time_range()) << sec << "." << msec << " sec";
// Setter mSecs
- meter.set_time_range(sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
- msec);
+ meter.set_time_range(sec * date_time::MILLISECONDS_IN_SECOND + msec);
EXPECT_EQ(time_range, meter.time_range()) << sec << "." << msec << " sec";
}
}
@@ -113,7 +111,7 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
::utils::MessageMeter<int> meter;
const int id1 = 1;
const int id2 = 2;
- const TimevalStruct null_time_range{0, 0};
+ const date_time::TimeDuration null_time_range = date_time::TimeDurationZero();
meter.set_time_range(null_time_range);
for (int i = 0; i < 10000; ++i) {
// 1st Connection
@@ -129,10 +127,10 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
TEST_P(MessageMeterTest,
DISABLED_TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
size_t messages = 0;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
// Add messages for less range period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
++messages;
@@ -153,10 +151,10 @@ TEST_P(MessageMeterTest,
TEST_P(MessageMeterTest,
DISABLED_TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
size_t messages = 0;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
// Add messages for less range period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
++messages;
@@ -188,14 +186,14 @@ TEST_P(MessageMeterTest,
TEST_P(MessageMeterTest,
DISABLED_Frequency_CountingOverPeriod_CorrectCountOfMessages) {
const size_t one_message = 1;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
EXPECT_EQ(one_message, meter.TrackMessage(id1));
EXPECT_EQ(one_message, meter.TrackMessage(id2));
EXPECT_EQ(one_message, meter.TrackMessage(id3));
// Check messages count over period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
usleep(time_range_msecs);
diff --git a/src/components/utils/test/mock_signals_posix.cc b/src/components/utils/test/mock_signals_posix.cc
new file mode 100644
index 0000000000..47531b4a9f
--- /dev/null
+++ b/src/components/utils/test/mock_signals_posix.cc
@@ -0,0 +1,76 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "utils/mock_signals_posix.h"
+#include "utils/signals.h"
+
+namespace utils {
+
+bool Signals::UnsubscribeFromTermination() {
+ return MockSignalsPosix::signals_posix_mock()->UnsubscribeFromTermination();
+}
+
+bool Signals::WaitTerminationSignals(sighandler_t sig_handler) {
+ return MockSignalsPosix::signals_posix_mock()->WaitTerminationSignals(
+ sig_handler);
+}
+
+bool Signals::UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data) {
+ return MockSignalsPosix::signals_posix_mock()
+ ->UnsubscribeFromLowVoltageSignals(offset_data);
+}
+
+void Signals::SendSignal(const int signo, const pid_t pid) {
+ MockSignalsPosix::signals_posix_mock()->SendSignal(signo, pid);
+}
+
+void Signals::ExitProcess(const int status) {
+ MockSignalsPosix::signals_posix_mock()->ExitProcess(status);
+}
+
+void Signals::WaitPid(pid_t cpid, int* status, int options) {
+ MockSignalsPosix::signals_posix_mock()->WaitPid(cpid, status, options);
+}
+
+pid_t Signals::Fork() {
+ return MockSignalsPosix::signals_posix_mock()->Fork();
+}
+
+MockSignalsPosix* MockSignalsPosix::signals_posix_mock() {
+ static ::testing::NiceMock<MockSignalsPosix> signals_posix_mock;
+ return &signals_posix_mock;
+}
+
+} // namespace utils
diff --git a/src/components/utils/test/shared_ptr_test.cc b/src/components/utils/test/shared_ptr_test.cc
deleted file mode 100644
index 99fe4f7dd7..0000000000
--- a/src/components/utils/test/shared_ptr_test.cc
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdlib.h>
-#include <vector>
-#include <iostream>
-#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
-namespace test {
-namespace components {
-namespace utils_test {
-
-class CMockObject {
- public:
- CMockObject(int id);
- virtual ~CMockObject();
- virtual int getId() const;
-
- MOCK_METHOD0(destructor, void());
-
- private:
- int mId_;
-};
-
-class CExtendedMockObject : public CMockObject {
- public:
- CExtendedMockObject(int id);
-};
-
-using ::testing::NiceMock;
-
-CMockObject::CMockObject(int id) : mId_(id) {}
-
-CMockObject::~CMockObject() {
- destructor();
-}
-
-int CMockObject::getId() const {
- return mId_;
-}
-
-CExtendedMockObject::CExtendedMockObject(int id) : CMockObject(id) {}
-
-typedef utils::SharedPtr<CMockObject> tMockObjectPtr;
-typedef utils::SharedPtr<CExtendedMockObject> tExtendedMockObjectPtr;
-
-TEST(SharedPtrTest, DefaultConstructorTest) {
- // Constructor checks
- tMockObjectPtr p0;
- ASSERT_EQ(0, p0.get());
- ASSERT_FALSE(p0.valid());
-}
-
-TEST(SharedPtrTest, ConstructorWithOneParameterTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- // Constructor checks
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, CopyConstructorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- // Constructor checks
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(p1);
- ASSERT_EQ(1, p2->getId());
- ASSERT_EQ(2u, *(p2.get_ReferenceCounter()));
- tMockObjectPtr p3 = p2;
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(3u, *(p3.get_ReferenceCounter()));
- {
- tMockObjectPtr p4 = p3;
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(4u, *(p3.get_ReferenceCounter()));
- }
- // Check reference counter decreased
- ASSERT_EQ(3u, *(p3.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, SecondConstructorWithOneParameterTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(2);
- EXPECT_CALL(*object1, destructor()).Times(0);
-
- // Constructors checks
- tExtendedMockObjectPtr p1(object1);
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(p1);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(2u, *(p2.get_ReferenceCounter()));
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, AssignmentOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
-
- p5 = p2;
-
- // Check reference counter for new SharedPtr increased
- ASSERT_EQ(2, p5->getId());
- ASSERT_EQ(2u, *(p5.get_ReferenceCounter()));
-
- // Check reference counter for old SharedPtr decreased
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(3u, *(p1.get_ReferenceCounter()));
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, SecondAssignmentOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
- // Use assignment operator
- p5 = p2;
-
- // Check reference counter for new SharedPtr increased
- ASSERT_EQ(2, p5->getId());
- ASSERT_EQ(2u, *(p5.get_ReferenceCounter()));
-
- // Check reference counter for old SharedPtr decreased
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(3u, *(p1.get_ReferenceCounter()));
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, EqualOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
- // Checks
- ASSERT_TRUE(p1 == p3);
- ASSERT_TRUE(p1 == p4);
- ASSERT_TRUE(p4 == p3);
- ASSERT_FALSE(p1 == p2);
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, LessThanOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- // Checks
- if (object1 < object2) {
- ASSERT_TRUE(p1 < p2);
- } else {
- ASSERT_FALSE(p1 < p2);
- }
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, StaticPointerCastTest_DerivedToBase_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Derived class to SharedPtr to Base class
- p1 = utils::SharedPtr<CExtendedMockObject>::static_pointer_cast<CMockObject>(
- ep1);
- // Checks
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(2u, *(p1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, StaticPointerCastTest_BaseToDerived_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Base class to SharedPtr to Derived class
- ep1 = utils::SharedPtr<CMockObject>::static_pointer_cast<CExtendedMockObject>(
- p1);
- // Checks
- ASSERT_EQ(1, ep1->getId());
- ASSERT_EQ(2u, *(ep1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, DynamicPointerCastTest_DerivedToBase_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Derived class to SharedPtr to Base class
- p1 = utils::SharedPtr<CExtendedMockObject>::dynamic_pointer_cast<CMockObject>(
- ep1);
- // Checks
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(2u, *(p1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, DynamicPointerCastTest_BaseToDerived_ExpectNullPtr) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Base class to SharedPtr to Derived class
- ep1 =
- utils::SharedPtr<CMockObject>::dynamic_pointer_cast<CExtendedMockObject>(
- p1);
- // Checks
- ASSERT_EQ(NULL, ep1);
-
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, ArrowOperatorTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tExtendedMockObjectPtr ep1(object1);
- // Check
- ASSERT_EQ(1, ep1->getId());
-
- tMockObjectPtr p1(ep1);
- // Check
- ASSERT_EQ(1, p1->getId());
-
- tExtendedMockObjectPtr ep2(object2);
- // Check
- ASSERT_EQ(2, ep2->getId());
-}
-
-TEST(SharedPtrTest, DereferenceOperatorTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tExtendedMockObjectPtr ep1(object1);
- // Check
- ASSERT_EQ(1, (*ep1).getId());
-
- tMockObjectPtr p1(ep1);
- // Check
- ASSERT_EQ(1, (*p1).getId());
-
- tExtendedMockObjectPtr ep2(object2);
- // Check
- ASSERT_EQ(2, (*ep2).getId());
-}
-
-TEST(SharedPtrTest, BoolOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2;
-
- // Checks
- ASSERT_TRUE(p1);
- ASSERT_FALSE(p2);
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, ResetWithoutArgsTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
- // Act
- p2.reset();
- // Check
- EXPECT_EQ(NULL, p2.get());
- EXPECT_EQ(1u, *(p2.get_ReferenceCounter()));
- p4.reset();
- // Check
- EXPECT_EQ(NULL, p4.get());
- EXPECT_EQ(1u, *(p4.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, ResetWithArgumentTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(27);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p3(p1);
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
- // Act
- p4.reset(object2);
- // Check
- EXPECT_EQ(27, (*p4).getId());
- EXPECT_EQ(1u, *(p4.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, GetMethodTest_ExpectObjPointer) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
- tMockObjectPtr p1(object1);
- // Check
- ASSERT_EQ(object1, p1.get());
-}
-
-TEST(SharedPtrTest, ValidMethodTest_ExpectCorrectValidation) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2;
- // Check
- ASSERT_TRUE(p1.valid());
- ASSERT_FALSE(p2.valid());
-}
-
-TEST(SharedPtrTest, DISABLED_StressTest) {
- // Arrange
- const size_t kNumIterations = 1024U * 1024U;
-
- size_t objectCreated = 0U;
- size_t pointersCopied = 0U;
- std::vector<tMockObjectPtr> objects;
-
- for (size_t i = 0U; i < kNumIterations; ++i) {
- if ((true == objects.empty()) || (0 == rand() % 256)) {
- CMockObject* object = new CMockObject(0);
- EXPECT_CALL(*object, destructor());
- objects.push_back(object);
- ++objectCreated;
- } else {
- size_t objectIndex = static_cast<size_t>(rand()) % objects.size();
-
- if (rand() % 2) {
- objects.push_back(objects[objectIndex]);
- ++pointersCopied;
- } else {
- objects.erase(objects.begin() + objectIndex);
- }
- }
- }
- printf("%zu objects created, %zu pointers copied\n",
- objectCreated,
- pointersCopied);
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
diff --git a/third_party.md b/third_party.md
new file mode 100644
index 0000000000..249d58fade
--- /dev/null
+++ b/third_party.md
@@ -0,0 +1,104 @@
+### SDL CORE
+
+Copyright (C) 2018 SmartDeviceLink Consortium, Inc.
+
+#### License
+Copyright (c) 2017 - 2018, SmartDeviceLink Consortium, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. 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.
+
+#### Third Party Licenses
+
+Both the source and binary distributions of this software contain
+some third party software. All the third party software included
+or linked is redistributed under the terms and conditions of their
+original licenses.
+
+The third party software included and used by this project is:
+
+**googlemock 1.7.0**
+
+* Copyright 2008, Google Inc
+* Licensed under BSD 3-clause
+* The library is included in Google C++ Mocking Framework
+* See [https://github.com/google/googletest/tree/master/googlemock](https://github.com/google/googletest/tree/master/googlemock)
+
+**googlemock 1.7.0**
+
+* Copyright [2007] Neal Norwitz
+* Portions Copyright [2007] Google Inc
+* Licensed under the Apache License, Version 2.0
+* The library is included in the Google Mock class generator
+* See [https://github.com/google/googletest/tree/master/googlemock](https://github.com/google/googletest/tree/master/googlemock)
+
+**json-cpp 0.6.0 rc2**
+
+* Copyright (c) 2007-2010 Baptiste Lepilleur
+* Licensed under MIT License
+* The library is included in jsoncpp 3rd party static src folder
+* See [https://github.com/open-source-parsers/jsoncpp/releases/tag/svn-release-0.6.0-rc2](https://github.com/open-source-parsers/jsoncpp/releases/tag/svn-release-0.6.0-rc2)
+
+**Apache log4cxx 0.10.0**
+
+* Copyright 2004-2007 The Apache Software Foundation
+* Licensed under the Apache License, Version 2.0
+* The library is included in apache-log4cxx-0.10.0 3rd party src folder
+* See [https://github.com/apache/logging-log4cxx/releases](https://github.com/apache/logging-log4cxx/releases)
+
+**Apache Portable Runtime 1.5**
+
+* Copyright (c) 2000-2013 The Apache Software Foundation.
+* Licensed under the Apache License, Version 2.0.
+* The library is included in apr-1.5.0 3rd party src folder.
+* See [https://github.com/apache/apr/releases/tag/1.5.0](https://github.com/apache/apr/releases/tag/1.5.0)
+
+**Apache Portable Runtime Utility 1.5.3**
+
+* Copyright (c) 2000-2013 The Apache Software Foundation
+* Licensed under the Apache License, Version 2.0
+* The library is included in apr-util-1.5.3 3rd party src folder
+* See [https://github.com/apache/apr-util/releases/tag/1.5.3](https://github.com/apache/apr-util/releases/tag/1.5.3)
+
+**Apache Portable Runtime 1.5**
+
+* Copyright (c) 1987, 1992, 1993, 1994, The Regents of the University of California
+* Licensed under BSD 4-clause
+* The library is included in apr-1.5.0 3rd party src folder
+* See [https://github.com/apache/apr/releases/tag/1.5.0](https://github.com/apache/apr/releases/tag/1.5.0)
+
+**inetlib**
+
+* Copyright (c) 1996 by Internet Software Consortium
+* Licensed under ISC License
+* The library is included in the unix folder of network_io, under the apr-1.5.0 3rd party src folder
+
+**Expat 2.1.0**
+
+* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper
+* Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers
+* Licensed under MIT License
+* The library is included in expat-2.1.0 3rd party src folder
+* See [https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat](https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat)
+
+**Expat 2.1.0**
+
+* Licensed under GNU Free Documentation License v1.1
+* The library is included in the doc folder, under the expat-2.1.0 3rd party src folder
+* See [https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat/doc](https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat/doc)
+
+**Pugixml 1.2**
+
+* Copyright (C) 2006-2012, by Arseny Kapoulkine
+* Licensed under MIT License
+* The library is used as an XML processing library, located in the tools folder
+* See [https://github.com/zeux/pugixml/releases/tag/v1.2](https://github.com/zeux/pugixml/releases/tag/v1.2) \ No newline at end of file
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index cf3e2c692c..58a2cf5873 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -5,7 +5,8 @@ include(ExternalProject)
set(intergen_SOURCES "${CMAKE_CURRENT_LIST_DIR}/intergen")
set(intergen_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/intergen")
set(intergen_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/intergen")
-set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR})
+set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR} -DCMAKE_CXX_FLAGS="-std=gnu++0x")
+
ExternalProject_Add(intergen
SOURCE_DIR ${intergen_SOURCES}
diff --git a/tools/InterfaceGenerator/MsgVersionGenerate.py b/tools/InterfaceGenerator/MsgVersionGenerate.py
index 86251cd419..4a24a3239f 100644
--- a/tools/InterfaceGenerator/MsgVersionGenerate.py
+++ b/tools/InterfaceGenerator/MsgVersionGenerate.py
@@ -12,14 +12,25 @@ def generate_msg_version(file_name, path_to_storage):
"""
tree = xml.etree.ElementTree.parse(file_name)
root = tree.getroot()
- if (root.tag == "interface" and "version" in root.attrib):
+ if (root.tag == "interface" and "version" and "minVersion" in root.attrib):
check_version_format(root.attrib["version"])
array = (root.attrib["version"]).split(".")
major_version = array[0]
minor_version = array[1]
patch_version = array[2]
- if (major_version.isdigit() and minor_version.isdigit() and patch_version.isdigit):
- data_for_storage = prepare_data_for_storage(major_version, minor_version, patch_version)
+
+ check_minimum_version_format(root.attrib["minVersion"])
+ minimum_version_array = (root.attrib["minVersion"]).split(".")
+ if (len(minimum_version_array) == 2):
+ minimum_version_array.append("0")
+ minimum_major_version = minimum_version_array[0]
+ minimum_minor_version = minimum_version_array[1]
+ minimum_patch_version = minimum_version_array[2]
+
+ if (major_version.isdigit() and minor_version.isdigit() and patch_version.isdigit() and
+ minimum_major_version.isdigit() and minimum_minor_version.isdigit() and minimum_patch_version.isdigit()):
+ data_for_storage = prepare_data_for_storage(major_version, minor_version, patch_version,
+ minimum_major_version, minimum_minor_version, minimum_patch_version)
store_data_to_file(path_to_storage, data_for_storage)
else:
raise RPCBase.ParseError("Attribute version has incorect value in MOBILE_API.xml")
@@ -45,7 +56,16 @@ def check_version_format(version):
raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
"Need format of version major_version.minor_version.patch_version")
-def prepare_data_for_storage(major_version, minor_version, patch_version):
+
+def check_minimum_version_format(version):
+ """Checks correctness of format of version
+ """
+ p = re.compile('\d+\\.\d+\\.\d+|\d+\\.\d+')
+ result = p.match(version)
+ if result == None or (result.end() != len(version)):
+ raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
+ "Need format of minVersion major_version.minor_version or major_version.minor_version.patch_version")
+def prepare_data_for_storage(major_version, minor_version, patch_version, minimum_major_version, minimum_minor_version, minimum_patch_version):
"""Prepares data to store to file.
"""
temp = Template(
@@ -80,8 +100,12 @@ def prepare_data_for_storage(major_version, minor_version, patch_version):
u'''const uint16_t major_version = $m_version;\n'''
u'''const uint16_t minor_version = $min_version;\n'''
u'''const uint16_t patch_version = $p_version;\n'''
+ u'''const uint16_t minimum_major_version = $min_major_version;\n'''
+ u'''const uint16_t minimum_minor_version = $min_minor_version;\n'''
+ u'''const uint16_t minimum_patch_version = $min_patch_version;\n'''
u'''} // namespace application_manager\n'''
u'''#endif // GENERATED_MSG_VERSION_H''')
- data_to_file = temp.substitute(m_version = major_version, min_version = minor_version, p_version = patch_version)
+ data_to_file = temp.substitute(m_version = major_version, min_version = minor_version, p_version = patch_version,
+ min_major_version = minimum_major_version, min_minor_version = minimum_minor_version, min_patch_version = minimum_patch_version)
return data_to_file
diff --git a/tools/InterfaceGenerator/generator/Model.py b/tools/InterfaceGenerator/generator/Model.py
index ee458d934a..e7cce732ed 100755
--- a/tools/InterfaceGenerator/generator/Model.py
+++ b/tools/InterfaceGenerator/generator/Model.py
@@ -124,7 +124,8 @@ class InterfaceItemBase(object):
"""
def __init__(self, name, description=None, design_description=None,
- issues=None, todos=None, platform=None, default_value=None, scope=None):
+ issues=None, todos=None, platform=None, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
self.name = name
self.description = description if description is not None else []
self.design_description = \
@@ -134,6 +135,11 @@ class InterfaceItemBase(object):
self.platform = platform
self.default_value = default_value
self.scope = scope
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
+ self.history = history
class EnumElement(InterfaceItemBase):
@@ -149,13 +155,18 @@ class EnumElement(InterfaceItemBase):
def __init__(self, name, description=None, design_description=None,
issues=None, todos=None, platform=None, internal_name=None,
- value=None):
+ value=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(EnumElement, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform)
+ platform=platform, history=history)
self.internal_name = internal_name
self.value = value
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
+
@property
def primary_name(self):
@@ -180,15 +191,19 @@ class Enum(InterfaceItemBase):
def __init__(self, name, description=None, design_description=None,
issues=None, todos=None, platform=None, internal_scope=None,
- elements=None, scope=None):
+ elements=None, scope=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(Enum, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, history=history)
self.internal_scope = internal_scope
self.elements = \
elements if elements is not None else collections.OrderedDict()
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
class EnumSubset(InterfaceItemBase):
@@ -204,15 +219,19 @@ class EnumSubset(InterfaceItemBase):
def __init__(self, name, enum, description=None, design_description=None,
issues=None, todos=None, platform=None,
- allowed_elements=None):
+ allowed_elements=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(EnumSubset, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform)
+ platform=platform, history=history)
self.enum = enum
self.allowed_elements = \
allowed_elements if allowed_elements is not None else {}
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
class Param(InterfaceItemBase):
@@ -229,15 +248,20 @@ class Param(InterfaceItemBase):
def __init__(self, name, param_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, is_mandatory=True, default_value=None, scope=None):
+ platform=None, is_mandatory=True, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(Param, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, default_value=default_value, scope=scope)
+ platform=platform, default_value=default_value, scope=scope, history=history)
self.is_mandatory = is_mandatory
self.param_type = param_type
self.default_value = default_value
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed=removed
class FunctionParam(Param):
@@ -251,11 +275,13 @@ class FunctionParam(Param):
def __init__(self, name, param_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, is_mandatory=True, default_value=None, scope=None):
+ platform=None, is_mandatory=True, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(FunctionParam, self).__init__(
name, param_type=param_type, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, is_mandatory=is_mandatory, default_value=default_value, scope=scope)
+ platform=platform, is_mandatory=is_mandatory, default_value=default_value,
+ scope=scope, since=since, until=until, deprecated=deprecated, removed=removed, history=history)
self.default_value = default_value
@@ -270,11 +296,13 @@ class Struct(InterfaceItemBase):
"""
def __init__(self, name, description=None, design_description=None,
- issues=None, todos=None, platform=None, members=None, scope=None):
+ issues=None, todos=None, platform=None, members=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(Struct, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, since=since, until=until,
+ deprecated=deprecated, removed=removed, history=history)
self.members = \
members if members is not None else collections.OrderedDict()
@@ -293,11 +321,11 @@ class Function(InterfaceItemBase):
def __init__(self, name, function_id, message_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, params=None, scope=None):
+ platform=None, params=None, scope=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(Function, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, since=since, until=until, deprecated=deprecated, removed=removed, history=history)
self.function_id = function_id
self.message_type = message_type
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
index d13ac29c9b..c6a0145ac6 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
@@ -505,7 +505,6 @@ class CodeGenerator(object):
String with structs implementation source code.
"""
-
processed_enums = []
return self._struct_impl_template.substitute(
namespace=namespace,
@@ -518,9 +517,46 @@ class CodeGenerator(object):
schema_items_decl=self._gen_schema_items_decls(
struct.members.values()),
schema_item_fill=self._gen_schema_items_fill(
- struct.members.values())),
+ struct.members.values(), struct.since, struct.until, struct.deprecated, struct.removed)),
1))
+
+ def _enum_has_history_present(self, enum):
+ '''
+ Check if any elements in an enum has history signature
+ '''
+ for element in enum.param_type.elements.values():
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+ def _element_has_history_present(self, element):
+ '''
+ Check if a specific element has a history signature
+ '''
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+ def _enum_param_type_has_history_present(self, param_type):
+ '''
+ Check if any elements in an enum has history signature
+ '''
+ for element in param_type.elements.values():
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+
def _gen_schema_loc_decls(self, members, processed_enums):
"""Generate local declarations of variables for schema.
@@ -540,6 +576,7 @@ class CodeGenerator(object):
for member in members:
if type(member.param_type) is Model.Enum and \
member.param_type.name not in processed_enums:
+ has_history = self._enum_has_history_present(member)
local_var = self._gen_schema_loc_emum_var_name(
member.param_type)
result = u"\n".join(
@@ -555,6 +592,46 @@ class CodeGenerator(object):
enum=member.param_type.name,
value=x.primary_name)
for x in member.param_type.elements.values()])])
+
+ if has_history == True:
+ history_result = u"\n"
+ history_result += self._impl_code_loc_decl_enum_history_set_template.substitute(
+ type=member.param_type.name)
+ history_result += u"\n"
+ history_result += u"\n".join(
+ [self._impl_code_loc_decl_enum_history_set_value_init_template.substitute(
+ enum=member.param_type.name,
+ value=x.primary_name)
+ for x in member.param_type.elements.values() if self._element_has_history_present(x)])
+ history_result += u"\n"
+ history_map_result = []
+
+ for x in member.param_type.elements.values():
+ if self._element_has_history_present(x):
+ history_map_result.append(
+ self._impl_code_loc_decl_enum_history_set_insert_template.
+ substitute(
+ enum=member.param_type.name,
+ value=x.primary_name,
+ since=x.since if x.since is not None else "",
+ until=x.until if x.until is not None else "",
+ removed=x.removed if x.removed is not None else u"false"))
+ if(x.history is not None) :
+ history_list = x.history
+ for item in history_list:
+ history_map_result.append(
+ self._impl_code_loc_decl_enum_history_set_insert_template.
+ substitute(
+ enum=member.param_type.name,
+ value=x.primary_name,
+ since=item.since if item.since is not None else "",
+ until=item.until if item.until is not None else "",
+ removed=item.removed if item.removed is not None else u"false"))
+
+ history_result += u"\n".join(history_map_result)
+ result += "\n"
+ result += history_result
+
processed_enums.append(member.param_type.name)
result = u"".join([result, u"\n\n"]) if result else u""
elif type(member.param_type) is Model.EnumSubset:
@@ -599,10 +676,40 @@ class CodeGenerator(object):
"""
- result = u"\n\n".join(
- [self._gen_schema_item_decl(x) for x in members])
+ result_array = []
+ for x in members:
+ result_array.append(self._gen_schema_item_decl(x))
+ count = 0
+ if x.history is not None:
+ history_list = x.history
+ for item in history_list:
+ item.name += "_history_v" + str(len(history_list)-count)
+ result_array.append(self._gen_schema_item_decl(item))
+ count += 1
+ result_array.append(self._gen_history_vector_decl(history_list, x.name))
+
+ result = u"\n\n".join(result_array)
+ return result
+
+ def _gen_history_vector_decl(self, history_list, name):
+ """Generate History Vector Declaration.
+
+ Generates the declaration and initialization
+ of a vector of schema items
+
+ Arguments:
+ history_list -> list of history items
+ name -> name of parent parameter name
+
+ Returns:
+ String with history array code.
+ """
+ result_array = []
+ result_array.append(self._impl_code_shared_ptr_vector_template.substitute(var_name = name))
+ result = u"\n".join(result_array)
+ return result
+
- return u"".join([result, u"\n\n"]) if result else u""
def _gen_schema_item_decl(self, member):
"""Generate schema item declaration.
@@ -696,16 +803,30 @@ class CodeGenerator(object):
code = self._impl_code_struct_item_template.substitute(
name=param.name)
elif type(param) is Model.Enum:
- code = self._impl_code_enum_item_template.substitute(
- type=param.name,
- params=u"".join(
- [self._gen_schema_loc_emum_var_name(param),
- u", ",
- self._gen_schema_item_param_values(
- [[u"".join([param.name, u"::eType"]),
- u"".join([param.name, u"::",
- default_value.primary_name]) if
- default_value is not None else None]])]))
+ if self._enum_param_type_has_history_present(param):
+ code = self._impl_code_enum_item_with_history_template.substitute(
+ type=param.name,
+ params=u"".join(
+ [self._gen_schema_loc_emum_var_name(param),
+ u", ",
+ self._impl_gen_schema_enum_history_map_template.substitute(name=param.name),
+ u", ",
+ self._gen_schema_item_param_values(
+ [[u"".join([param.name, u"::eType"]),
+ u"".join([param.name, u"::",
+ default_value.primary_name]) if
+ default_value is not None else None]])]))
+ else:
+ code = self._impl_code_enum_item_template.substitute(
+ type=param.name,
+ params=u"".join(
+ [self._gen_schema_loc_emum_var_name(param),
+ u", ",
+ self._gen_schema_item_param_values(
+ [[u"".join([param.name, u"::eType"]),
+ u"".join([param.name, u"::",
+ default_value.primary_name]) if
+ default_value is not None else None]])]))
elif type(param) is Model.EnumSubset:
code = self._impl_code_enum_item_template.substitute(
type=param.enum.name,
@@ -746,7 +867,7 @@ class CodeGenerator(object):
return result
- def _gen_schema_items_fill(self, members):
+ def _gen_schema_items_fill(self, members=None, since=None, until=None, deprecated=None, removed=None):
"""Generate schema items fill code.
Generates source code that fills new schema with items.
@@ -758,10 +879,16 @@ class CodeGenerator(object):
String with function schema items fill code.
"""
-
- result = u"\n".join(
- [self._gen_schema_item_fill(x) for x in members])
-
+ result_array = []
+ for x in members:
+ #If history, create Smember History vector first
+ if x.history is not None:
+ history_list = x.history
+ for item in history_list:
+ result_array.append(self._gen_history_vector_item_fill(item, x.name))
+ result_array.append(self._gen_schema_item_fill(x, since, until, deprecated, removed))
+
+ result = u"\n".join(result_array)
return u"".join([result, u"\n\n"]) if result else u""
def _gen_schema_params_fill(self, message_type_name):
@@ -781,7 +908,34 @@ class CodeGenerator(object):
raise GenerateError("Unexpected call to the unimplemented function.")
- def _gen_schema_item_fill(self, member):
+ def _check_member_history(self, member):
+ """
+ Checks set of rules that history items are valid
+ Raises error if rules are violated
+ """
+ if (member.since is None and
+ member.until is None and
+ member.deprecated is None and
+ member.removed is None and
+ member.history is None):
+ return
+ if (member.history is not None and member.since is None):
+ raise GenerateError("Error: Missing since version parameter for " + member.name)
+ if (member.until is not None):
+ raise GenerateError("Error: Until should only exist in history tag for " + member.name)
+ if (member.history is None):
+ if(member.until is not None or
+ member.deprecated is not None or
+ member.removed is not None):
+ raise GenerateError("Error: No history present for " + member.name)
+ if (member.deprecated is not None and member.removed is not None):
+ raise GenerateError("Error: Deprecated and removed should not be present together for " + member.name)
+ if(member.history is not None):
+ for item in member.history:
+ if item.since is None or item.until is None:
+ raise GenerateError("Error: History items require since and until parameters for " + member.name)
+
+ def _gen_schema_item_fill(self, member, since, until, deprecated, removed):
"""Generate schema item fill code.
Generates source code that fills new schema with item.
@@ -793,11 +947,62 @@ class CodeGenerator(object):
String with schema item fill code.
"""
+ self._check_member_history(member)
+
+ if (since is not None or
+ member.since is not None):
+ if member.history is not None:
+ return self._impl_code_item_fill_template_with_version_and_history_vector.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else since if since is not None else "",
+ until=member.until if member.until is not None else until if until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else deprecated if deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else removed if removed is not None else u"false",
+ vector_name=member.name)
+ else:
+ return self._impl_code_item_fill_template_with_version.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else since if since is not None else "",
+ until=member.until if member.until is not None else until if until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else deprecated if deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else removed if removed is not None else u"false")
+ else:
+ return self._impl_code_item_fill_template.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false")
- return self._impl_code_item_fill_template.substitute(
- name=member.name,
- var_name=self._gen_schema_item_var_name(member),
- is_mandatory=u"true" if member.is_mandatory is True else u"false")
+ def _gen_history_vector_item_fill(self, member, vector_name):
+ """Generate schema item fill code.
+
+ Generates source code that fills history vector with item.
+
+ Keyword arguments:
+ member -- struct member/function parameter to process.
+
+ Returns:
+ String with schema item fill code.
+
+ """
+
+ if (member.since is not None or
+ member.until is not None or
+ member.deprecated is not None or
+ member.removed is not None):
+ return self._impl_code_append_history_vector_template.substitute(
+ vector_name=vector_name,
+ name=member.name,
+ mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else "",
+ until=member.until if member.until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else u"false")
+ else:
+ print "Warning! History item does not have any version history. Omitting %s" % member.name
@staticmethod
def _gen_schema_item_var_name(member):
@@ -899,7 +1104,7 @@ class CodeGenerator(object):
schema_items_decl=self._gen_schema_items_decls(
function.params.values()),
schema_item_fill=self._gen_schema_items_fill(
- function.params.values()),
+ function.params.values(), function.since, function.until, function.deprecated, function.removed),
schema_params_fill=self._gen_schema_params_fill(
function.message_type.name)),
1))
@@ -1283,7 +1488,6 @@ class CodeGenerator(object):
u'''#include "formatters/CSmartFactory.h"\n'''
u'''#include "smart_objects/smart_schema.h"\n'''
u'''#include "smart_objects/schema_item.h"\n'''
- u'''#include "utils/shared_ptr.h"\n'''
u'''#include "$header_file_name"\n'''
u'''\n'''
u'''$namespace_open'''
@@ -1368,10 +1572,10 @@ class CodeGenerator(object):
u'''#include "smart_objects/number_schema_item.h"\n'''
u'''#include "smart_objects/schema_item_parameter.h"\n'''
u'''\n'''
- u'''using namespace NsSmartDeviceLink::NsSmartObjects;\n'''
+ u'''using namespace ns_smart_device_link::ns_smart_objects;\n'''
u'''\n'''
u'''$namespace::$class_name::$class_name()\n'''
- u''' : NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, '''
+ u''' : ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, '''
u'''messageType::eType, StructIdentifiers::eType>() {\n'''
u''' TStructsSchemaItems struct_schema_items;\n'''
u''' InitStructSchemes(struct_schema_items);\n'''
@@ -1386,7 +1590,7 @@ class CodeGenerator(object):
u'''message_type_items);\n'''
u'''}\n'''
u'''\n'''
- u'''utils::SharedPtr<ISchemaItem> $namespace::$class_name::'''
+ u'''std::shared_ptr<ISchemaItem> $namespace::$class_name::'''
u'''ProvideObjectSchemaItemForStruct(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const StructIdentifiers::eType struct_id) {\n'''
@@ -1396,7 +1600,7 @@ class CodeGenerator(object):
u''' return it->second;\n'''
u''' }\n'''
u'''\n'''
- u''' return NsSmartDeviceLink::NsSmartObjects::'''
+ u''' return ns_smart_device_link::ns_smart_objects::'''
u'''CAlwaysFalseSchemaItem::create();\n'''
u'''}\n'''
u'''\n'''
@@ -1423,13 +1627,13 @@ class CodeGenerator(object):
u'''\n'''
u'''//-------------- String to value enum mapping ----------------\n'''
u'''\n'''
- u'''namespace NsSmartDeviceLink {\n'''
- u'''namespace NsSmartObjects {\n'''
+ u'''namespace ns_smart_device_link {\n'''
+ u'''namespace ns_smart_objects {\n'''
u'''\n'''
u'''$enum_string_coversions'''
u'''\n'''
- u'''} // NsSmartObjects\n'''
- u'''} // NsSmartDeviceLink\n'''
+ u'''} // ns_smart_objects\n'''
+ u'''} // ns_smart_device_link\n'''
u'''\n''')
_enum_to_str_converter_template = string.Template(
@@ -1465,7 +1669,7 @@ class CodeGenerator(object):
u'''\n''')
_struct_schema_item_template = string.Template(
- u'''utils::SharedPtr<ISchemaItem> struct_schema_item_${name} = '''
+ u'''std::shared_ptr<ISchemaItem> struct_schema_item_${name} = '''
u'''InitStructSchemaItem_${name}(struct_schema_items);\n'''
u'''struct_schema_items.insert(std::make_pair('''
u'''StructIdentifiers::${name}, struct_schema_item_${name}));\n'''
@@ -1474,15 +1678,15 @@ class CodeGenerator(object):
u'''struct_schema_item_${name})));''')
_function_schema_template = string.Template(
- u'''functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::'''
- u'''NsJSONHandler::'''
+ u'''functions_schemes_.insert(std::make_pair(ns_smart_device_link::'''
+ u'''ns_json_handler::'''
u'''SmartSchemaKey<FunctionID::eType, messageType::eType>'''
u'''(FunctionID::$function_id, messageType::$message_type), '''
u'''InitFunction_${function_id}_${message_type}('''
u'''struct_schema_items, function_id_items, message_type_items)));''')
_struct_impl_template = string.Template(
- u'''utils::SharedPtr<ISchemaItem> $namespace::$class_name::'''
+ u'''std::shared_ptr<ISchemaItem> $namespace::$class_name::'''
u'''InitStructSchemaItem_${struct_name}(\n'''
u''' const TStructsSchemaItems &struct_schema_items) {\n'''
u'''$code'''
@@ -1499,12 +1703,31 @@ class CodeGenerator(object):
_impl_code_loc_decl_enum_template = string.Template(
u'''std::set<${type}::eType> ${var_name};''')
+ _impl_code_loc_decl_enum_history_set_template = string.Template(
+ u'''std::map<${type}::eType, std::vector<ElementSignature>> ${type}_element_signatures;''')
+
_impl_code_loc_decl_enum_insert_template = string.Template(
u'''${var_name}.insert(${enum}::${value});''')
+ _impl_code_loc_decl_enum_history_set_value_init_template = string.Template(
+ u'''${enum}_element_signatures[${enum}::${value}] = std::vector<ElementSignature>();'''
+ )
+
+ _impl_code_loc_decl_enum_history_set_insert_template = string.Template(
+ u'''${enum}_element_signatures[${enum}::${value}].push_back(ElementSignature("${since}", "${until}", ${removed}));''')
+
+ _impl_gen_schema_enum_history_map_template = string.Template(
+ u'''${name}_element_signatures''')
+
_impl_code_item_decl_temlate = string.Template(
u'''${comment}'''
- u'''utils::SharedPtr<ISchemaItem> ${var_name} = ${item_decl};''')
+ u'''std::shared_ptr<ISchemaItem> ${var_name} = ${item_decl};''')
+
+ _impl_code_shared_ptr_vector_template = string.Template(
+ u'''std::vector<CObjectSchemaItem::SMember> ${var_name}_history_vector;''')
+
+ _impl_code_append_history_vector_template = string.Template(
+ u'''${vector_name}_history_vector.push_back(CObjectSchemaItem::SMember(${name}_SchemaItem, ${mandatory}, "${since}", "${until}", ${deprecated}, ${removed}));''')
_impl_code_integer_item_template = string.Template(
u'''TNumberSchemaItem<${type}>::create(${params})''')
@@ -1525,6 +1748,9 @@ class CodeGenerator(object):
_impl_code_enum_item_template = string.Template(
u'''TEnumSchemaItem<${type}::eType>::create(${params})''')
+ _impl_code_enum_item_with_history_template = string.Template(
+ u'''TEnumSchemaItem<${type}::eType>::createWithSignatures(${params})''')
+
_impl_code_item_param_value_template = string.Template(
u'''TSchemaItemParameter<$type>($value)''')
@@ -1532,6 +1758,14 @@ class CodeGenerator(object):
u'''schema_members["${name}"] = CObjectSchemaItem::'''
u'''SMember(${var_name}, ${is_mandatory});''')
+ _impl_code_item_fill_template_with_version = string.Template(
+ u'''schema_members["${name}"] = CObjectSchemaItem::'''
+ u'''SMember(${var_name}, ${is_mandatory}, "${since}", "${until}", ${deprecated}, ${removed});''')
+
+ _impl_code_item_fill_template_with_version_and_history_vector = string.Template(
+ u'''schema_members["${name}"] = CObjectSchemaItem::'''
+ u'''SMember(${var_name}, ${is_mandatory}, "${since}", "${until}", ${deprecated}, ${removed}, ${vector_name}_history_vector);''')
+
_function_impl_template = string.Template(
u'''CSmartSchema $namespace::$class_name::'''
u'''InitFunction_${function_id}_${message_type}(\n'''
@@ -1553,11 +1787,11 @@ class CodeGenerator(object):
u'''\n'''
u'''CObjectSchemaItem::Members '''
u'''root_members_map;\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MSG_PARAMS] = '''
u'''CObjectSchemaItem::SMember(CObjectSchemaItem::'''
u'''create(schema_members), true);\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PARAMS] = '''
u'''CObjectSchemaItem::SMember(CObjectSchemaItem::'''
u'''create(params_members), true);\n\n'''
@@ -1566,7 +1800,7 @@ class CodeGenerator(object):
_class_h_template = string.Template(
u'''$comment\n'''
- u'''class $class_name : public NsSmartDeviceLink::NsJSONHandler::'''
+ u'''class $class_name : public ns_smart_device_link::ns_json_handler::'''
u'''CSmartFactory<FunctionID::eType, messageType::eType, '''
u'''StructIdentifiers::eType> {\n'''
u''' public:\n'''
@@ -1580,7 +1814,7 @@ class CodeGenerator(object):
u''' * @brief Type that maps of struct IDs to schema items.\n'''
u''' */\n'''
u''' typedef std::map<const StructIdentifiers::eType, '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::'''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::'''
u'''ISchemaItem> > TStructsSchemaItems;\n'''
u'''\n'''
u''' /**\n'''
@@ -1589,10 +1823,10 @@ class CodeGenerator(object):
u''' * @param struct_schema_items Struct schema items.\n'''
u''' * @param struct_id ID of structure to provide.\n'''
u''' *\n'''
- u''' * @return utils::SharedPtr of strucute\n'''
+ u''' * @return std::shared_ptr of strucute\n'''
u''' */\n'''
u''' static '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> '''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::ISchemaItem> '''
u'''ProvideObjectSchemaItemForStruct(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const StructIdentifiers::eType struct_id);\n'''
@@ -1623,12 +1857,12 @@ class CodeGenerator(object):
u'''$init_struct_decls'''
u'''};''')
- _function_return_comment = u''' * @return NsSmartDeviceLink::''' \
- u'''NsSmartObjects::CSmartSchema\n'''
+ _function_return_comment = u''' * @return ns_smart_device_link::''' \
+ u'''ns_smart_objects::CSmartSchema\n'''
_function_decl_template = string.Template(
u'''$comment\n'''
- u'''static NsSmartDeviceLink::NsSmartObjects::CSmartSchema '''
+ u'''static ns_smart_device_link::ns_smart_objects::CSmartSchema '''
u'''InitFunction_${function_id}_${message_type}(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const std::set<FunctionID::eType> &function_id_items,\n'''
@@ -1637,7 +1871,7 @@ class CodeGenerator(object):
_struct_decl_template = string.Template(
u'''$comment\n'''
u'''static '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> '''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::ISchemaItem> '''
u'''InitStructSchemaItem_${struct_name}(\n'''
u''' const TStructsSchemaItems &struct_schema_items);''')
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py b/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
index cf9887d39d..6924ec67aa 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
@@ -94,7 +94,7 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
_error_response_insert_template = string.Template(
u'''functions_schemes_.insert(std::make_pair('''
- u'''NsSmartDeviceLink::NsJSONHandler::'''
+ u'''ns_smart_device_link::ns_json_handler::'''
u'''SmartSchemaKey<FunctionID::eType, messageType::eType>('''
u'''FunctionID::${function_id}, messageType::error_response), '''
u'''error_response_schema));\n''')
@@ -102,32 +102,32 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
_error_response_schema_template = (
u'''CObjectSchemaItem::Members '''
u'''params_members;\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember('''
u'''TEnumSchemaItem<FunctionID::eType>::create('''
u'''function_id_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember('''
u'''TEnumSchemaItem<messageType::eType>::create('''
u'''message_type_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kCode] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kMessage] = CObjectSchemaItem::SMember('''
u'''CStringSchemaItem::create(), true);\n'''
u'''\n'''
u'''CObjectSchemaItem::Members root_members_map;\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PARAMS] = CObjectSchemaItem::SMember('''
u'''CObjectSchemaItem::create(params_members), true);\n'''
u'''\n'''
@@ -136,30 +136,30 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
u'''\n''')
_base_params = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::'''
u'''SMember(TEnumSchemaItem<FunctionID::eType>::'''
u'''create(function_id_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::'''
u'''SMember(TEnumSchemaItem<messageType::eType>::'''
u'''create(message_type_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
_correlation_id_param = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
_additional_response_params = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kCode] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py b/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
index b3fb61f4a9..c3244f7e95 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
@@ -67,23 +67,23 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
"""
base_params = \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::''' \
u'''SMember(TEnumSchemaItem<FunctionID::eType>::''' \
u'''create(function_id_items), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::''' \
u'''SMember(TEnumSchemaItem<messageType::eType>::''' \
u'''create(message_type_items), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
correlation_id_param = \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
diff --git a/tools/InterfaceGenerator/generator/parsers/RPCBase.py b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
index 4853916dad..21f07e6ac5 100755
--- a/tools/InterfaceGenerator/generator/parsers/RPCBase.py
+++ b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
@@ -6,7 +6,7 @@ Contains base parser for SDLRPC v1/v2 and JSON RPC XML format.
import collections
import xml.etree.ElementTree
-
+import re
from generator import Model
@@ -203,16 +203,35 @@ class Parser(object):
internal_scope = None
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "internal_scope":
internal_scope = attributes[attribute]
elif attribute == "scope":
scope = attributes[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
else:
raise ParseError("Unexpected attribute '" + attribute +
"' in enum '" + params["name"] + "'")
params["internal_scope"] = internal_scope
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
elements = collections.OrderedDict()
for subelement in subelements:
@@ -236,13 +255,32 @@ class Parser(object):
params, subelements, attrib = self._parse_base_item(element, prefix)
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attrib:
if attribute == "scope":
scope = attrib[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attrib[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attrib[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attrib[attribute]
else:
raise ParseError("Unexpected attribute '" + attribute +
"' in struct '" + params["name"] + "'")
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
members = collections.OrderedDict()
for subelement in subelements:
@@ -271,13 +309,32 @@ class Parser(object):
attributes)
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "scope":
scope = attributes[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
params["function_id"] = function_id
params["message_type"] = message_type
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
function_params = collections.OrderedDict()
for subelement in subelements:
@@ -359,6 +416,8 @@ class Parser(object):
issues = []
todos = []
subelements = []
+ history = None
+ warnings = []
if "name" not in element.attrib:
raise ParseError("Name is not specified for " + element.tag)
@@ -379,6 +438,12 @@ class Parser(object):
todos.append(self._parse_simple_element(subelement))
elif subelement.tag == "issue":
issues.append(self._parse_issue(subelement))
+ elif subelement.tag == "history":
+ if history is not None:
+ raise ParseError("Elements can only have one history tag: " + element.tag)
+ history = self._parse_history(subelement, prefix, element)
+ elif subelement.tag == "warning":
+ warnings.append(self._parse_simple_element(subelement))
else:
subelements.append(subelement)
@@ -386,6 +451,7 @@ class Parser(object):
params["design_description"] = design_description
params["issues"] = issues
params["todos"] = todos
+ params["history"] = history
return params, subelements, attrib
@@ -443,6 +509,11 @@ class Parser(object):
internal_name = None
value = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "internal_name":
internal_name = attributes[attribute]
@@ -452,9 +523,22 @@ class Parser(object):
except:
raise ParseError("Invalid value for enum element: '" +
attributes[attribute] + "'")
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
params["internal_name"] = internal_name
params["value"] = value
-
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
# Magic usage is correct
# pylint: disable=W0142
return Model.EnumElement(**params)
@@ -548,6 +632,25 @@ class Parser(object):
"""
params, subelements, attrib = self._parse_base_item(element, "")
+ since_version = self._extract_attrib(attrib, "since")
+ if since_version is not None:
+ result = self._parse_version(since_version)
+ params["since"] = result
+
+ until_version = self._extract_attrib(attrib, "until")
+ if until_version is not None:
+ result = self._parse_version(until_version)
+ params["until"] = result
+
+ deprecated = self._extract_attrib(attrib, "deprecated")
+ if deprecated is not None:
+ params["deprecated"] = deprecated
+
+ removed = self._extract_attrib(attrib, "removed")
+ if removed is not None:
+ params["removed"] = removed
+
+
is_mandatory = self._extract_attrib(attrib, "mandatory")
if is_mandatory is None:
raise ParseError("'mandatory' is not specified for parameter '" +
@@ -765,3 +868,48 @@ class Parser(object):
print ("Ignoring attribute '" +
name + "'")
return True
+
+ def _parse_version(self, version):
+ """
+ Validates if a version supplied is in the correct
+ format of Major.Minor.Patch. If Major.Minor format
+ is supplied, a patch version of 0 will be added to
+ the end.
+ """
+ p = re.compile('\d+\\.\d+\\.\d+|\d+\\.\d+')
+ result = p.match(version)
+ if result == None or (result.end() != len(version)):
+ raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
+ "Need format of major_version.minor_version or major_version.minor_version.patch_version")
+
+ version_array = version.split(".")
+ if (len(version_array) == 2):
+ version_array.append("0")
+ dot_str = "."
+ return dot_str.join(version_array)
+
+ def _parse_history(self, history, prefix, parent):
+ if history.tag != "history":
+ raise ParseError("Invalid history tag: " + interface.tag)
+
+ items = []
+
+ for subelement in history:
+ if subelement.tag == "enum" and parent.tag == "enum":
+ items.append(self._parse_enum(subelement, prefix))
+ elif subelement.tag == "element" and parent.tag == "element":
+ items.append(self._parse_enum_element(subelement))
+ elif subelement.tag == "description" and parent.tag == "description":
+ items.append(self._parse_simple_element(subelement))
+ elif subelement.tag == "struct" and parent.tag == "struct":
+ items.append(self._parse_struct(subelement, prefix))
+ elif subelement.tag == "param" and parent.tag == "param":
+ items.append(self._parse_function_param(subelement, prefix))
+ elif subelement.tag == "function" and parent.tag == "function":
+ items.append(self.__parse_function(subelement, prefix))
+ else:
+ raise ParseError("A history tag must be nested within the element it notes the history for. Fix item: '" +
+ parent.attrib["name"] + "'")
+
+ return items
+
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
index b21e320038..c4813d00a8 100755
--- a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
+++ b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
@@ -17,61 +17,61 @@ from generator import Model
EXPECTED_RESULT_REQUEST = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
EXPECTED_RESULT_RESPONSE = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::kCode] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
EXPECTED_RESULT_NOTIFICATION = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
@@ -79,33 +79,33 @@ EXPECTED_RESULT_NOTIFICATION = (
EXPECTED_PRE_FUNCTION_CODE = (
u""" std::map<std::string, CObjectSchemaItem::SMember> """
u"""params_members;\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler"""
+ u""" params_members[ns_smart_device_link::ns_json_handler"""
u"""::strings::kCode] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::kMessage] = CObjectSchemaItem::SMember("""
u"""CStringSchemaItem::create(), true);\n"""
u"""\n"""
u""" std::map<std::string, CObjectSchemaItem::SMember> """
u"""root_members_map;\n"""
- u""" root_members_map[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" root_members_map[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PARAMS] = CObjectSchemaItem::SMember("""
u"""CObjectSchemaItem::create(params_members), true);\n"""
u"""\n"""
@@ -113,7 +113,7 @@ EXPECTED_PRE_FUNCTION_CODE = (
u"""root_members_map));\n"""
u"""\n"""
u""" functions_schemes_.insert(std::make_pair("""
- u"""NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<"""
+ u"""ns_smart_device_link::ns_json_handler::SmartSchemaKey<"""
u"""FunctionID::eType, messageType::eType>("""
u"""FunctionID::request, messageType::error_response)"""
u""", error_response_schema));\n"""
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
index 111ffb3cbc..35e4aeb6ce 100755
--- a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
+++ b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
@@ -17,23 +17,23 @@ from generator import Model
EXPECTED_NOTIFICATION_RESULT = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n""")
EXPECTED_REQ_RESP_RESULT = "".join([EXPECTED_NOTIFICATION_RESULT, (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n""")])
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
index 458c27543b..49369d2559 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
@@ -50,7 +50,7 @@
#include "SmartObjects/TNumberSchemaItem.hpp"
#include "SmartObjects/TSchemaItemParameter.hpp"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
XXX::YYY::ZZZ::Test::Test()
: CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType>() {
@@ -77,7 +77,7 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::ProvideObjectSchemaItemForStruct(
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::create();
}
void XXX::YYY::ZZZ::Test::InitStructSchemes(
@@ -96,24 +96,24 @@ void XXX::YYY::ZZZ::Test::InitFunctionSchemes(
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items) {
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kMessage] = CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kMessage] = CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
CSmartSchema error_response_schema(CObjectSchemaItem::create(root_members_map));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::error_response), error_response_schema));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::error_response), error_response_schema));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
}
//------------- Functions schemes initialization -------------
@@ -153,15 +153,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_name1_request(
schema_members["param2"] = CObjectSchemaItem::SMember(param2_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -173,16 +173,16 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_1_response(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -194,14 +194,14 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_2_notification(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -298,8 +298,8 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::InitStructSchemaItem_Struct2(
//-------------- String to value enum mapping ----------------
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const std::map<XXX::YYY::ZZZ::Enum1::eType, std::string> &TEnumSchemaItem<XXX::YYY::ZZZ::Enum1::eType>::getEnumElementsStringRepresentation() {
@@ -380,6 +380,6 @@ const std::map<XXX::YYY::ZZZ::messageType::eType, std::string> &TEnumSchemaItem<
return enum_string_representation;
}
-} // NsSmartObjects
-} // NsSmartDeviceLink
+} // ns_smart_objects
+} // ns_smart_device_link
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
index b265603480..d7310e4d0f 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
@@ -223,7 +223,7 @@ enum eType {
* param2 - value2
* param1 - value1
*/
-class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
+class Test : public ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
public:
/**
* @brief Constructor.
@@ -234,7 +234,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Type that maps of struct IDs to schema items.
*/
- typedef std::map<const StructIdentifiers::eType, NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> > TStructsSchemaItems;
+ typedef std::map<const StructIdentifiers::eType, ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> > TStructsSchemaItems;
/**
* @brief Helper that allows to make reference to struct
@@ -244,7 +244,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
*
* @return TSharedPtr of strucute
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> ProvideObjectSchemaItemForStruct(
const TStructsSchemaItems &struct_schema_items,
const StructIdentifiers::eType struct_id);
@@ -268,9 +268,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function1.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_name1_request(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_name1_request(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -278,9 +278,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_1_response(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_1_response(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -288,9 +288,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_2_notification(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_2_notification(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -304,7 +304,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct1(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct1(
const TStructsSchemaItems &struct_schema_items);
/**
@@ -314,7 +314,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct2(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct2(
const TStructsSchemaItems &struct_schema_items);
};
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
index 53e5b7f78a..a62f485eb9 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
@@ -50,7 +50,7 @@
#include "SmartObjects/TNumberSchemaItem.hpp"
#include "SmartObjects/TSchemaItemParameter.hpp"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
XXX::YYY::ZZZ::Test::Test()
: CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType>() {
@@ -76,7 +76,7 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::ProvideObjectSchemaItemForStruct(
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::create();
}
void XXX::YYY::ZZZ::Test::InitStructSchemes(
@@ -94,9 +94,9 @@ void XXX::YYY::ZZZ::Test::InitFunctionSchemes(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items) {
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
}
//------------- Functions schemes initialization -------------
@@ -136,15 +136,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_name1_request(
schema_members["param2"] = CObjectSchemaItem::SMember(param2_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -156,15 +156,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_1_response(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -176,14 +176,14 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_2_notification(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -280,8 +280,8 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::InitStructSchemaItem_Struct2(
//-------------- String to value enum mapping ----------------
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const std::map<XXX::YYY::ZZZ::Enum1::eType, std::string> &TEnumSchemaItem<XXX::YYY::ZZZ::Enum1::eType>::getEnumElementsStringRepresentation() {
@@ -361,6 +361,6 @@ const std::map<XXX::YYY::ZZZ::messageType::eType, std::string> &TEnumSchemaItem<
return enum_string_representation;
}
-} // NsSmartObjects
-} // NsSmartDeviceLink
+} // ns_smart_objects
+} // ns_smart_device_link
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
index 826ea55ce1..cf22f0711f 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
@@ -218,7 +218,7 @@ enum eType {
* param2 - value2
* param1 - value1
*/
-class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
+class Test : public ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
public:
/**
* @brief Constructor.
@@ -229,7 +229,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Type that maps of struct IDs to schema items.
*/
- typedef std::map<const StructIdentifiers::eType, NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> > TStructsSchemaItems;
+ typedef std::map<const StructIdentifiers::eType, ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> > TStructsSchemaItems;
/**
* @brief Helper that allows to make reference to struct
@@ -239,7 +239,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
*
* @return TSharedPtr of strucute
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> ProvideObjectSchemaItemForStruct(
const TStructsSchemaItems &struct_schema_items,
const StructIdentifiers::eType struct_id);
@@ -263,9 +263,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function1.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_name1_request(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_name1_request(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -273,9 +273,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_1_response(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_1_response(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -283,9 +283,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_2_notification(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_2_notification(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -299,7 +299,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct1(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct1(
const TStructsSchemaItems &struct_schema_items);
/**
@@ -309,7 +309,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct2(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct2(
const TStructsSchemaItems &struct_schema_items);
};
diff --git a/tools/cmake/modules/FindDBus.cmake b/tools/cmake/modules/FindDBus.cmake
deleted file mode 100644
index 1d0f29dd75..0000000000
--- a/tools/cmake/modules/FindDBus.cmake
+++ /dev/null
@@ -1,59 +0,0 @@
-# - Try to find DBus
-# Once done, this will define
-#
-# DBUS_FOUND - system has DBus
-# DBUS_INCLUDE_DIRS - the DBus include directories
-# DBUS_LIBRARIES - link these to use DBus
-#
-# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
-# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_DBUS QUIET dbus-1)
-
-FIND_LIBRARY(DBUS_LIBRARIES
- NAMES dbus-1
- HINTS ${PC_DBUS_LIBDIR}
- ${PC_DBUS_LIBRARY_DIRS}
-)
-
-FIND_PATH(DBUS_INCLUDE_DIR
- NAMES dbus/dbus.h
- HINTS ${PC_DBUS_INCLUDEDIR}
- ${PC_DBUS_INCLUDE_DIRS}
-)
-
-GET_FILENAME_COMPONENT(_DBUS_LIBRARY_DIR ${DBUS_LIBRARIES} PATH)
-FIND_PATH(DBUS_ARCH_INCLUDE_DIR
- NAMES dbus/dbus-arch-deps.h
- HINTS ${PC_DBUS_INCLUDEDIR}
- ${PC_DBUS_INCLUDE_DIRS}
- ${_DBUS_LIBRARY_DIR}
- ${DBUS_INCLUDE_DIR}
- PATH_SUFFIXES include
-)
-
-SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES) \ No newline at end of file
diff --git a/tools/cmake/modules/FindQt5DBus.cmake b/tools/cmake/modules/FindQt5DBus.cmake
deleted file mode 100644
index d850010e97..0000000000
--- a/tools/cmake/modules/FindQt5DBus.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-execute_process(
- COMMAND ${CMAKE_SOURCE_DIR}/FindQt.sh -v ${qt_version} Qt5DBusConfig.cmake
- OUTPUT_VARIABLE config_file
-)
-
-if(config_file STREQUAL "")
- message(FATAL_ERROR "Qt5 DBus module not found")
-endif(config_file STREQUAL "")
-
-include(${config_file})
diff --git a/tools/infrastructure/check_style.sh b/tools/infrastructure/check_style.sh
index 647427e793..08ae1b9860 100755
--- a/tools/infrastructure/check_style.sh
+++ b/tools/infrastructure/check_style.sh
@@ -58,6 +58,19 @@ if [ "$1" = "--fix" ]
then
for FILE_NAME in $FILE_NAMES; do fix_style $FILE_NAME; done
else
- for FILE_NAME in $FILE_NAMES; do check_style $FILE_NAME; done
+ PASSED=0
+ for FILE_NAME in $FILE_NAMES; do
+ check_style $FILE_NAME
+ if [ $? != 0 ]
+ then
+ echo "in " $FILE_NAME
+ PASSED=1
+ fi
+ done
+ if [ $PASSED = 1 ]
+ then
+ exit 1
+ fi
fi
+
diff --git a/tools/intergen/GenerateInterfaceLibrary.cmake b/tools/intergen/GenerateInterfaceLibrary.cmake
index bec35e1e3a..31b06880c6 100644
--- a/tools/intergen/GenerateInterfaceLibrary.cmake
+++ b/tools/intergen/GenerateInterfaceLibrary.cmake
@@ -11,20 +11,14 @@ set(GENERATED_LIB_HEADER_DEPENDENCIES
# |generated_interface_names| should contain list of generated interfaces
# if |AUTO_FUNC_IDS| is added to argument list, intergen is called with "-a"
# flag telling intergen to generate function ids automatically
-# if |DBUS_SUPPORT| is added to argument list, intergen is called with "-d"
-# flag that enables DBus serialization code generation
# from xml_file (intergen creates separate directory for every interface).
# Their names are written lowercase_underscored_style.
function (GenerateInterfaceLibrary xml_file_name generated_interface_names)
- set(options AUTO_FUNC_IDS DBUS_SUPPORT)
+ set(options AUTO_FUNC_IDS)
cmake_parse_arguments(GenerateInterfaceLibrary "${options}" "" "" ${ARGN})
if (GenerateInterfaceLibrary_AUTO_FUNC_IDS)
set(AUTOID "-a")
endif()
- if (GenerateInterfaceLibrary_DBUS_SUPPORT)
- set(NEED_DBUS "-d")
- list(APPEND GENERATED_LIB_HEADER_DEPENDENCIES ${DBUS_INCLUDE_DIRS})
- endif()
foreach(interface_name ${generated_interface_names})
set(HEADERS
@@ -41,7 +35,7 @@ function (GenerateInterfaceLibrary xml_file_name generated_interface_names)
${interface_name}/interface.cc
)
add_custom_command( OUTPUT ${HEADERS} ${SOURCES}
- COMMAND ${INTERGEN_CMD} -f ${CMAKE_CURRENT_SOURCE_DIR}/${xml_file_name} -j ${AUTOID} ${NEED_DBUS} -i ${interface_name}
+ COMMAND ${INTERGEN_CMD} -f ${CMAKE_CURRENT_SOURCE_DIR}/${xml_file_name} -j ${AUTOID} -i ${interface_name}
DEPENDS ${INTERGEN_CMD} ${xml_file_name}
COMMENT "Generating interface ${interface_name} from ${xml_file_name}"
VERBATIM
diff --git a/tools/intergen/cppgen/CMakeLists.txt b/tools/intergen/cppgen/CMakeLists.txt
index c6e052a2ae..d20f3d9ab3 100644
--- a/tools/intergen/cppgen/CMakeLists.txt
+++ b/tools/intergen/cppgen/CMakeLists.txt
@@ -27,7 +27,6 @@ set (SOURCES
src/cppgen/namespace.cc
src/cppgen/naming_convention.cc
src/cppgen/struct_type_constructor.cc
- src/cppgen/struct_type_dbus_serializer.cc
src/cppgen/struct_type_from_json_method.cc
src/cppgen/struct_type_is_initialized_method.cc
src/cppgen/struct_type_is_valid_method.cc
@@ -58,7 +57,6 @@ set (HEADERS
include/cppgen/namespace.h
include/cppgen/naming_convention.h
include/cppgen/struct_type_constructor.h
- include/cppgen/struct_type_dbus_serializer.h
include/cppgen/struct_type_from_json_method.h
include/cppgen/struct_type_is_initialized_method.h
include/cppgen/struct_type_is_valid_method.h
diff --git a/tools/intergen/cppgen/include/cppgen/generator_preferences.h b/tools/intergen/cppgen/include/cppgen/generator_preferences.h
index 5278a24417..d0a58950e2 100644
--- a/tools/intergen/cppgen/include/cppgen/generator_preferences.h
+++ b/tools/intergen/cppgen/include/cppgen/generator_preferences.h
@@ -43,18 +43,15 @@ struct TypePreferences {
int minimum_interger_size;
bool avoid_unsigned;
bool generate_json;
- bool generate_dbus;
TypePreferences(int minimum_interger_size,
bool avoid_unsigned,
- bool generate_json,
- bool generate_dbus);
+ bool generate_json);
};
struct Preferences {
Preferences(int minimum_interger_size,
bool avoid_unsigned,
bool generate_json,
- bool generate_dbus,
const std::set<std::string>& requested_interfaces);
TypePreferences type_preferences;
std::set<std::string> requested_interfaces;
diff --git a/tools/intergen/cppgen/include/cppgen/message_factory_function.h b/tools/intergen/cppgen/include/cppgen/message_factory_function.h
index da63b4453a..aa8a0ab6c4 100644
--- a/tools/intergen/cppgen/include/cppgen/message_factory_function.h
+++ b/tools/intergen/cppgen/include/cppgen/message_factory_function.h
@@ -46,8 +46,7 @@ class Interface;
class MessageFactoryFunction: public CppFunction {
public:
enum SerializationType {
- kJson,
- kDbus
+ kJson
};
// Methods
diff --git a/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h b/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h
deleted file mode 100644
index 64872f3265..0000000000
--- a/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
-#define CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
-
-#include "cppgen/cpp_function.h"
-
-namespace codegen {
-class Interface;
-class Struct;
-class TypePreferences;
-
-class StructTypeDbusMessageSignatureMethod: public CppFunction {
- public:
- StructTypeDbusMessageSignatureMethod(const TypePreferences* preferences,
- const Struct* strct,
- bool substructure);
- ~StructTypeDbusMessageSignatureMethod();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- const TypePreferences* preferences_;
- bool substructure_;
- const Struct* strct_;
-};
-
-class StructTypeFromDbusReaderConstructor : public CppStructConstructor {
- public:
- StructTypeFromDbusReaderConstructor(const TypePreferences* preferences,
- const Struct* strct,
- bool substructure,
- const std::string& base_class_name);
- ~StructTypeFromDbusReaderConstructor();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- const TypePreferences* preferences_;
- bool substructure_;
- const Struct* strct_;
-};
-
-class StructTypeToDbusWriterMethod : public CppFunction {
- public:
- StructTypeToDbusWriterMethod(const Struct* strct,
- bool substructure);
- ~StructTypeToDbusWriterMethod();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- bool substructure_;
- const Struct* strct_;
-};
-
-} // namespace codegen
-
-#endif // CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
diff --git a/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc b/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
index 49bd758b6e..519e6a06e2 100644
--- a/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
@@ -183,9 +183,6 @@ void CppInterfaceCodeGenerator::GenerateMessageFactories() {
if (preferences_->generate_json) {
ser_types[ser_types_count++] = MessageFactoryFunction::kJson;
}
- if (preferences_->generate_dbus) {
- ser_types[ser_types_count++] = MessageFactoryFunction::kDbus;
- }
for (size_t i = 0; i < ser_types_count; ++i) {
MessageFactoryFunction request_factory(interface_,
diff --git a/tools/intergen/cppgen/src/cppgen/declaration_generator.cc b/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
index 46e459198e..649ffd8c68 100644
--- a/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
@@ -47,7 +47,6 @@
#include "cppgen/module_manager.h"
#include "cppgen/naming_convention.h"
#include "cppgen/struct_type_constructor.h"
-#include "cppgen/struct_type_dbus_serializer.h"
#include "cppgen/struct_type_from_json_method.h"
#include "cppgen/struct_type_is_initialized_method.h"
#include "cppgen/struct_type_is_valid_method.h"
@@ -98,14 +97,6 @@ void DeclareExternalTypes(const TypePreferences& prefs, Namespace* ns) {
Namespace::ForwardDeclaration(
Namespace::ForwardDeclaration::kClass, "Value"));
}
- if (prefs.generate_dbus) {
- ns->nested("dbus").ForwardDeclare(
- Namespace::ForwardDeclaration(
- Namespace::ForwardDeclaration::kClass, "MessageReader"));
- ns->nested("dbus").ForwardDeclare(
- Namespace::ForwardDeclaration(
- Namespace::ForwardDeclaration::kClass, "MessageWriter"));
- }
}
}
@@ -172,13 +163,6 @@ void DeclarationGenerator::GenerateCodeForStruct(const Struct* strct) {
StructTypeFromJsonConstructor(strct, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(strct).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(
- preferences_, strct, true, base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(strct, true).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- strct, true).Declare(&o, true);
- }
StructTypeIsValidMethod(strct).Declare(&o, true);
StructTypeIsInitializedMethod(strct).Declare(&o, true);
StructTypeStructEmptyMethod(strct).Declare(&o, true);
@@ -284,13 +268,6 @@ void DeclarationGenerator::GenerateCodeForRequest(const Request& request,
StructTypeFromJsonConstructor(&request, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(&request).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &request, false,
- base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(&request, false).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &request, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&request).Declare(&o, true);
StructTypeIsInitializedMethod(&request).Declare(&o, true);
StructTypeStructEmptyMethod(&request).Declare(&o, true);
@@ -336,14 +313,6 @@ void DeclarationGenerator::GenerateCodeForResponse(const Response& response) {
StructTypeToJsonMethod(&response).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &response, false,
- base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(&response, false).Declare(&o , true);
-
- StructTypeDbusMessageSignatureMethod(preferences_,
- &response, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&response).Declare(&o, true);
StructTypeIsInitializedMethod(&response).Declare(&o, true);
StructTypeStructEmptyMethod(&response).Declare(&o, true);
@@ -389,13 +358,6 @@ void DeclarationGenerator::GenerateCodeForNotification(
StructTypeFromJsonConstructor(&notification, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(&notification).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &notification, false,
- base_class_name).Declare(&o , true);
- StructTypeToDbusWriterMethod(&notification, false).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &notification, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&notification).Declare(&o, true);
StructTypeIsInitializedMethod(&notification).Declare(&o, true);
StructTypeStructEmptyMethod(&notification).Declare(&o, true);
diff --git a/tools/intergen/cppgen/src/cppgen/definition_generator.cc b/tools/intergen/cppgen/src/cppgen/definition_generator.cc
index e2ad0ded04..b5e404fa71 100644
--- a/tools/intergen/cppgen/src/cppgen/definition_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/definition_generator.cc
@@ -40,7 +40,6 @@
#include "cppgen/message_handle_with_method.h"
#include "cppgen/module_manager.h"
#include "cppgen/struct_type_constructor.h"
-#include "cppgen/struct_type_dbus_serializer.h"
#include "cppgen/struct_type_from_json_method.h"
#include "cppgen/struct_type_is_initialized_method.h"
#include "cppgen/struct_type_is_valid_method.h"
@@ -97,13 +96,6 @@ void DefinitionGenerator::GenerateCodeForStruct(const Struct* strct) {
StructTypeFromJsonConstructor(strct, base_class_name).Define(&o , false);
StructTypeToJsonMethod(strct).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, strct, true,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(strct, true).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- strct, true).Define(&o, false);
- }
StructTypeIsValidMethod(strct).Define(&o, false);
StructTypeIsInitializedMethod(strct).Define(&o, false);
StructTypeStructEmptyMethod(strct).Define(&o, false);
@@ -137,13 +129,6 @@ void DefinitionGenerator::GenerateCodeForResponse(const Response& response) {
StructTypeFromJsonConstructor(&response, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&response).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &response, false,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(&response, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &response, false).Define(&o, false);
- }
MessageHandleWithMethod(response.name()).Define(&o, false);
StructTypeIsValidMethod(&response).Define(&o, false);
StructTypeIsInitializedMethod(&response).Define(&o, false);
@@ -173,13 +158,6 @@ void DefinitionGenerator::GenerateCodeForNotification(
StructTypeFromJsonConstructor(&notification, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&notification).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &notification, false,
- base_class_name).Define(&o, false);
- StructTypeToDbusWriterMethod(&notification, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &notification, false).Define(&o, false);
- }
MessageHandleWithMethod(notification.name()).Define(&o, false);
StructTypeIsValidMethod(&notification).Define(&o, false);
StructTypeIsInitializedMethod(&notification).Define(&o, false);
@@ -209,13 +187,6 @@ void DefinitionGenerator::GenerateCodeForRequest(const Request& request,
StructTypeFromJsonConstructor(&request, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&request).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &request, false,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(&request, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &request, false).Define(&o, false);
- }
StructTypeIsValidMethod(&request).Define(&o, false);
StructTypeIsInitializedMethod(&request).Define(&o, false);
StructTypeStructEmptyMethod(&request).Define(&o, false);
diff --git a/tools/intergen/cppgen/src/cppgen/generator_preferences.cc b/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
index ca5b12e2d9..cc3bbe0819 100644
--- a/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
+++ b/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
@@ -44,21 +44,18 @@ namespace codegen {
TypePreferences::TypePreferences(int minimum_interger_size,
bool avoid_unsigned,
- bool generate_json,
- bool generate_dbus)
+ bool generate_json)
: minimum_interger_size(minimum_interger_size),
avoid_unsigned(avoid_unsigned),
- generate_json(generate_json),
- generate_dbus(generate_dbus) {
+ generate_json(generate_json) {
}
Preferences::Preferences(int minimum_interger_size,
bool avoid_unsigned,
bool generate_json,
- bool generate_dbus,
const std::set<std::string>& requested_interfaces)
: type_preferences(minimum_interger_size, avoid_unsigned,
- generate_json, generate_dbus),
+ generate_json),
requested_interfaces(requested_interfaces) {
}
diff --git a/tools/intergen/cppgen/src/cppgen/handler_interface.cc b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
index 57b41523fd..a078b7af9a 100644
--- a/tools/intergen/cppgen/src/cppgen/handler_interface.cc
+++ b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
@@ -76,7 +76,7 @@ void HandlerInterface::CollectMethods() {
assert(!"Unexpected function message type");
}
}
- std::auto_ptr<CppClass::Method> destructor(
+ std::unique_ptr<CppClass::Method> destructor(
new CppClass::Method(this, CppClass::kPublic,
"~"+name(), "",
CppFunction::kVirtual));
@@ -93,7 +93,7 @@ void HandlerInterface::AddFunctionMessageHandlers(
message_ns.ForwardDeclare(Namespace::ForwardDeclaration(
Namespace::ForwardDeclaration::kStruct,
func_msg->name()));
- std::auto_ptr<CppClass::Method> method(
+ std::unique_ptr<CppClass::Method> method(
new CppClass::Method(
this, CppClass::kPublic, "Handle" + func_msg->name(),
"void", CppFunction::kVirtual | CppFunction::kAbstract));
diff --git a/tools/intergen/cppgen/src/cppgen/message_factory_function.cc b/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
index 2cfc3ea0cd..bce7ef50b2 100644
--- a/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
+++ b/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
@@ -47,15 +47,15 @@ MessageFactoryFunction::MessageFactoryFunction(
SerializationType serialization_type,
FunctionMessage::MessageType factory_type)
: CppFunction("",
- serialization_type == kJson ? "NewFromJson" : "NewFromDbus",
+ "NewFromJson",
Capitalize(
FunctionMessage::MessageTypeToString(
factory_type)) + "*"),
interface_(interface),
factory_type_(factory_type) {
Add(MessageFactoryFunction::Parameter(
- serialization_type == kJson ? "json" : "reader",
- serialization_type == kJson ? "const Json::Value*": "dbus::MessageReader*"));
+ "json",
+ "const Json::Value*"));
Add(MessageFactoryFunction::Parameter("function_id", "FunctionID"));
}
diff --git a/tools/intergen/cppgen/src/cppgen/module_manager.cc b/tools/intergen/cppgen/src/cppgen/module_manager.cc
index 494e279e5c..104e3fa856 100644
--- a/tools/intergen/cppgen/src/cppgen/module_manager.cc
+++ b/tools/intergen/cppgen/src/cppgen/module_manager.cc
@@ -105,12 +105,6 @@ ModuleManager::ModuleManager(const std::string& name,
functions_source_.Include(
CppFile::Header("rpc_base/rpc_base_json_inl.h", true));
}
- if (prefs.generate_dbus) {
- structs_source_.Include(
- CppFile::Header("rpc_base/rpc_base_dbus_inl.h", true));
- functions_source_.Include(
- CppFile::Header("rpc_base/rpc_base_dbus_inl.h", true));
- }
}
ModuleManager::~ModuleManager() {
diff --git a/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc b/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc
deleted file mode 100644
index 5040652e43..0000000000
--- a/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "cppgen/struct_type_dbus_serializer.h"
-
-#include "cppgen/naming_convention.h"
-#include "cppgen/type_name_code_generator.h"
-#include "model/composite_type.h"
-#include "utils/safeformat.h"
-
-using typesafe_format::strmfmt;
-
-namespace codegen {
-
-StructTypeDbusMessageSignatureMethod::StructTypeDbusMessageSignatureMethod(
- const TypePreferences* preferences,
- const Struct* strct,
- bool substructure)
- : CppFunction(strct->name(), "GetDbusSignature", "void", kStatic),
- preferences_(preferences),
- substructure_(substructure),
- strct_(strct) {
- Add(Parameter("signature", "std::string*"));
-}
-
-StructTypeDbusMessageSignatureMethod::~StructTypeDbusMessageSignatureMethod() {
-}
-
-void StructTypeDbusMessageSignatureMethod::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- if (!fields.empty()) {
- if (substructure_) {
- *os << "(*signature) += DBUS_STRUCT_BEGIN_CHAR;\n";
- }
- for (Struct::FieldsList::const_iterator i = fields.begin(),
- end = fields.end(); i != end; ++i) {
- // Field is considered optional if it has mandatory=false attribute and
- // if it does NOT have default values. Fields that have default values are
- // always available no mater if they present in input or not
- bool field_is_optional = false;
- if (!i->is_mandatory()) {
- if (i->default_value() == NULL) {
- field_is_optional = true;
- }
- }
- std::string field_type = RpcTypeNameGenerator(&strct_->interface(),
- preferences_,
- i->type(),
- field_is_optional).result();
- strmfmt(*os, "rpc::DbusSignature< {0} >({1});\n",
- field_type, parameters_[0].name);
-
- }
- if (substructure_) {
- *os << "(*signature) += DBUS_STRUCT_END_CHAR;\n";
- }
- }
-}
-
-StructTypeFromDbusReaderConstructor::StructTypeFromDbusReaderConstructor(
- const TypePreferences* preferences,
- const Struct* strct,
- bool substructure,
- const std::string& base_class_name)
- : CppStructConstructor(strct->name()),
- preferences_(preferences),
- strct_(strct),
- substructure_(substructure) {
- Add(Parameter("reader__", "dbus::MessageReader*"));
- std::string base_initializer = "reader__";
- if (!strct->frankenstruct()) {
- base_initializer = "InitHelper(true)";
- }
- Add(Initializer(base_class_name, base_initializer));
- // In case of non-substructure use initializer list to initialize fields
- // From MessageReader passed in
- if (!substructure_) {
- const Struct::FieldsList& fields = strct->fields();
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- Add(Initializer(AvoidKeywords(i->name()),
- "reader__"));
- }
- }
-}
-
-StructTypeFromDbusReaderConstructor::~StructTypeFromDbusReaderConstructor() {
-}
-
-void StructTypeFromDbusReaderConstructor::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- // If initializing substructure (a structure that is used as
- // a field of other structure) additional structure reading iterator
- // should be created
- if (substructure_ && !fields.empty()) {
- *os << "dbus::MessageReader subreader__ = reader__->TakeStructReader();\n";
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- // Field is considered optional if it has mandatory=false attribute and
- // if it does NOT have default values. Fields that have default values are
- // always available no mater if they present in input or not
- bool field_is_optional = false;
- if (!i->is_mandatory()) {
- if (i->default_value() == NULL) {
- field_is_optional = true;
- }
- }
- std::string field_type = RpcTypeNameGenerator(&strct_->interface(),
- preferences_,
- i->type(),
- field_is_optional).result();
- strmfmt(*os, "{0} = {1}(&subreader__);\n", i->name(), field_type);
- }
- }
-}
-
-StructTypeToDbusWriterMethod::StructTypeToDbusWriterMethod(
- const Struct* strct,
- bool substructure)
- : CppFunction(strct->name(), "ToDbusWriter", "void", kConst),
- substructure_(substructure),
- strct_(strct) {
- Add(Parameter("writer__", "dbus::MessageWriter*"));
-}
-
-StructTypeToDbusWriterMethod::~StructTypeToDbusWriterMethod() {
-
-}
-
-void StructTypeToDbusWriterMethod::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- if (!fields.empty()) {
- std::string writer_ptr_name = parameters_[0].name;
- if (substructure_) {
- strmfmt(*os, "dbus::MessageWriter subwriter__({0}, dbus::kStruct, NULL);\n",
- writer_ptr_name);
- writer_ptr_name = "&subwriter__";
- }
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- strmfmt(*os, "{0}.ToDbusWriter({1});\n",
- i->name(),
- writer_ptr_name);
- }
- }
-}
-
-
-} // namespace codegen
diff --git a/tools/intergen/model/src/model/composite_type.cc b/tools/intergen/model/src/model/composite_type.cc
index 57e89cce54..d4b0687c5a 100644
--- a/tools/intergen/model/src/model/composite_type.cc
+++ b/tools/intergen/model/src/model/composite_type.cc
@@ -332,6 +332,7 @@ bool NullableType::operator<(const NullableType& that) const {
if (type_ != that.type_) {
return type_ < that.type_;
}
+ return false;
}
TypeCodeGenerator* NullableType::Apply(
diff --git a/tools/intergen/test/CMakeLists.txt b/tools/intergen/test/CMakeLists.txt
index f2973dd71c..7695ec419c 100644
--- a/tools/intergen/test/CMakeLists.txt
+++ b/tools/intergen/test/CMakeLists.txt
@@ -30,11 +30,7 @@
if(BUILD_TESTS)
include(${CMAKE_SOURCE_DIR}/tools/intergen/GenerateInterfaceLibrary.cmake)
-if (${HMI_DBUS_API})
- GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface DBUS_SUPPORT)
-else()
- GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface)
-endif()
+GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface)
set (TEST_HMI_INTERFACES
common
@@ -45,11 +41,7 @@ set (TEST_HMI_INTERFACES
ui
)
-if (${HMI_DBUS_API})
- GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS DBUS_SUPPORT)
-else()
- GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS)
-endif()
+GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS)
include_directories (
${CMAKE_SOURCE_DIR}/src/components/rpc_base/include
@@ -70,16 +62,5 @@ set (SOURCES
generated_interface_json_tests.cc
)
-if (${HMI_DBUS_API})
- # Build dbus tests
- include_directories(
- ${CMAKE_SOURCE_DIR}/src/components/dbus/include
- ${DBUS_INCLUDE_DIRS}
- )
- set (LIBRARIES ${LIBRARIES} DBus)
- set (SOURCES ${SOURCES} generated_interface_dbus_tests.cc)
-endif ()
-
-
create_test(test_generated_interface "${SOURCES}" "${LIBRARIES}")
endif()
diff --git a/tools/intergen/test/generated_interface_dbus_tests.cc b/tools/intergen/test/generated_interface_dbus_tests.cc
deleted file mode 100644
index a510ccd77a..0000000000
--- a/tools/intergen/test/generated_interface_dbus_tests.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gmock/gmock.h"
-
-#include <test_rpc_interface/interface.h>
-#include <test_rpc_interface/functions.h>
-
-#include "dbus/dbus_message.h"
-
-namespace test {
-using namespace rpc::test_rpc_interface;
-
-TEST(GeneratedInterfaceDbusTests, TestFailedDbusDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_TRUE(reader.has_failed());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_FALSE(dm.is_valid());
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- writer.PutUint16(22);
- writer.PutUint16(42);
- dbus::MessageWriter array_writer(&writer, dbus::kArray, DBUS_TYPE_BYTE_AS_STRING);
- array_writer.PutByte(11);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_TRUE(dm.is_valid());
- ASSERT_EQ(dm.targetID, 22);
- ASSERT_EQ(dm.messageLength, 42);
- ASSERT_EQ(dm.messageData.size(), 1u);
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusSerializationDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- request::DiagnosticMessage dm;
- dm.targetID = 70;
- dm.messageLength = 1;
- dm.messageData.push_back(42);
- dm.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_TRUE(dm.is_valid());
- ASSERT_EQ(dm.targetID, 70);
- ASSERT_EQ(dm.messageLength, 1);
- ASSERT_EQ(dm.messageData.size(), 1u);
- ASSERT_EQ(dm.messageData[0], 42u);
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusAddSubMenuSerializatioDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- notification::DummyNotification dn;
- TdStruct tds;
- tds.resArrMap["Hello"].push_back(R_SUCCESS);
- (*tds.optionalResArrMap)["World"].push_back(R_INVALID_DATA);
- dn.tds.push_back(tds);
- ASSERT_TRUE(dn.is_valid());
- dn.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msg);
- notification::DummyNotification dn(&reader);
- ASSERT_TRUE(dn.is_initialized());
- ASSERT_TRUE(dn.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(dn.tds[0].resArrMap["Hello"][0], R_SUCCESS);
- ASSERT_EQ((*dn.tds[0].optionalResArrMap)["World"][0], R_INVALID_DATA);
- }
-}
-
-} // namespace test
diff --git a/tools/intergen/test/test_hmi_interface.xml b/tools/intergen/test/test_hmi_interface.xml
index 16f2892327..7573d35ef9 100644
--- a/tools/intergen/test/test_hmi_interface.xml
+++ b/tools/intergen/test/test_hmi_interface.xml
@@ -66,6 +66,7 @@
<enum name="ButtonName">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
<element name="OK"/>
+ <element name="PLAY_PAUSE"/>
<element name="SEEKLEFT"/>
<element name="SEEKRIGHT"/>
<element name="TUNEUP"/>
@@ -2777,938 +2778,573 @@
</description>
</param>
</function>
-
-<!--Qt HMI version of GetVehicleData-->
- <function name="GetGpsData" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetGpsData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="true">
+ <function name="SubscribeVehicleData" messagetype="request">
+ <description>
+ Subscribes for specific published data items.
+ The data will be only sent if it has changed.
+ The application will be notified by the onVehicleData notification whenever new data is available.
+ To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
+ </description>
+ <param name="gps" type="Boolean" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
-
- <function name="GetSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="response">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <param name="speed" type="Boolean" mandatory="false">
<description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="GetRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="response">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <param name="rpm" type="Boolean" mandatory="false">
<description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="GetFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <param name="fuelLevel" type="Boolean" mandatory="false">
<description>The fuel level in the tank (percentage)</description>
</param>
- </function>
-
- <function name="GetFuelLevelState" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="response">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
<description>The fuel level state</description>
</param>
- </function>
-
- <function name="GetInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="GetExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
+ <param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- </function>
-
- <function name="GetVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
-
- <function name="GetPrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="response">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="GetTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <param name="tirePressure" type="Boolean" mandatory="false">
<description>See TireStatus</description>
</param>
- </function>
-
- <function name="GetOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="response">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
+ <param name="odometer" type="Boolean" mandatory="false">
<description>Odometer in km</description>
</param>
- </function>
-
- <function name="GetBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <param name="beltStatus" type="Boolean" mandatory="false">
<description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="GetBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <param name="bodyInformation" type="Boolean" mandatory="false">
<description>The body information including power modes</description>
</param>
- </function>
-
- <function name="GetDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <param name="deviceStatus" type="Boolean" mandatory="false">
<description>The device status including signal and battery strength</description>
</param>
- </function>
-
- <function name="GetDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <param name="driverBraking" type="Boolean" mandatory="false">
<description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="GetWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <param name="wiperStatus" type="Boolean" mandatory="false">
<description>The status of the wipers</description>
</param>
- </function>
-
- <function name="GetHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <param name="headLampStatus" type="Boolean" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="GetEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="response">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <param name="engineTorque" type="Boolean" mandatory="false">
<description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
-
- <function name="GetAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
<description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="GetSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="GetECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="GetECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
- </function>
-
- <function name="GetAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
+ <param name="airbagStatus" type="Boolean" mandatory="false">
<description>The status of the air bags</description>
</param>
- </function>
-
- <function name="GetEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
<description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="GetClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
<description>The status modes of the cluster</description>
</param>
- </function>
-
- <function name="GetMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="response">
- <param name="myKey" type="Common.MyKey" mandatory="true">
+ <param name="myKey" type="Boolean" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
-<!--end Qt HMI version of GetVehicleData-->
-
-<!--Qt HMI version of OnVehicleData-->
- <function name="OnGpsData" messagetype="notification">
- <param name="gps" type="Common.GPSData" mandatory="true">
+ <function name="SubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
-
- <function name="OnSpeed" messagetype="notification">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
<description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="OnRpm" messagetype="notification">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
<description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="OnFuelLevel" messagetype="notification">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
<description>The fuel level in the tank (percentage)</description>
</param>
- </function>
-
- <function name="OnFuelLevelState" messagetype="notification">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
<description>The fuel level state</description>
</param>
- </function>
-
- <function name="OnInstantFuelConsumption" messagetype="notification">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="OnExternalTemperature" messagetype="notification">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
-
- <function name="OnVin" messagetype="notification">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number.</description>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
</param>
- </function>
-
- <function name="OnPrndl" messagetype="notification">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="OnTirePressure" messagetype="notification">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
<description>See TireStatus</description>
</param>
- </function>
-
- <function name="OnOdometer" messagetype="notification">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="2000000" mandatory="true">
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
<description>Odometer in km</description>
</param>
- </function>
-
- <function name="OnBeltStatus" messagetype="notification">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="OnBodyInformation" messagetype="notification">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
<description>The body information including power modes</description>
</param>
- </function>
-
- <function name="OnDeviceStatus" messagetype="notification">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The device status including signal and battery strength</description>
</param>
- </function>
-
- <function name="OnDriverBraking" messagetype="notification">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="OnWiperStatus" messagetype="notification">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the wipers</description>
</param>
- </function>
-
- <function name="OnHeadLampStatus" messagetype="notification">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="OnEngineTorque" messagetype="notification">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
<description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
-
- <function name="OnAccPedalPosition" messagetype="notification">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
<description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="OnSteeringWheelAngle" messagetype="notification">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="OnMyKey" messagetype="notification">
- <param name="myKey" type="Common.MyKey" mandatory="true">
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
-<!--end Qt HMI version of OnVehicleData-->
-
-<!--Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- <function name="SubscribeGps" messagetype="request">
+ <function name="UnsubscribeVehicleData" messagetype="request">
+ <description>
+ This function is used to unsubscribe the notifications from the subscribeVehicleData function.
+ </description>
<param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <description>ID of application that requested this RPC.</description>
</param>
- </function>
- <function name="SubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
+ <param name="gps" type="Boolean" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeGps" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="UnsubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="SubscribeSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="SubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
</param>
- </function>
-
- <function name="SubscribeRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="SubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="UnsubscribeRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="UnsubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="SubscribeFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
- <function name="SubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
-
- <function name="SubscribeFuelLevel_State" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
</param>
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="SubscribeInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="SubscribeExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="SubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
- <function name="UnsubscribeExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <function name="UnsubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="SubscribePrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="SubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribePrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="SubscribeVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="SubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="UnsubscribeVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="UnsubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
-
- <function name="SubscribeTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="SubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="SubscribeOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="SubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
-
- <function name="SubscribeBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="SubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
-
- <function name="SubscribeBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
- <function name="SubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
+ <function name="GetVehicleData" messagetype="request">
+ <description>Non periodic vehicle data read request.</description>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="SubscribeDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="SubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
</param>
- </function>
-
- <function name="SubscribeDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
</param>
- </function>
- <function name="SubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
-
- <function name="SubscribeWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="SubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
</param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="SubscribeHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
+ <param name="headLampStatus" type="Boolean" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="SubscribeEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
- <function name="SubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
-
- <function name="SubscribeAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
</function>
- <function name="UnsubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
+ <function name="GetVehicleData" messagetype="response">
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
-
- <function name="SubscribeSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="SubscribeECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="SubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="SubscribeAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="SubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
</function>
- <function name="UnsubscribeAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <function name="OnVehicleData" messagetype="notification">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="SubscribeEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="SubscribeClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
</param>
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
</param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
-
- <function name="SubscribeMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="SubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
</function>
-<!--end Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
</interface>
</interfaces>
diff --git a/tools/intergen/tool/intergen.cc b/tools/intergen/tool/intergen.cc
index bad87b178b..8fc8302dcc 100644
--- a/tools/intergen/tool/intergen.cc
+++ b/tools/intergen/tool/intergen.cc
@@ -54,7 +54,6 @@ struct Options {
char* interface_xml;
bool auto_generate_function_ids;
bool generate_json_code;
- bool generate_dbus_code;
std::set<std::string> requested_interfaces;
std::set<std::string> excluded_scopes;
bool avoid_unsigned;
@@ -63,7 +62,6 @@ struct Options {
: interface_xml(NULL),
auto_generate_function_ids(false),
generate_json_code(false),
- generate_dbus_code(false),
avoid_unsigned(false),
minimum_word_size(8) {
}
@@ -138,10 +136,6 @@ int main(int argc, char* argv[]) {
options.generate_json_code = true;
break;
}
- case 'd': {
- options.generate_dbus_code = true;
- break;
- }
default: {
cerr << "Invalid option: '" << opt << "'" << '\n';
return EXIT_FAILURE;
@@ -165,7 +159,6 @@ int main(int argc, char* argv[]) {
codegen::Preferences(options.minimum_word_size,
options.avoid_unsigned,
options.generate_json_code,
- options.generate_dbus_code,
options.requested_interfaces));
if (bad.empty()) {
return EXIT_SUCCESS;